/* Kinetic layer, everything that moves. Gated by prefers-reduced-motion at the bottom. */

/* ---------- Reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(46px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
[data-reveal="left"] { transform: translateX(-60px); }
[data-reveal="right"] { transform: translateX(60px); }
[data-reveal="zoom"] { transform: scale(0.88); }
[data-reveal].in { opacity: 1; transform: none; }

/* Split headline: each word masked, rises with stagger once body.ready */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.split .w > span { display: inline-block; transform: translateY(112%) rotate(4deg); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 70ms + 150ms); }
/* Gradient text must live on the word spans once headlines are split (clip doesn't cross inline-blocks) */
.split .grad { background: none; animation: none; color: inherit; -webkit-background-clip: border-box; background-clip: border-box; }
.split .grad .w > span { background: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--amber)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }
body.ready .split.in .w > span, body.ready .split.ready-now .w > span { transform: none; }

/* ---------- Cursor glow + doors ---------- */
.cursor-glow {
  position: fixed; width: 520px; height: 520px; left: 0; top: 0; z-index: -1; pointer-events: none;
  margin: -260px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.11), rgba(124, 58, 237, 0.06) 45%, transparent 70%);
  transition: opacity 0.4s;
}
.doors { position: fixed; inset: 0; z-index: 3000; pointer-events: none; display: flex; }
.doors i {
  flex: 1; position: relative; background: linear-gradient(180deg, #10131b, #07080c);
  transition: transform 0.75s var(--ease);
}
.doors i:first-child { border-right: 2px solid rgba(255, 215, 106, 0.5); transform: translateX(-101%); }
.doors i:last-child { border-left: 2px solid rgba(255, 215, 106, 0.5); transform: translateX(101%); }
.doors i::after { /* rivets */
  content: ''; position: absolute; top: 0; bottom: 0; width: 10px; opacity: 0.5;
  background: radial-gradient(circle, #3b4252 2px, transparent 3px) 0 0 / 10px 46px;
}
.doors i:first-child::after { right: 8px; }
.doors i:last-child::after { left: 8px; }
.doors.shut { pointer-events: all; }
.doors.shut i { transform: none; }
.doors.start-shut i { transition: none; transform: none; }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + 40px) 0 90px; overflow: hidden; }
#net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero .wrap { position: relative; z-index: 2; }
.hero h1 .serif:last-child { display: block; }
.hero .lead { margin-top: 30px; }
.hero .eyebrow { margin-bottom: 28px; }
.dial {
  position: absolute; z-index: 1; right: -12vw; top: 50%; width: min(78vw, 880px); aspect-ratio: 1;
  margin-top: calc(min(78vw, 880px) / -2); opacity: 0.55; pointer-events: none;
  transform: rotate(calc(var(--scroll, 0) * 0.18deg));
  -webkit-mask-image: radial-gradient(circle, #000 45%, transparent 72%); mask-image: radial-gradient(circle, #000 45%, transparent 72%);
}
.dial svg { width: 100%; height: 100%; }
.dial .spin-a { transform-origin: 50% 50%; animation: spin 90s linear infinite; }
.dial .spin-b { transform-origin: 50% 50%; animation: spin 60s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.scroll-cue { position: absolute; z-index: 2; bottom: 28px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.25em; color: var(--text-2); text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-cue::after { content: ''; width: 1px; height: 44px; background: linear-gradient(var(--cyan), transparent); animation: drip 2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Brass seam: the hero closes like a vault door edge (gold line + rivets) */
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; z-index: 3; pointer-events: none; background: radial-gradient(circle at 50% 50%, #7a6a3a 2px, transparent 3px) 0 0 / 38px 14px, linear-gradient(90deg, transparent, rgba(255, 215, 106, 0.55) 20%, rgba(255, 215, 106, 0.55) 80%, transparent) bottom / 100% 2px no-repeat; opacity: 0.85; }
.card .lab { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 10px; }

/* ---------- Marquee ---------- */
.marquee { padding: 26px 0; border-block: 1px solid var(--line-2); overflow: hidden; background: rgba(255, 255, 255, 0.015); }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-size: clamp(1.4rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; padding: 0 28px; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35); transition: color 0.3s; }
.marquee span:hover { color: var(--cyan); -webkit-text-stroke-color: var(--cyan); }
.marquee span.f { color: var(--text); -webkit-text-stroke: 0; }
.marquee .sep { color: var(--amber); -webkit-text-stroke: 0; padding: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Vault map (the original clickable plates, now alive) ---------- */
.vault-stage { position: relative; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8), 0 0 90px -30px var(--glow-amber); transform-style: preserve-3d; transition: transform 0.25s ease-out; }
.vault-stage img { width: 100%; height: auto; }
.vault-stage .scan { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 0%, rgba(0, 212, 255, 0.14) 50%, transparent 100%) 0 -100% / 100% 40% no-repeat; animation: scan 5s linear infinite; }
@keyframes scan { to { background-position: 0 200%; } }
.plate { position: absolute; left: 68%; width: 23.5%; border-radius: 10px; z-index: 3; transition: background 0.3s, box-shadow 0.4s, transform 0.4s var(--spring); }
.plate:hover, .plate:focus-visible { background: rgba(255, 215, 106, 0.22); box-shadow: 0 0 40px rgba(255, 215, 106, 0.55), inset 0 0 0 2px rgba(255, 215, 106, 0.7); transform: scale(1.035) translateX(-1.2%); outline: none; }
.plate span { position: absolute; right: calc(100% + 14px); top: 50%; transform: translate(12px, -50%); opacity: 0; white-space: nowrap; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 8px 14px; border-radius: 8px; background: rgba(0, 0, 0, 0.8); border: 1px solid rgba(255, 215, 106, 0.5); color: var(--gold); transition: 0.35s var(--ease); pointer-events: none; }
.plate:hover span, .plate:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.p1 { top: 7%; height: 22%; } .p2 { top: 31%; height: 24%; } .p3 { top: 57%; height: 16%; } .p4 { top: 75%; height: 24%; }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: center; }


/* ---------- Brass: everything below the hero lives inside the vault ---------- */
.gold { color: var(--gold); }
.brass .eyebrow { color: var(--gold); }
.brass .eyebrow::before { background: linear-gradient(90deg, var(--gold), transparent); }
.brass .btn.primary { background: linear-gradient(120deg, var(--gold), var(--amber)); box-shadow: 0 10px 40px -10px var(--glow-amber); }
.brass .btn:hover { border-color: var(--gold); box-shadow: 0 0 30px rgba(255, 215, 106, 0.35); }
.brass .card::before { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 215, 106, 0.13), transparent 60%); }
.brass .co:hover { border-color: rgba(255, 215, 106, 0.5); }
.brass .co .more, .brass .tl small { color: var(--gold); }
.brass .checks li::before { border-color: var(--gold); }
.brass .timeline::before { background: linear-gradient(var(--gold), var(--amber), transparent); }
.brass .tl::before { border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 215, 106, 0.4); }
.brass .tl.next::before { border-color: var(--amber); box-shadow: 0 0 16px var(--glow-amber); }
.brass .stack-card .code { background: linear-gradient(120deg, var(--gold), var(--amber)); -webkit-background-clip: text; background-clip: text; }
.brass .marquee .sep { color: var(--gold); }
.brass .marquee span:hover { color: var(--gold); -webkit-text-stroke-color: var(--gold); }
a:not(.btn):not(.card):not(.plate):not(.brand):not(.skip-link) { text-decoration-color: rgba(255, 215, 106, 0.5); }
.note { margin-top: 36px; font-size: 0.92rem; color: var(--text-2); max-width: 70ch; }
.note a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Sovereignty: three bolts slide home along one bar ---------- */
.sov { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; position: relative; margin-top: 64px; padding-top: 36px; }
.sov::before { content: ''; position: absolute; left: 27px; right: 27px; top: 27px; height: 2px; background: linear-gradient(90deg, var(--gold), rgba(255, 215, 106, 0.15)); transform: scaleX(0); transform-origin: left; transition: transform 1.8s var(--ease) 0.2s; }
.sov.in::before { transform: scaleX(1); }
.sov-step { position: relative; }
.sov-step .n { position: absolute; top: -36px; left: 0; z-index: 2; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 500; color: var(--gold); background: var(--bg); border: 2px solid var(--gold); box-shadow: 0 0 0 0 rgba(255, 215, 106, 0.5); opacity: 0; transform: scale(0.4); }
.sov.in .sov-step .n { animation: bolt 0.9s var(--spring) forwards; animation-delay: calc(var(--i) * 450ms + 300ms); }
@keyframes bolt { 60% { box-shadow: 0 0 0 14px rgba(255, 215, 106, 0); } to { opacity: 1; transform: none; box-shadow: 0 0 22px rgba(255, 215, 106, 0.35); } }
.sov-step .card { height: 100%; padding-top: 44px; display: flex; flex-direction: column; align-items: flex-start; }
.sov-step .by { margin-top: auto !important; }
.sov-step p { margin-bottom: 22px; }
.sov-step small { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 10px; }
.sov-step .by { display: inline-block; margin-top: 22px; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 860px) { .sov { grid-template-columns: 1fr; gap: 44px; } .sov::before { display: none; } }

/* ---------- Sticky stack ---------- */
.stack { position: relative; }
.stack-card { position: sticky; top: calc(var(--header-h) + 26px + var(--n) * 22px); margin-bottom: 38px; transform-origin: 50% 0; transition: transform 0.15s linear, filter 0.15s linear; will-change: transform; }
/* Code word sits on its own row and is sized to the card (cqw), so even the longest word stays whole on one line */
.stack-card .card { display: grid; grid-template-columns: 1fr; gap: 22px; container-type: inline-size; background: linear-gradient(160deg, #161a26, #0e1118); }
.stack-card .code { font-family: var(--mono); font-size: min(4.4rem, 9cqw); white-space: nowrap; font-weight: 800; line-height: 1; letter-spacing: -0.04em; margin-top: 8px; background: linear-gradient(120deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stack-card small { font-family: var(--mono); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.8rem; color: var(--amber); }

/* ---------- Company cards ---------- */
.co { display: flex; flex-direction: column; min-height: 100%; transform-style: preserve-3d; transition: transform 0.2s ease-out, border-color 0.3s; }
.co:hover { border-color: rgba(0, 212, 255, 0.5); }
.co .tag { align-self: flex-start; margin-bottom: 22px; }
.co p { flex: 1; margin-bottom: 24px; }
.co .more { font-weight: 700; color: var(--cyan); display: inline-flex; gap: 10px; align-items: center; }
.co .more::after { content: '→'; transition: transform 0.4s var(--spring); }
.co:hover .more::after { transform: translateX(8px); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--cyan), var(--violet), transparent); }
.tl { position: relative; padding-bottom: 36px; }
.tl::before { content: ''; position: absolute; left: -34px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 16px var(--glow-cyan); }
.tl.next::before { border-color: var(--amber); box-shadow: 0 0 16px var(--glow-amber); animation: blink 1.6s infinite; }
.tl small { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan); }
.tl.next small { color: var(--amber); }
.tl h3 { margin: 6px 0 8px; }

/* ---------- Inner page hero ---------- */
.page-hero { position: relative; min-height: 78svh; display: flex; align-items: flex-end; padding: calc(var(--header-h) + 70px) 0 70px; overflow: hidden; }
.page-hero .bg { position: absolute; inset: -8% 0; background-size: cover; background-position: center; opacity: 0.4; transform: translateY(calc(var(--scroll, 0) * 0.25px)); filter: saturate(1.15); }
.page-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 8, 12, 0.55), var(--bg) 96%); }
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero h1 { font-size: clamp(2.6rem, 7vw, 6rem); }
.page-hero .lead { margin-top: 26px; }
.page-hero .logo { height: clamp(54px, 8vw, 96px); width: auto; margin-bottom: 28px; filter: drop-shadow(0 0 30px rgba(255, 215, 106, 0.25)); }
.callout { border: 1px solid rgba(245, 158, 11, 0.35); padding: 18px 24px; background: rgba(245, 158, 11, 0.07); border-radius: 14px; font-size: 0.95rem; }
.big-quote { font-family: var(--serif); font-style: italic; font-size: clamp(1.7rem, 4vw, 3.2rem); line-height: 1.3; color: var(--text); letter-spacing: -0.01em; }

/* ---------- Intro overlay (see intro.js) ---------- */
#intro { position: fixed; inset: 0; z-index: 5000; background: #000; display: grid; place-items: center; overflow: hidden; }
#intro.done { opacity: 0; pointer-events: none; transition: opacity 0.9s ease; }
#intro .brandmark { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 22px; transition: opacity 0.7s; }
#intro .brandmark h2 { font-size: clamp(2.2rem, 7vw, 5rem); display: flex; }
#intro .brandmark h2 i { font-style: normal; display: inline-block; opacity: 0; transform: translateY(60px) rotateX(80deg); animation: letterIn 0.9s var(--ease) forwards; animation-delay: calc(var(--i) * 80ms); }
@keyframes letterIn { to { opacity: 1; transform: none; } }
#intro .bars { display: flex; gap: 6px; height: 34px; align-items: flex-end; }
#intro .bars i { width: 5px; background: linear-gradient(var(--cyan), var(--violet)); animation: bar 1s ease-in-out infinite; animation-delay: calc(var(--i) * 120ms); height: 100%; transform-origin: bottom; }
@keyframes bar { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }
#intro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s; }
#intro video.on { opacity: 1; }
#intro .grid4 { position: absolute; inset: 2.5%; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 4px; }
#intro .grid4 div { background: rgba(0, 0, 0, 0.9) center / contain no-repeat; border-radius: 6px; transform: scale(0); opacity: 0; will-change: transform, opacity; }
#intro .chip { position: absolute; z-index: 5; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.55); color: #fff; backdrop-filter: blur(8px); cursor: pointer; font-family: var(--mono); }
#intro .skip { right: 22px; bottom: 22px; }
#intro .unmute { left: 22px; bottom: 22px; display: none; }
#intro .chip:hover { border-color: var(--cyan); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .split-2, .stack-card .card { grid-template-columns: 1fr; }
  .dial { right: -40vw; opacity: 0.35; }
}
@media (max-width: 760px) {
  /* Plates hide on phones; the company cards below the vault are the tappable doors */
  .plate { display: none; }
  .stack-card { position: relative; top: auto; }
}

/* ---------- Reduced motion: keep content, drop the movement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-reveal], .split .w > span { opacity: 1 !important; transform: none !important; }
  .marquee-track { animation: none; }
  .cursor-glow, #net { display: none; }
}
