:root {
  color-scheme: dark;
  --ink: #eef6ec;
  --muted: rgba(226, 239, 229, .58);
  --line: rgba(226, 239, 229, .16);
  --moss: #b9e59b;
  --ember: #e58d69;
  --blue: #8bbfcb;
  --bg: #07110f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--ink); }
body { overflow: hidden; }
button, a { font: inherit; }
button { color: inherit; }

#field { position: fixed; inset: 0; width: 100%; height: 100%; }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: screen; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E"); }

.topbar { position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 24px clamp(20px, 4vw, 58px); }
.mark { color: var(--ink); text-decoration: none; letter-spacing: .22em; font-size: 12px; font-weight: 700; }
.mark i { display: inline-block; width: 8px; height: 8px; border: 1px solid var(--moss); border-radius: 50%; margin-right: 8px; box-shadow: 0 0 18px var(--moss); }
.quiet-button, .secondary-action { border: 1px solid var(--line); background: rgba(5, 13, 12, .38); border-radius: 999px; padding: 10px 15px; cursor: pointer; color: var(--muted); backdrop-filter: blur(14px); }
.quiet-button:hover, .secondary-action:hover { color: var(--ink); border-color: rgba(226,239,229,.38); }

main { position: relative; z-index: 2; height: 100svh; }
.threshold, .experience, .crystal { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(76px, 10vw, 130px) clamp(22px, 8vw, 120px) 46px; max-width: 950px; }
.threshold[hidden], .experience[hidden], .crystal[hidden] { display: none; }
.eyebrow { color: var(--moss); text-transform: uppercase; letter-spacing: .22em; font-size: 11px; font-weight: 700; margin: 0 0 18px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(54px, 9vw, 122px); font-weight: 400; line-height: .88; letter-spacing: -.055em; margin: 0; max-width: 900px; }
.intro { max-width: 610px; color: var(--muted); line-height: 1.7; font-size: clamp(15px, 2vw, 19px); margin: 34px 0 28px; }
.enter-button { align-self: flex-start; min-width: min(100%, 300px); border: 1px solid rgba(217,239,210,.38); background: rgba(185,229,155,.09); border-radius: 999px; padding: 8px 8px 8px 22px; display: flex; justify-content: space-between; align-items: center; gap: 24px; cursor: pointer; }
.enter-button b { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--moss); color: #102015; font-weight: 500; }
.enter-button:hover { background: rgba(185,229,155,.17); }
.consent-line { color: rgba(226,239,229,.38); font-size: 11px; max-width: 440px; line-height: 1.5; }

.experience { max-width: none; align-items: center; text-align: center; pointer-events: none; }
.experience button, .signal-strip, .parent-card { pointer-events: auto; }
.game-hud { position: absolute; z-index: 3; top: clamp(76px, 10vh, 108px); left: 50%; translate: -50% 0; width: min(680px, calc(100vw - 40px)); display: flex; justify-content: space-between; align-items: flex-start; }
.state-readout { display: grid; gap: 4px; text-align: left; }
.state-readout span { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .2em; }
.state-readout strong { font-family: Georgia, serif; font-weight: 400; font-size: 24px; }
.awakening-progress { display: grid; gap: 8px; justify-items: end; color: var(--muted); text-transform: uppercase; font-size: 9px; letter-spacing: .15em; }
.progress-pips { display: flex; gap: 6px; }
.progress-pips i { width: 22px; height: 3px; border-radius: 99px; background: rgba(226,239,229,.18); transition: background .5s, box-shadow .5s, transform .5s; }
.progress-pips i.awake { background: var(--moss); box-shadow: 0 0 14px var(--moss); transform: scaleY(1.5); }
.field-language { position: absolute; top: 20%; font-family: Georgia, serif; font-size: clamp(18px, 3vw, 34px); font-style: italic; color: rgba(238,246,236,.72); letter-spacing: -.025em; max-width: 720px; margin: 0; text-wrap: balance; transition: opacity .25s ease; }
.quest-card { position: absolute; bottom: 176px; left: 50%; translate: -50% 0; width: min(440px, calc(100vw - 40px)); padding: 13px 18px; display: grid; gap: 4px; border: 1px solid rgba(226,239,229,.13); border-radius: 16px; background: rgba(3,8,12,.42); backdrop-filter: blur(12px); }
.quest-card span { color: rgba(226,239,229,.4); font-size: 8px; text-transform: uppercase; letter-spacing: .18em; }
.quest-card strong { font-family: Georgia, serif; font-size: 15px; font-weight: 400; color: rgba(238,246,236,.82); }
.discovery { position: absolute; z-index: 8; inset: 0; display: grid; place-content: center; gap: 8px; opacity: 0; transform: scale(.88); transition: opacity .4s, transform .7s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.discovery.reveal { opacity: 1; transform: scale(1); }
.discovery span { color: var(--muted); text-transform: uppercase; letter-spacing: .2em; font-size: 9px; }
.discovery strong { font-family: Georgia, serif; font-size: clamp(72px, 15vw, 180px); font-weight: 400; letter-spacing: -.06em; text-shadow: 0 0 60px rgba(185,229,155,.28); }
.parent-card { position: absolute; top: 92px; left: clamp(20px, 5vw, 72px); text-align: left; border-left: 1px solid var(--ember); padding-left: 12px; display: grid; gap: 3px; color: var(--muted); font-size: 10px; }
.parent-card strong { color: var(--ink); letter-spacing: .15em; }
.parent-card small { color: rgba(226,239,229,.38); }
.actions { position: absolute; bottom: 108px; display: flex; gap: 8px; pointer-events: auto; }
.primary-action { border: 0; background: var(--ink); color: #0b1613; border-radius: 999px; padding: 13px 18px; cursor: pointer; }
.primary-action:disabled { opacity: .28; cursor: not-allowed; }
.signal-strip { position: absolute; bottom: 28px; left: 50%; translate: -50% 0; width: min(620px, calc(100vw - 40px)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.signal-strip div { display: grid; gap: 6px; text-align: left; }
.signal-strip span { color: rgba(226,239,229,.42); text-transform: uppercase; font-size: 8px; letter-spacing: .16em; }
.signal-strip div::after { content: ''; height: 1px; background: var(--line); grid-area: 2 / 1; }
.signal-strip i { height: 1px; width: 0%; background: var(--moss); grid-area: 2 / 1; z-index: 1; transition: width .12s linear; box-shadow: 0 0 10px var(--moss); }

.crystal { max-width: 860px; }
.crystal h2, dialog h2 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(48px, 8vw, 98px); line-height: .92; letter-spacing: -.05em; margin: 0; }
.trace-glyph { width: min(68vw, 380px); aspect-ratio: 3 / 1; margin: 28px 0 20px; display: flex; align-items: center; gap: 3px; }
.trace-glyph i { flex: 1; min-width: 2px; border-radius: 999px; background: linear-gradient(to top, var(--ember), var(--moss)); box-shadow: 0 0 15px rgba(185,229,155,.2); }
.trace-summary { color: var(--muted); max-width: 620px; line-height: 1.6; }
.lineage { color: rgba(226,239,229,.42); font-size: 11px; letter-spacing: .06em; }
.lineage strong { color: var(--moss); letter-spacing: .15em; }
.crystal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.share-status { min-height: 18px; color: var(--moss); font-size: 12px; }

dialog { width: min(560px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: rgba(8, 18, 16, .96); padding: clamp(24px, 5vw, 46px); box-shadow: 0 30px 100px #000; }
dialog::backdrop { background: rgba(0, 5, 4, .72); backdrop-filter: blur(9px); }
dialog h2 { font-size: clamp(36px, 6vw, 58px); }
dialog ul { color: var(--muted); line-height: 1.6; padding-left: 20px; }
dialog li + li { margin-top: 8px; }
.dialog-close { position: absolute; top: 16px; right: 18px; border: 0; background: none; font-size: 28px; color: var(--muted); cursor: pointer; }

@media (max-width: 620px) {
  .topbar { padding-top: max(18px, env(safe-area-inset-top)); }
  .threshold, .crystal { justify-content: flex-end; padding-bottom: max(34px, env(safe-area-inset-bottom)); }
  h1 { font-size: clamp(54px, 18vw, 82px); }
  .intro { margin: 24px 0 20px; }
  .experience { padding-inline: 20px; }
  .game-hud { top: max(70px, calc(env(safe-area-inset-top) + 52px)); }
  .state-readout strong { font-size: 20px; }
  .field-language { top: 19%; padding: 0 24px; font-size: clamp(18px, 5.5vw, 25px); }
  .parent-card { top: 128px; }
  .quest-card { bottom: 174px; }
  .actions { bottom: 103px; width: calc(100vw - 30px); justify-content: center; flex-wrap: wrap; }
  .actions .primary-action { flex-basis: 100%; }
  .actions button { padding-block: 9px; font-size: 12px; }
  .signal-strip { bottom: max(20px, env(safe-area-inset-bottom)); }
  .progress-pips i { width: 14px; }
  .motion-unsupported { display: none; }
}

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