/**
 * The home page and the features page (index.html, features.html).
 *
 * Moved out of index.html when the features page split off it, so the two share
 * one sheet. The header is styled by site-header.css, not here.
 */
@font-face {
  font-family: "Black Ops One";
  src: url("BlackOpsOne.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #DED6C0;
  --surface: #D3C9AE;
  --card: #E8E1CE;
  --card-alt: #C9BD9C;
  --border: #B3A688;
  --border-strong: #7E7458;
  --ink: #1E2A1C;
  --ink-2: #3F4739;
  --accent: #8A2E12;
  --accent-dark: #6B2210;
  --on-accent: #F2EDDF;
  --accent-text: #8A2E12;
  --z1: #7C8079; --z2: #456B7E; --z3: #4F7550; --z4: #96762A; --z5: #A32A1B;
  --grid: rgba(30, 42, 28, 0.08);
  --scrim: rgba(11, 13, 11, 0.82);
  /* Contour ink. Olive on sand; see the dark block for why it is not the
     same color turned up. */
  --topo-ink: #7E7458;
  --topo-faint: 0.22;
  --topo-strong: 0.3;
  --display: "Black Ops One", system-ui, sans-serif;
  --body: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0D0B;
    --surface: #141A12;
    --card: #1E2A1C;
    --card-alt: #27331F;
    --border: #35402F;
    --border-strong: #5A6650;
    --ink: #E4DDC8;
    --ink-2: #A99F84;
    --accent: #C2F53F;
    --accent-dark: #9BC72F;
    --on-accent: #0B0D0B;
    --accent-text: #E4DDC8;
    --z1: #8A9086; --z2: #5E90AC; --z3: #7FA26B; --z4: #C7A03F; --z5: #D9553C;
    --grid: rgba(228, 221, 200, 0.05);
    /**
     * Dark mode gets its own ink, not the same color turned up.
     *
     * The olive that works on sand sits too close to near-black to register.
     * Tritium — what the dark theme already swaps the accent to — lifts off
     * black the way nothing else in the palette does, and tritium is what
     * glows on iron sights in the dark, which is a reasonable thing for a map
     * to be drawn in at night. It carries far more contrast, so the opacity
     * comes down to compensate: same apparent weight, different hue.
     */
    --topo-ink: #C2F53F;
    --topo-faint: 0.16;
    --topo-strong: 0.26;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.sub {
  color: var(--ink-2);
  max-width: 58ch;
  margin-top: 14px;
  font-size: 1.06rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 2px;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- brand (footer) ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand svg { flex: none; }

/* ---------- contour ground ---------- */
/**
 * Real ground behind the whole site, matching the app.
 *
 * These are contours traced from SRTM elevation data over Takur Ghar — the
 * same survey the app draws from, in src/lib/terrain.ts. It replaces the
 * graph-paper grid the hero used to carry: an app about land navigation
 * should not advertise itself over squared paper, and the app stopped having
 * one.
 *
 * Fixed to the viewport rather than sized to a section, so the page scrolls
 * over the ground instead of dragging it along — which is how it behaves in
 * the app, where the layer sits behind every screen and the cards stack on
 * top. `z-index: -1` puts it above the page background and below everything
 * else, so no content needs its own stacking rule to stay clear of it.
 *
 * The app rotates through six sites daily. This is fixed on one, because
 * carrying all six would add about 50 kB of path data to a page that has no
 * build step to strip it, and a visitor sees one backdrop per visit anyway.
 */
.topo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}
/* `slice` is the SVG spelling of background-size: cover. The data is a unit
   square because the ground was a square box — three kilometers a side —
   so stretching it to a viewport's aspect ratio would make a real hillside
   steeper than it is. Cover keeps the proportions and crops instead. */
.topo polyline {
  fill: none;
  stroke: var(--topo-ink);
  stroke-width: 1;
  opacity: var(--topo-faint);
  /* Without this the stroke scales with the viewBox and thickens on a wide
     screen, which turns faint contours into a cage. */
  vector-effect: non-scaling-stroke;
}
/* Every fifth path heavier, for depth rather than meaning — a real index
   contour is every fifth *level*, and these paths are not grouped that way.
   The app says the same thing in the same words. */
.topo polyline.heavy { stroke-width: 1.5; opacity: var(--topo-strong); }

/**
 * The bands that used to be flat color now let the ground through.
 *
 * A fixed layer behind opaque sections is a layer you see in the hero and
 * nowhere else. The app hit the same problem and solved it the same way —
 * its card colors carry alpha so the contours read faintly through rather
 * than being hidden by the thing stacked on them.
 *
 * The cards go further than the full-width bands. A card is a small shape
 * with ground on every side of it, so it reads as pasted on unless the same
 * ground runs under it; a band spans the page and only has to avoid looking
 * like a hard cut. Body text sits on the card at 68% against a contour line
 * at 0.22 opacity, which is a far smaller contrast cost than it sounds.
 */
/**
 * The alpha lives on each original rule further down this sheet, not here.
 *
 * A block at this point in the file loses to the untouched `.stats`/`.card`
 * rules below it — same specificity, later wins — and the page still looks
 * roughly right because the contours show in the gaps between sections. Only
 * the computed background gives it away.
 *
 * Each of those rules now carries the opaque color and then the mixed one.
 * That is not redundancy: a browser without `color-mix` drops the whole
 * declaration rather than degrading it, which would leave the element with no
 * background at all and text sitting straight on the contours.
 */

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--border); }
.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 48px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 80px;
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
.hero h1 em {
  font-style: normal;
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.14em;
}
.hero .sub { font-size: 1.13rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-photo {
  border: 1px solid var(--border-strong);
  outline: 1px solid var(--border);
  outline-offset: 6px;
  position: relative;
  overflow: hidden;
}
.hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: grayscale(1) contrast(1.08); }
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(138, 46, 18, 0.2), rgba(11, 13, 11, 0.35));
  mix-blend-mode: multiply;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; }
  .hero-photo { display: none; }
}

/* ---------- stat band ---------- */
.stats {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
}
.stat { padding: 26px 8px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat b { display: block; font-family: var(--mono); font-size: 2rem; font-weight: 600; }
.stat span { color: var(--ink-2); font-size: 0.92rem; }
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}

section { padding: 88px 0; }
section + section { border-top: 1px solid var(--border); }

/* ---------- pipelines ---------- */
.schools {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.school {
  border: 1px solid var(--border);
  background: var(--card);
  background: color-mix(in srgb, var(--card) 45%, transparent);
  padding: 18px 18px 16px;
  transition: border-color 0.15s ease;
}
.school:hover { border-color: var(--border-strong); }
.school b { display: block; font-family: var(--mono); font-size: 1.15rem; letter-spacing: 0.02em; }
.school span { color: var(--ink-2); font-size: 0.88rem; }
@media (max-width: 860px) { .schools { grid-template-columns: repeat(2, 1fr); } }
/* The five commissioning routes are their own row, so they get their own
   track count rather than leaving an orphan card on a four-wide grid. */
.schools-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1040px) { .schools-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .schools-5 { grid-template-columns: repeat(2, 1fr); } }
.group-label {
  margin-top: 30px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- tracking bento ---------- */
.bento {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.cell {
  border: 1px solid var(--border);
  background: var(--card);
  background: color-mix(in srgb, var(--card) 45%, transparent);
  padding: 24px;
}
.cell h3 { font-size: 1.08rem; margin-bottom: 8px; }
.cell p { color: var(--ink-2); font-size: 0.97rem; }
.cell-photo {
  grid-column: span 7;
  position: relative;
  overflow: hidden;
  padding: 0;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
}
.cell-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.cell-photo .cap {
  position: relative;
  width: 100%;
  padding: 40px 24px 22px;
  background: linear-gradient(transparent, var(--scrim) 62%);
}
.cell-photo .cap h3, .cell-photo .cap p { color: #E4DDC8; }
.cell-photo .cap p { color: #C9BD9C; }
.cell-hr { grid-column: span 5; background: var(--card-alt); }
.zonebar { display: flex; height: 14px; margin: 14px 0 6px; }
.zonebar i { flex: 1; }
.zonebar i:nth-child(1) { background: var(--z1); }
.zonebar i:nth-child(2) { background: var(--z2); }
.zonebar i:nth-child(3) { background: var(--z3); }
.zonebar i:nth-child(4) { background: var(--z4); }
.zonebar i:nth-child(5) { background: var(--z5); }
.zonelabels { display: flex; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); margin-bottom: 10px; }
.zonelabels i { flex: 1; font-style: normal; text-align: center; }
.cell-4 { grid-column: span 4; }
@media (max-width: 860px) {
  .cell-photo, .cell-hr, .cell-4 { grid-column: span 12; }
  .cell-photo { min-height: 240px; }
}

/* ---------- land nav ---------- */
.landnav-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 48px;
  align-items: center;
  margin-top: 40px;
}
.landnav-photo {
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
}
.landnav-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.landnav-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(74, 107, 69, 0.28), rgba(11, 13, 11, 0.3));
  mix-blend-mode: multiply;
}
.landnav-copy p + p { margin-top: 14px; }
.landnav-copy p { color: var(--ink-2); }
.landnav-copy p strong { color: var(--ink); }
.school-callout {
  margin-top: 26px;
  border-left: 3px solid var(--accent);
  background: var(--card);
  background: color-mix(in srgb, var(--card) 45%, transparent);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}
.school-callout h3 { font-size: 1.05rem; margin-bottom: 6px; }
.school-callout p { font-size: 0.97rem; }
@media (max-width: 860px) {
  .landnav-grid { grid-template-columns: 1fr; gap: 28px; }
  .landnav-photo img { aspect-ratio: 16 / 10; }
}

/* ---------- plans ---------- */
.plans-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 14px;
  margin-top: 40px;
}
.plan-featured {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--card);
  background: color-mix(in srgb, var(--card) 45%, transparent);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.plan-featured h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.plan-featured p { color: var(--ink-2); margin-top: 10px; }
.plan-featured .tag { font-family: var(--mono); font-size: 0.82rem; color: var(--accent-text); }
.plan-clusters { display: grid; gap: 14px; }
.cluster { border: 1px solid var(--border); background: var(--card);
  background: color-mix(in srgb, var(--card) 45%, transparent); padding: 22px 24px; }
.cluster h3 { font-size: 1.02rem; margin-bottom: 10px; }
.cluster ul {
  list-style: none;
  columns: 2;
  column-gap: 28px;
  color: var(--ink-2);
  font-size: 0.97rem;
}
.cluster li { padding: 3px 0; break-inside: avoid; }
.cluster .note { margin-top: 12px; color: var(--ink-2); font-size: 0.9rem; }
@media (max-width: 860px) {
  .plans-grid { grid-template-columns: 1fr; }
  .cluster ul { columns: 1; }
}

/* ---------- watch / sync ---------- */
.sync-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
  margin-top: 26px;
}
.sync {
  border-top: 1px solid var(--border-strong);
  padding: 20px 0 30px;
}
.sync h3 { font-size: 1.05rem; margin-bottom: 6px; }
.sync p { color: var(--ink-2); font-size: 0.97rem; }
@media (max-width: 720px) { .sync-grid { grid-template-columns: 1fr; } }

/* ---------- faq ---------- */
.faq { margin-top: 40px; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: block;
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 20px 48px 20px 0;
  font-weight: 700;
  font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 10px;
  top: 18px;
  font-family: var(--mono);
  font-size: 1.45rem;
  line-height: 1;
  color: var(--accent-text);
}
.faq details[open] summary::after { content: "\2013"; }
.faq summary:hover { color: var(--accent-text); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.faq .answer { color: var(--ink-2); max-width: 76ch; padding: 0 48px 24px 0; }
.faq .answer p + p { margin-top: 12px; }
.faq .answer a { color: var(--accent-text); }

/* ---------- download ---------- */
.download { background: var(--surface);
  background: color-mix(in srgb, var(--surface) 72%, transparent); }
.dl-status {
  color: var(--ink-2); max-width: 62ch; margin: 0 auto 22px; text-align: center;
}
.dl-status.founding {
  color: var(--ink); border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 16px 20px; max-width: 68ch;
}

.dl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 40px;
}
.dl {
  border: 1px solid var(--border);
  background: var(--card);
  background: color-mix(in srgb, var(--card) 45%, transparent);
  padding: 30px;
}
.dl h3 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.dl p { color: var(--ink-2); margin: 12px 0 22px; }
.dl .fine { font-size: 0.85rem; margin: 14px 0 0; }

/* The Android beta switch.
   The whole section carries `android-pending` until open testing is live.
   Removing that one word from the <section> tag flips every piece of copy
   at once — the lede and the Android card together — so the page cannot
   end up half-announced, which is what a hand-uncommented block invites.
   Nothing here needs a build step or any JavaScript. */
.android-pending .when-live { display: none; }
.download:not(.android-pending) .when-pending { display: none; }
@media (max-width: 720px) { .dl-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 44px 0 56px; }
.foot-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-legal { margin-top: 26px; color: var(--ink-2); font-size: 0.85rem; max-width: 72ch; }
.foot-legal p + p { margin-top: 6px; }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(14px); transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

/* ---------- linked cards (home) ---------- */
/* The pipeline tiles and feature cards on the home page are links into the
   pricing and features pages, so the whole card is the target. */
a.school, a.feature-card { text-decoration: none; color: inherit; display: block; }
a.school:hover, a.feature-card:hover { border-color: var(--accent); }
a.school:focus-visible, a.feature-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.feature-card { display: flex; flex-direction: column; }
.feature-card p { flex: 1; }
.feature-card .more {
  display: inline-block; margin-top: 12px; font-weight: 700; font-size: 0.9rem; color: var(--accent-text);
}
#pipelines .hero-ctas { margin-top: 26px; }
.sub a { color: var(--accent-text); }

/* ---------- features page ---------- */
.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.jump a {
  font-size: 0.88rem; font-weight: 600; text-decoration: none; color: var(--ink);
  border: 1px solid var(--border-strong); padding: 7px 12px; border-radius: 2px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
.jump a:hover { border-color: var(--ink); }
section[id] { scroll-margin-top: 64px; }
.feature-grid { grid-template-columns: repeat(4, 1fr); gap: 0 28px; }
@media (max-width: 1000px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .feature-grid { grid-template-columns: 1fr; } }
