:root {
  color-scheme: dark;
  --ground: #0a0a0b;
  --ground-soft: #11100f;
  --ink: #eee8dc;
  --ink-soft: #b8afa0;
  --muted: #8f887d;
  --gold: #caa86a;
  --gold-bright: #e5c680;
  --line: rgba(202, 168, 106, 0.28);
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --morph-duration: 2600ms;
}

* { box-sizing: border-box; }

html { background: var(--ground); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 62% 48%, rgba(202, 168, 106, 0.055), transparent 33%),
    linear-gradient(115deg, #09090a 0%, #0b0b0c 54%, #080809 100%);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
}

button { font: inherit; }

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--ground);
  background: var(--gold-bright);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-lines {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.2s ease;
}

body.is-loaded .field-lines { opacity: 1; }

.field-lines::before,
.field-lines::after,
.field-lines span {
  content: "";
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.field-lines::before {
  width: min(58vw, 900px);
  aspect-ratio: 1;
  left: 58%;
  top: 48%;
  transform: translate(-50%, -50%);
}

.field-lines::after {
  width: min(42vw, 650px);
  aspect-ratio: 1;
  left: 58%;
  top: 48%;
  transform: translate(-50%, -50%);
  border-style: dotted;
}

.field-lines span:nth-child(1) {
  width: 1px;
  height: 130vh;
  left: 42%;
  top: -15vh;
  border-radius: 0;
  border-width: 0 0 0 1px;
}

.field-lines span:nth-child(2) {
  width: 1px;
  height: 130vh;
  left: 78%;
  top: -15vh;
  border-radius: 0;
  border-width: 0 0 0 1px;
}

.field-lines span:nth-child(3) {
  width: 130vw;
  height: 1px;
  left: -15vw;
  top: 50%;
  border-radius: 0;
  border-width: 1px 0 0;
}

.experience {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(420px, 1.4fr) 72px;
  gap: clamp(24px, 3vw, 58px);
  align-items: stretch;
  width: 100%;
  max-width: 1720px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(34px, 5vh, 64px) clamp(28px, 4.5vw, 76px) max(26px, env(safe-area-inset-bottom));
}

.narrative {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1vh 0 0;
}

.identity h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 2.3vw, 36px);
  font-weight: 300;
  line-height: 1.38;
  letter-spacing: 0.27em;
  text-transform: uppercase;
}

.identity h1 span { color: #e7d5ac; }

.identity-line {
  width: 1px;
  height: clamp(58px, 10vh, 98px);
  margin-top: clamp(26px, 5vh, 52px);
  background: linear-gradient(to bottom, var(--gold), transparent);
}

.belief-copy {
  max-width: 510px;
  padding: clamp(20px, 2.5vh, 30px) 0 clamp(26px, 3vh, 42px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.belief-copy.is-changing {
  opacity: 0.32;
  transform: translateY(6px);
}

.counter,
.dialog-number {
  margin: 0 0 22px;
  color: var(--gold-bright);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.object-name {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.belief-copy h2,
.about-dialog h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(36px, 4vw, 66px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.belief-text {
  max-width: 44ch;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(17px, 1.45vw, 23px);
  line-height: 1.48;
}

.lens-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--gold);
  color: var(--gold-bright);
  background: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
}

.lens-link span { transition: transform 180ms ease; }
.lens-link:hover span { transform: translateX(4px); }

.credit {
  max-width: 36ch;
  margin: auto 0 0;
  color: #6f6a63;
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: 0.05em;
}

.visual {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.art-frame {
  position: relative;
  width: min(100%, 570px);
  aspect-ratio: 0.7498;
  overflow: hidden;
  border: 1px solid rgba(229, 198, 128, 0.72);
  background: #e4dbce;
  box-shadow:
    0 0 0 1px rgba(202, 168, 106, 0.12),
    0 22px 80px rgba(0, 0, 0, 0.66),
    0 0 60px rgba(202, 168, 106, 0.10);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 900ms ease, transform 900ms ease;
  touch-action: pan-y;
}

body.is-loaded .art-frame {
  opacity: 1;
  transform: translateY(0);
}

.shard-stage,
.shard {
  position: absolute;
  inset: 0;
}

.shard-stage { overflow: hidden; }

.shard {
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}

.shard.is-scattering {
  transition:
    transform 900ms cubic-bezier(0.18, 0.8, 0.18, 1),
    opacity 700ms ease;
  transition-delay: var(--scatter-delay, 0ms);
}

.art-glow {
  position: absolute;
  z-index: -1;
  inset: 15% -10% -9%;
  background: radial-gradient(ellipse, rgba(202, 168, 106, 0.18), transparent 66%);
  filter: blur(24px);
}

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 640px;
  min-height: 58px;
  margin-top: clamp(18px, 2.8vh, 34px);
}

.transport button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.transport button:hover { color: var(--gold-bright); }
.transport button:disabled { cursor: wait; opacity: 0.42; }

.transport-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 14px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.arrow {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.arrow.left { transform: rotate(-135deg); }
.arrow.right { transform: rotate(45deg); }

.transport-rule {
  width: 1px;
  height: 28px;
  margin: 0 14px;
  background: var(--line);
}

.play-button {
  display: grid;
  min-width: 66px !important;
  grid-template-rows: 42px auto;
  place-items: center;
  gap: 5px;
  padding: 0 8px 4px;
}

.play-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.play-icon::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--gold-bright);
}

.play-button[aria-pressed="true"] .play-icon::before {
  width: 8px;
  height: 11px;
  margin: 0;
  border: 0;
  border-right: 3px solid var(--gold-bright);
  border-left: 3px solid var(--gold-bright);
}

.play-label {
  color: var(--gold-bright);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.scatter-icon {
  position: relative;
  display: inline-block;
  width: 23px;
  height: 23px;
}

.scatter-icon i {
  position: absolute;
  left: 10px;
  top: 1px;
  width: 2px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: 1px 10px;
}

.scatter-icon i:nth-child(2) { transform: rotate(60deg); }
.scatter-icon i:nth-child(3) { transform: rotate(120deg); }
.scatter-icon i:nth-child(4) { transform: rotate(180deg); }
.scatter-icon i:nth-child(5) { transform: rotate(240deg); }
.scatter-icon i:nth-child(6) { transform: rotate(300deg); }

.key-hints {
  display: flex;
  align-self: flex-end;
  gap: 8px;
  margin: -42px 0 0;
}

kbd {
  min-width: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(202, 168, 106, 0.32);
  border-radius: 3px;
  color: #857a67;
  background: rgba(255, 255, 255, 0.015);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.belief-rail {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  align-self: center;
  height: min(78vh, 760px);
  padding: 8px 0;
}

.belief-rail::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 6px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: rgba(202, 168, 106, 0.28);
}

.rail-button {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  grid-template-columns: 13px 1fr;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  color: #817b73;
  background: transparent;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.rail-dot {
  display: block;
  width: 8px;
  height: 8px;
  border: 1px solid #817b73;
  border-radius: 50%;
  background: var(--ground);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.rail-button:hover,
.rail-button[aria-current="true"] { color: var(--gold-bright); }

.rail-button[aria-current="true"] .rail-dot {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  box-shadow: 0 0 0 4px rgba(202, 168, 106, 0.13), 0 0 15px rgba(229, 198, 128, 0.58);
}

.about-dialog {
  width: min(660px, calc(100vw - 40px));
  padding: clamp(32px, 5vw, 64px);
  border: 1px solid rgba(202, 168, 106, 0.45);
  color: var(--ink);
  background: #11100f;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.75);
}

.about-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(7px);
}

.about-dialog h2 { font-size: clamp(38px, 6vw, 62px); }

.about-dialog p:not(.dialog-number):not(.dialog-note) {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.dialog-note {
  margin: 30px 0 0;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .experience {
    grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.25fr) 60px;
    gap: 24px;
    padding-inline: 28px;
  }

  .identity h1 { font-size: 23px; }
  .belief-copy h2 { font-size: clamp(36px, 4.8vw, 54px); }
  .key-hints { display: none; }
}

@media (max-width: 900px) {
  .experience {
    grid-template-columns: 1fr;
    gap: 26px;
    min-height: auto;
    padding: 28px 22px 42px;
  }

  .narrative { display: contents; }
  .identity { grid-row: 1; }
  .identity h1 { font-size: 18px; line-height: 1.35; }
  .identity-line { display: none; }

  .visual { grid-row: 2; }

  .art-frame {
    width: min(74vw, 480px);
    max-height: 68vh;
  }

  .belief-rail {
    grid-row: 3;
    flex-direction: row;
    align-self: stretch;
    width: 100%;
    height: auto;
    padding: 0;
  }

  .belief-rail::before {
    left: 3%;
    right: 3%;
    top: 6px;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .rail-button {
    display: flex;
    min-width: 26px;
    min-height: 44px;
    flex-direction: column;
    gap: 7px;
    font-size: 9px;
  }

  .belief-copy {
    grid-row: 4;
    max-width: 720px;
    padding: 8px 0 26px;
  }

  .belief-copy h2 { font-size: clamp(40px, 9vw, 64px); }
  .belief-text { max-width: 55ch; }
  .credit { grid-row: 5; max-width: none; }
  .transport { margin-top: 20px; }
}

@media (max-width: 560px) {
  .experience { padding-inline: 16px; }
  .art-frame { width: min(86vw, 430px); }
  .transport { justify-content: space-between; }
  .transport-rule { display: none; }
  .transport-button { padding-inline: 5px; gap: 9px; letter-spacing: 0.17em; }
  .play-button { min-width: 54px !important; }
  .scatter .scatter-label { position: absolute; width: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .belief-rail { overflow-x: auto; scrollbar-width: none; }
  .belief-rail::-webkit-scrollbar { display: none; }
  .rail-button { flex: 0 0 8.333%; }
  .belief-copy h2 { font-size: clamp(38px, 12vw, 58px); }
  .belief-text { font-size: 18px; }
}

@media (max-height: 760px) and (min-width: 901px) {
  .experience { padding-block: 24px 20px; }
  .art-frame { width: min(100%, 455px); }
  .identity-line { height: 44px; margin-top: 22px; }
  .belief-copy { padding-block: 18px; }
  .belief-copy h2 { font-size: clamp(34px, 3.6vw, 52px); }
  .belief-text { margin-top: 17px; font-size: 17px; }
  .lens-link { margin-top: 20px; }
  .transport { margin-top: 14px; }
  .belief-rail { height: 82vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
