/* Sea Serpent studio site — variation C, Field Notes. Base + hero rules are the scaffold's, unchanged. */
:root {
  --ink: #070d14;
  --ink-2: #0c1622;
  --panel: #0f1d2b;
  --line: rgba(183, 197, 211, 0.14);
  --line-strong: rgba(183, 197, 211, 0.32);
  --paper: #f5f5ef;
  --muted: #a5b4c3;
  --cobalt: #234ee8;
  --cobalt-2: #5677ff;
  --teal: #2fd3c3;
  --ember: #ff7a3d;
  --display: "Rubik", "Fredoka", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --body: "Rubik", system-ui, sans-serif; /* same family as the headings, lighter weight */
  --wrap: 1320px;
  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 400 16px/1.65 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }
.section { padding: clamp(80px, 11vw, 150px) 0; position: relative; }
h1, h2, h3 { font-family: var(--display); font-weight: 630; text-transform: uppercase; letter-spacing: -.02em; line-height: 1; margin: 0; }
.h2 { font-size: clamp(32px, 4.3vw, 66px); }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 60ch; }
.label { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chip { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--paper); background: rgba(255,255,255,.03); }

/* Emblem: full-screen section, white backdrop, flat-colour serpent head on the right.
   The intro (navy sea, wave stripes, rising serpent) is layered on top and driven by site.js. */
.emblem-section { --edge: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); --navy: #0b3a5a; position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; background: var(--navy); color: var(--paper); overflow: hidden; }
/* Field Notes: copy sits higher than the scaffold so the lead clears the top wave stripe (waterline ≈ 215px above the bottom) */
.emblem-copy { padding: 40px 0 clamp(150px, 27svh, 270px) var(--edge); position: relative; z-index: 4; }
.emblem-copy .eyebrow { color: var(--teal); }
.emblem-copy .h2 { font-size: clamp(42px, 5.4vw, 90px); }
.emblem-copy .lead { color: #b7c5d3; max-width: 40ch; margin: 26px 0 0; font-size: clamp(16px, 1.3vw, 19px); }
.rise { display: block; overflow: hidden; padding-bottom: .06em; }
.rise > span { display: inline-block; will-change: transform; }
.emblem { position: relative; align-self: stretch; min-height: 100svh; z-index: 2; }
.emblem-serpent {
  --serpent: #fff;
  position: absolute; top: -6%; right: calc(-16% + 120px); height: 118%; aspect-ratio: 488 / 518;
  background: var(--serpent);
  -webkit-mask: url("assets/masks/serpent-head-fade.svg") 0 0 / 100% 100% no-repeat;
  mask: url("assets/masks/serpent-head-fade.svg") 0 0 / 100% 100% no-repeat;
  will-change: transform;
}
/* Ambient echoes share the serpent's box so they line up with its silhouette */
.emblem-echo { position: absolute; top: -6%; right: calc(-16% + 120px); height: 118%; aspect-ratio: 488 / 518; overflow: visible; pointer-events: none; z-index: 0; }
.emblem-echo path { fill: none; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
@keyframes emblem-breathe { 50% { transform: scale(1.012) rotate(-.3deg); } }

/* Intro layers */
.intro-sea { position: absolute; inset: 0; z-index: 1; background: var(--navy); pointer-events: none; }
.intro-waves { position: absolute; left: 0; bottom: 0; width: 100%; height: 52%; z-index: 3; overflow: visible; pointer-events: none; }
.intro-waves path { fill: #fff; }
.no-intro .intro-sea, .no-intro .intro-splash { display: none; }
.intro-splash { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.intro-splash i { position: absolute; left: 0; top: 0; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #fff; box-shadow: 0 0 0 2px rgba(11, 58, 90, .45); }
.intro-splash .crown { box-shadow: none; }
.intro-splash .crown { border-radius: 50%; background: none; border: 3px solid #fff; }
html.intro-lock, html.intro-lock body { overflow: hidden; height: 100%; }
/* Hide the resting state until the intro has positioned things (no flash before JS runs) */
.js [data-intro]:not(.is-done):not(.is-playing) .emblem-serpent { visibility: hidden; }
.js [data-intro]:not(.is-done) .rise > span { transform: translateY(115%); }

/* ==== Field Notes (variation C) ==========================================================
   Editorial, typography-led: rules and whitespace instead of boxes. */
.skip { position: absolute; left: 16px; top: -80px; z-index: 20; padding: 12px 18px; background: var(--paper); color: var(--ink); font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 16px; }

/* Deep sections: each one sits further underwater; the serpent's body runs through them */
main { position: relative; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.deep-section { position: relative; min-height: 100svh; display: flex; align-items: center; color: var(--paper); background: #093350; }
.deep-section[data-depth="2"] { background: #082c46; }
.deep-section[data-depth="3"] { background: #07263d; }
.deep-section[data-depth="4"] { background: #062034; }
.deep-section[data-depth="5"] { background: #051a2b; }
.deep-section[data-depth="6"] { background: #041522; }
.deep-section[data-depth="7"] { background: #030f19; }
.deep-section:focus { outline: none; }
.deep-content { position: relative; z-index: 2; padding-block: clamp(80px, 10vw, 140px); }
.deep-content.side-left { padding-right: 42%; }
.deep-content.side-right { padding-left: 44%; }
h3 { font-size: clamp(22px, 2vw, 28px); }

/* ---- The serpent body as line art (geometry + scrub in body.js) ---- */
.serpent-body { position: absolute; left: 0; top: 0; width: 100%; z-index: 1; pointer-events: none; overflow: visible; transition: opacity .5s ease; }
.emblem-section:not(.is-done) ~ .serpent-body { opacity: 0; }
.emblem-section.is-done .emblem-serpent { clip-path: var(--join-clip, none); }
/* the solid head sits exactly on top of the fading one and fades in once the intro is done */
.emblem-serpent-solid { -webkit-mask-image: url("assets/masks/serpent-head.svg"); mask-image: url("assets/masks/serpent-head.svg"); opacity: 0; transition: opacity .7s ease; }
.emblem-section.is-done .emblem-serpent-solid { opacity: 1; }
.serpent-body .b-edge { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.serpent-body .b-heavy { stroke-width: 6; }
.serpent-body .b-ribs { fill: none; stroke: var(--teal); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.serpent-body .b-nib { fill: var(--teal); stroke: #fff; stroke-width: 2; transition: opacity .3s; }
.serpent-body .b-nib.is-hidden { opacity: 0; }

/* ---- Lottie annotation marks ---- */
.anno { position: relative; display: inline-block; }
.fx { position: absolute; display: block; pointer-events: none; }
.fx svg { display: block; }
.fx[hidden] { display: none; }
.fx-under { left: -1%; width: 102%; bottom: -.1em; height: 24px; transform: translateY(55%); }
.fx-under2 { left: -1%; width: 102%; bottom: 0; height: 30px; transform: translateY(70%); }
.fx-circle { left: -.3em; right: -.3em; top: -.16em; bottom: -.1em; }
.fx-circle-sm { left: -.7em; right: -.7em; top: -.6em; bottom: -.6em; }
.fx-arrow { position: relative; display: inline-block; width: 92px; height: 56px; margin-left: 10px; }
.fx-arrow-down { transform: rotate(78deg) translate(14px, 6px); margin-bottom: -10px; }
.bracketed { position: relative; padding-left: 40px; }
.fx-bracket { left: 0; top: .3em; bottom: .3em; width: 22px; }
.fx-ast { position: relative; display: inline-block; width: 22px; height: 22px; margin-right: 6px; vertical-align: -6px; }
.fx-tag { position: relative; display: inline-block; width: 34px; height: 20px; margin: -4px 4px -4px -40px; }
.hand-note { display: flex; align-items: flex-start; margin: 28px 0 0; font: italic 400 14px/1.3 var(--mono); color: var(--teal); }

/* ---- Buttons ---- */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border: 1.5px solid var(--paper); border-radius: 999px; font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.btn-solid { background: var(--paper); color: var(--ink); }
.btn:hover, .btn:focus-visible { background: var(--teal); border-color: var(--teal); color: var(--ink); }

/* ---- AI: compact statement ---- */
.ai-section { min-height: 0; background: #0b3a5a; }
.ai-section .deep-content { padding-block: clamp(64px, 10vh, 120px); }
.ai-headline { margin: 0; font: 630 clamp(30px, 4.1vw, 66px)/1.06 var(--display); letter-spacing: -.02em; text-transform: uppercase; }
.ai-grad {
  background: linear-gradient(90deg, var(--cobalt-2), var(--teal), #9ff0e6, var(--teal), var(--cobalt-2));
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: ai-sweep 10s linear infinite;
}
@keyframes ai-sweep { to { background-position: 300% 0; } }
.ai-word, .ai-l1 { white-space: nowrap; }
/* only the R glitches in and out: "revolution" ⇄ "evolution" */
.ai-r { display: inline-block; color: var(--teal); -webkit-text-fill-color: var(--teal); animation: ai-glitch 4.2s steps(1) infinite; }
@keyframes ai-glitch {
  0%, 30% { opacity: 1; clip-path: none; }
  32% { opacity: 1; clip-path: inset(0 0 55% 0); }
  34% { opacity: 1; clip-path: inset(45% 0 0 0); }
  36%, 62% { opacity: 0; }
  64% { opacity: 1; clip-path: inset(20% 0 30% 0); }
  66%, 70% { opacity: 0; }
  72%, 100% { opacity: 1; clip-path: none; }
}
.ai-lines { margin: clamp(22px, 3vh, 34px) 0 0; display: grid; gap: 6px; font: 400 clamp(18px, 1.7vw, 24px)/1.4 var(--body); }
.ai-line { display: block; }
.js .ai-lines.reveal { transform: none; opacity: 1; }
.ai-line-1 { color: var(--muted); }
.js .ai-line-1 { opacity: 0; transition: opacity 1.4s ease .2s; }
.js .ai-lines.in .ai-line-1 { opacity: 1; }
.ai-line-2 { color: #b7c5d3; animation: ai-drift 11s ease-in-out infinite; }   /* drifts like the waterline */
@keyframes ai-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(28px); } }
.ai-line-3 { color: var(--paper); font-weight: 500; }                               /* the anchor: perfectly still */

/* ---- Portfolio showcases: themed sections, character render, trailer over the serpent ---- */
.showcase { --hud: var(--teal); --accent: var(--teal); min-height: max(64svh, 600px); overflow: visible; background: #062034; }
.theme-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.theme-bg::after { content: ""; position: absolute; inset: -10%; opacity: .5; animation: theme-pan 40s linear infinite; }
@keyframes theme-pan { to { transform: translate3d(-4%, -6%, 0); } }
@keyframes theme-drift { to { background-position: 100% 50%; } }
.hud { position: absolute; inset: clamp(14px, 2.4vw, 32px); z-index: 0; pointer-events: none; }
.hud-c { position: absolute; width: 28px; height: 28px; border: 2px solid var(--hud); }
.hud-tl { left: 0; top: 0; border-right: 0; border-bottom: 0; } .hud-tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.hud-bl { left: 0; bottom: 0; border-right: 0; border-top: 0; } .hud-br { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.hud-line { position: absolute; height: 1px; background: var(--hud); opacity: .45; }
.hud-line-a { left: 40px; right: 40px; top: 0; } .hud-line-b { left: 40px; width: 28%; bottom: 0; }
.show-decor { position: absolute; z-index: 0; width: clamp(120px, 14vw, 200px); aspect-ratio: 1; top: clamp(40px, 7vh, 70px); left: 44%; opacity: .9; pointer-events: none; }
.show-copy { padding-block: clamp(70px, 10vh, 120px); }
.showcase.side-left .show-copy { padding-right: 58%; }
.showcase.side-right .show-copy { padding-left: 58%; }
.show-index { margin: 0 0 18px; color: var(--accent); }
.show-name { margin: 0; }
.show-genre { margin: 10px 0 0; color: var(--accent); }
.show-desc { margin: 18px 0 28px; max-width: 46ch; color: #d3dbe3; }
.show-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.btn-trailer { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px 0 6px; border: 1.5px solid var(--accent); border-radius: 999px; background: rgba(0, 0, 0, .2); color: var(--paper); font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: background .2s, color .2s; }
.btn-trailer:hover, .btn-trailer:focus-visible { background: var(--accent); color: #0b0716; }
.btn-trailer[aria-expanded="true"] { visibility: hidden; }
.btn-trailer { position: relative; text-decoration: none; }
.btn-trailer::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 1.5px solid var(--accent); opacity: 0; pointer-events: none; animation: btn-pulse 2.8s ease-out infinite; }
@keyframes btn-pulse { 0% { opacity: .7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.12, 1.4); } }
.btn-contact { --accent: var(--teal); margin-top: 22px; }
.discord-dm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.discord-dm strong { color: var(--paper); font-weight: 630; }
.btn-copy { min-height: 32px; padding: 0 14px; border: 1px solid rgba(47, 211, 195, .6); border-radius: 999px; background: none; color: var(--teal); font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: background .2s, color .2s; }
.btn-copy:hover, .btn-copy:focus-visible { background: var(--teal); color: #0b0716; }
.btn-copy.is-copied { background: var(--teal); color: #0b0716; }
.play-ic { width: 40px; height: 40px; }
.show-link { display: inline-flex; align-items: center; min-height: 44px; font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--paper); text-underline-offset: 6px; text-decoration-color: var(--accent); }
/* the character faces the serpent; showcase.js sets --render-left from the body's edge */
.show-render { position: absolute; z-index: 3; margin: 0; bottom: 0; left: var(--render-left, 42%); height: min(58svh, 560px); width: auto; pointer-events: none; }
.show-render img { height: 100%; width: auto; max-width: none; display: block; }
.r-float { position: relative; height: 100%; transform-origin: 50% 100%; }
.show-render.is-flipped .r-float { scale: -1 1; }
.js .show-render { opacity: 0; transform: translateX(-40px); transition: opacity .9s ease, transform 1.1s cubic-bezier(.2, .8, .2, 1); }
.js .side-right .show-render { transform: translateX(40px); }
.js .show-render.is-in { opacity: 1; transform: none; }
.show-render.is-in .r-float { animation: render-float 6s ease-in-out infinite; }
@keyframes render-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
/* echo: like the hero serpent's sonar outline — a 1.5px line around the silhouette that grows outward and fades */
.r-echo { position: absolute; inset: 0; pointer-events: none; opacity: 0; transform-origin: 50% 55%;
  -webkit-mask: var(--src) 0 0 / 100% 100% no-repeat, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: var(--src) 0 0 / 100% 100% no-repeat exclude, linear-gradient(#000 0 0); }
.r-echo img { width: 100%; height: 100%; filter: drop-shadow(1.5px 0 0 var(--accent)) drop-shadow(-1.5px 0 0 var(--accent)) drop-shadow(0 1.5px 0 var(--accent)) drop-shadow(0 -1.5px 0 var(--accent)); }
.show-render.is-in .r-echo { animation: render-echo 3.2s ease-out infinite; }
@keyframes render-echo { 0% { opacity: .6; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12); } }
/* trailer: collapsed by default; expands over the serpent body and may break out of the section */
.trailer { position: absolute; z-index: 6; left: var(--tr-left, 50%); top: var(--tr-top, 50%); width: var(--tr-w, min(760px, 90vw)); aspect-ratio: 16 / 9; background: #000; border: 2px solid var(--accent); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.trailer[hidden] { display: none; }
.trailer video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.trailer-close { position: absolute; right: -14px; top: -14px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); background: #0b0716; color: var(--paper); font: 400 26px/1 var(--body); cursor: pointer; }
.trailer-close:hover, .trailer-close:focus-visible { background: var(--accent); color: #0b0716; }

/* Protodroid DeLTA: purple sci-fi HUD, triangle motif */
.theme-pd { --hud: #c07bff; --accent: #c07bff; }
.theme-pd .theme-bg { background: linear-gradient(120deg, #2a0f52, #160634 45%, #3a0f66 75%, #12052a); background-size: 240% 240%; animation: theme-drift 18s ease-in-out infinite alternate; }
.theme-pd .theme-bg::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104'%3E%3Cpath d='M60 8 104 96H16Z' fill='none' stroke='%23b14cff' stroke-opacity='.28' stroke-width='1.5'/%3E%3C/svg%3E"); }
/* Infinite Victory: court lines, scoreboard heat */
.theme-iv { --hud: #ffb36b; --accent: #ff8f4a; }
.theme-iv .theme-bg { background: linear-gradient(160deg, #3d1808, #1c0b05 60%, #2a0f05); background-size: 200% 200%; animation: theme-drift 20s ease-in-out infinite alternate; }
.theme-iv .theme-bg::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='240'%3E%3Cg fill='none' stroke='%23ffb36b' stroke-opacity='.18' stroke-width='2'%3E%3Ccircle cx='180' cy='120' r='46'/%3E%3Cpath d='M180 0v240M0 60h70v120H0M360 60h-70v120h70'/%3E%3C/g%3E%3C/svg%3E"); }
/* Project Wraith: tactical grid, cold red and steel */
.theme-wr { --hud: #e0383e; --accent: #ef4a50; }
.theme-wr .theme-bg { background: linear-gradient(180deg, #161b20, #0b0e11); }
.theme-wr .theme-bg::after { background-image: linear-gradient(rgba(154, 167, 178, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(154, 167, 178, .09) 1px, transparent 1px); background-size: 44px 44px; }
/* Rolled Out!: rails and bright yellow */
.theme-ro { --hud: #f3c44f; --accent: #f3c44f; }
.theme-ro .theme-bg { background: linear-gradient(140deg, #2a2468, #16123c 60%, #241d5c); background-size: 220% 220%; animation: theme-drift 16s ease-in-out infinite alternate; }
.theme-ro .theme-bg::after { background-image: conic-gradient(rgba(243, 196, 79, .07) 25%, transparent 0 50%, rgba(243, 196, 79, .07) 0 75%, transparent 0); background-size: 96px 96px; }
.theme-ro .show-decor { left: 30%; }
/* Project Wraith is the curl: leave room below the copy for the body to cross */
.showcase[data-body="curl"] { min-height: 92svh; align-items: flex-start; }

/* ---- Closer: the cast, then the shelf ---- */
.closer { display: block; min-height: 0; padding: clamp(70px, 10vh, 120px) 0 clamp(40px, 6vh, 70px); }
.closer-hero { position: relative; z-index: 2; display: flex; flex-direction: column; margin-left: 30%; padding-right: 4vw; }
.closer-title { position: relative; z-index: 1; margin: 0; font-size: clamp(50px, 6.2vw, 104px); line-height: .98; max-width: none; }
/* the cast stands in front of the headline, overlapping only its lower edge (no glow) */
.closer-group { position: relative; z-index: 2; display: block; width: auto; height: min(60svh, 580px); max-width: 100%; margin-top: clamp(-70px, -4.5vw, -30px); object-fit: contain; object-position: left bottom; }
/* echo outline: copies of the headline drawn as a thin outline that grow outward and fade, like the serpent's echo */
.closer-title::before, .closer-title::after { content: attr(data-echo); position: absolute; inset: 0; white-space: pre-line; color: transparent; -webkit-text-stroke: 1.5px var(--teal); pointer-events: none; opacity: 0; transform-origin: 30% 55%; animation: title-echo 3.2s ease-out infinite; }
.closer-title::after { animation-delay: 1.6s; }
@keyframes title-echo { 0% { opacity: .65; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }
.shelf { --case-w: clamp(170px, min(20vw, 52vh), 300px); --depth: 18px; position: relative; z-index: 2; height: clamp(600px, 84svh, 780px); margin-top: 24px; perspective: 1400px; touch-action: pan-y; cursor: grab; outline: 0; }
.shelf:focus-visible { box-shadow: inset 0 0 0 2px var(--teal); }
.shelf.is-dragging { cursor: grabbing; }
.shelf-kicker { position: absolute; left: 50%; top: 0; transform: translateX(-50%); margin: 0; white-space: nowrap; }
.shelf-cases { position: absolute; inset: 0; }
.shelf-item { position: absolute; top: 52%; left: 50%; width: var(--case-w); aspect-ratio: 9 / 16; transform-style: preserve-3d; transition: left .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1), opacity .4s, width .55s cubic-bezier(.16, 1, .3, 1), aspect-ratio .55s cubic-bezier(.16, 1, .3, 1); }
.shelf-item[data-position="far-left"] { left: 12%; opacity: .3; transform: translate3d(-50%, -42%, -180px) rotateY(28deg) scale(.72); }
.shelf-item[data-position="left"] { left: 30%; z-index: 2; opacity: .7; transform: translate3d(-50%, -48%, -30px) rotateY(17deg) scale(.86); }
.shelf-item[data-position="center"] { left: 50%; z-index: 5; transform: translate3d(-50%, -52%, 100px); }
.shelf-item[data-position="right"] { left: 70%; z-index: 2; opacity: .7; transform: translate3d(-50%, -48%, -30px) rotateY(-17deg) scale(.86); }
.shelf-item[data-position="far-right"] { left: 88%; opacity: .3; transform: translate3d(-50%, -42%, -180px) rotateY(-28deg) scale(.72); }
.shelf-item[data-position="offstage"] { visibility: hidden; opacity: 0; pointer-events: none; transform: translate3d(-50%, -30%, -340px) scale(.5); }
.shelf-item.is-open { z-index: 12; width: clamp(420px, 52vw, 760px); aspect-ratio: 16 / 9; }
.game-case { position: absolute; inset: 0; padding: 0; border: 0; background: none; color: var(--paper); cursor: pointer; transform-style: preserve-3d; container-type: inline-size; }
.game-case:focus { outline: 0; }
.case-face { position: absolute; display: block; overflow: hidden; border: 1px solid rgba(247, 249, 255, .2); backface-visibility: hidden; }
.case-front { inset: 0; z-index: 3; border-radius: 5px; background: #0a1830; transform: translateZ(calc(var(--depth) / 2)); box-shadow: 0 30px 70px rgba(0, 0, 0, .55), inset 0 0 0 4px #0b1d3b; }
.game-case:focus-visible .case-front { box-shadow: 0 0 0 3px #dceaff, 0 0 0 7px var(--teal), 0 30px 70px rgba(0, 0, 0, .55); }
.case-front > img, .case-front > video { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: cover; background: #13233d; }
.case-front > video { z-index: 1; opacity: 0; transition: opacity .4s; }
.shelf-item.is-live .case-front > video, .shelf-item.is-open .case-front > video { opacity: 1; }
.shelf-item.is-open .case-front > video { object-fit: contain; background: #000; }
.case-placeholder { position: absolute; z-index: 2; left: 50%; top: 38%; transform: translate(-50%, -50%); font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); white-space: nowrap; }
.case-grade { position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, rgba(1, 6, 14, .05) 30%, rgba(2, 8, 18, .9)); pointer-events: none; }
.shelf-item.is-open .case-grade, .shelf-item.is-open .case-title { opacity: 0; transition: opacity .3s; }
.case-title { position: absolute; z-index: 3; left: 7cqi; right: 7cqi; bottom: 7cqi; text-align: left; overflow-wrap: anywhere; }
.case-title small { display: block; margin-bottom: 3cqi; font: 500 clamp(7px, 3.6cqi, 11px)/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.case-title strong { display: block; font: 630 clamp(13px, 10.5cqi, 34px)/.95 var(--display); text-transform: uppercase; text-wrap: balance; }
.case-front.is-text { background: linear-gradient(160deg, #0d2a44, #061424); }
.case-front.is-text::before { content: ""; position: absolute; inset: 14px; border: 1.5px dashed rgba(47, 211, 195, .45); border-radius: 3px; }
.case-spine, .case-edge { top: 0; bottom: 0; width: var(--depth); background: #10294b; }
.case-spine { left: 0; transform: rotateY(-90deg) translateZ(calc(var(--depth) / 2)); }
.case-edge { right: 0; transform: rotateY(90deg) translateZ(calc(var(--depth) / 2)); }
.shelf-item.is-open .case-spine, .shelf-item.is-open .case-edge { opacity: 0; }
.shelf-arrow { position: absolute; z-index: 15; top: 52%; width: 52px; height: 52px; border: 1px solid rgba(247, 249, 255, .46); border-radius: 50%; background: rgba(3, 15, 25, .7); color: var(--paper); font-size: 18px; cursor: pointer; transition: background .2s, color .2s; }
.shelf-prev { left: max(var(--gutter), 30%); } .shelf-next { right: var(--gutter); }
.shelf-arrow:hover, .shelf-arrow:focus-visible { background: var(--paper); color: var(--ink); }
.shelf-caption { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); margin: 0; width: min(560px, 90%); text-align: center; font: 500 12px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.shelf-caption b { display: block; color: var(--paper); font-weight: 500; }

/* ---- Three-step ---- */
.three-step { min-height: 0; }
.steps-box { position: relative; margin-left: 30%; padding: clamp(32px, 4vw, 56px); border: 1.5px solid var(--line-strong); background: #030f19; }
.steps-box::before, .steps-box::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--teal); }
.steps-box::before { left: -2px; top: -2px; border-right: 0; border-bottom: 0; }
.steps-box::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }
.steps-box .h2 { margin: 0 0 clamp(26px, 3vw, 40px); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.step { padding: 24px; border: 1px solid var(--line-strong); }
.step-ic { display: block; width: 64px; height: 64px; margin-bottom: 14px; }
.step h3 { margin: 0 0 8px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.engines { margin: clamp(24px, 3vw, 34px) 0 0; font: 500 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }

/* ---- The tail band and the footer under it ---- */
.tail-band { position: relative; height: clamp(440px, 52svh, 560px); background: #030f19; }
.site-footer { position: relative; z-index: 2; background: #030f19; color: var(--paper); }
.foot-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px 48px; padding-block: clamp(48px, 8vh, 96px); }
.foot-inner .h2 { margin: 0; }
.contact { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 0 34px; }
.contact a { display: inline-flex; align-items: center; min-height: 44px; font-size: clamp(16px, 1.4vw, 19px); text-underline-offset: 6px; text-decoration-color: var(--teal); }
.contact a:hover, .contact a:focus-visible { color: var(--teal); }
.foot-sign { grid-column: 1 / -1; margin: 0; }


/* Reveal: transform/opacity only, content stays in the DOM */
.js .reveal { transform: translateY(28px); opacity: .25; transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .9s; }
.js .reveal.in { transform: none; opacity: 1; }

@media (max-width: 1080px) {
  .emblem-section { grid-template-columns: 1fr; }
  .emblem-copy { padding: 72px var(--gutter) 0; }
  .emblem { min-height: 70svh; }
  /* centred with `translate` (not transform), so the GSAP intro's transform can't undo it */
  .emblem-serpent, .emblem-echo { height: 100%; top: 0; right: auto; left: 50%; translate: -50% 0; }
  .deep-content.side-left, .deep-content.side-right { padding-left: 0; padding-right: 0; }
  /* the drawing sits behind full-width text here: keep it quieter */
  .serpent-body { opacity: .4; }
  .showcase.side-left .show-copy, .showcase.side-right .show-copy { padding-left: 0; padding-right: 0; }
  .showcase { flex-direction: column; align-items: stretch; }
  .show-render { position: relative; left: auto; bottom: auto; height: auto; width: min(70%, 420px); margin: 0 auto 40px; }
  .show-render img { width: 100%; height: auto; }
  .show-decor { left: auto; right: 6%; }
  .closer-hero, .steps-box { margin-left: 0; }
  .closer-hero { height: auto; }
  .closer-group { height: auto; width: 100%; margin-top: 0; }
  .closer-hero { padding-right: 0; }
  .steps { grid-template-columns: 1fr; }
  .shelf-prev { left: var(--gutter); }
}
@media (max-width: 720px) {
  .contact { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr; }
  /* phones: the contact section rides up over the tail's run and curl instead of sitting below a blank band */
  .site-footer { margin-top: calc(clamp(440px, 52svh, 560px) * -0.62); background: transparent; }
  .site-footer .foot-inner { padding-top: 0; }
  .site-footer .h2, .site-footer .eyebrow, .discord-dm { text-shadow: 0 2px 14px rgba(3, 15, 25, .85); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { transform: none; opacity: 1; }
  .js .show-render { opacity: 1; transform: none; }
}

/* ---- Lite mode (html.lite: phones, tablets, low-end hardware, Save-Data) ----------------------------------
   Only the entrance animates. Everything below the hero is still: no looping CSS animations, no echo outlines,
   no animated theme backgrounds, no expensive filters. Reveal fades stay (they run once and are cheap). */
html.lite main > :not(.emblem-section) *,
html.lite main > :not(.emblem-section) *::before,
html.lite main > :not(.emblem-section) *::after,
html.lite .emblem-section.is-done * { animation: none !important; }
html.lite .closer-title::before, html.lite .closer-title::after,
html.lite .btn-trailer::after, html.lite .theme-bg::after,
html.lite .r-echo, html.lite .emblem-echo { display: none !important; }
html.lite .theme-bg { background-size: 100% 100% !important; }
html.lite .show-render { will-change: auto; }

/* First-visit trailer (trailer.js). html.trailer-pending is set in <head>, so the overlay covers the page from first paint. */
.site-trailer { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: #07101d; opacity: 0; transition: opacity .7s ease; }
.site-trailer[hidden] { display: none; }
html.trailer-pending .site-trailer, .site-trailer.is-playing { display: grid; opacity: 1; }
.site-trailer.is-leaving { opacity: 0; pointer-events: none; }
.site-trailer video { width: 100%; height: 100%; object-fit: contain; background: #07101d; }
.site-trailer-controls { position: absolute; right: clamp(16px, 3vw, 40px); bottom: clamp(16px, 3vw, 40px); display: flex; gap: 10px; }
.site-trailer-controls button { min-height: 44px; padding: 10px 18px; border: 1px solid rgba(247,249,255,.55); border-radius: 999px; background: rgba(7,16,29,.62); color: #f7f9ff; font: 500 13px "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; backdrop-filter: blur(8px); transition: background-color .2s, color .2s; }
.site-trailer-controls button:hover, .site-trailer-controls button:focus-visible { background: #f7f9ff; color: #07101d; }
.site-trailer-controls button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
html.trailer-open, html.trailer-open body { overflow: hidden; }

/* Small replay button under the hero copy; rises out of the water with the other lines */
.trailer-replay { margin: 30px 0 0; }
.trailer-replay button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 14px; border: 1px solid rgba(183,197,211,.45); border-radius: 999px; background: transparent; color: #b7c5d3; font: 500 12px "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s; }
.trailer-replay button:hover, .trailer-replay button:focus-visible { color: var(--paper); border-color: var(--teal); }
.trailer-replay button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.trailer-replay button span { font-size: 10px; }
