/* Outer Meridian -- site styles.
   Hand-written, no framework, no build step.

   Every colour, size, radius and duration below comes from
   crates/outer-meridian-ui/src/theme.rs, which is the launcher's and the game HUD's
   design system. That is the point: the website, the launcher and the cockpit
   are one product, and a visitor who downloads the client should not feel like
   they have moved to a different company's software.

   Where theme.rs has no opinion -- a login form, an admin table, a news card --
   the shape is built from the same grammar it does define: a translucent fill,
   a one-point hairline, a radius already on the scale. Nothing here invents a
   second vocabulary.

   Content-Security-Policy (services/auth/src/main.rs::security_headers) allows
   'unsafe-inline' for styles but nothing external, so: self-hosted fonts, no
   CDN, and `style="--chip-rgb: ..."` is how a status colour reaches a chip. */

/* ---- fonts ---------------------------------------------------------------
   Rajdhani, the chrome face, at the two weights theme.rs embeds. These are the
   same Latin subsets the binaries carry, re-wrapped as WOFF2 by
   scripts/subset_fonts.py -- same glyphs and metrics, a third of the bytes.
   Licensed under the SIL OFL; the licence ships beside them. */

@font-face {
  font-family: "Outer Meridian Display";
  src: url("fonts/rajdhani-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outer Meridian Display";
  src: url("fonts/rajdhani-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- tokens --------------------------------------------------------------
   theme.rs stores glass and hairline colours premultiplied. A browser wants
   straight alpha, so each one below is `premultiplied * 255 / alpha`. Where
   that lands above 255 -- the hairlines, which egui deliberately overdrives so
   a rule reads slightly whiter than a plain translucent line could -- the
   channel is clamped. At these alphas the difference at composite time is under
   two parts in 255, which is less than the dithering on the starfield behind
   it. */

:root {
  /* Native controls -- the date picker, scrollbars, the select arrow -- follow
     this rather than defaulting to a white widget in a dark panel. */
  color-scheme: dark;

  /* void and glass */
  --void:         #04060b;
  --panel:        rgba(6, 18, 29, .839);    /* PANEL        (5,15,24,214)  */
  --panel-raised: rgba(11, 27, 41, .878);   /* PANEL_RAISED (10,24,36,224) */
  --panel-active: rgba(17, 43, 60, .922);   /* PANEL_ACTIVE (16,40,55,235) */
  --panel-sunken: rgba(2, 9, 16, .863);     /* PANEL_SUNKEN (2,8,14,220)   */

  /* hairlines. Every rule in the interface is exactly one pixel wide --
     hierarchy comes from opacity, never from thickness. */
  --hairline:        rgba(141, 255, 255, .376);
  --hairline-soft:   rgba(173, 255, 255, .220);
  --hairline-strong: rgba(120, 211, 239, .549);
  --bevel:           rgba(81, 148, 172, .431);
  --hw: 1px;

  /* the teal, taken from the in-game flight header unchanged */
  --accent:      #78d2ee;
  --accent-dim:  #4a8598;
  --accent-wash: rgba(27, 57, 69, .784);
  --on-accent:   #040e14;

  /* The only other hues, and they are status. None of them is ever a button
     fill: the moment a second colour can be the loud one, the teal stops
     meaning "this is Outer Meridian" and starts meaning nothing. */
  --good: #78c882;
  --warn: #e6be64;
  --bad:  #e66e5a;
  --good-rgb: 120, 200, 130;
  --warn-rgb: 230, 190, 100;
  --bad-rgb:  230, 110, 90;
  --flat-rgb: 150, 177, 193;

  --text:  #e2ecfa;
  --muted: #96b1c1;
  --faint: #617787;

  /* One spacing scale. Anything not on it looks like a mistake because it is
     one. egui points and CSS pixels are both device-independent, so these are
     theme.rs's numbers unchanged. */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;

  --r-chip: 3px;
  --r-btn: 4px;
  --r-card: 6px;
  --r-panel: 8px;

  /* Durations are the literal animate_bool_with_time arguments in widgets.rs.
     No "the web feels slower, pad it out" adjustment: the whole point is that
     this reads as the same product as the launcher. */
  --t-fast: .08s;
  --t: .09s;
  --t-nav: .10s;
  --t-slow: .12s;

  --font-display: "Outer Meridian Display", system-ui, -apple-system, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;

  --shell: 1080px;   /* the content column the header and footer align to */
}

* { box-sizing: border-box; }

/* paintNav() toggles `hidden`, and several nav items set their own display.
   Without this the UA rule loses on specificity and a signed-out header still
   shows the account link. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font: 400 15px/1.6 var(--font-body);
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }

::selection { background: var(--accent-wash); color: var(--text); }

/* Nothing in widgets.rs draws a browser-style focus ring, because egui has its
   own focus model. On the web it is not optional -- so it is built from the one
   thing this palette already treats as "selected": the accent as structure. */
:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- backdrop ------------------------------------------------------------
   A port of crates/outer-meridian-ui/src/backdrop.rs. Two of its five layers move, and
   those two are the canvas in backdrop.js. The grid and the vignette never do
   -- backdrop.rs says so of the grid in as many words -- so they are static
   gradients painted once by the compositor rather than work repeated thirty
   times a second. */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background-color: var(--void);
}

.backdrop canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The grid: the one element that does not move. It reads as the glass the
   panels are mounted on. 44px is backdrop.rs's GRID_PITCH. */
.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(to right, rgba(137, 255, 255, .102) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(to bottom, rgba(137, 255, 255, .102) 0 1px, transparent 1px 44px);
}

/* Darkens the edges so the content sits in the middle of something. */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 33%, rgba(0, 0, 0, .588) 100%);
}

/* ---- the mark ------------------------------------------------------------
   The mark is drawn as a CSS mask rather than as inline SVG or an <img>.

   An <img> cannot be recoloured, and `fill: currentColor` inside the file only
   resolves when the SVG is inlined in the document -- which, with no build step
   to de-duplicate through, would mean pasting six kilobytes of path data into
   the header and the footer of every page. A mask gets both properties for one
   cached request: the shape comes from the file, the colour from `background`,
   and it is one file for every instance.

   Every use is decorative -- the wordmark beside it carries the name, so there
   is nothing here a screen reader loses. */

.mark {
  display: inline-block;
  vertical-align: middle;
  aspect-ratio: 3118 / 2749;
  background-color: currentColor;
  -webkit-mask: url("assets/outer-meridian-mark.svg") center / contain no-repeat;
  mask: url("assets/outer-meridian-mark.svg") center / contain no-repeat;
}

/* ---- header --------------------------------------------------------------
   44px is theme.rs's layout::TITLE_BAR, which is what the launcher's own title
   bar is. Taller here because a website header carries navigation the launcher
   puts in a rail.

   On the front page it starts transparent over the hero (`.over`, set by
   app.js while the page is at the top) and turns to glass once the hero has
   scrolled away. Everywhere else it is glass from the start. */

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: var(--hw) solid var(--hairline-soft);
  background: rgba(4, 6, 11, .86);
  transition: background-color var(--t-slow) ease, border-color var(--t-slow) ease;
}
body.cinematic header.site {
  position: fixed;
  left: 0;
  right: 0;
}
header.site.over {
  background: linear-gradient(to bottom, rgba(4, 6, 11, .7), rgba(4, 6, 11, 0));
  border-bottom-color: transparent;
}

header.site > .shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--sp-xl);
  height: 64px;
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand .mark { height: 20px; color: var(--accent); }
/* text::brand -- wide tracking; the only place tracking is this loud. */
.brand .wordmark {
  font: 600 15px var(--font-display);
  letter-spacing: 4.2px;
  text-transform: uppercase;
}

header.site nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}
header.site nav a {
  font: 600 12px var(--font-display);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--t-nav) ease;
}
header.site nav a:hover,
header.site nav a[aria-current="page"] { color: var(--text); }
header.site nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--accent); padding-bottom: 2px; }

/* The one filled control in the header. */
header.site nav a.nav-cta {
  color: var(--on-accent);
  background: var(--accent);
  padding: 8px 16px;
  border-radius: var(--r-btn);
  box-shadow: none;
  transition: background-color var(--t) ease;
}
header.site nav a.nav-cta:hover { background: #fff; color: var(--on-accent); }

.nav-toggle {
  display: none;
  min-width: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  margin-left: auto;
  background: transparent;
  box-shadow: inset 0 0 0 var(--hw) var(--hairline);
}
.nav-toggle::after { content: none; }
.nav-toggle:hover:not(:disabled) { background: var(--accent-wash); }
.nav-toggle i,
.nav-toggle i::before,
.nav-toggle i::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  position: relative;
  transition: transform var(--t-slow) ease, background-color var(--t-slow) ease;
}
.nav-toggle i::before, .nav-toggle i::after { content: ""; position: absolute; left: 0; }
.nav-toggle i::before { top: -5px; }
.nav-toggle i::after { top: 5px; }
.nav-open .nav-toggle i { background: transparent; }
.nav-open .nav-toggle i::before { transform: translateY(5px) rotate(45deg); }
.nav-open .nav-toggle i::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 900px) {
  header.site > .shell { padding: 0 var(--sp-lg); }
  .nav-toggle { display: inline-flex; }
  header.site nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-sm) var(--sp-lg) var(--sp-lg);
    background: rgba(4, 6, 11, .97);
    border-bottom: var(--hw) solid var(--hairline-soft);
  }
  .nav-open header.site nav { display: flex; }
  .nav-open header.site.over { background: rgba(4, 6, 11, .97); }
  header.site nav a { padding: 14px 0; font-size: 14px; border-bottom: var(--hw) solid var(--hairline-soft); }
  header.site nav a[aria-current="page"] { box-shadow: none; color: var(--accent); }
  header.site nav a.nav-cta { margin-top: var(--sp-md); text-align: center; border-bottom: none; }
}


/* ---- layout --------------------------------------------------------------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--sp-3xl) var(--sp-xl) 72px;
}
main.narrow { max-width: 460px; }
main.wide { max-width: 1240px; }

/* text::h1 -- Rajdhani Medium, not SemiBold. theme.rs's own note: at this size
   semibold turns into shouting. The launcher sets it at 24px because that is a
   screen title in a 1280pt window; a page heading on a 1080px column is given
   more room, with the tracking scaled to match rather than left behind. */
h1 {
  margin: 0 0 var(--sp-sm);
  font: 500 clamp(28px, 4vw, 38px)/1.15 var(--font-display);
  letter-spacing: 1.2px;
  color: var(--text);
}


/* text::h2 -- a card's name, a ship's name. */
h2 {
  margin: 0;
  font: 600 18px var(--font-display);
  letter-spacing: .6px;
  color: var(--text);
}

h3 {
  margin: 0;
  font: 600 15px var(--font-display);
  letter-spacing: .4px;
  color: var(--text);
}

.lede {
  margin: 0 0 var(--sp-2xl);
  max-width: 62ch;
  color: var(--muted);
  font-size: 16px;
}

p { margin: 0 0 var(--sp-md); color: var(--muted); }
p:last-child { margin-bottom: 0; }

/* ---- surfaces ------------------------------------------------------------
   "Dark glass" here is three cheap things, not a blur: a translucent fill, a
   hairline border, and a brighter rule along the top edge that reads as light
   catching a bevel. widgets.rs refuses a real backdrop blur because it means
   sampling the framebuffer every frame; backdrop-filter is the same bill on the
   web, for an effect a pseudo-element gets for nothing. */

.panel,
.card {
  position: relative;
  border: var(--hw) solid var(--hairline);
}

.panel {
  background: var(--panel);
  border-radius: var(--r-panel);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
}

.card {
  background: var(--panel-raised);
  border-radius: var(--r-card);
  padding: var(--sp-md);
}

/* The bevel highlight, inset by the corner radius so it stops before the
   rounded ends rather than cutting across them. */
.panel::before,
.card::before {
  content: "";
  position: absolute;
  top: 0;
  height: var(--hw);
  background: var(--bevel);
}
.panel::before { left: var(--r-panel); right: var(--r-panel); }
.card::before { left: var(--r-card); right: var(--r-card); }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}
.panel-head h2 { margin: 0; }
.panel-head a {
  font: 600 11px var(--font-display);
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

/* A small uppercase caption with a rule running out to the right of it: titles
   a region without spending a heading on it. section() in widgets.rs measures
   the label and draws from there to the right edge; flex:1 on an empty
   pseudo-element is the same measurement, done by the browser. */
.section {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}
.section::after {
  content: "";
  flex: 1;
  height: var(--hw);
  background: var(--hairline-soft);
}

hr.rule {
  border: none;
  border-top: var(--hw) solid var(--hairline-soft);
  margin: var(--sp-lg) 0;
}

/* ---- corner brackets -----------------------------------------------------
   The HUD's way of saying "this one", and the reason nothing in this interface
   needs a glow. Four L-shapes, each two stripes, all eight drawn as
   linear-gradients on a single pseudo-element: no extra markup, no per-frame
   cost, and they survive any scale factor. widgets.rs draws them at a fixed
   dimness that never animates, so a static background-image is the honest
   translation. */

.brackets::after {
  content: "";
  position: absolute;
  inset: var(--bk-inset, 5px);
  pointer-events: none;
  background-image:
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk));
  background-repeat: no-repeat;
  background-size:
    var(--bk-arm, 9px) var(--bk-w, 1.3px), var(--bk-w, 1.3px) var(--bk-arm, 9px),
    var(--bk-arm, 9px) var(--bk-w, 1.3px), var(--bk-w, 1.3px) var(--bk-arm, 9px),
    var(--bk-arm, 9px) var(--bk-w, 1.3px), var(--bk-w, 1.3px) var(--bk-arm, 9px),
    var(--bk-arm, 9px) var(--bk-w, 1.3px), var(--bk-w, 1.3px) var(--bk-arm, 9px);
  background-position:
    left top, left top,
    right top, right top,
    right bottom, right bottom,
    left bottom, left bottom;
}

/* ---- buttons -------------------------------------------------------------
   One loud control per screen: the accent fill with brackets. Everything else
   is a hairline outline with no fill, so a page never has two things claiming
   to be the action. */

button, .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  height: 46px;
  padding: 0 var(--sp-xl);
  border: none;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--on-accent);
  font: 600 15px var(--font-display);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  cursor: pointer;
  /* Colour only. theme.rs sets every widget's expansion to zero because egui's
     one-point grow-on-hover reads as a wobble in an interface built out of
     aligned rules; the same is true of transform: scale() here. */
  transition: background-color var(--t) ease, color var(--t) ease,
              border-color var(--t) ease;
  --bk: rgba(4, 14, 20, .55);
}

/* widgets.rs::primary lerps the fill toward white on hover, not toward a
   second teal. At full hover it really is white -- it reads as hot metal,
   which is what a flat colour change buys that a glow does not. */
button:hover:not(:disabled), .btn:hover { background: #fff; color: var(--on-accent); }
button:active:not(:disabled) { background: var(--accent); }

button:disabled {
  background: var(--accent-wash);
  color: var(--faint);
  box-shadow: inset 0 0 0 var(--hw) var(--hairline);
  cursor: default;
  --bk: rgba(141, 255, 255, .21);
}

button::after, .btn::after {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  background-image:
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk));
  background-repeat: no-repeat;
  background-size:
    9px 1.3px, 1.3px 9px, 9px 1.3px, 1.3px 9px,
    9px 1.3px, 1.3px 9px, 9px 1.3px, 1.3px 9px;
  background-position:
    left top, left top, right top, right top,
    right bottom, right bottom, left bottom, left bottom;
}

/* Everything that is not the primary action: hairline outline, no fill. */
button.secondary {
  min-width: 0;
  height: 36px;
  padding: 0 var(--sp-lg);
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 var(--hw) var(--hairline);
  font-size: 13px;
  letter-spacing: 1.2px;
}
button.secondary:hover:not(:disabled) {
  background: var(--accent-wash);
  color: var(--text);
  box-shadow: inset 0 0 0 var(--hw) var(--accent-dim);
}
button.secondary::after { content: none; }

/* A destructive action. The same shape as a secondary, in the alert colour, so
   it is never one mis-click away from looking like an ordinary button. */
button.danger {
  min-width: 0;
  height: 36px;
  padding: 0 var(--sp-lg);
  background: transparent;
  color: color-mix(in srgb, var(--bad) 85%, transparent);
  box-shadow: inset 0 0 0 var(--hw) color-mix(in srgb, var(--bad) 60%, transparent);
  font-size: 13px;
  letter-spacing: 1.2px;
}
button.danger:hover:not(:disabled) {
  color: var(--bad);
  background: rgba(var(--bad-rgb), .08);
  box-shadow: inset 0 0 0 var(--hw) var(--bad);
}
button.danger::after { content: none; }

button.small {
  min-width: 0;
  height: 28px;
  padding: 0 var(--sp-md);
  font-size: 11px;
  letter-spacing: 1.2px;
}
button.small::after { content: none; }

button.block { width: 100%; margin-top: var(--sp-xl); }

a:has(> button) { display: inline-flex; }
a:has(> button):hover { text-decoration: none; }

/* ---- readouts ------------------------------------------------------------
   The instrument pattern the flight HUD uses: a tiny tracked caption over a
   monospace value. The caption is never the thing being read -- it exists so
   the value below it needs no sentence. */

.label {
  display: block;
  font: 600 10px var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faint);
}
.label.lit { color: var(--accent); }

.value { font: 400 13px var(--font-mono); color: var(--text); }
.value-lg { font: 400 19px var(--font-mono); color: var(--text); }

/* Versions, hashes, file names, paths. theme.rs draws these in FAINT; on the
   web they are the thing being read rather than a caption, so they sit at
   MUTED -- FAINT does not clear 4.5:1 at 11px, and a SHA-256 nobody can read is
   not a security feature. */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.stat-block { display: flex; flex-direction: column; gap: 1px; }

/* The one number on the account page that matters: how long access lasts. Set
   as an instrument, because that is what it is. */
.status-line { font: 400 26px var(--font-mono); line-height: 1.2; color: var(--text); }
.status-line.good { color: var(--good); }
.status-line.warn { color: var(--warn); }
.status-line.bad { color: var(--bad); }

.muted { color: var(--muted); font-size: 13.5px; }
.faint { color: var(--faint); font-size: 12px; }
.center { text-align: center; }
.row { display: flex; gap: var(--sp-md); flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: var(--sp-md); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- chips and badges ----------------------------------------------------
   One colour at three alphas: the ink at full, the hairline at 120/255, the
   fill at 28/255. That is widgets.rs::chip's formula, and it is the only
   formula on the site for a tinted status surface -- so a badge, a chip and a
   message box are visibly the same idea at three sizes. The colour arrives as
   `style="--tint: ..."` or one of the classes below. */

.badge {
  display: inline-flex;
  align-items: center;
  --tint: var(--flat-rgb);
  padding: 3px 8px;
  border-radius: var(--r-chip);
  background: rgba(var(--tint), .11);
  border: var(--hw) solid rgba(var(--tint), .47);
  color: rgb(var(--tint));
  font: 600 9.5px var(--font-display);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge.good { --tint: var(--good-rgb); }
.badge.warn { --tint: var(--warn-rgb); }
.badge.bad  { --tint: var(--bad-rgb); }
.badge.flat { --tint: var(--flat-rgb); }
.badge.accent { --tint: 120, 210, 238; }

/* ---- messages ------------------------------------------------------------- */

.msg {
  display: none;
  margin-top: var(--sp-lg);
  padding: var(--sp-md);
  border-radius: var(--r-btn);
  --tint: var(--flat-rgb);
  background: rgba(var(--tint), .11);
  border: var(--hw) solid rgba(var(--tint), .47);
  color: rgb(var(--tint));
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.show { display: block; }
.msg.ok { --tint: var(--good-rgb); }
.msg.bad { --tint: var(--bad-rgb); }
.msg.info { --tint: var(--flat-rgb); }
.msg.mono { font-family: var(--font-mono); font-size: 12px; }

/* ---- forms ---------------------------------------------------------------- */

label {
  display: block;
  margin-bottom: 6px;
  font: 600 10px var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faint);
}

.field { margin-bottom: var(--sp-lg); }
.field:last-of-type { margin-bottom: 0; }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], select {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-sunken);
  border: var(--hw) solid var(--hairline);
  border-radius: var(--r-btn);
  color: var(--text);
  /* Typed values are data, so they are set as data. It also stops an email
     address and a password of the same length looking different widths. */
  font: 400 13px var(--font-mono);
  transition: border-color var(--t) ease, background-color var(--t) ease;
}
input::placeholder { color: var(--faint); font-family: var(--font-body); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent-dim);
  background: var(--panel-active);
}
input.compact, select.compact { width: auto; }
select { cursor: pointer; }

.hint { margin-top: 6px; font-size: 12px; color: var(--faint); }

/* Numbered steps. Roomier than a default list, because these are read once and
   followed, not skimmed. */
.steps { margin: var(--sp-md) 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.steps li { margin-bottom: var(--sp-md); line-height: 1.55; }
.steps strong { color: var(--text); font-weight: 600; }

code {
  font: 400 12.5px var(--font-mono);
  color: var(--accent);
  background: var(--panel-sunken);
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-chip);
  padding: 1px 5px;
}

/* ---- key/value ------------------------------------------------------------ */

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-sm) var(--sp-xl);
  align-items: baseline;
  margin: 0;
}
.kv dt {
  font: 600 10px var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.kv dd { margin: 0; font-size: 13.5px; color: var(--text); }
.kv dd.mono { font-size: 12px; }

/* ---- tables --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left;
  padding: 10px var(--sp-md);
  border-bottom: var(--hw) solid var(--hairline-soft);
  vertical-align: top;
}
th {
  font: 600 10px var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faint);
}
td { color: var(--muted); }
tbody tr:hover td { background: var(--panel-raised); }

/* ---- filter chips --------------------------------------------------------
   Buttons, not a <select>: which slice you are looking at is worth seeing
   without opening anything, and one of these is always true. */

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-sm); margin-top: var(--sp-lg); }

button.chip {
  min-width: 0;
  height: 28px;
  padding: 0 var(--sp-md);
  background: transparent;
  box-shadow: inset 0 0 0 var(--hw) var(--hairline-soft);
  color: var(--faint);
  font: 600 10px var(--font-display);
  letter-spacing: 1.6px;
}
button.chip::after { content: none; }
button.chip:hover:not(:disabled) { background: var(--accent-wash); color: var(--muted); }
button.chip.on {
  background: var(--accent-wash);
  color: var(--accent);
  box-shadow: inset 0 0 0 var(--hw) var(--accent-dim);
}

/* ---- progress ------------------------------------------------------------- */

.progress {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--accent-wash);
  overflow: hidden;
}
.progress > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  min-width: 3px;
  background: var(--accent);
  border-radius: 3px;
}
/* A brighter leading edge, so the bar has a direction even when it is not
   moving fast enough to see. */
.progress > i::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, .75);
}

/* ---- framed imagery ------------------------------------------------------
   The frame the launcher puts round a ship: a sunken plate, corner brackets,
   and a hairline. The brackets are what stop an empty or slow-loading image
   area reading as a hole in the panel. */

.frame {
  position: relative;
  background: var(--panel-sunken);
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-card);
  overflow: hidden;
  --bk: rgba(74, 133, 152, .7);
  --bk-inset: var(--sp-sm);
  --bk-arm: 16px;
  --bk-w: 1.2px;
}
.frame img {
  display: block;
  width: 100%;
  height: 100%;
  /* Contain, not cover. A ship is a shape; cropping the nose off one to fill a
     box defeats the point of showing it. */
  object-fit: contain;
}

/* A vignette over the picture, not under it.

   These renders come out of Blender on a studio backdrop, and a flat grey
   rectangle butted against the panel's glass reads as a screenshot pasted onto
   the page. Darkening the edges toward the void does what the backdrop's own
   vignette does for the page: it stops the image having a hard border and puts
   the hull in the middle of something. */
.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(4, 6, 11, .82) 100%),
    linear-gradient(to bottom, rgba(4, 6, 11, .55) 0%, transparent 22%);
}

/* ---- roadmap -------------------------------------------------------------
   Three columns of cards: live, in progress, next. The progress bar is the same
   widget the launcher draws while it downloads, at the same six pixels, because
   it means the same thing in both places. */

.road-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-lg);
  align-items: start;
}
.road-column {
  position: relative;
  background: var(--panel);
  border: var(--hw) solid var(--hairline);
  border-radius: var(--r-panel);
  padding: var(--sp-lg);
}
.road-column::before {
  content: "";
  position: absolute;
  top: 0; left: var(--r-panel); right: var(--r-panel);
  height: var(--hw);
  background: var(--bevel);
}
/* The one place the accent is structure rather than emphasis: a short bar on
   the leading edge of the column being worked on, exactly as the launcher's nav
   rail marks the screen you are on. */
.road-column[data-column="building"]::after {
  content: "";
  position: absolute;
  left: 0; top: var(--sp-lg);
  width: 2px; height: 22px;
  background: var(--accent);
}
.road-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  padding-bottom: var(--sp-sm);
  border-bottom: var(--hw) solid var(--hairline-soft);
}
.road-column > .faint { margin: var(--sp-sm) 0 var(--sp-md); display: block; }

.road-stack { display: grid; gap: var(--sp-sm); }

.road-card {
  background: var(--panel-raised);
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-card);
  padding: var(--sp-md);
}
.road-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xs);
}
.road-card h3 { font-size: 14px; }
.road-card .label { flex: none; }
.road-card p { margin: 0; font-size: 12.5px; }
.road-progress {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}
.road-progress .progress { flex: 1; }
.road-progress .value { font-size: 11px; color: var(--muted); }

/* A finished item does not need a number repeated eight times down a column --
   the column it is in already says it shipped. */
.road-column[data-column="live"] .road-progress { display: none; }

/* ---- admin ---------------------------------------------------------------
   The panel is read before it is used: the counters say what kind of day it
   is, and the table is narrowed to one account before anything is changed. */

.spread { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-md); }

/* auto-fit rather than a fixed column count, so eight tiles become two rows on
   a laptop and one column on a phone without a second breakpoint. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: var(--sp-sm);
}
.stat {
  position: relative;
  background: var(--panel-sunken);
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-card);
  padding: var(--sp-md);
}
.stat-value { font: 400 24px var(--font-mono); line-height: 1.1; color: var(--text); }
.stat-value.good { color: var(--good); }
.stat-value.warn { color: var(--warn); }
.stat-value.bad { color: var(--bad); }
.stat-label {
  margin-top: 6px;
  font: 600 10px var(--font-display);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faint);
}

/* The expanded account. A row rather than a modal, so the list it came from
   stays on screen -- support work is comparing one account with the next. */
tr.drawer:hover td { background: none; }
tr.drawer > td { background: var(--panel-sunken); padding: var(--sp-lg); }
.drawer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr);
  gap: var(--sp-xl);
}
.drawer-title {
  margin: 0 0 var(--sp-md);
  font: 600 10px var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faint);
}
.drawer-sub {
  margin: var(--sp-lg) 0 var(--sp-sm);
  font: 600 12px var(--font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.drawer-grid .hint { margin-top: 0; flex: 1 1 220px; }
.drawer-grid .row { align-items: center; }

/* Audit lines. Three columns so the verb, the sentence and the time line up
   down the list rather than wrapping around each other. */
.log-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-md);
  align-items: baseline;
  padding: 10px 0;
  border-bottom: var(--hw) solid var(--hairline-soft);
  font-size: 13px;
}
.log-line:last-child { border-bottom: none; }
.log-what { color: var(--muted); }
.log-what strong { color: var(--text); font-weight: 600; }
.log-line .faint { white-space: nowrap; }

pre.mail {
  margin: var(--sp-sm) 0 0;
  padding: var(--sp-md);
  background: var(--panel-sunken);
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-btn);
  font: 400 12px/1.55 var(--font-mono);
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- footer --------------------------------------------------------------- */

footer.site {
  border-top: var(--hw) solid var(--hairline-soft);
  background: rgba(4, 6, 11, .9);
  font-size: 12px;
  color: var(--faint);
}
footer.site > .shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--sp-2xl) var(--sp-xl);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-lg) var(--sp-2xl);
}
footer.site .brand .wordmark { font-size: 13px; letter-spacing: 3.6px; }
footer.site .brand .mark { height: 16px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: var(--sp-xl); }
footer.site nav a,
footer.site .social a {
  font: 600 11px var(--font-display);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faint);
}
footer.site nav a:hover,
footer.site .social a:hover { color: var(--text); }
footer.site .social { display: flex; gap: var(--sp-lg); }
footer.site .social:empty { display: none; }
footer.site .build { margin-left: auto; font: 400 11px var(--font-mono); color: var(--faint); }

/* ==========================================================================
   Cinematic pages
   ==========================================================================
   The front page, the download page and news articles are image-led: the
   game's own captures, full bleed, with as few words over them as possible.
   Everything below is compositor-only animation (opacity and transform), and
   none of it runs under prefers-reduced-motion. */

body.cinematic main { max-width: none; padding: 0; }
body.cinematic .backdrop::before { opacity: .35; }

.shell-w {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}
@media (max-width: 760px) { .shell-w { padding: 0 var(--sp-lg); } }

/* A picture that fills its box. `media/<id>` references become a srcset in
   app.js; the box keeps its size while the image streams in, and the image
   fades up rather than painting top to bottom. */
.fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--void);
}
.fill > img,
.fill > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .9s ease;
}
.fill > .ready { opacity: 1; }

/* ---- hero ----------------------------------------------------------------- */

.hero-cine {
  position: relative;
  min-height: max(620px, 100svh);
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.hero-cine .fill { z-index: -2; }
.hero-cine .fill > img,
.hero-cine .fill > video { transform: scale(1.06); }
.hero-cine .fill > .ready { animation: drift 24s cubic-bezier(.2, .6, .3, 1) forwards; }
@keyframes drift { from { transform: scale(1.06); } to { transform: scale(1); } }

/* Two washes: one so the headline always has contrast whatever the capture,
   one so the hero dissolves into the page instead of ending on a hard edge. */
.hero-cine::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--void) 0%, rgba(4, 6, 11, .72) 22%, rgba(4, 6, 11, 0) 58%),
    linear-gradient(to right, rgba(4, 6, 11, .55) 0%, rgba(4, 6, 11, 0) 55%);
}

/* The reel: stacked shots, one visible at a time, crossfading. A shot's video
   sits over its still and only shows once it is actually playing. */
.fill.reel > .reel-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.fill.reel > .reel-layer.on.ready { opacity: 1; }
.reel-layer > img,
.reel-layer > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reel-layer > video { opacity: 0; transition: opacity .5s ease; }
.reel-layer.playing > video { opacity: 1; }
.reel-layer.drift > img { animation: drift 8s cubic-bezier(.2, .6, .3, 1) forwards; }
.hero-cine .fill.reel > .reel-layer > img { transform: none; }

.reel-ticks {
  position: absolute;
  right: var(--sp-xl);
  bottom: clamp(48px, 10vh, 120px);
  display: flex;
  gap: 6px;
}
.reel-ticks[hidden] { display: none; }
button.reel-tick {
  min-width: 0;
  width: 36px;
  height: 18px;
  padding: 8px 0;
  background: none;
  cursor: pointer;
}
button.reel-tick::after { content: none; }
button.reel-tick:hover:not(:disabled) { background: none; }
/* flex: 1 because the base button is a centred flex box, which would
   otherwise shrink an empty bar to nothing. */
button.reel-tick i {
  display: block;
  flex: 1;
  height: 2px;
  background: rgba(226, 236, 250, .22);
  position: relative;
  overflow: hidden;
}
button.reel-tick i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}
@media (max-width: 760px) { .reel-ticks { right: var(--sp-lg); bottom: 20px; } }

.hero-copy {
  padding-bottom: clamp(48px, 10vh, 120px);
}
.display {
  margin: 0;
  font: 600 clamp(48px, 9vw, 132px)/.9 var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
}
.hero-copy .tagline {
  margin: var(--sp-lg) 0 0;
  max-width: 40ch;
  font: 500 clamp(17px, 1.6vw, 21px)/1.4 var(--font-display);
  letter-spacing: .03em;
  color: var(--muted);
}
.hero-copy .tagline:empty { display: none; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-lg) var(--sp-xl);
  margin-top: var(--sp-2xl);
}
.cta-row button { height: 54px; min-width: 240px; font-size: 16px; }
.cta-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 400 12px var(--font-mono);
  color: var(--muted);
}
.cta-meta a { font: 600 11px var(--font-display); letter-spacing: 1.6px; text-transform: uppercase; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--accent-dim));
  overflow: hidden;
}
.scroll-cue::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1px;
  height: 14px;
  background: var(--accent);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { from { transform: translateY(-14px); } to { transform: translateY(44px); } }
@media (max-width: 760px) { .scroll-cue { display: none; } }

/* ---- features ------------------------------------------------------------- */

.feature {
  position: relative;
  min-height: min(92vh, 980px);
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  margin-top: 2px;
}
.feature .fill { z-index: -2; }
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(4, 6, 11, .92) 0%, rgba(4, 6, 11, .35) 34%, rgba(4, 6, 11, 0) 60%),
    linear-gradient(to bottom, var(--void) 0%, rgba(4, 6, 11, 0) 16%);
}
.feature-copy { padding-bottom: clamp(40px, 9vh, 96px); }
@media (max-width: 760px) { .feature { min-height: 72vh; } }
.feature.flip .feature-copy { text-align: right; }
.feature.flip .feature-copy .kicker { justify-content: flex-end; }
.feature.flip .feature-copy p { margin-left: auto; }

.kicker {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
  font: 600 12px var(--font-display);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker::before {
  content: "";
  width: 28px;
  height: var(--hw);
  background: var(--accent);
}
.feature.flip .kicker::before { order: 2; }

.headline {
  margin: 0;
  max-width: 16ch;
  font: 600 clamp(34px, 5.4vw, 76px)/1 var(--font-display);
  letter-spacing: .02em;
  color: var(--text);
}
.feature.flip .headline { margin-left: auto; }
.feature-copy p {
  margin-top: var(--sp-lg);
  max-width: 44ch;
  font-size: 16px;
  color: var(--muted);
}

/* ---- bands ---------------------------------------------------------------- */

.band { padding: clamp(64px, 12vh, 128px) 0; }
.band + .band { padding-top: 0; }
.band-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-2xl);
}
.band-head h2 {
  font: 600 clamp(28px, 3.6vw, 44px)/1 var(--font-display);
  letter-spacing: .02em;
}
.band-head a {
  font: 600 12px var(--font-display);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- ships ---------------------------------------------------------------- */

.hangar { display: grid; gap: var(--sp-3xl); }
.ship-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  gap: var(--sp-2xl);
  align-items: center;
}
.ship-stage .view {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-panel);
  overflow: hidden;
  border: var(--hw) solid var(--hairline-soft);
  background: radial-gradient(ellipse at 50% 60%, rgba(27, 57, 69, .5), var(--void) 70%);
}
.ship-stage .view .fill { background: transparent; }
.ship-stage .view .fill > img { object-fit: contain; }
/* A hull with no render yet is its numbers alone, not a frame round nothing. */
.ship-stage.no-render,
.ship-stage.no-render:nth-child(even) { grid-template-columns: minmax(0, 560px); }
.ship-stage h3 {
  font: 600 clamp(32px, 4vw, 52px)/1 var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ship-stage .class { margin: var(--sp-sm) 0 var(--sp-xl); color: var(--accent); font: 600 12px var(--font-display); letter-spacing: 2px; text-transform: uppercase; }
.ship-stage .blurb { margin-top: var(--sp-xl); font-size: 14px; }
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: var(--hw) solid var(--hairline-soft);
}
.spec-grid > div {
  padding: var(--sp-md) 0;
  border-bottom: var(--hw) solid var(--hairline-soft);
}
.spec-grid .value { font-size: 18px; }
.ship-stage:nth-child(even) { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.7fr); }
.ship-stage:nth-child(even) .view { order: 2; }
@media (max-width: 860px) {
  .ship-stage,
  .ship-stage:nth-child(even) { grid-template-columns: 1fr; }
  .ship-stage:nth-child(even) .view { order: 0; }
}

/* ---- gallery -------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: clamp(120px, 14vw, 200px);
  gap: var(--sp-sm);
}
.gallery .shot:nth-child(6n + 1) { grid-column: span 4; grid-row: span 2; }
.gallery .shot:nth-child(6n + 2),
.gallery .shot:nth-child(6n + 3) { grid-column: span 2; }
.gallery .shot:nth-child(6n + 4),
.gallery .shot:nth-child(6n + 5),
.gallery .shot:nth-child(6n + 6) { grid-column: span 2; }
@media (max-width: 760px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 140px; }
  .gallery .shot:nth-child(n) { grid-column: span 1; grid-row: span 1; }
  .gallery .shot:nth-child(3n + 1) { grid-column: span 2; grid-row: span 2; }
}

button.shot {
  position: relative;
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--panel-sunken);
  cursor: zoom-in;
  text-transform: none;
  letter-spacing: normal;
}
button.shot::after { content: none; }
button.shot:hover:not(:disabled) { background: var(--panel-sunken); }
button.shot .fill > img { transition: opacity .9s ease, transform .6s cubic-bezier(.2, .6, .3, 1); }
button.shot:hover .fill > img { transform: scale(1.04); }
button.shot .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 12px;
  text-align: left;
  font: 600 11px var(--font-display);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text);
  background: linear-gradient(to top, rgba(4, 6, 11, .85), transparent);
  opacity: 0;
  transition: opacity var(--t-slow) ease;
}
button.shot:hover .caption,
button.shot:focus-visible .caption { opacity: 1; }

dialog.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: none;
  padding: 56px 24px 20px;
  background: rgba(2, 4, 8, .96);
  color: var(--text);
}
dialog.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
dialog.lightbox::backdrop { background: rgba(2, 4, 8, .6); }
.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
}
.lightbox .bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xl);
  padding-top: var(--sp-md);
  font: 600 12px var(--font-display);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.lightbox .close { position: absolute; top: 12px; right: 16px; }

/* ---- news cards ----------------------------------------------------------- */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--sp-xl);
}
.story {
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--text);
}
.story:hover { color: var(--text); }
.story .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-card);
  overflow: hidden;
  border: var(--hw) solid var(--hairline-soft);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(74, 133, 152, .25), transparent 60%),
    var(--panel-sunken);
}
.story .thumb .fill { background: transparent; }
.story .thumb .fill > img { transition: opacity .9s ease, transform .6s cubic-bezier(.2, .6, .3, 1); }
.story:hover .thumb .fill > img { transform: scale(1.04); }
.story .meta {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin: var(--sp-md) 0 var(--sp-sm);
}
.story h3 {
  font: 600 20px/1.2 var(--font-display);
  letter-spacing: .02em;
  transition: color var(--t) ease;
}
a.story:hover h3 { color: var(--accent); }
.story p { margin-top: var(--sp-sm); font-size: 14px; }
.story.text-only {
  padding: var(--sp-xl);
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-card);
  background: var(--panel);
}
.story.text-only .meta { margin-top: 0; }
a.story.text-only:hover { border-color: var(--accent-dim); background: var(--panel-raised); }
.news-grid.lead .story:first-child { grid-column: 1 / -1; }
.news-grid.lead .story.text-only:first-child { display: block; }
@media (min-width: 900px) {
  .news-grid.lead .story:first-child {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: var(--sp-2xl);
    align-items: center;
  }
  .news-grid.lead .story:first-child h3 { font-size: clamp(26px, 2.6vw, 36px); }
}
.story.skeleton .thumb { animation: pulse 1.6s ease-in-out infinite; }
.story.skeleton i {
  display: block;
  height: 12px;
  margin-top: var(--sp-md);
  width: 70%;
  border-radius: 2px;
  background: var(--panel-raised);
}
@keyframes pulse { 50% { opacity: .55; } }

/* ---- roadmap strip on the front page ------------------------------------- */

.road-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-lg);
}
.road-strip .road-card { padding: var(--sp-lg); }

/* ---- closing band --------------------------------------------------------- */

.finale {
  position: relative;
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  isolation: isolate;
}
.finale .fill { z-index: -2; }
.finale::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, var(--void) 0%, rgba(4, 6, 11, .55) 30%, rgba(4, 6, 11, .55) 70%, var(--void) 100%);
}
.finale .display { font-size: clamp(40px, 7vw, 96px); }
.finale .cta-row { justify-content: center; }

/* ---- reveal on scroll ----------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .6, .3, 1);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-cine .fill > .ready { animation: none; transform: none; }
  .reel-layer.drift > img { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue::after { animation: none; }
  .fill > img, .fill > video { transition: none; }
  button.shot:hover .fill > img, .story:hover .thumb .fill > img { transform: none; }
}

/* ==========================================================================
   Download
   ========================================================================== */

.dl-hero {
  position: relative;
  padding: 140px 0 72px;
  isolation: isolate;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
}
/* The hero fades into the starfield below instead of ending on a hard edge:
   no opaque fill behind it, and the picture masked out over its last third. */
.dl-hero .fill,
.article-hero .fill {
  z-index: -2;
  background: transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.dl-hero .fill > img { opacity: 0; }
.dl-hero .fill > img.ready { opacity: .55; }
.dl-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(4, 6, 11, 0) 0%, rgba(4, 6, 11, .6) 35%, rgba(4, 6, 11, .3) 100%);
}
.dl-hero .display { font-size: clamp(44px, 7vw, 96px); }

.dl-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: var(--sp-2xl);
  align-items: end;
  margin-top: var(--sp-2xl);
}
@media (max-width: 860px) { .dl-main { grid-template-columns: 1fr; } }

.dl-primary .os-line {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  font: 600 13px var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.os-icon { width: 20px; height: 20px; fill: currentColor; flex: none; }
.dl-primary .cta-row { margin-top: 0; }
.dl-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-lg);
  padding: var(--sp-lg) 0;
  border-top: var(--hw) solid var(--hairline-soft);
  border-bottom: var(--hw) solid var(--hairline-soft);
}
.dl-facts dd { margin: 0; }
.dl-facts .value { font-size: 14px; }

.platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-lg);
}
@media (max-width: 860px) { .platforms { grid-template-columns: 1fr; } }
.platform {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  padding: var(--sp-xl);
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-panel);
  background: var(--panel);
}
.platform.mine { border-color: var(--accent-dim); }
.platform.mine::before {
  content: "";
  position: absolute;
  top: -1px;
  left: var(--r-panel);
  right: var(--r-panel);
  height: 2px;
  background: var(--accent);
}
.platform-head { display: flex; align-items: center; gap: var(--sp-md); }
.platform-head h3 { font-size: 20px; flex: 1; }
.platform .os-icon { width: 26px; height: 26px; color: var(--text); }
.platform .req { font-size: 13px; color: var(--muted); margin: 0; }
.platform .actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--sp-sm); align-items: center; }
.platform .actions a:has(> button) { flex: 1; }
.platform .actions button { width: 100%; min-width: 0; height: 42px; }
.platform details { font-size: 12px; }
.platform summary {
  cursor: pointer;
  font: 600 10px var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faint);
}
.platform summary:hover { color: var(--muted); }
.platform details .mono { display: block; margin-top: var(--sp-sm); }
.copy-link {
  min-width: 0;
  height: auto;
  padding: 2px 0;
  background: none;
  color: var(--accent);
  font: 600 10px var(--font-display);
  letter-spacing: 1.6px;
}
.copy-link::after { content: none; }
.copy-link:hover:not(:disabled) { background: none; color: var(--text); }

.install-steps {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-xl);
  counter-reset: step;
}
@media (max-width: 860px) { .install-steps { grid-template-columns: 1fr; } }
.install-steps li {
  list-style: none;
  counter-increment: step;
  padding-top: var(--sp-lg);
  border-top: var(--hw) solid var(--hairline-soft);
  color: var(--muted);
  font-size: 14px;
}
.install-steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: var(--sp-sm);
  font: 400 13px var(--font-mono);
  color: var(--accent);
}
.install-steps strong { display: block; margin-bottom: 4px; color: var(--text); font: 600 17px var(--font-display); letter-spacing: .02em; }

/* ==========================================================================
   Subscribe
   ========================================================================== */

.sub-hero { min-height: 56vh; }
.sub-hero .fill > img.ready { opacity: .8; }
.sub-status {
  display: inline-block;
  margin-top: var(--sp-lg);
  padding: 6px 12px;
  border: var(--hw) solid rgba(var(--good-rgb), .47);
  border-radius: var(--r-chip);
  background: rgba(var(--good-rgb), .11);
  color: var(--good);
  font: 600 12px var(--font-display);
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.sub-status.warn {
  border-color: rgba(var(--warn-rgb), .47);
  background: rgba(var(--warn-rgb), .11);
  color: var(--warn);
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--sp-xl);
  align-items: stretch;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  padding: var(--sp-2xl) var(--sp-xl) var(--sp-xl);
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-panel);
  background: var(--panel);
}
.plan.featured { border-color: var(--accent-dim); background: var(--panel-raised); }
.plan.featured::before {
  content: "";
  position: absolute;
  top: -1px;
  left: var(--r-panel);
  right: var(--r-panel);
  height: 2px;
  background: var(--accent);
}
.plan h3 {
  font: 600 13px var(--font-display);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-price { display: flex; align-items: baseline; gap: var(--sp-sm); }
.plan-price .amount { font: 600 48px/1 var(--font-display); color: var(--text); letter-spacing: .01em; }
.plan-price .per { font-size: 14px; color: var(--muted); }
.plan-billed { margin: 0; font-size: 13px; color: var(--faint); }
.plan button { margin-top: auto; width: 100%; min-width: 0; }
.plan-badge {
  position: absolute;
  top: var(--sp-lg);
  right: var(--sp-lg);
  padding: 3px 8px;
  border-radius: var(--r-chip);
  background: var(--accent-wash);
  border: var(--hw) solid var(--hairline);
  color: var(--accent);
  font: 600 10px var(--font-display);
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--sp-md) var(--sp-2xl);
}
.perks li {
  position: relative;
  padding: var(--sp-md) 0 var(--sp-md) 28px;
  border-top: var(--hw) solid var(--hairline-soft);
  color: var(--text);
  font-size: 15px;
}
.perks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 19px;
  width: 12px;
  height: 6px;
  border-left: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}

.faq { display: grid; gap: var(--sp-sm); max-width: 860px; }
.faq-item {
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-card);
  background: var(--panel);
}
.faq-item summary {
  cursor: pointer;
  padding: var(--sp-lg) var(--sp-xl);
  font: 600 16px var(--font-display);
  letter-spacing: .02em;
  color: var(--text);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--accent); }
.faq-item[open] summary::after { content: "2"; }
.faq-item p { padding: 0 var(--sp-xl) var(--sp-lg); margin: 0; font-size: 15px; }

/* ==========================================================================
   Prose pages (page.html)
   ========================================================================== */

main.prose-main { max-width: 760px; }
.prose h2 { margin: var(--sp-2xl) 0 var(--sp-md); font-size: 22px; }
.prose p, .prose li { font-size: 16px; line-height: 1.75; color: #c6d4e4; }
.prose ul { margin: 0 0 var(--sp-lg); padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* ==========================================================================
   Articles
   ========================================================================== */

.article-hero {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  padding-top: 120px;
}
.article-hero.bare { min-height: 0; padding-top: 140px; }
.article-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, var(--void) 0%, rgba(4, 6, 11, .5) 50%, rgba(4, 6, 11, .2) 100%);
}
.article-hero h1 {
  max-width: 22ch;
  margin: var(--sp-md) 0 var(--sp-2xl);
  font: 600 clamp(34px, 5vw, 64px)/1.05 var(--font-display);
  letter-spacing: .01em;
}
.article-hero .shell-w { max-width: 808px; }
.article-body {
  max-width: 808px;
  margin: var(--sp-2xl) auto var(--sp-3xl);
  padding: 0 var(--sp-xl);
}
.article-body p { font-size: 17px; line-height: 1.75; color: #c6d4e4; margin-bottom: 1.2em; }
.article-body .summary { font-size: 20px; color: var(--text); }
.article-foot { max-width: 808px; margin: 0 auto 96px; padding: 0 var(--sp-xl); }

/* Page headings on the ordinary (non-cinematic) pages leave room for the
   fixed-height header without a hero behind it. */
.page-head { padding: 24px 0 var(--sp-2xl); }
.page-head h1 { font: 600 clamp(36px, 5vw, 60px)/1 var(--font-display); letter-spacing: .02em; }
main.narrow .page-head h1 { font-size: 36px; }

/* ==========================================================================
   Content editor (content.html)
   ========================================================================== */

textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  background: var(--panel-sunken);
  border: var(--hw) solid var(--hairline);
  border-radius: var(--r-btn);
  color: var(--text);
  font: 400 14px/1.6 var(--font-body);
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent-dim); background: var(--panel-active); }
input[type=url], input[type=datetime-local], input[type=search] {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-sunken);
  border: var(--hw) solid var(--hairline);
  border-radius: var(--r-btn);
  color: var(--text);
  font: 400 13px var(--font-mono);
}
input[type=url]:focus, input[type=datetime-local]:focus, input[type=search]:focus {
  outline: none;
  border-color: var(--accent-dim);
  background: var(--panel-active);
}
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

.tabs {
  display: flex;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-xl);
  border-bottom: var(--hw) solid var(--hairline-soft);
  overflow-x: auto;
}
.tabs a, .tabs button.tab {
  min-width: 0;
  height: auto;
  padding: 10px 14px;
  border-radius: 0;
  background: none;
  color: var(--faint);
  font: 600 12px var(--font-display);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: none;
}
.tabs button.tab::after { content: none; }
.tabs a:hover, .tabs button.tab:hover:not(:disabled) { background: none; color: var(--text); }
.tabs a[aria-current="page"], .tabs .tab[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

.editor-bar {
  position: sticky;
  top: 64px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  flex-wrap: wrap;
  padding: var(--sp-md) 0;
  margin-bottom: var(--sp-lg);
  background: rgba(4, 6, 11, .92);
  border-bottom: var(--hw) solid var(--hairline-soft);
}
.editor-bar .state { font: 400 12px var(--font-mono); color: var(--faint); }
.editor-bar .state.dirty { color: var(--warn); }
.editor-bar .spacer { flex: 1; }
.editor-bar button:not(.secondary) { height: 36px; min-width: 120px; font-size: 13px; }

.entry {
  border: var(--hw) solid var(--hairline-soft);
  border-radius: var(--r-card);
  background: var(--panel);
  margin-bottom: var(--sp-md);
}
.entry > summary {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  cursor: pointer;
  list-style: none;
}
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary .title { flex: 1; font: 600 15px var(--font-display); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry > summary .thumb-sm { width: 64px; height: 36px; border-radius: 2px; object-fit: cover; background: var(--panel-sunken); flex: none; }
.entry[open] > summary { border-bottom: var(--hw) solid var(--hairline-soft); }
.entry .body { padding: var(--sp-lg); display: grid; gap: var(--sp-lg); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-lg); }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.field .hint:empty { display: none; }

.media-pick { display: flex; gap: var(--sp-md); align-items: center; }
.media-pick .preview {
  width: 128px;
  height: 72px;
  flex: none;
  border-radius: var(--r-chip);
  border: var(--hw) solid var(--hairline-soft);
  background: var(--panel-sunken);
  object-fit: cover;
}
.media-pick .path { flex: 1; min-width: 0; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-md);
}
.media-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  height: auto;
  padding: 6px;
  border-radius: var(--r-card);
  background: var(--panel-sunken);
  box-shadow: inset 0 0 0 var(--hw) var(--hairline-soft);
  color: var(--muted);
  font: 400 11px var(--font-mono);
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  align-items: stretch;
}
.media-tile::after { content: none; }
.media-tile:hover:not(:disabled) { background: var(--panel-active); box-shadow: inset 0 0 0 var(--hw) var(--accent-dim); color: var(--text); }
.media-tile img, .media-tile video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: #000; }
.media-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropzone {
  display: grid;
  place-items: center;
  padding: var(--sp-2xl);
  border: 1px dashed var(--hairline);
  border-radius: var(--r-panel);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t) ease, background-color var(--t) ease;
}
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--text); }

dialog.picker {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: var(--sp-xl);
  background: #070c14;
  color: var(--text);
  border: var(--hw) solid var(--hairline);
  border-radius: var(--r-panel);
}
dialog.picker::backdrop { background: rgba(2, 4, 8, .8); }

.spec-rows { display: grid; gap: var(--sp-sm); }
.spec-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--sp-sm); }
.spec-row button { min-width: 0; }


/* ---- responsive ----------------------------------------------------------
   900px is theme.rs's layout::WINDOW_MIN width -- the point where the launcher
   collapses its own two columns. Reusing it keeps the two products breaking at
   the same place. */

@media (max-width: 900px) {
  .drawer-grid { grid-template-columns: 1fr; gap: var(--sp-lg); }
  .log-line { grid-template-columns: auto 1fr; }
  .log-line .faint { grid-column: 2; }
}

@media (max-width: 620px) {
  main { padding: var(--sp-xl) var(--sp-lg) var(--sp-3xl); }
  footer.site > .shell { padding: var(--sp-xl) var(--sp-lg); gap: var(--sp-lg); }
  footer.site .build { margin-left: 0; width: 100%; }
  .panel { padding: var(--sp-lg); }
  .lede { margin-bottom: var(--sp-xl); }
  /* Page actions go full width; the small controls and the filter chips do not.
     A "Search" button the width of a phone next to a field the width of a phone
     reads as two fields, and a column of full-width chips is a menu, not a
     filter row. */
  button:not(.small):not(.chip):not(.nav-toggle):not(.shot):not(.media-tile):not(.copy-link):not(.tab),
  .btn { min-width: 0; width: 100%; }
  .cta-row > a:has(> button) { width: 100%; }
  .row > a:has(> button) { width: 100%; }
  .panel-head { flex-wrap: wrap; }
  .panel-head .row { width: 100%; }
  .panel-head input { flex: 1; min-width: 0; }
  button.chip { flex: 0 0 auto; }
}

/* ---- reduced motion ------------------------------------------------------
   The same intent as the backdrop's: state changes still happen, nothing
   eases, and the sky is still there with nothing moving in it. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
