/* Two Lane — the shared layer.
 *
 * Tokens, chrome, buttons, and the phone component. Every page loads this;
 * page-specific choreography lives beside it in its own sheet so two type
 * ramps never fight over the same class names.
 *
 * The palette is the app's, and the two load-bearing rules come with it:
 * green only ever means open or accurate, and the mono face is for numerals
 * only — never words, never labels.
 */

:root {
  --ground: #FAF6EF;
  --surface: #FFFFFF;
  --sunken: #F2EDE3;
  --border: #E7E0D4;
  --border-firm: #D7CFC1;

  --ink: #17171C;
  --ink-2: #3D3A35;
  --muted: #6B6760;

  --action: #2340B8;
  --action-wash: #E4E9F7;
  --deep: #16255E;
  --deeper: #0B1330;
  --gold: #FFB020;
  --green: #14783C;
  --green-lit: #6FE39B;
  --cherry: #C62828;

  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --body: 'Karla', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --shell: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E0D13;
    --surface: #18171F;
    --sunken: #141319;
    --border: #2A2833;
    --border-firm: #3A3745;
    --ink: #F4F1EA;
    --ink-2: #D3CEC5;
    --muted: #948E86;
    --action: #93A9EE;
    --action-wash: #1B2340;
    --deep: #0D1734;
    --deeper: #070C1F;
  }
}
:root[data-theme="dark"] {
  --ground: #0E0D13;
  --surface: #18171F;
  --sunken: #141319;
  --border: #2A2833;
  --border-firm: #3A3745;
  --ink: #F4F1EA;
  --ink-2: #D3CEC5;
  --muted: #948E86;
  --action: #93A9EE;
  --action-wash: #1B2340;
  --deep: #0D1734;
  --deeper: #070C1F;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 660px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(42px, 8vw, 88px); line-height: 0.97; text-wrap: balance; }
h2 { font-size: clamp(31px, 5vw, 54px); line-height: 1.02; text-wrap: balance; }
h3 { font-size: 24px; line-height: 1.15; }
h4 { font-size: 19px; line-height: 1.2; }
p { margin: 0 0 16px; }
a { color: var(--action); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.eyebrow {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.lede { font-size: 19px; color: var(--ink-2); max-width: 56ch; }

/* ------------------------------------------------------------------ nav */

.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.solid { border-bottom-color: var(--border); }
.nav .row {
  max-width: var(--shell); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: 0.05em; font-size: 14.5px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.nav nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 600;
  padding: 8px 12px; border-radius: 999px;
}
.nav nav a:hover { background: var(--sunken); color: var(--ink); }
.nav nav a[aria-current="page"] { color: var(--action); }

/* on the homepage the nav floats over the dark hero until you scroll */
.nav.over-hero { background: transparent; }
.nav.over-hero .brand, .nav.over-hero nav a { color: #F6F2EA; }
.nav.over-hero nav a:hover { background: rgba(255,255,255,0.14); color: #fff; }

@media (max-width: 620px) {
  .nav nav a { padding: 8px 9px; font-size: 13.5px; }
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 52px; padding: 0 26px; border-radius: 13px;
  background: var(--action); color: #FAF6EF;
  font-weight: 700; font-size: 15.5px; text-decoration: none; border: none;
  font-family: var(--body); cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-firm); }
.btn.light { background: #FAF6EF; color: var(--deep); }
.btn.onDark { background: transparent; color: #F6F2EA; border: 1px solid rgba(246,242,234,0.4); }

/* ------------------------------------------------------- phone component
 *
 * A device drawn in markup rather than screenshotted. It stays sharp at any
 * size, carries no simulator chrome, and updates when the app's tokens do.
 * .deck gives a parent 3D space; .phone can then be rotated in it.
 */

.deck { perspective: 1400px; perspective-origin: 50% 45%; }

.phone {
  position: relative;
  width: 100%; max-width: 268px; aspect-ratio: 268 / 552;
  border-radius: 38px;
  background: linear-gradient(160deg, #2A2833, #14131A 60%);
  padding: 9px;
  box-shadow:
    0 2px 0 rgba(255,255,255,0.10) inset,
    0 30px 60px rgba(12,10,20,0.30),
    0 6px 16px rgba(12,10,20,0.18);
  transform-style: preserve-3d;
}
.phone::after {
  content: ""; position: absolute; left: 50%; top: 15px; translate: -50% 0;
  width: 74px; height: 20px; border-radius: 999px; background: #0B0A10; z-index: 3;
}
.phone .screen {
  position: relative; height: 100%; border-radius: 30px; overflow: hidden;
  background: var(--ground); display: flex; flex-direction: column;
  padding: 34px 13px 13px; gap: 9px;
}
.phone.tall { max-width: 300px; }

/* miniature app chrome — mirrors the real tokens */
.m-title { font-family: var(--display); font-size: 20px; color: var(--ink); line-height: 1.1; }
.m-eyebrow { font-size: 8.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.m-row { display: flex; align-items: center; gap: 7px; }
.m-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.m-chip {
  font-size: 9.5px; font-weight: 700; padding: 4px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap;
}
.m-chip.on { background: var(--action); border-color: var(--action); color: #FAF6EF; }
.m-card {
  border-radius: 11px; background: var(--surface); border: 1px solid var(--border);
  padding: 9px 10px;
}
.m-card.deep { background: var(--deep); border-color: transparent; color: #F6F2EA; }
.m-card.warn { background: #FBE7E7; border-color: #F0C9C9; }
.m-name { font-weight: 700; font-size: 11.5px; line-height: 1.25; }
.m-sub { font-size: 9.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.m-card.deep .m-sub { color: #A9BCF0; }
.m-open { font-weight: 700; color: var(--green); display: inline-flex; align-items: center; gap: 4px; }
.m-open i { width: 5px; height: 5px; border-radius: 999px; background: #1B9E4B; display: block; }
.m-bar { height: 3.5px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 6px; }
.m-bar i { display: block; height: 100%; background: var(--green); }
.m-btn {
  margin-top: 8px; height: 29px; border-radius: 8px; background: var(--ground);
  color: var(--deep); font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.m-btn.cobalt { background: var(--action); color: #FAF6EF; }
.m-thumb { width: 34px; height: 34px; border-radius: 8px; flex: none; background: var(--action-wash); }
.m-step { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; font-weight: 700; }
.m-step .pm { display: flex; align-items: center; gap: 6px; }
.m-step .pm b { width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; background: var(--action); color: #FAF6EF; font-size: 12px; }
.m-step .pm s { text-decoration: none; font-family: var(--mono); }
.m-big { font-family: var(--mono); font-size: 27px; line-height: 1; }
.m-tabs {
  margin-top: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.m-tabs i { height: 3px; border-radius: 999px; background: var(--border); display: block; }
.m-tabs i.on { background: var(--action); }
.m-hero {
  height: 74px; border-radius: 10px; margin: -2px 0 2px;
  background: linear-gradient(135deg, #E8EEFB, #CFE0D4);
  position: relative; overflow: hidden;
}
.m-hero.photo { background-size: cover; background-position: center; }

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

.foot { border-top: 1px solid var(--border); margin-top: 0; background: var(--sunken); }
.foot .row {
  max-width: var(--shell); margin: 0 auto; padding: 46px 24px 56px;
  display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.foot h5 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-family: var(--body); }
.foot a { display: block; color: var(--ink-2); text-decoration: none; font-size: 14.5px; padding: 4px 0; }
.foot a:hover { color: var(--action); }
.foot .fine { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

.note {
  max-width: var(--shell); margin: 0 auto; padding: 16px 24px 40px;
  color: var(--muted); font-size: 13px;
}

/* ----------------------------------------------------------- animations
 * Everything starts from a visible state. No element is parked at opacity 0
 * waiting on a scroll observer — a slow connection or an unsupported browser
 * must still show a finished page.
 */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .rise { animation: rise linear both; animation-timeline: view(block); animation-range: entry 6% cover 32%; }
    @keyframes rise { from { transform: translateY(28px); } to { transform: translateY(0); } }

    .liftIn { animation: liftIn linear both; animation-timeline: view(block); animation-range: entry 0% cover 40%; }
    @keyframes liftIn {
      from { transform: perspective(1200px) translateY(40px) rotateX(9deg) scale(0.955); }
      to   { transform: perspective(1200px) translateY(0) rotateX(0deg) scale(1); }
    }
  }
}

/* ---------------------------------------------------------------- the map
   A drawn basemap, not a tile layer. Three reasons, in order: the CSP
   forbids fetching anything from a map host, a real tile bill to decorate
   a marketing page is absurd, and the app's basemap is a deliberate style
   — land, fields, water, three road weights, no POI — which an off-the-
   shelf tile set would misrepresent. What is drawn here is what ships. */
.mapsec { padding: clamp(72px, 11vh, 116px) 0; background: var(--surface); border-top: 1px solid var(--border); }
.mapsec .lede { margin-top: 16px; }

.mapwrap {
  margin-top: 34px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: stretch;
}
@media (max-width: 900px) { .mapwrap { grid-template-columns: 1fr; } }

.mapcanvas {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-firm);
  background: var(--m-land);
  aspect-ratio: 16 / 10;
  box-shadow: 0 24px 48px rgba(23,23,28,0.10);
}
@media (max-width: 900px) { .mapcanvas { aspect-ratio: 4 / 3; } }
.mapcanvas > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

:root {
  --m-land:  #F1EDE4;
  --m-field: #DFE9D9;
  --m-water: #CFDCF5;
  --m-road:  #FFFFFF;
  --m-case:  #E4DCCC;
  --m-label: #8A857C;
}
:root[data-theme="dark"] {
  --m-land:  #16151C;
  --m-field: #17201A;
  --m-water: #131B2E;
  --m-road:  #2E2C38;
  --m-case:  #232130;
  --m-label: #7C776F;
}

/* Pins. A pin carries a glyph so the map is readable BEFORE you tap
   anything — a field of identical teardrops tells you nothing. */
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: grid; justify-items: center; gap: 1px;
  background: none; border: 0; padding: 0; cursor: pointer;
  transition: transform .22s cubic-bezier(.22,.61,.36,1);
}
.pin:hover { transform: translate(-50%, -100%) scale(1.09); }
.pin[aria-pressed="true"] { transform: translate(-50%, -100%) scale(1.2); z-index: 3; }
.pin .disc {
  width: 46px; height: 46px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
/* Green is status, never brand — it appears here only because open IS a
   status, and nowhere else on this page. */
.pin.open  .disc { border: 3px solid #1B9E4B; }
.pin.shut  .disc { border: 3px solid var(--border-firm); opacity: .74; }
.pin[aria-pressed="true"] .disc { border-color: var(--action); border-width: 4px; }
.pin .tail { width: 3px; height: 9px; border-radius: 2px; background: #1B9E4B; }
.pin.shut .tail { background: var(--border-firm); }
.pin[aria-pressed="true"] .tail { background: var(--action); }
.pin .shut-tag {
  font-size: 9px; font-weight: 700; color: var(--muted);
  background: var(--ground); padding: 0 4px; border-radius: 3px;
}
.pin:focus-visible { outline: 3px solid var(--action); outline-offset: 4px; border-radius: 999px; }

/* Where you are. Deliberately not a pin — you are not a stand. */
.mehere {
  position: absolute; transform: translate(-50%, -50%);
  width: 15px; height: 15px; border-radius: 999px;
  background: var(--action); border: 3px solid var(--surface);
  box-shadow: 0 0 0 6px rgba(35,64,184,0.16);
}

/* The card that does the talking. A callout cannot hold a price, a stock
   count and an accuracy meter without becoming a screen of its own. */
.mapcard {
  border-radius: 18px; border: 1px solid var(--border);
  background: var(--ground); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.mapcard .who { font-size: 19px; font-weight: 700; line-height: 1.2; }
/* Not ".status" — page.css already owns that for the contact form, where
   it is display:none until a submit fills it in. */
.mapcard .mline { font-size: 13.5px; color: var(--muted); }
.mapcard .mline .lit { color: var(--green); font-weight: 700; }
.mapcard .mline i {
  display: inline-block; width: 7px; height: 7px; border-radius: 999px;
  background: #1B9E4B; margin-right: 5px; vertical-align: 1px;
}
.mapcard .goods { display: flex; flex-wrap: wrap; gap: 6px; }
.mapcard .goods span {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--action-wash); color: var(--deep);
}
:root[data-theme="dark"] .mapcard .goods span { color: var(--ink); }
.mapcard .meterrow { margin-top: 2px; display: flex; align-items: center; gap: 9px; }
.mapcard .meter { flex: 1; height: 5px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.mapcard .meter i { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width .3s ease; }
.mapcard .meter i.low { background: var(--cherry); }
.mapcard .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.mapnote { margin-top: 16px; font-size: 13.5px; color: var(--muted); max-width: 62ch; }

/* SVG presentation attributes do NOT resolve var() in Chromium — a
   fill="var(--m-land)" silently falls back to the initial value, which is
   black, and the whole basemap paints as a black rectangle. These have to be
   real CSS rules. */
.mapcanvas .m-land  { fill: var(--m-land); }
.mapcanvas .m-field { fill: var(--m-field); }
.mapcanvas .m-water { stroke: var(--m-water); }
.mapcanvas .m-case  { stroke: var(--m-case); }
.mapcanvas .m-road  { stroke: var(--m-road); }
.mapcanvas .m-label { fill: var(--m-label); }
.mapcanvas .m-waterlabel { fill: #4A6491; }
:root[data-theme="dark"] .mapcanvas .m-waterlabel { fill: #6C86BE; }
