/* ================================
   Primesaut — studio site stylesheet

   The palette is not invented here. Every colour below is a row of
   src/game/render/palette.c in the game repository, so the site and the game
   state the same art direction: near-black chromatic grounds, neutral gear
   greys carrying the type, and one luminous chartreuse used only for
   contamination. If a colour is wrong, it is wrong in the game too.
   ================================ */

:root {
  /* Grounds — THEME_INK, THEME_VOID, THEME_PANEL, THEME_RAISED */
  --ink: #04060b;
  --void: #0b0c14;
  --panel: #141724;
  --raised: #242a3d;

  /* Structure — THEME_EDGE, THEME_BORDER */
  --edge: #3a4254;
  --border: #596783;

  /* Type — THEME_TEXT, THEME_MUTED, THEME_GEAR_IVORY, THEME_GEAR_LIGHT */
  --text: #eef0f6;
  --muted: #929aaf;
  --ivory: #d9d7c9;
  --plane: #aeb6b7;

  /* The one emissive. THEME_TOXIC: chartreuse, not a green, because in this
     world uncontrolled glow means the compound is in the body. Used for
     accents and nothing structural. */
  --bloom: #a0c73e;
  --bloom-deep: #5d7524;

  --gold: #f5c451;
  --danger: #da525c;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1080px;
  --shadow: rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--bloom); text-decoration: none; }
a:hover { color: #c2e065; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(2.6rem, 7vw, 5rem); text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); text-transform: uppercase; }
h3 { font-size: 1.3rem; letter-spacing: 0.03em; }

p { margin: 0 0 1em; color: var(--plane); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(4, 6, 11, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Only non-layout properties change on scroll. A previous version of the
   sibling site shrank the header's padding, which moved the page, which
   changed scrollY, which toggled the class back off: a feedback loop that
   made scrolling jerk near the threshold. */
.site-header.is-scrolled {
  border-bottom-color: var(--edge);
  box-shadow: 0 4px 24px var(--shadow);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* The brand pushes everything else right, rather than space-between spreading
   four children unevenly once the language switch joined the row. */
.brand { margin-right: auto; }

/* The mark is an image, the name is live text. The wordmark as a whole cannot
   be an image here: type rasterised at header size gets no hinting, so every
   stem lands half-lit and the name reads as blurry. Live text is hinted onto
   the pixel grid. mark-80.png is cropped to the figure and rendered at twice
   the 33x34 it is drawn at. Cropping matters twice over: mark-transparent.svg
   pads the figure to a 512 square, so an uncropped export wastes half its
   height on nothing and its padding is not symmetric, which pushed the figure
   a pixel above the name. Sized against the name the way wordmark.svg relates
   them, at 1.70 cap heights tall with a gap of 0.56 of a cap height.
   The name is set in the display face rather than the wordmark's DejaVu, so
   this lockup is the header's own and is not wordmark.svg. */
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.brand img {
  display: block;
  height: 2.125rem;
  width: auto;
}
.brand span {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}
.brand:hover span { color: var(--bloom); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 5px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--bloom);
}

/* ---------- Language switch ---------- */

/* The current language is a <span>, not a link to the page you are already on.
   Both sides keep the same size and weight so the row does not shift when the
   switch is used. */
.lang {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.lang .is-current { color: var(--bloom); }
.lang a { color: var(--muted); }
.lang a:hover { color: var(--text); }
.lang-sep { color: var(--edge); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

/* ---------- Sections ---------- */

section { padding: 5rem 0; }

.hero {
  padding: 7rem 0 5rem;
  position: relative;
  overflow: hidden;
}

/* The bloom sits behind the type, off centre, low opacity: motivated light in
   an otherwise near-black frame, never a wash over the whole page. */
.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  background: radial-gradient(circle, rgba(160, 199, 62, 0.13), transparent 68%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 780px; }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bloom);
  margin-bottom: 1.4rem;
}

.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.8rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--edge);
}

.lede {
  font-size: 1.15rem;
  color: var(--plane);
  max-width: 62ch;
}

.small { font-size: 0.92rem; color: var(--muted); }

.tagline {
  font-family: var(--font-body);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--bloom);
  margin-top: -0.4rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--edge);
  margin: 0;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.prose { max-width: 68ch; }
.prose h2 { margin-top: 2.5rem; }

/* ---------- Buttons ---------- */

.button-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 1.6rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--bloom);
  color: var(--ink);
  border-color: var(--bloom);
}
.btn-primary:hover { background: #b8dd52; border-color: #b8dd52; color: var(--ink); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--edge);
}
.btn-ghost:hover { border-color: var(--bloom); color: var(--bloom); }

.mt-2 { margin-top: 1rem; }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-top: 2px solid var(--bloom-deep);
  padding: 1.8rem;
}
.card h3 { color: var(--ivory); }
.card p:last-child { margin-bottom: 0; }

/* ---------- Game feature ---------- */

.game-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

/* Placeholder for real capture art. Replace the whole .plate div with an
   <img>: see README. It is a flat vector-ish stand-in on purpose, so nobody
   mistakes it for a screenshot of the game. */
.plate {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--edge);
  background:
    radial-gradient(120% 90% at 72% 18%, rgba(160, 199, 62, 0.18), transparent 60%),
    linear-gradient(180deg, #10131f 0%, #0b0c14 55%, #04060b 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  position: relative;
}
.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 6, 11, 0.75) 100%);
  pointer-events: none;
}
.plate span {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

/* ---------- Spec list ---------- */

.spec {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--edge);
}
.spec li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--edge);
}
.spec dt, .spec .key {
  flex: 0 0 11rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.2rem;
}
.spec .val { flex: 1 1 16rem; color: var(--plane); }

.status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bloom);
  border: 1px solid var(--bloom-deep);
  padding: 0.25rem 0.7rem;
}

/* ---------- Form ---------- */

form { max-width: 620px; }

.form-group { margin-bottom: 1.4rem; }

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--edge);
  padding: 0.7rem 0.9rem;
}
textarea { min-height: 170px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--bloom);
}

.hidden-field { display: none; }

.form-status { margin-top: 1rem; font-size: 0.95rem; }
.form-status.success { color: var(--bloom); }
.form-status.error { color: var(--danger); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--edge);
  padding: 2.5rem 0;
  background: var(--void);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--bloom); }

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--i, 0) * 60ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--void);
    border-bottom: 1px solid var(--edge);
    padding: 0.5rem 1.5rem 1rem;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: 0.7rem 0; }
  .site-header .container { gap: 1rem; }
  .brand img { height: 1.7rem; }
  .brand span { font-size: 1.4rem; }
  .nav-links a.active::after { display: none; }
  .site-header .container { position: relative; }

  .game-feature { grid-template-columns: 1fr; }
  section { padding: 3.5rem 0; }
  .hero { padding: 4.5rem 0 3.5rem; }
  .spec dt, .spec .key { flex-basis: 100%; }
}
