/* GalvaBase — the brand tokens from docs/BRAND.md, in one place.
 *
 * BACKLOG-189 exists because these values were retyped in four files and had already drifted:
 * site/genesis.css and web/static/hud/index.html set the same token to two different hexes.
 * This file is therefore the only place a GalvaBase colour is written down. If you find
 * yourself typing a hex anywhere else in this directory, that is the bug.
 *
 * Names are the brand story, not a palette convention: paper and ink from the drawing table,
 * steel and zinc from galvanising, graphite from the pencil, spark from the verb the company
 * is named after.
 */

:root {
  --paper:        #F6F4EF;   /* default background of every outward surface */
  --ink:          #1B1D21;   /* body text on paper (15.3:1); the dark background when inverted */
  --steel:        #2A2E33;   /* raised surfaces on dark only -- never text */
  --graphite:     #565B62;   /* secondary text on paper (6.2:1) */
  --zinc:         #C7CBCF;   /* hairlines and rules on light; secondary text on dark */
  --spark:        #C74210;   /* THE accent, light contexts */
  --spark-bright: #F0602A;   /* the same accent for dark contexts -- never on paper */

  --bg:        var(--paper);
  --fg:        var(--ink);
  --fg-dim:    var(--graphite);
  --rule:      var(--zinc);
  --accent:    var(--spark);
  --surface:   #FFFFFF;

  /* The three brand faces are not self-hosted yet -- see the README. Google's font CDN is
   * deliberately NOT linked: it sends every visitor's IP address to Google, which is a real
   * GDPR problem for a Dutch business and not something to trade away for a placeholder page.
   * Until the OFL files are in this directory, headlines fall back to a system grotesque,
   * which is honest rather than broken. The wordmark is unaffected: it is SVG outlines. */
  --font-display: "Space Grotesk", ui-sans-serif, "Helvetica Neue", Arial, sans-serif;
  --font-text:    Inter, ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-data:    "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 62ch;
  --step--1: clamp(0.86rem, 0.83rem + 0.14vw, 0.94rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.13rem);
  --step-1:  clamp(1.27rem, 1.18rem + 0.42vw, 1.55rem);
  --step-2:  clamp(1.6rem, 1.42rem + 0.9vw, 2.2rem);
  --step-3:  clamp(2.1rem, 1.72rem + 1.9vw, 3.4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      var(--ink);
    --fg:      var(--paper);
    --fg-dim:  var(--zinc);
    --rule:    #3A3F45;
    --accent:  var(--spark-bright);
    --surface: var(--steel);
  }
}

/* The viewer's own toggle must win over the media query in both directions. */
:root[data-theme="dark"] {
  --bg: var(--ink); --fg: var(--paper); --fg-dim: var(--zinc);
  --rule: #3A3F45; --accent: var(--spark-bright); --surface: var(--steel);
}
:root[data-theme="light"] {
  --bg: var(--paper); --fg: var(--ink); --fg-dim: var(--graphite);
  --rule: var(--zinc); --accent: var(--spark); --surface: #FFFFFF;
}

/* The cockpit object frame -- the one place Genesis' HUD colours appear on GalvaBase
 * surfaces: framed, as a machine on the workshop bench, never as the room itself
 * (docs/BRAND.md section 1). These values are owned by the Genesis HUD
 * (web/static/hud/index.html); they are declared here only so that no page ever writes
 * them as a literal. Do not use them for anything except the framed cockpit object. */
:root {
  --cockpit-bg:     #050B14;
  --cockpit-line:   #0E2C40;
  --cockpit-cyan:   #12B8D6;
  --cockpit-bright: #5BE6FF;
  --cockpit-dim:    #6E93A6;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

/* Layout does the spacing: gap on the container, not margins on the children. */
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 2.75rem; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p  { margin: 0; max-width: var(--measure); }
.dim { color: var(--fg-dim); }
.lead { font-size: var(--step-1); line-height: 1.45; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-color: var(--rule); }
a:hover { text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.label {
  font-family: var(--font-data);
  font-size: var(--step--1);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* One emphasised element per page -- the brand rule, expressed as there being one button style. */
.action {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  align-self: flex-start;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-0);
  padding: 0.72em 1.35em;
  border: 0;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.action:hover { filter: brightness(1.07); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) {
  .action { transition: none; }
  .action:hover { transform: none; }
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

.masthead, .colophon { padding-block: 2rem; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { display: block; width: clamp(150px, 22vw, 210px); height: auto; }
.wordmark .letters { fill: var(--fg); }
.wordmark .stop { fill: var(--accent); }

main { padding-block: clamp(3rem, 9vh, 6rem); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Wide content scrolls inside its own box; the page body never scrolls sideways. */
.scroll-x { overflow-x: auto; }

.colophon {
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--fg-dim);
}
