/* Trucky site stylesheet. One file, no build step.
   Direction: road-marking. Monochrome paper/asphalt palette, one signage-amber accent,
   hairline borders, and one memorable element: the dashed lane line. It runs under the
   hero, down the left of the chat (carrying the step discs 1, 2, 3 and D), through the
   "How it works" steps and along the foot of every page. One dash pattern everywhere.

   Colour tokens are plain hex plus a prefers-color-scheme block, so every browser that
   can lay the page out also gets the colours (no OKLCH or light-dark() dependency). */

/* ---------- Fonts (self-hosted, Latin subset of Geist and Geist Mono) ---------- */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Size-adjusted fallbacks so the swap does not shift layout. */
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 108.6%;
  ascent-override: 92.5%;
  descent-override: 27.2%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Courier New"), local("Liberation Mono"), local("DejaVu Sans Mono");
  size-adjust: 100%;
  ascent-override: 100.5%;
  descent-override: 29.5%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Light: warm paper. */
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f1ed;
  --ink: #171612;
  --ink-2: #54534c;
  --line: #dfdeda;
  --line-strong: #bfbeb9;
  --control-line: #82807a;
  --stage-edge: #1b1a16;

  /* Road-marking / signage amber. Only ever a fill, always with dark ink on top. */
  --accent: #fac123;
  --accent-hover: #ffd039;
  --on-accent: #171612;

  /* The chat stage is asphalt in both schemes. */
  --st-bg: #1b1a16;
  --st-card: #272621;
  --st-line: #3d3c37;
  --st-ink: #f4f3f0;
  --st-ink-2: #b9b8b1;
  --st-paper: #f4f3f0;

  /* One dash pattern for every lane line: 24px dash, 16px gap, 4px thick. */
  --lane-h: repeating-linear-gradient(90deg, var(--accent) 0 24px, transparent 24px 40px);
  --lane-v: repeating-linear-gradient(180deg, var(--accent) 0 24px, transparent 24px 40px);

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --measure: 62ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151411;
    --surface: #1f1e1a;
    --surface-2: #2b2a26;
    --ink: #f4f3f0;
    --ink-2: #b2b1ab;
    --line: #34332f;
    --line-strong: #54524e;
    --control-line: #82807b;
    --stage-edge: #3a3934;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: 1.5rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }

h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
p, dd, li { text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.wrap {
  inline-size: min(100% - 2 * var(--gutter), 72rem);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  inset-inline-start: var(--gutter);
  inset-block-start: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-s);
  font-weight: 500;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* ---------- Header ---------- */
.site-header { padding-block: 1rem; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 2.75rem;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand svg { inline-size: 1.75rem; block-size: 1.75rem; flex: none; }
/* The mark sits on a fixed asphalt tile; a hairline ring keeps it visible on the dark page. */
.brand svg > :first-child { stroke: var(--line-strong); stroke-width: 1; }
.nav { display: flex; align-items: center; gap: clamp(0.75rem, 3vw, 1.75rem); font-size: 0.9375rem; }
.nav a:not(.btn) { display: inline-flex; align-items: center; min-block-size: 2.75rem; text-decoration: none; color: var(--ink-2); }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
.nav a.nav__extra { display: none; }
@media (min-width: 40rem) { .nav a.nav__extra { display: inline-flex; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 3rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  font: inherit;
  font-weight: 550;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn--ghost { border-color: var(--control-line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); text-decoration: none; }
.btn--sm { white-space: nowrap; min-block-size: 2.75rem; padding: 0.4rem 0.9rem; font-size: 0.9375rem; }

/* ---------- Type helpers ---------- */
h1 {
  font-size: clamp(2.25rem, 1.25rem + 4.4vw, 3.875rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 620;
}
h2 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
h3 { font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.012em; }
.lede { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-inline-size: 38rem; }

/* ---------- The lane line (the one memorable element) ---------- */
.lane { block-size: 4px; background: var(--lane-h); }

/* The step disc. Used on the chat messages and again in "How it works". */
.disc {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: var(--disc, 1.75rem);
  block-size: var(--disc, 1.75rem);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 0.8125rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2rem, 5vw, 4rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero__grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
@media (min-width: 62rem) {
  .hero__grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 4.5rem; }
}
.hero__copy > * + * { margin-block-start: 1.5rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block-start: 2rem !important; }
@media (max-width: 29.99rem) { .cta .btn { flex: 1 1 100%; } }

/* ---------- Illustrative chat on an asphalt stage ---------- */
.demo { inline-size: 100%; }
@media (min-width: 30rem) { .demo { max-inline-size: 30rem; margin-inline: 0; } }
@media (min-width: 62rem) { .demo { margin-inline: 0; max-inline-size: none; } }
.demo figcaption { margin-block-start: 0.85rem; font-size: 0.875rem; color: var(--ink-2); }

.stage {
  --pad: 1rem;
  --col: 1.75rem;
  background: var(--st-bg);
  color: var(--st-ink);
  border: 1px solid var(--stage-edge);
  border-radius: var(--radius-l);
  font-size: 0.9375rem;
  line-height: 1.45;
  overflow: hidden;
}
.row { display: grid; grid-template-columns: var(--col) minmax(0, 1fr); column-gap: 0.75rem; align-items: start; }
.stage__head { align-items: center; padding: 0.85rem var(--pad); border-block-end: 1px solid var(--st-line); }
.stage__head svg { inline-size: var(--col); block-size: var(--col); display: block; }
.stage__head strong { display: block; font-weight: 600; line-height: 1.2; }
.stage__head span { font-size: 0.8125rem; color: var(--st-ink-2); }

.stage__body { position: relative; display: grid; gap: 0.875rem; padding: 1.1rem var(--pad) 1.25rem; }
/* The lane: a vertical road marking behind the discs. */
.stage__body::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: calc(var(--pad) + var(--col) / 2 - 2px);
  inline-size: 4px;
  background: var(--lane-v);
}
.stage .disc { position: relative; box-shadow: 0 0 0 4px var(--st-bg); }
.discs { display: grid; gap: 0.875rem; justify-items: center; align-content: start; padding-block-start: 0.5rem; }

.bubble { min-inline-size: 0; border-radius: 14px; }
.bubble--user {
  justify-self: end;
  max-inline-size: 88%;
  padding: 0.55rem 0.7rem 0.45rem;
  background: var(--st-paper);
  color: var(--on-accent);
  border-end-end-radius: 4px;
}
.bubble--user .time { display: block; margin-block-start: 0.25rem; font-size: 0.75rem; font-variant-numeric: tabular-nums; color: #54534c; text-align: end; }
.bubble--user p { padding-block-end: 0.1rem; }
.pod { display: block; inline-size: min(100%, 15rem); block-size: auto; border-radius: 8px; }

/* Tool-result style card */
.card {
  justify-self: start;
  max-inline-size: 100%;
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  background: var(--st-card);
  border: 1px solid var(--st-line);
  border-radius: 14px;
  border-end-start-radius: 4px;
  min-inline-size: 11.5rem;
}
.card__title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.card__title svg { inline-size: 1.25rem; block-size: 1.25rem; flex: none; }
.card dl { display: grid; border-block-start: 1px solid var(--st-line); }
.card dl > div { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.35rem; border-block-end: 1px solid var(--st-line); }
.card dl > div:last-child { border-block-end: 0; padding-block-end: 0; }
.card dt { color: var(--st-ink-2); }
.card dd { font-family: var(--mono); font-size: 0.875rem; text-align: end; }

@media (max-width: 29.99rem) {
  /* Edge to edge on phones so the chat keeps a readable width next to the lane. */
  .demo { margin-inline: calc(-1 * var(--gutter)); inline-size: auto; }
  .demo figcaption { padding-inline: var(--gutter); }
  .stage { --pad: var(--gutter); border-radius: 0; border-inline: 0; }
  .stage .row { column-gap: 0.625rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 6rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--rule { border-block-start: 1px solid var(--line); }
.section__head { display: grid; gap: 1rem; max-inline-size: 44rem; margin-block-end: clamp(2rem, 5vw, 3.5rem); }

/* How it works: steps joined by the same lane line */
.route { container-type: inline-size; --gap: 2.5rem; --disc: 2.75rem; }
.steps { list-style: none; padding: 0; display: grid; gap: var(--gap); }
.step { position: relative; padding-inline-start: 4.25rem; }
.step__n { position: absolute; inset-block-start: 0; inset-inline-start: 0; z-index: 1; font-size: 1.25rem; }
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-inline-start: calc(var(--disc) / 2 - 2px);
  inset-block-start: calc(var(--disc) / 2);
  inline-size: 4px;
  block-size: calc(100% + var(--gap));
  background: var(--lane-v);
  transform-origin: top;
}
.step h3 { padding-block-start: 0.5rem; font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.02em; }
.step p { margin-block-start: 0.5rem; color: var(--ink-2); max-inline-size: 30rem; }

@container (min-width: 54rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step { padding-inline-start: 0; padding-block-start: 4rem; }
  .step:not(:last-child)::before {
    inset-inline-start: calc(var(--disc) / 2);
    inset-block-start: calc(var(--disc) / 2 - 2px);
    inline-size: calc(100% + var(--gap));
    block-size: 4px;
    background: var(--lane-h);
    transform-origin: left;
  }
  .step h3 { padding-block-start: 0; }
}

/* Diesel gets parity with the steps: same disc as in the chat. */
.diesel {
  --disc: 2.75rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  align-items: start;
  margin-block-start: clamp(2.5rem, 5vw, 3.5rem);
  padding: 1.5rem 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
}
.diesel .disc { grid-row: span 2; font-size: 1.25rem; }
.diesel h3 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.02em; padding-block-start: 0.5rem; }
.diesel p { color: var(--ink-2); max-inline-size: 36rem; }

/* Who it is for + at a glance */
.who { display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
@media (min-width: 62rem) { .who { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5rem; align-items: center; } }
.who__roles { display: grid; gap: 2rem; align-content: start; }
.who__roles h3 { margin-block-end: 0.4rem; }
.who__roles p { color: var(--ink-2); max-inline-size: var(--measure); }
.glance { border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface); }
.glance h3 { padding: 1rem 1.25rem; border-block-end: 1px solid var(--line); }
.glance dl > div { display: grid; gap: 0.15rem 1.5rem; padding: 0.9rem 1.25rem; border-block-end: 1px solid var(--line); }
.glance dl > div:last-child { border-block-end: 0; }
.glance dt { font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.glance dd { overflow-wrap: anywhere; }
@media (min-width: 36rem) { .glance dl > div { grid-template-columns: 9.5rem minmax(0, 1fr); align-items: baseline; } }

/* Privacy strip */
.trust { background: var(--surface); border-block: 1px solid var(--line); }
.trust__grid { display: grid; gap: 1.5rem 4rem; align-items: start; }
@media (min-width: 52rem) { .trust__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.trust p { color: var(--ink-2); max-inline-size: var(--measure); }
.trust p + p { margin-block-start: 1rem; }
.trust a:not(.btn) { color: var(--ink); text-decoration-color: var(--ink); }
.trust .btn { margin-block-start: 1.5rem; }

/* Contact */
.contact__mail {
  display: inline-block;
  margin-block-start: 1rem;
  font-size: clamp(1.25rem, 0.8rem + 2.4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 4px;
  text-underline-offset: 0.2em;
}
.contact__mail:hover { text-decoration-thickness: 6px; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 2rem 2rem; font-size: 0.9375rem; color: var(--ink-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; padding-block-start: 1.5rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.site-footer a { color: var(--ink); }
.site-footer nav a { display: inline-flex; align-items: center; min-block-size: 2.75rem; }
.site-footer .brand { font-size: 1.0625rem; }

/* ---------- Privacy policy page ---------- */
.policy { padding-block: clamp(2rem, 6vw, 5rem) clamp(3rem, 8vw, 6rem); }
.policy__head { max-inline-size: 48rem; padding-block-end: clamp(2rem, 4vw, 3rem); }
.policy__head h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem); }
.policy__meta { margin-block-start: 0.9rem; font-size: 0.9375rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.policy__lead { margin-block-start: 1.75rem; font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem); line-height: 1.55; max-inline-size: 40rem; }
.policy__rows { border-block-start: 1px solid var(--line-strong); }
.policy__row { display: grid; gap: 0.5rem 3rem; padding-block: 1.6rem; border-block-end: 1px solid var(--line); }
.policy__row h2 { font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.012em; }
.policy__row p { max-inline-size: var(--measure); }
@media (min-width: 52rem) { .policy__row { grid-template-columns: 15rem minmax(0, 1fr); } }
/* Below 52rem each row runs on, so it reads like the source "Label: text" form. */
@media (max-width: 51.99rem) {
  .policy__row { display: block; padding-block: 1.25rem; }
  .policy__row h2 { display: inline; font-size: 1.0625rem; }
  .policy__row h2::after { content: ":"; }
  .policy__row p { display: inline; }
}
.policy__row a { text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.policy__row a:hover { text-decoration-thickness: 4px; }

/* ---------- 404 ---------- */
.lost { padding-block: clamp(3rem, 10vw, 8rem); }
.lost p { margin-block-start: 1.25rem; color: var(--ink-2); max-inline-size: 34rem; }
/* 8 dashes, ends on a full dash: 8 * 40px - 16px */
.lost .lane { inline-size: 304px; max-inline-size: 100%; margin-block-start: 2rem; }
.lost .cta { margin-block-start: 2rem !important; }

/* ---------- Touch targets ---------- */
@media (pointer: coarse) {
  .glance dd a, .contact__mail, .policy__row:last-child p > a {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
  }
}

/* ---------- Motion (progressive enhancement only; no looping animation anywhere) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Cross-document view transition between / and /privacy */
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  .site-footer { view-transition-name: site-footer; }
  ::view-transition-group(root) { animation-duration: 0.22s; }
  ::view-transition-old(root) { animation-timing-function: cubic-bezier(0.3, 0, 1, 1); }
  ::view-transition-new(root) { animation-timing-function: cubic-bezier(0, 0, 0, 1); }

  /* The lane line draws itself as each step scrolls in. Fully visible without it. */
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes draw-y { from { scale: 1 0; } to { scale: 1 1; } }
    @keyframes draw-x { from { scale: 0 1; } to { scale: 1 1; } }
    .step:not(:last-child)::before {
      animation: draw-y linear both;
      animation-timeline: view();
      animation-range: entry 30% cover 55%;
    }
    @container (min-width: 54rem) {
      .step:not(:last-child)::before {
        animation-name: draw-x;
        animation-range: entry 20% cover 45%;
      }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Windows high contrast / forced colours: keep boundaries and the accent legible. */
@media (forced-colors: active) {
  .btn--primary, .disc { border: 1px solid ButtonText; }
  .lane, .step::before, .stage__body::before { forced-color-adjust: none; }
}
