:root {
  color-scheme: light;
  --bg: #f2ece0;
  --ink: #282620;
  --accent: #795b35;
  --muted: #5e564a;
  --sky-ink: #fff7e8;
  --sky-image: url("day-sky.jpg");
  --sky-overlay: linear-gradient(180deg, #18334e10, #17345630 45%, #152e4d6e 83%, #152b45a8);
  --mono: "Space Mono", monospace;
  --display: "Bodoni Moda", Georgia, serif;
  font-family: "Inter Tight", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12161f;
  --ink: #f8efe1;
  --accent: #dcc3a2;
  --muted: #c7bfb1;
  --sky-image: url("night-sky.jpg");
  --sky-overlay: linear-gradient(180deg, #101a3455, #15214228 55%, #0b1021a0);
}
* { box-sizing: border-box; }
body, figure, h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.bar {
  position: fixed;
  z-index: 5;
  inset: 0 0 auto;
  height: 74px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding-inline: clamp(16px, 4vw, 64px);
  color: var(--sky-ink);
  background: linear-gradient(#07101f9c, transparent);
}
.overline, .artifact-caption, .scroll-cue, figcaption {
  font: .69rem/1.6 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.sequence { position: relative; }
.reveal-anchor { position: absolute; top: 56svh; }
.motion .sequence { height: 335svh; }
.motion { scroll-behavior: smooth; }
.screen {
  height: 100svh;
  min-height: 440px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
}
.motion .screen { position: sticky; top: 0; }
.atmosphere, .artifact { position: absolute; inset: 0; pointer-events: none; }
.atmosphere {
  background: var(--sky-overlay), var(--sky-image) center / cover no-repeat;
}
.opening, .scroll-cue { color: var(--sky-ink); }
.opening { text-shadow: 0 2px 30px #07132660; }
.opening {
  z-index: 2;
  position: relative;
  text-align: center;
  opacity: var(--title-alpha, 1);
  transform: translateY(var(--title-y, 0px)) scale(var(--title-scale, 1));
}
.opening .overline {
  color: var(--sky-ink);
  margin-bottom: clamp(14px, 2.5vh, 26px);
  font-size: clamp(.95rem, 1.8vw, 1.4rem);
}
h1 {
  font-size: clamp(4.2rem, min(17vw, 23svh), 15.5rem);
  font-weight: 900;
  letter-spacing: -.09em;
  line-height: .76;
  padding: 0 .09em .06em 0;
  animation: arrive 850ms cubic-bezier(.2,.75,.25,1) both;
}
@keyframes arrive { from { opacity: 0; transform: translateY(20px); } }
.scroll-cue {
  position: absolute;
  bottom: max(28px, 5svh);
  z-index: 3;
  color: var(--sky-ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: var(--cue, 1);
}
.scroll-cue span { display: grid; place-items: center; width: 30px; aspect-ratio: 1; border: 1px solid #ffffff47; border-radius: 50%; }
.scroll-cue:focus-visible { opacity: 1; }
.progress { position: absolute; bottom: 0; inset-inline: 0; height: 2px; background: var(--accent); transform: scaleX(var(--progress, 0)); transform-origin: left; z-index: 4; }
.artifact { opacity: var(--scene-alpha, 0); }
.artifact-caption {
  position: absolute;
  inset: auto clamp(20px, 5vw, 74px) 7svh;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 13px;
  color: #fff6e8;
  border-top: 1px solid #ffffff80;
  text-shadow: 0 1px 8px #000;
}
.frame-count { color: #f8e4c7; }
.orbit-axis {
  position: absolute;
  inset: 20% 8%;
  border: 1px solid #f5eee17a;
  border-radius: 50%;
  transform: rotate(-13deg) scaleY(.65);
  box-shadow: 0 0 0 24px #f5eee11a, 0 0 0 48px #f5eee110;
}
.wheel { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1100px; }
.wheel figure {
  position: absolute;
  width: min(51vw, 650px, calc(55svh * var(--ratio)));
  aspect-ratio: var(--ratio);
  border-radius: 4px;
  border: 1px solid #fff8;
  overflow: hidden;
  background: #ece1cf;
  box-shadow: 0 18px 85px #0009;
  transform: translate3d(var(--x, 0px), var(--y, 0px), var(--z, 0px)) rotateY(var(--yaw, 0deg)) rotateZ(var(--roll, 0deg));
  opacity: var(--card-alpha, 1);
  z-index: var(--order, 0);
}
.artifact img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wheel figure img { object-fit: contain; }
.wheel figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 29%, #fff8 49%, transparent 70%);
  transform: translateX(var(--glint, -105%));
  opacity: var(--glint-alpha, 0);
}
.about { min-height: 75svh; padding: clamp(85px, 15svh, 160px) 20px; margin: auto; text-align: center; max-width: 860px; }
.about .overline { color: var(--accent); }
.about h2 { font-size: clamp(2.65rem, 6.5vw, 6rem); line-height: 1; letter-spacing: -.065em; margin: 18px auto 20px; text-wrap: balance; }
.about p:not(.overline) { font-size: clamp(1rem, 2vw, 1.25rem); max-width: 40ch; margin: auto; color: var(--muted); line-height: 1.55; }
.about p + p { margin-top: 1em; }
.about a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: .25em; }
.contact-page { min-height: 100svh; display: grid; place-items: center; }
.contact-page .about { min-height: auto; }
.contact-links { display: grid; gap: 12px; margin: 30px auto; padding: 0; list-style: none; width: min(100%, 27rem); }
.contact-links a {
  display: flex;
  justify-content: space-between;
  border: 1px solid #ffffff30;
  border-radius: 10px;
  padding: 16px 20px;
  text-decoration: none;
}
.contact-links a:hover, .contact-links a:focus-visible { border-color: var(--accent); }
.contact-links span { color: var(--accent); }
@media (max-width: 680px) {
  .bar { grid-template-columns: 1fr 1fr; height: 62px; gap: 5px; padding-inline: 10px; }
  .wheel figure { width: min(74vw, 390px, calc(48svh * var(--ratio))); }
}
@media (prefers-reduced-motion: reduce) {
  h1 { animation: none; }
  .scroll-cue { bottom: 30px; }
}
.still .screen { height: auto; display: flex; flex-direction: column; padding-top: 130px; }
.still .opening { order: -1; opacity: 1; transform: none; margin-bottom: 48px; }
.still .artifact { position: relative; width: 100%; height: 70svh; opacity: 1; }
.still .scroll-cue, .still .progress { display: none; }
.contact-title {
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 1;
  padding: 0;
  animation: none;
}

.opening h1 { font-family: var(--display); font-weight: 700; letter-spacing: -.062em; line-height: .86; }
.about h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.04em; }
.theme-switch {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #fff7;
  border-radius: 50%;
  background: #121414db;
  color: #fff4e1;
  font: inherit;
  font-size: 1.15rem;
  cursor: pointer;
}
.theme-switch:focus-visible { outline: 2px solid #fff4e1; outline-offset: 3px; }
.theme-icon::before { content: "☾"; }
[data-theme="dark"] .theme-icon::before { content: "☼"; }
.sky-credits {
  padding: 0 16px 24px;
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
}

.more {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 44px) 42px;
  scroll-margin-top: 82px;
  text-align: center;
}
.more summary {
  display: inline-flex;
  align-items: center;
  gap: .7em;
  padding: .65em 1em .65em 1.2em;
  border: 1px solid var(--accent);
  border-radius: 99px;
  color: var(--ink);
  cursor: pointer;
  font-size: .93rem;
  list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.more summary span {
  display: grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  transition: transform 320ms ease;
}
.more[open] summary span { transform: rotate(45deg); }
.more:not([open]) .more-panels { display: none; }
.more-panels {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  text-align: left;
}
.more-panel {
  position: relative;
  flex: 1 1 0;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  min-height: clamp(330px, 59svh, 590px);
  overflow: hidden;
  isolation: isolate;
  color: #fff6e8;
  background: #25201c;
  border-radius: 5px;
  text-decoration: none;
  transition: flex-grow 520ms cubic-bezier(.2,.72,.25,1);
}
.more-panel img, .more-panel::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.more-panel img {
  z-index: -2;
  object-fit: cover;
  transition: transform 720ms cubic-bezier(.2,.72,.25,1);
}
.more-panel::after {
  content: "";
  z-index: -1;
  background: linear-gradient(180deg, #15100c16 10%, #15100c66 49%, #15100cef 100%);
}
.more[open] .more-panel { animation: panel-enter 720ms cubic-bezier(.18,.75,.25,1) both; }
.more[open] .more-panel + .more-panel { animation-delay: 100ms; }
@keyframes panel-enter {
  from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(18px); }
  to { opacity: 1; clip-path: inset(0); transform: translateY(0); }
}
.more-panel-copy {
  display: grid;
  gap: 10px;
  padding: clamp(20px, 3vw, 42px);
}
.more-index { color: #f0d4aa; font: .75rem var(--mono); }
.more-title {
  font-family: var(--display);
  font-size: clamp(2.3rem, 5.1vw, 5.2rem);
  font-weight: 600;
  line-height: .94;
  letter-spacing: -.045em;
}
.more-note { font-size: .92rem; }
@media (hover: hover) and (pointer: fine) {
  .more-panel:hover { flex-grow: 1.24; }
  .more-panel:hover img { transform: scale(1.06); }
}
.more-panel:focus-visible { outline-offset: 2px; }
@media (max-width: 680px) {
  .more-panels { flex-direction: column; }
  .more-panel { flex-basis: auto; min-height: 285px; }
}
@media (prefers-reduced-motion: reduce) {
  .more[open] .more-panel { animation: none; }
  .more-panel, .more-panel img, .more summary span { transition: none; }
}
