/* Itharium / Nalaro site ("Trailhead", docs/design/web-pass-2). Plain CSS: no build step, no scripts, nothing from
   another origin. Colour roles are the Nalaro app's v4 tokens (app/src/ui/theme.tsx), dark first, as in the app.
   Rules carried over from the app: amber is the one action on a view; the pages never use red (it appears only inside
   app screenshots); links are never amber; contour brown is for source lines and the route drawing, never a control. */

@font-face {
  font-family: "Besley";
  src: url("fonts/Besley-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #111312;
  --surface: #191C1A;
  --surface-2: #212522;
  --line: #2F3430;
  --line-strong: #727A74;
  --text: #EDEEEA;
  --muted: #B3B8B2;
  --contour: #C99B6C;
  --contour-faint: #4A3E31;
  --amber: #F5C451;
  --amber-hover: #F8D06E;
  --on-amber: #111312;
  --amber-edge: #F5C451;
  --star: #F5C451;
  --star-edge: #F5C451;
  --focus: #FFFFFF;
  --shadow: 0 1.75rem 3rem -1.5rem rgba(0, 0, 0, 0.7);
  --device-rim: #5A615C;

  --display: "Besley", "Sitka Heading", "Sitka Text", Georgia, "Times New Roman", serif;
  --sans: Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F5F6F3;
    --surface: #FFFFFF;
    --surface-2: #ECEEE8;
    --line: #D5D9D1;
    --line-strong: #80877F;
    --text: #161816;
    --muted: #4A504A;
    --contour: #87582A;
    --contour-faint: #E3D3C0;
    --amber: #F2B41B;
    --amber-hover: #F6C23F;
    --on-amber: #1A1400;
    --amber-edge: #8C6500;
    --star: #F2B41B;
    --star-edge: #8C6500;
    --focus: #000000;
    --shadow: 0 1.75rem 3rem -1.5rem rgba(22, 24, 22, 0.35);
    --device-rim: #2B2F2C;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) var(--bg);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  font-variant-numeric: lining-nums;
  overflow-wrap: anywhere; /* at very large text sizes a long word wraps instead of widening the page */
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--contour); color: var(--bg); }

img, svg { display: block; }
img { max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color 160ms var(--ease);
}
a:hover { text-decoration-color: var(--contour); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

p { margin: 0 0 1rem; max-width: 62ch; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 500; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.75rem); line-height: 1.06; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); line-height: 1.12; letter-spacing: -0.012em; max-width: 20ch; margin-bottom: 1.25rem; }
h3 { font-size: 1.3125rem; line-height: 1.25; margin-bottom: 0.5rem; }

.wrap { width: 100%; max-width: 74rem; margin: 0 auto; padding: 0 var(--gutter); }
.lede { color: var(--muted); max-width: 46ch; }

.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: 10;
  background: var(--text); color: var(--bg); padding: 0.6rem 1rem; font-weight: 600; text-decoration: none; border-radius: 8px;
}
.skip:focus { top: 1rem; }

/* ---------- site header (every page) ---------- */
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem;
  min-height: 4rem;
}
.wordmark { font: 500 1.1875rem/1 var(--display); text-decoration: none; padding: 0.75rem 0; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 clamp(0.25rem, 2vw, 1.25rem); list-style: none; margin: 0 -0.5rem 0 0; padding: 0; }
.site-nav a {
  display: block; padding: 0.75rem 0.5rem; font-size: 0.9375rem; color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* ---------- first view ---------- */
.hero { padding: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(2.5rem, 4vw, 3rem); }
.hero-grid { display: grid; gap: 2.75rem; grid-template-columns: minmax(0, 1fr); }

.product {
  display: flex; align-items: center; gap: 0.875rem;
  font-size: min(clamp(2.5rem, 1.7rem + 3.6vw, 4.25rem), 17vw); line-height: 1; letter-spacing: -0.015em;
}
/* The brand mark keeps its own colours in both schemes: a charcoal tile (D126), never themed. */
.mark { flex: none; width: 1em; height: 1em; border-radius: 0.18em; }
.mark-tile { fill: #212522; }
.mark-back { fill: #9A9AA0; }
.mark-front { fill: #ECECEC; }
.mark-star { fill: #F5C451; }
@media (prefers-color-scheme: light) { .mark-tile { fill: #111312; } }

.claim {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.625rem, 1.05rem + 2.6vw, 3rem); line-height: 1.14; letter-spacing: -0.012em;
  max-width: 22ch; margin: clamp(1.5rem, 4vw, 2.25rem) 0 1.25rem; text-wrap: balance;
}
.hero .lede { margin-bottom: 2rem; }

/* Facts: label and value on a line, ruled. Used for status, price and contact addresses. */
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts > div {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem;
  padding: 0.8rem 0; border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--muted); font-size: 0.9375rem; padding-top: 0.08rem; }
.facts dd { margin: 0; }
.status { max-width: 34rem; margin-bottom: 1.75rem; }
.status > div { grid-template-columns: 4.25rem minmax(0, 1fr); padding: 0.7rem 0; }
.status dd { font-weight: 500; }

/* The one filled amber control on a view. */
.button {
  display: inline-flex; align-items: center; justify-content: center; max-width: 100%; text-align: center;
  min-height: 3.5rem; padding: 0.75rem 1.75rem;
  background: var(--amber); color: var(--on-amber); border: 1px solid var(--amber-edge); border-radius: 12px;
  font: 600 1.125rem/1.2 var(--sans); text-decoration: none;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.button:hover { background: var(--amber-hover); }
.button:active { transform: translateY(1px); }
.does { margin-top: 0.75rem; color: var(--muted); font-size: 0.9375rem; max-width: 34ch; }

/* A whole phone screen, in a plain phone: tall and narrow (the screen is 20:9), a slim even bezel, body and screen
   corners that share one centre, and nothing that points at a make (no notch, camera, buttons or logo). The body keeps
   its own dark colour in both schemes, as a real handset would. Only whole-screen images go in here; a part of a
   screen is set as a plate instead. */
.device { margin: 0; width: min(100%, 16.5rem); }
.device img {
  width: 100%; /* height follows the image's own 1048 x 2340, so the screen is never stretched */
  border: 0.4375rem solid #0A0B0A; border-radius: 2.25rem; background: #0A0B0A;
  box-shadow: 0 0 0 1px var(--device-rim), var(--shadow);
}
.hero-device { justify-self: center; }

/* A part of a screen, set as a plate. */
.plate { margin: 0; }
.plate img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }

/* A row of plates: side by side when there is room, a sideways strip on a phone (the next plate peeks in). */
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 80%; gap: 1rem;
  overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
  margin: 2.25rem calc(-1 * var(--gutter)) 0; padding: 0.25rem var(--gutter) 0.75rem;
  scrollbar-width: thin;
}
.strip > * { scroll-snap-align: center; }

/* Source line: contour-brown text over a faint contour hairline, as in the app. */
.source {
  margin: 1rem 0 0; padding-top: 0.6rem; max-width: 62ch;
  border-top: 1px solid var(--contour-faint);
  color: var(--contour); font-size: 0.875rem; line-height: 1.5;
}
.source a { text-decoration-color: currentColor; }

/* ---------- the route: page navigation drawn as the app's plan line, climbing to the star ---------- */
.route { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); padding: 1.5rem 0 0.5rem; }
.route-draw { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 2.125rem; align-items: start; }
.route-line { width: 100%; height: 48px; overflow: visible; margin-top: 9px; }
.route-line path { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.route-todo { stroke: var(--contour); stroke-dasharray: 0.1 7; }
.route-done { stroke: var(--text); stroke-width: 3; }
.route-here {
  position: absolute; left: calc((100% - 2.125rem) * 0.08 - 8px); top: calc(9px + 44px - 8px);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--text);
}
.route-star { width: 2.125rem; height: 2.125rem; }
.route-star path, .goal path { fill: var(--star); stroke: var(--star-edge); stroke-width: 1; stroke-linejoin: round; }
.route ol {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none;
  margin: 0 2.125rem 0 0; padding: 0;
}
.route a {
  display: block; padding: 0.75rem 0 0.875rem; min-height: 2.75rem;
  font-size: 0.875rem; font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
}
.route a:hover { text-decoration: underline; text-decoration-color: var(--contour); text-decoration-thickness: 2px; }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; scroll-margin-top: 1rem; }
.section + .section { border-top: 1px solid var(--line); }
.two { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
.figs { margin-top: 2.5rem; }
.sub { margin-top: clamp(3rem, 7vw, 5rem); }

/* The card list, set as a running index rather than a grid of tiles. */
.index { list-style: none; margin: 1.75rem 0 0; padding: 0; line-height: 1.75; }
.index li { display: inline; }
.index li:not(:last-child)::after { content: "\00a0\00b7 "; color: var(--line-strong); }

.side-fig { justify-self: center; }
.plate.side-fig { width: min(100%, 20rem); }
.inset { margin-top: 2rem; max-width: 22rem; }
.more { margin-top: 1.5rem; }
.map-figs { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.credits { margin-top: 1.25rem; max-width: 78ch; }
.also h3:not(:first-child) { margin-top: 2rem; }

/* Close */
.goal { width: 2.75rem; height: 2.75rem; margin-bottom: 1.25rem; }
.close p { color: var(--muted); }
.act { margin-top: 1.75rem; }
.hero .act { margin-top: 0; }
.close .facts { align-self: start; border-top-color: var(--line-strong); }
.important { margin-top: clamp(3rem, 7vw, 5rem); padding: 1.5rem; background: var(--surface-2); border-radius: 12px; }
.important h3 { font: 600 1rem/1.4 var(--sans); }
.important p { color: var(--text); max-width: 78ch; font-size: 1rem; }

/* ---------- company page ---------- */
.lead { padding: clamp(2.5rem, 7vw, 5.5rem) 0 0; }
.lead h1 { max-width: 16ch; margin-bottom: 1.5rem; }
.entry h2 { display: flex; align-items: center; gap: 0.75rem; }
.entry .act { margin-top: 2rem; }
.principles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 44rem; }
.principles li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.principles strong { color: var(--text); }

/* ---------- contact ---------- */
.addresses { margin: 0; max-width: 46rem; border-top: 1px solid var(--line-strong); }
.addresses > div { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.addresses dt { font: 500 1.25rem/1.3 var(--display); margin-bottom: 0.25rem; }
.addresses dd { margin: 0; color: var(--muted); }
.addresses a { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.after { margin-top: 2rem; }
.note { font-size: 0.9375rem; color: var(--muted); }

/* ---------- legal pages (privacy, map packs) ---------- */
.legal-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; border-bottom: 1px solid var(--line); }
.legal-head h1 { margin-bottom: 1rem; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; color: var(--muted); font-size: 0.9375rem; margin: 0; max-width: none; }
.legal { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1fr); padding-top: 3rem; padding-bottom: 5rem; }
.toc { font-size: 0.9375rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.toc li { border-bottom: 1px solid var(--line); }
.toc a { display: block; padding: 0.6rem 0; text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--text); }
.legal h2 { font-size: 1.625rem; max-width: none; margin: 2.75rem 0 0.75rem; scroll-margin-top: 1.5rem; }
.legal h2:first-child { margin-top: 0; }
.prose p, .prose li { max-width: 68ch; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--line-strong); }
.prose code { font-family: var(--mono); font-size: 0.9em; overflow-wrap: anywhere; }
.notice { display: inline-block; margin: 0 0 1.25rem; padding: 0.4rem 0.75rem; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 0.9375rem; }
/* A value the owner still has to supply. Must not appear in a published page (see site/DEPLOY.md). */
.pending { background: var(--contour-faint); padding: 0 0.2em; font-weight: 600; }
/* Map packs: checksums wrap instead of widening the page. */
.hash { font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.addresses dd ul { list-style: none; padding: 0; margin: 0.25rem 0 0; }
.addresses dd li { margin: 0 0 0.6rem; max-width: none; }

/* ---------- recommended gear ---------- */
.disclosure { margin-top: 2rem; padding: 1.25rem 1.5rem; background: var(--surface-2); border-radius: 12px; max-width: 46rem; }
.disclosure p { max-width: none; }
.gear { padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.gear h2 { font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.125rem); max-width: none; margin: 0 0 0.75rem; scroll-margin-top: 1.5rem; }
.gear section + section { margin-top: clamp(3rem, 7vw, 4.5rem); padding-top: clamp(3rem, 7vw, 4.5rem); border-top: 1px solid var(--line); }
.gear section > p, .gear section > ul { max-width: 68ch; }
.look { font-weight: 600; margin-bottom: 0.35rem; }
.item { margin-top: 1.75rem; padding: 1.25rem 1.5rem; max-width: 46rem; border: 1px solid var(--line-strong); border-radius: 12px; }
.item h3 { margin-bottom: 0.6rem; }
.item p { max-width: none; }
.buy { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.buy a { font-weight: 600; }
/* The label that must sit right at every paid link. Text, not colour, carries the meaning. */
.paid { margin-left: 0.4rem; padding: 0.05rem 0.4rem; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 0.8125rem; font-weight: 400; color: var(--muted); white-space: nowrap; }

/* ---------- site footer (every page) ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.9375rem; }
.site-foot .wrap { display: grid; gap: 1rem; }
.site-foot p { margin: 0; }
.site-foot ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-foot a { display: inline-block; padding: 0.5rem 0; }

/* ---------- wider screens ---------- */
@media (min-width: 40rem) {
  .strip { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; margin: 2.5rem 0 0; padding: 0; align-items: start; }
  .strip.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 4rem; align-items: start; }
  .hero-device { width: min(100%, 15.75rem); justify-self: end; }

  .route { padding-top: 2rem; }
  .route a { font-size: 1.0625rem; }

  .two { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(3rem, 7vw, 6.5rem); }
  .two.flip { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: center; }
  .two.flip .side-fig { order: -1; justify-self: start; }
  .two.side { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: center; }
  .two.side .side-fig { justify-self: end; }
  .device.side-fig { width: min(100%, 17.5rem); }
  .two.head h2 { margin-bottom: 0; }

  .strip { gap: 1.5rem; }
  .strip.pair { max-width: 40rem; }
  .strip.three { max-width: 60rem; }

  .act { display: flex; align-items: center; gap: 1.25rem; }
  .act .button { flex: none; white-space: nowrap; }
  .act .does { margin-top: 0; }

  .legal { grid-template-columns: 14rem minmax(0, 1fr); }
  .toc nav { position: sticky; top: 1.5rem; }

  .site-foot .wrap { grid-template-columns: auto 1fr; align-items: center; }
  .site-foot ul { justify-content: flex-end; }
}

.sub-lede { margin-top: 1rem; }
.sub-look { margin-top: 2.5rem; }
