:root {
  --void: #03040a;
  --text: #eef1fb;
  --soft: #aab3c4;
  --line: rgba(220, 235, 255, 0.14);
  --crystal: #4fb0ff;
  --spectrum: linear-gradient(90deg, #ff7a3d, #ff4fa8 35%, #a878ff 65%, #2fe0cf);
  --display: 'Unbounded', system-ui, sans-serif;
  --sans: 'Sora', system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--void); color: var(--text); font-family: var(--sans); font-weight: 300; -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
a { color: var(--crystal); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 1px solid var(--crystal); outline-offset: 3px; }
.kicker { margin: 0 0 0.8rem; font-size: 0.64rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--c, var(--crystal)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
[hidden] { display: none !important; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#view { position: relative; z-index: 1; }
#flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, #fff 0%, var(--c, #fff) 35%, var(--void) 100%); }

/* ---------- top bar ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: max(14px, env(safe-area-inset-top)) 16px 12px; background: linear-gradient(180deg, rgba(3,4,10,.8), rgba(3,4,10,0)); pointer-events: none; }
.top > * { pointer-events: auto; }
.wordmark { font-family: var(--display); font-weight: 300; font-size: 0.72rem; letter-spacing: 0.4em; text-decoration: none; background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.top-nav { display: flex; gap: 6px; }
.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 0.45rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(6, 9, 18, 0.6); backdrop-filter: blur(8px); font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--soft); cursor: pointer; text-decoration: none; }
.pill:hover { color: #fff; border-color: rgba(220,235,255,.35); }
.count:not(:empty) { min-width: 18px; padding: 1px 5px; border-radius: 999px; background: var(--crystal); color: #03040a; font-size: 0.6rem; letter-spacing: 0; text-align: center; }

.btn { display: inline-block; padding: 0.95rem 1.8rem; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; background: var(--c, var(--crystal)); color: #03040a; font-family: var(--display); font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 500; box-shadow: 0 0 36px color-mix(in srgb, var(--c, var(--crystal)) 55%, transparent); transition: transform 0.4s var(--ease), box-shadow 0.5s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 60px color-mix(in srgb, var(--c, var(--crystal)) 75%, transparent); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid color-mix(in srgb, var(--c, var(--crystal)) 55%, transparent); box-shadow: none; }

.cue { display: flex; align-items: center; gap: 12px; margin: 2rem 0 0; font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--soft); }
.cue span { position: relative; width: 1px; height: 42px; background: rgba(255,255,255,.18); overflow: hidden; }
.cue span::after { content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--c, var(--crystal)); animation: drip 2.2s ease-in-out infinite; }
@keyframes drip { to { top: 100%; } }

.reveal { opacity: 0; transform: translateY(46px); transition: opacity 1.2s ease, transform 1.4s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; min-height: 560px; overflow: hidden; background: var(--void); }
.hero-stage { position: absolute; left: 50%; top: 50%; width: max(100vw, calc(100vh * 1.767)); aspect-ratio: 2400 / 1358; transform: translate(-50%, -50%); }
@media (max-aspect-ratio: 85/100) { .hero-stage { width: 100vw; height: 100vh; aspect-ratio: auto; } #hero-img { object-fit: cover; } }
#hero-img, #hero-sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3,4,10,.2), rgba(3,4,10,.15) 45%, rgba(3,4,10,.85) 85%, var(--void)); pointer-events: none; }
.hero-copy { position: absolute; left: max(20px, 6vw); right: 20px; bottom: 10vh; z-index: 2; max-width: 660px; }
.hero-copy h1 { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(3rem, 9vw, 6.4rem); line-height: 0.95; text-shadow: 0 2px 40px rgba(0,0,0,.6); }
.lede { margin: 1rem 0 0; font-size: clamp(1rem, 1.9vw, 1.25rem); line-height: 1.6; text-shadow: 0 1px 14px #000; }

/* ---------- intro ---------- */
.intro { padding: 16vh max(20px, 8vw) 6vh; display: grid; gap: 22vh; background: linear-gradient(180deg, var(--void), rgba(3,4,10,.55) 30%, rgba(3,4,10,.35)); }
.intro-block { max-width: 640px; }
.intro-block:nth-child(2) { margin-left: auto; }
.intro-block h2, .yours h2 { margin: 0 0 1.2rem; font-family: var(--display); font-weight: 300; font-size: clamp(1.6rem, 3.6vw, 2.6rem); line-height: 1.15; }
.intro-block p:not(.kicker) { margin: 0 0 1rem; font-size: clamp(1rem, 1.5vw, 1.12rem); line-height: 1.85; color: #d7ddeb; }

/* ---------- yours ---------- */
.yours { padding: 16vh max(20px, 8vw) 22vh; }
.yours-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; max-width: 980px; }
.yours-card { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.8rem; border-radius: 22px; text-decoration: none; color: var(--text); border: 1px solid color-mix(in srgb, var(--c, var(--crystal)) 45%, transparent); background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--c, var(--crystal)) 22%, transparent), rgba(6, 9, 18, 0.78) 70%); backdrop-filter: blur(10px); transition: transform 0.5s var(--ease), box-shadow 0.5s; }
.yours-card:hover { transform: translateY(-4px); box-shadow: 0 0 50px color-mix(in srgb, var(--c, var(--crystal)) 35%, transparent); }
.yours-card.ghost { --c: #9fb4dc; }
.yc-k { font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--c, var(--crystal)); }
.yours-card strong { font-family: var(--display); font-weight: 400; font-size: 1.4rem; line-height: 1.2; }
.yours-card em { font-style: normal; color: #d7ddeb; line-height: 1.6; }
.yc-go { margin-top: auto; padding-top: 0.6rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c, var(--crystal)); }

/* ---------- the descent ---------- */
.descent { position: relative; pointer-events: none; }
.stage { position: sticky; top: 0; height: 100vh; }
.stage::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: linear-gradient(0deg, rgba(3,4,10,.85), rgba(3,4,10,.45) 55%, transparent); opacity: 0; transition: opacity .6s; }
body.in-descent .stage::before { opacity: 1; }
.gate { position: absolute; left: max(20px, 6vw); bottom: max(9vh, 70px); max-width: 520px; padding-right: 20px; pointer-events: none; opacity: 0; transform: translateY(24px); transition: opacity 0.5s ease, transform 0.8s var(--ease); }
.gate.on { opacity: 1; transform: none; pointer-events: auto; }
.g-name { margin: 0 0 0.8rem; font-family: var(--display); font-weight: 300; font-size: clamp(1.7rem, 4.4vw, 3.2rem); line-height: 1.08; text-shadow: 0 0 40px color-mix(in srgb, var(--c) 55%, transparent), 0 2px 20px #000; }
.g-glyph { display: block; margin-bottom: 0.5rem; font-size: 0.7em; color: var(--c); font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', var(--sans); }
.g-inv { margin: 0 0 0.6rem; font-size: clamp(0.98rem, 1.5vw, 1.1rem); line-height: 1.7; color: #dde3f0; text-shadow: 0 1px 12px #000; }
.g-count { margin: 0 0 1.3rem; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
.rail { position: absolute; right: max(12px, 2.4vw); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; pointer-events: auto; opacity: 0; transition: opacity 0.6s; }
body.in-descent .rail { opacity: 1; }
.rail button { position: relative; width: 22px; height: 9px; padding: 0; border: 0; background: none; cursor: pointer; }
.rail button::before { content: ''; position: absolute; right: 0; top: 3px; width: 8px; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--c) 55%, #333); transition: width 0.3s, background 0.3s; }
.rail button:hover::before, .rail button.on::before { width: 20px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.rail button span { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 0.7rem; color: #fff; opacity: 0; pointer-events: none; transition: opacity 0.2s; text-shadow: 0 1px 8px #000; }
.rail button:hover span { opacity: 1; }
.hint { position: absolute; left: 50%; top: 78px; transform: translateX(-50%); margin: 0; font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(220,230,255,.5); white-space: nowrap; opacity: 0; transition: opacity 0.6s; }
body.in-descent .hint { opacity: 1; }

.beyond { position: relative; padding: 24vh max(20px, 8vw) 16vh; max-width: 900px; margin: 0 auto; text-align: center; }
.beyond h2 { margin: 0 0 1rem; font-family: var(--display); font-weight: 300; font-size: clamp(1.8rem, 4.4vw, 3rem); }
.beyond > p:not(.kicker) { margin: 0 auto 2rem; max-width: 620px; line-height: 1.85; color: #d7ddeb; }
.beyond-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 4rem; }

/* ---------- daily law form ---------- */
.daily { max-width: 560px; margin: 0 auto; padding: 2rem; border-radius: 24px; text-align: left; border: 1px solid var(--line); background: rgba(6, 9, 18, 0.78); backdrop-filter: blur(12px); }
.daily h3 { margin: 0 0 0.5rem; font-family: var(--display); font-weight: 300; font-size: 1.3rem; }
.d-sub { margin: 0 0 1rem; color: var(--soft); line-height: 1.6; font-size: 0.92rem; }
.d-row { display: flex; gap: 8px; flex-wrap: wrap; }
.d-row input { flex: 1 1 200px; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(3,4,10,.6); color: var(--text); font: inherit; outline: none; }
.d-row input:focus { border-color: var(--c, var(--crystal)); }
.d-row button { padding: 0.8rem 1.3rem; border: 0; border-radius: 999px; background: var(--c, var(--crystal)); color: #03040a; font-family: var(--display); font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 500; cursor: pointer; }
.d-msg { margin: 0.8rem 0 0; color: var(--c, var(--crystal)); font-size: 0.9rem; }
.d-msg:empty { display: none; }

/* ---------- inside a portal ---------- */
.arrive { min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; padding: 120px 20px 9vh; background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--c) 16%, transparent), rgba(3,4,10,.25) 60%); }
.a-glyph { margin: 0 0 0.6rem; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1; color: var(--c); text-shadow: 0 0 40px var(--c); font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', var(--sans); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); text-shadow: 0 0 70px var(--c); } }
.arrive h1 { margin: 0 0 1rem; max-width: 900px; font-family: var(--display); font-weight: 300; font-size: clamp(2rem, 6vw, 4.2rem); line-height: 1.05; text-shadow: 0 0 50px color-mix(in srgb, var(--c) 50%, transparent); }
.a-inv { margin: 0 0 0.8rem; max-width: 620px; font-size: clamp(1rem, 1.7vw, 1.2rem); line-height: 1.7; color: #dde3f0; }
.a-meta { margin: 0; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
.arrive .cue { justify-content: center; }

.scrolls { display: flex; flex-direction: column; align-items: center; gap: 12vh; padding: 8vh 16px 16vh; }

/* a scroll: two luminous rods and a sheet of star-vellum that unrolls with --u (0 rolled, 1 open) */
.scroll { --u: 0; --h: 400px; --rod: 22px; position: relative; width: min(680px, 100%); padding: var(--rod) 0; }
.scroll:nth-child(3n + 2) { transform: translateX(min(6vw, 60px)); }
.scroll:nth-child(3n) { transform: translateX(max(-6vw, -60px)); }
.rod { position: absolute; left: -18px; right: -18px; height: var(--rod); z-index: 2; border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, #fff) 0%, var(--c) 30%, color-mix(in srgb, var(--c) 40%, #000) 75%, color-mix(in srgb, var(--c) 20%, #000) 100%);
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 60%, transparent), 0 8px 18px rgba(0,0,0,.6); }
.rod::before, .rod::after { content: ''; position: absolute; top: -5px; width: 16px; height: calc(var(--rod) + 10px); border-radius: 6px; background: radial-gradient(circle at 40% 35%, #fff, var(--c) 45%, color-mix(in srgb, var(--c) 30%, #000)); box-shadow: 0 0 14px var(--c); }
.rod::before { left: -8px; }
.rod::after { right: -8px; }
.rod i { position: absolute; inset: 6px 30px; border-radius: 999px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.25) 0 1px, transparent 1px 9px); opacity: 0.5; }
.rod.top { top: 0; }
.rod.bottom { top: var(--rod); transform: translateY(calc(var(--u) * var(--h))); }
.sheet { position: relative; clip-path: inset(0 0 calc((1 - var(--u)) * 100%) 0);
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--c) 20%, transparent), transparent 60%),
    radial-gradient(circle at 20% 70%, rgba(255,255,255,.04) 0 1px, transparent 2px) 0 0 / 34px 34px,
    radial-gradient(circle at 70% 30%, rgba(255,255,255,.05) 0 1px, transparent 2px) 0 0 / 51px 51px,
    linear-gradient(180deg, #0c1022, #080a16 70%, #0a0d1c);
  border-left: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: inset 0 0 60px rgba(0,0,0,.6), 0 0 60px color-mix(in srgb, var(--c) 14%, transparent); }
.sheet::before, .sheet::after { content: ''; position: absolute; left: 0; right: 0; height: 14px; pointer-events: none; }
.sheet::before { top: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent); }
.sheet::after { bottom: 0; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent); }
.sheet-in { padding: 2.6rem clamp(1.3rem, 5vw, 3.2rem) 2.4rem; text-align: center; opacity: calc(var(--u) * 1.4 - 0.25); }
.s-n { margin: 0 0 0.9rem; font-family: var(--display); font-size: 0.62rem; letter-spacing: 0.4em; text-transform: uppercase; color: var(--c); }
.scroll h3 { margin: 0 0 1rem; font-family: var(--display); font-weight: 400; font-size: clamp(1.25rem, 3vw, 1.75rem); line-height: 1.2; }
.s-decree { margin: 0 auto 1.4rem; max-width: 470px; font-size: clamp(1.1rem, 2.2vw, 1.35rem); line-height: 1.5; color: #fff; text-shadow: 0 0 24px color-mix(in srgb, var(--c) 45%, transparent); }
.s-decree::before, .s-decree::after { content: ''; display: block; width: 40px; height: 1px; margin: 1rem auto; background: var(--c); opacity: 0.6; }
.s-teach { margin: 0 auto 1.6rem; max-width: 520px; line-height: 1.85; color: #d3d9e8; }
.s-live { margin: 0 auto 1.6rem; max-width: 500px; padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); }
.s-live span { display: block; margin-bottom: 0.4rem; font-size: 0.58rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--c); }
.s-live p { margin: 0; line-height: 1.6; color: #eef1fb; }
.s-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.s-acts button { padding: 0.6rem 1.1rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); background: transparent; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; color: var(--text); transition: background 0.3s, color 0.3s; }
.s-acts button:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
.s-acts .carry.on { background: var(--c); color: #03040a; border-color: var(--c); }
.scroll.focus .sheet { box-shadow: inset 0 0 60px rgba(0,0,0,.6), 0 0 90px color-mix(in srgb, var(--c) 45%, transparent); }

.onward { padding: 14vh max(20px, 8vw) 16vh; max-width: 900px; margin: 0 auto; text-align: center; }
.onward h2 { margin: 0 0 1rem; font-family: var(--display); font-weight: 300; font-size: clamp(1.7rem, 4.4vw, 3rem); text-shadow: 0 0 50px color-mix(in srgb, var(--c) 55%, transparent); }
.onward > p:not(.kicker) { margin: 0 auto 2rem; max-width: 600px; line-height: 1.8; color: #d7ddeb; }

/* ---------- codex ---------- */
.codex { padding: 120px max(16px, 6vw) 16vh; max-width: 1100px; margin: 0 auto; background: rgba(3,4,10,.6); min-height: 100vh; }
.codex h1 { margin: 0 0 0.8rem; font-family: var(--display); font-weight: 300; font-size: clamp(2rem, 5vw, 3.4rem); }
.codex .lede { margin: 0 0 1.6rem; text-shadow: none; color: #d7ddeb; }
.c-search input { width: min(560px, 100%); padding: 0.9rem 1.2rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(6,9,18,.85); color: var(--text); font: inherit; outline: none; }
.c-search input:focus { border-color: var(--crystal); }
#c-msg { min-height: 1.4em; margin: 0.8rem 0 1.4rem; color: var(--crystal); }
.c-mine { margin-bottom: 3rem; padding: 1.4rem; border-radius: 20px; border: 1px solid rgba(79,176,255,.35); background: rgba(79,176,255,.06); }
.c-mine h2 { margin: 0 0 1rem; font-family: var(--display); font-weight: 300; font-size: 1.2rem; }
.c-type { margin-bottom: 2.6rem; }
.c-head { display: flex; align-items: center; gap: 14px; margin-bottom: 0.9rem; text-decoration: none; color: var(--text); }
.c-glyph { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--c); color: var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 40%, transparent); font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', var(--sans); }
.c-k { display: block; font-size: 0.56rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--c); }
.c-head strong { font-family: var(--display); font-weight: 400; font-size: 1.1rem; }
.c-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 6px; }
.law-link { display: flex; gap: 10px; align-items: baseline; padding: 0.6rem 0.8rem; border-radius: 12px; text-decoration: none; color: #dde3f0; border: 1px solid transparent; transition: background 0.25s, border-color 0.25s; }
.law-link:hover { background: color-mix(in srgb, var(--c) 12%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.ll-n { flex: none; min-width: 2.2em; font-family: var(--display); font-size: 0.62rem; color: var(--c); }
.ll-name { font-size: 0.92rem; }

.noscript { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; margin: 0; background: var(--void); }

@media (max-width: 700px) {
  .top { padding-left: 12px; padding-right: 12px; }
  .wordmark { font-size: 0.6rem; letter-spacing: 0.26em; }
  .pill { padding: 0.4rem 0.7rem; font-size: 0.54rem; letter-spacing: 0.16em; }
  .intro { gap: 14vh; }
  .intro-block:nth-child(2) { margin-left: 0; }
  .scroll:nth-child(3n + 2), .scroll:nth-child(3n) { transform: none; }
  .rod { left: -8px; right: -8px; }
  .gate { right: 44px; bottom: 7vh; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .a-glyph, .cue span::after { animation: none; }
}
