/* =====================================================================
   Kestrion website: one stylesheet for every page.
   Look: the game's own. Near-black navy, thin blue lines, a cyan-blue
   accent with a soft glow, gold for credits and highlights, Orbitron
   headings, Rajdhani text, and the game's cut-corner buttons.
   Dark only, on purpose: the game is dark. Contrast is kept high.
   ===================================================================== */

/* ---------- 1. Fonts: the game's own, served from /fonts (no third-party font host) ---------- */
@font-face { font-family: 'Orbitron'; src: url('../fonts/orbitron-latin.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../fonts/rajdhani-500-latin.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../fonts/rajdhani-600-latin.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../fonts/rajdhani-700-latin.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ---------- 2. Design tokens: change a value here and it changes everywhere ---------- */
:root {
  --void:    hsl(214 55% 3%);       /* page background: deep space (the game's --bg) */
  --hull:    hsl(214 50% 8%);       /* panels                                        */
  --hull-2:  hsl(214 45% 11%);      /* raised panels, code blocks                    */
  --line:    hsl(214 40% 20%);      /* borders and dividers                          */
  --ion:     hsl(205 100% 66%);     /* main accent: cyan-blue                        */
  --ion-deep:hsl(214 90% 42%);      /* button fill                                   */
  --text:    hsl(214 100% 94%);     /* main text                                     */
  --muted:   hsl(214 22% 68%);      /* secondary text                                */
  --gold:    #f2c14e;               /* credits, highlights                           */
  --hostile: #ff6a4d;               /* enemy red, used sparingly                     */
  --ok:      #5fd38d;               /* success messages                              */

  --display: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
  --body:    'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --mono:    ui-monospace, 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', monospace;

  --cut: 14px;                      /* size of the cut corner on buttons and panels  */
  color-scheme: dark;
}

/* ---------- 3. Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--void); color: var(--text); font: 500 19px/1.55 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ion); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--ion); outline-offset: 3px; }
[hidden] { display: none !important; }

/* The side gutter: at least 16px, more on phones with a notch */
.wrap {
  max-width: 1180px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 820px; }

/* A small uppercase label above a heading, like "PLAY" in the game menu */
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font: 700 12px var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--ion);
}
.eyebrow::before { content: ''; width: 7px; height: 7px; border: 1px solid currentColor; transform: rotate(45deg); flex: none; }

h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: .06em; line-height: 1.1; }
h2 { font-size: clamp(26px, 3.4vw, 40px); letter-spacing: .06em; line-height: 1.15; }
h3 { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.35; }
p  { margin: 0; max-width: 64ch; }
.lead { color: var(--muted); font-size: 21px; }
.caption { font-size: 15px; color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; fill: currentColor; }

/* Placeholder text the user still has to fill in: clearly marked, never mistaken for real content */
.ph { color: var(--gold); border: 1px dashed currentColor; padding: 0 6px; font-weight: 600; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.draft-banner { background: hsl(42 80% 50% / .12); border: 1px dashed var(--gold); color: var(--gold); padding: 10px 16px; font-weight: 600; }

/* ---------- 4. Buttons (the cut corner is the game's button shape) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 16px 30px;
  font: 700 15px var(--display); letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  color: #fff; background: linear-gradient(180deg, hsl(214 85% 52%), var(--ion-deep)); border: 0; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: filter .2s ease, transform .2s ease;
}
.btn:hover { color: #fff; filter: brightness(1.18); transform: translateY(-1px); }
.btn .icon { width: 20px; height: 20px; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--ion); }
.btn-small { padding: 10px 18px; font-size: 12px; }
.btn[aria-disabled="true"] { background: var(--hull-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); cursor: default; filter: none; transform: none; }

/* ---------- 5. Header and footer ---------- */
.top { position: relative; z-index: 5; padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--line); background: var(--void); }
.top.over { position: absolute; inset: 0 0 auto; border-bottom: 0; background: none; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 800 16px var(--display); letter-spacing: .2em; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.top nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--text); }
.top nav a[aria-current="page"] { box-shadow: 0 2px 0 var(--ion); }

footer { border-top: 1px solid var(--line); padding-block: 40px; color: var(--muted); font-size: 15px; }
footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
footer h3 { font-size: 12px; color: var(--text); margin-bottom: 10px; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer a { color: var(--muted); }
footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; }

/* ---------- 6. Home: hero ---------- */
.hero {
  position: relative; min-height: min(92vh, 880px); display: flex; align-items: flex-end; padding-block: 120px 72px;
  background:
    linear-gradient(90deg, hsl(214 55% 3% / .93) 0%, hsl(214 55% 3% / .55) 45%, hsl(214 55% 3% / 0) 75%),
    linear-gradient(0deg, var(--void) 0%, hsl(214 55% 3% / 0) 35%),
    url('../images/hero.webp') center / cover no-repeat;
}
.hero .wrap { width: 100%; }
.hero h1 {
  font-size: clamp(48px, 9vw, 112px); font-weight: 900; letter-spacing: .12em; line-height: 1;
  color: hsl(214 100% 80%); text-shadow: 0 0 34px hsl(214 100% 60% / .45), 0 2px 6px #000;
}
.hero h1 span { color: hsl(214 100% 64%); }
.tagline { margin-top: 16px; font-weight: 600; font-size: 14px; letter-spacing: .34em; text-transform: uppercase; color: var(--muted); }
.hero .lead { margin-top: 26px; color: var(--text); max-width: 46ch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 34px; }
.cta small { color: var(--muted); font-size: 15px; letter-spacing: .04em; }
.cta small b { color: var(--text); font-weight: 600; }

/* ---------- 7. Sections ---------- */
section { padding-block: clamp(64px, 9vw, 120px); }
.band { background: var(--hull); border-block: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split.flip { grid-template-columns: 7fr 5fr; }
.split.flip .copy { order: 2; }
.copy { display: grid; gap: 20px; min-width: 0; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 30px; margin-bottom: 34px; }
.shot { border: 1px solid var(--line); box-shadow: 0 30px 80px -30px hsl(214 100% 50% / .35); }

/* Feature blocks: five pillars of the game */
.features { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.features article { grid-column: span 2; background: var(--hull); padding: 28px 26px; display: grid; gap: 12px; align-content: start; }
.features article:nth-child(4), .features article:nth-child(5) { grid-column: span 3; }
.features .icon { width: 24px; height: 24px; color: var(--ion); }
.features p { color: var(--muted); font-size: 17px; }

/* Stat readout, styled like the builder's STATS panel */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 6px 0 0; }
.stats div { background: var(--hull); padding: 12px 14px; }
.stats dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 2px 0 0; font: 700 22px var(--display); font-variant-numeric: tabular-nums; }

/* Starter fleet strip */
.roster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }   /* minmax: equal tiles, a long name never widens its own */
.roster li { border: 1px solid var(--line); padding: 14px 12px; display: grid; gap: 4px; background: var(--void); }
.roster img { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 6px; }   /* rendered by tools/shipshots.ts with the game's ship art */
/* The fleet in flight: each ship drifts on its own slow course, out of step with its neighbours. Pointing at a tile lifts its ship
   (translate / scale add to the drifting transform, so the two never fight) and lights the tile. Still with reduced motion. */
.roster li { transition: border-color .3s ease, background-color .3s ease; }
.roster img { animation: fleet-drift 6s ease-in-out infinite alternate; transition: translate .35s ease, scale .35s ease, filter .35s ease; }
.roster li:nth-child(2n) img { animation-duration: 7.2s; animation-delay: -2.4s; }
.roster li:nth-child(3n) img { animation-duration: 5.4s; animation-delay: -4.1s; }
.roster li:nth-child(4n) img { animation-direction: alternate-reverse; }
@keyframes fleet-drift { from { transform: translate(-3px, 5px) rotate(-2.5deg); } to { transform: translate(3px, -5px) rotate(2.5deg); } }
.roster li:hover { border-color: var(--ion); background-color: hsl(214 60% 7%); }
.roster li:hover img { translate: 0 -8px; scale: 1.07; filter: drop-shadow(0 0 16px hsl(205 100% 60% / .5)) brightness(1.08); }
.roster b { font: 700 12px var(--display); letter-spacing: .03em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster span { color: var(--gold); font: 700 20px var(--display); font-variant-numeric: tabular-nums; }
.roster small { color: var(--muted); font-size: 13px; letter-spacing: .1em; }

/* AI styles list */
.doctrines { list-style: none; padding: 0; margin: 8px 0 0; display: grid; border-top: 1px solid var(--line); }
.doctrines li { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doctrines b { font: 700 13px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--hostile); padding-top: 4px; }
.doctrines span { color: var(--muted); }

/* The "made with AI" story: the user's own words, set like a letter */
.story { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(28px, 5vw, 64px); }
.story .letter { display: grid; gap: 18px; font-size: 20px; }
.story .letter ul { margin: 0; padding-left: 1.1em; display: grid; gap: 10px; max-width: 62ch; }
.story .letter li::marker { color: var(--ion); }
.story .sign { font: 700 14px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--ion); }

/* Screenshot gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery a { display: block; overflow: hidden; border: 1px solid var(--line); }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; transition: transform .5s ease; }
.gallery a:hover img { transform: scale(1.04); }

/* Closing download panel on the home page */
.closing { background: linear-gradient(180deg, var(--void), hsl(214 55% 3% / .75) 40%, var(--void)), url('../images/battle-3.webp') center / cover no-repeat; }
.panel { background: hsl(214 50% 8% / .9); border: 1px solid var(--line); padding: clamp(24px, 4vw, 44px); }
.panel-row { display: grid; grid-template-columns: 1fr auto; gap: 26px 48px; align-items: center; }
.specs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 16px; }
.specs b { color: var(--text); font-weight: 600; }

/* ---------- 8. Inner pages ---------- */
.page-head { padding-block: clamp(48px, 7vw, 84px) clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line);
  background: radial-gradient(80% 140% at 85% 0%, hsl(214 90% 40% / .16), transparent 60%); }
.page-head .lead { margin-top: 16px; }
.page-body { padding-block: clamp(40px, 6vw, 72px); }
.stack { display: grid; gap: clamp(44px, 6vw, 72px); }
/* Grid children may shrink below their content, so wide code and tables scroll inside their own box, never the page */
.stack > *, .prose > *, .platforms > * { min-width: 0; }
.stack > section { padding-block: 0; }   /* the stack's gap spaces these, not the big section padding */

/* Readable long text */
.prose { display: grid; gap: 16px; min-width: 0; }
.prose h2 { font-size: clamp(22px, 2.6vw, 30px); margin-top: 10px; scroll-margin-top: 24px; }
.prose h3 { margin-top: 8px; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; max-width: 64ch; }
.prose li::marker { color: var(--ion); }
.prose strong { color: #fff; font-weight: 700; }

/* Code and keys */
code { font: 500 .88em var(--mono); background: var(--hull-2); border: 1px solid var(--line); padding: 1px 6px; overflow-wrap: anywhere; }
.code { position: relative; background: var(--hull-2); border: 1px solid var(--line); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 500 15px/1.6 var(--mono); color: var(--text); }
.code pre code { background: none; border: 0; padding: 0; overflow-wrap: normal; }
.code .label { display: block; padding: 8px 18px; border-bottom: 1px solid var(--line); font: 700 11px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.copy-btn { position: absolute; top: 4px; right: 6px; background: none; border: 1px solid var(--line); color: var(--muted); font: 600 13px var(--body); letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--ion); }

/* Callouts */
.note { border: 1px solid var(--line); border-left: 3px solid var(--ion); background: var(--hull); padding: 16px 20px; display: grid; gap: 8px; }
.note.warn { border-left-color: var(--gold); }
.note.stop { border-left-color: var(--hostile); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 17px; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 700 12px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: var(--hull); }
tr:last-child td { border-bottom: 0; }

/* Platform cards on the download page */
.platforms { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.platform { background: var(--hull); border: 1px solid var(--line); padding: 26px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.platform.soon { background: transparent; border-style: dashed; }
.platform .files { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.platform .files li { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); background: var(--void); }
.platform .files code { justify-self: start; }
.platform .files span { color: var(--muted); font-size: 16px; }
.chip { justify-self: start; font: 700 11px var(--display); letter-spacing: .2em; text-transform: uppercase; padding: 4px 10px; border: 1px solid currentColor; color: var(--ion); }
.chip.soon { color: var(--gold); }

/* The Beta gate */
.gate { display: grid; gap: 14px; }
.gate form { display: flex; flex-wrap: wrap; gap: 10px; }
.gate input { flex: 1 1 220px; min-width: 0; background: var(--void); color: var(--text); border: 1px solid var(--line); padding: 14px 16px; font: 600 18px var(--body); letter-spacing: .14em; text-transform: uppercase; }
.gate input:focus { border-color: var(--ion); outline: none; }
.gate .msg { min-height: 1.5em; font-weight: 600; }
.gate .msg.bad { color: var(--hostile); }
.gate .msg.good { color: var(--ok); }

/* FAQ */
.faq { display: grid; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; font: 700 16px var(--display); letter-spacing: .06em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--ion); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '\2212'; }
.faq .answer { padding: 0 0 20px; display: grid; gap: 10px; color: var(--muted); }
.faq .answer strong { color: var(--text); }

/* News */
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.posts a { display: grid; grid-template-columns: 280px 1fr; gap: 24px; text-decoration: none; color: var(--text); background: var(--hull); border: 1px solid var(--line); }
.posts a:hover { border-color: var(--ion); color: var(--text); }
.posts img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; height: 100%; }
.posts .meta { padding: 20px 20px 20px 0; display: grid; gap: 8px; align-content: center; }
.posts p { color: var(--muted); }
time, .date { font: 700 12px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--ion); }
.post-hero { margin-top: 28px; border: 1px solid var(--line); }

/* Press kit downloads */
.assets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.assets a { display: grid; gap: 8px; text-decoration: none; color: var(--muted); font-size: 15px; }
.assets img { border: 1px solid var(--line); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.assets a.logo img { object-fit: contain; background: var(--hull); padding: 18px; }

/* ---------- 9. Smaller screens ---------- */
@media (max-width: 1180px) {   /* eight across only at the full page width: below it the longest name (JUGGERNAUT) would not fit */
  .roster { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .features article, .features article:nth-child(4), .features article:nth-child(5) { grid-column: span 3; }
  .platforms { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .split, .split.flip, .story, .panel-row { grid-template-columns: 1fr; }
  .split.flip .copy { order: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .gallery, .assets { grid-template-columns: repeat(2, 1fr); }
  .doctrines li { grid-template-columns: 1fr; gap: 2px; }
  .features article, .features article:nth-child(4), .features article:nth-child(5) { grid-column: 1 / -1; }
  .posts a { grid-template-columns: 1fr; gap: 0; }
  .posts .meta { padding: 18px; }
  footer .wrap { grid-template-columns: 1fr 1fr; }
  footer .about { grid-column: 1 / -1; }
  /* On phones the hero text sits over the ships, so darken the picture more */
  .hero { background:
    linear-gradient(0deg, var(--void) 0%, hsl(214 55% 3% / .8) 55%, hsl(214 55% 3% / .35) 100%),
    url('../images/hero.webp') 62% center / cover no-repeat; }
}
@media (max-width: 480px) {
  body { font-size: 18px; }
  .roster, .gallery, .assets { grid-template-columns: repeat(2, 1fr); }
  .btn { padding: 15px 22px; font-size: 13px; }
  .top nav { gap: 6px 16px; }
  .top nav a { font-size: 13px; }
}

/* Respect people who switch off animations */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .roster img { animation: none; }
}

/* ---------- 10. Studio: Lockstep Interactive ---------- */
.studio-mark { display: inline-block; margin-top: 14px; }
.studio-mark img { width: 150px; height: auto; }
.studio { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.assets a.logo.light img { background: #eef1f5; }
.swatch { display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px; border: 1px solid var(--line); }
.swatch.orange { background: #e8802c; } .swatch.blue { background: #4fb6e0; } .swatch.navy { background: #0b1426; } .swatch.white { background: #eef1f5; }
@media (max-width: 760px) { .studio { grid-template-columns: 1fr; } }

/* ---------- 11. System requirements, Steam style ---------- */
.reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.req { background: var(--hull); border: 1px solid var(--line); padding: 20px 22px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.req h3 { color: var(--ion); margin-bottom: 4px; }
.req dl { margin: 0; display: grid; gap: 10px; }
.req dl div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.req dt { font: 700 12px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.req dd { margin: 0; }
@media (max-width: 760px) { .reqs { grid-template-columns: 1fr; } .req dl div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- 12. Screenshot viewer (js/gallery.js) ---------- */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: hsl(214 60% 2% / .97); }
.lightbox figure { margin: 0; display: grid; gap: 10px; justify-items: center; padding: 56px max(16px, 6vw) 24px; }
.lightbox img { max-width: min(1600px, 88vw); max-height: 80vh; width: auto; height: auto; border: 1px solid var(--line); box-shadow: 0 30px 90px -20px hsl(214 100% 50% / .35); }
.lightbox figcaption { color: var(--muted); font-size: 16px; text-align: center; max-width: 70ch; }
.lb-count { display: block; margin-top: 4px; font: 700 11px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--ion); }
.lb-btn { position: fixed; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); background: hsl(214 50% 8% / .85);
  color: var(--text); cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.lb-btn:hover, .lb-btn:focus-visible { border-color: var(--ion); color: #fff; }
.lb-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.lb-close { top: max(14px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.lb-prev { left: max(16px, env(safe-area-inset-left, 0px)); top: 50%; translate: 0 -50%; }
.lb-next { right: max(16px, env(safe-area-inset-right, 0px)); top: 50%; translate: 0 -50%; }
.lightbox img.logo { background: var(--hull); padding: clamp(16px, 4vw, 48px); width: min(900px, 88vw); max-height: 70vh; object-fit: contain; }   /* press kit logos */
.lightbox img.logo.light { background: #eef1f5; }
.lb-dl { display: flex; width: max-content; margin: 12px auto 0; }
@media (max-width: 760px) { .lb-prev, .lb-next { top: auto; bottom: max(16px, env(safe-area-inset-bottom, 0px)); translate: none; } .lightbox img { max-width: 94vw; } }

/* ---------- 13. Soundtrack page (js/soundtrack.js) ---------- */
.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.track { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 20px; align-items: center; background: var(--hull); border: 1px solid var(--line); padding: 16px 20px; transition: border-color .2s ease; }
.track:hover, .track.on { border-color: hsl(205 100% 66% / .55); }
.track.on { background: linear-gradient(90deg, hsl(214 80% 30% / .2), transparent 70%), var(--hull); }
.t-main { display: grid; gap: 2px; min-width: 0; }
.t-where { font: 700 11px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--ion); }
.track h3 { font-size: 17px; letter-spacing: .1em; }
.t-desc { color: var(--muted); font-size: 17px; }
.t-len { font: 700 14px var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.track audio { grid-column: 1 / -1; width: 100%; }   /* only without JavaScript: the browser's own controls */
html:not(.js) .track .play { display: none; }
.play { width: 52px; height: 52px; display: grid; place-items: center; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, hsl(214 85% 52%), var(--ion-deep)); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); transition: filter .2s ease; }
.play:hover { filter: brightness(1.2); }
.track.playing .play { filter: brightness(1.15) saturate(1.2); }
.play svg, .nowbar svg { width: 22px; height: 22px; fill: currentColor; }
/* the open row: waveform, time, layers */
.live { grid-column: 1 / -1; display: grid; gap: 10px; margin-top: 10px; }
.wave { height: 76px; cursor: pointer; touch-action: none; border-block: 1px solid var(--line); }
.wave canvas { width: 100%; height: 100%; display: block; }
.live-time { font: 700 13px var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.live-time b { color: var(--text); }
.live-msg { color: var(--hostile); font-weight: 600; }
.live-msg:empty { display: none; }
.layers { display: grid; gap: 10px; }
.layers ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.layers li { --lv: 0; font: 700 11px var(--display); letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; border: 1px solid var(--line);
  opacity: calc(.28 + .72 * var(--lv)); background: hsl(205 100% 60% / calc(.16 * var(--lv))); transition: border-color .4s ease, box-shadow .4s ease; }
.layers li.in { border-color: var(--ion); box-shadow: 0 0 14px hsl(205 100% 60% / .3); }
.phase { font: 700 12px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.phase b { color: var(--gold); }
/* how it is made */
.how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.how article { background: var(--hull); padding: 24px; display: grid; gap: 10px; align-content: start; }
.how p { color: var(--muted); font-size: 17px; }
/* the bar at the bottom of the window */
.nowbar { position: fixed; inset: auto 0 0; z-index: 20; background: hsl(214 50% 6%); box-shadow: 0 -12px 30px hsl(214 55% 3% / .6); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.nowbar { isolation: isolate; }   /* so the phone's background scope can sit under the controls but over the bar */
.nowbar .wrap { display: grid; grid-template-columns: auto minmax(120px, 230px) minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding-block: 10px; }
.nb-scope { height: 44px; border: 1px solid var(--line); background: #03060d; min-width: 0; }   /* the live visualizer, as on the drafts page */
.nb-scope canvas { width: 100%; height: 100%; display: block; }
.nb-progress { height: 3px; background: var(--line); }
.nb-progress i { display: block; height: 100%; width: 0; background: var(--ion); }
.nb-buttons { display: flex; gap: 6px; }
.nb-buttons button { width: 42px; height: 42px; display: grid; place-items: center; background: none; border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.nb-buttons button:hover { border-color: var(--ion); }
.nb-buttons .nb-play { background: var(--ion-deep); border-color: transparent; }
.nowbar .nb-buttons svg { width: 18px; height: 18px; }
.nb-title { display: grid; min-width: 0; line-height: 1.3; }
.nb-title b { font: 700 14px var(--display); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-title span { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-time { font: 700 13px var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.nb-vol { display: flex; align-items: center; }
.nb-vol span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nb-vol input { width: 110px; accent-color: var(--ion); }
body.has-player { padding-bottom: 76px; }
@media (max-width: 760px) {
  .how { grid-template-columns: 1fr; }
  .track { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 14px; gap: 6px 14px; }
  .t-len { display: none; }
  .play { width: 46px; height: 46px; }
  .nowbar .wrap { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  .nb-scope { position: absolute; inset: 3px 0 0; height: auto; border: 0; z-index: -1; opacity: .4; background: none; }
  .nb-time, .nb-vol { display: none; }
}
