/* AppScope — the app's design system, on the web.
 *
 * Same tokens as Helpers/Theme.swift: warm ivory paper in light, true deep dark
 * in dark, one saturated brand blue, a muted earthy accent family for identity,
 * and no shadows or divider rules anywhere. Elevation is a change of surface
 * tone, never a light source. */

:root {
  --canvas: #f0eee6;
  --surface: #faf9f5;
  --surface-raised: #fffefb;
  --subtle: #e8e6dc;
  --border: #dcd8ca;
  --border-strong: #c7c2b0;

  --ink: #141413;
  --ink-2: #5e5d59;
  --ink-3: #7f7e76;

  --accent: #2474ff;
  --on-accent: #ffffff;

  --sky: #2f6fb8;
  --cactus: #2f7a6b;
  --heather: #6a5fa8;
  --kraft: #9e6b3c;
  --fig: #a85170;
  --clay: #c05f3c;
  --olive: #5f7548;

  --radius-card: 20px;
  --radius-control: 13px;
  --radius-chip: 8px;
  --radius-tile: 30%;

  /* SF Rounded, the same face the app uses. `ui-rounded` resolves to it on
   * Apple platforms; elsewhere the stack falls back to the softest system face
   * available, then to plain system-ui. No web font is downloaded. */
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --page: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #08090d;
    --surface: #111319;
    --surface-raised: #191c23;
    --subtle: #1c1f27;
    --border: #252932;
    --border-strong: #3a3f4b;

    --ink: #f2f4f8;
    --ink-2: #a4a9b6;
    --ink-3: #787e8c;

    --accent: #5e97ff;
    --on-accent: #080a0f;

    --sky: #8fbbe8;
    --cactus: #8ecfbe;
    --heather: #b0a7e8;
    --kraft: #dba76e;
    --fig: #de90ac;
    --clay: #e08b69;
    --olive: #a3be85;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--rounded);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Type ------------------------------------------------------------- */

/* Bold, and the only bold in the system — which is what makes a headline
 * figure the heaviest thing on the page. */
.display {
  font-family: var(--rounded);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.lede {
  font-size: 19px;
  color: var(--ink-2);
  margin: 0;
  max-width: 46ch;
}

/* --- Logo -------------------------------------------------------------
 * The mark is a PNG with an alpha channel, used as a mask so it can take any
 * colour — one asset, correct in both schemes and on the blue. */

.mark {
  display: block;
  aspect-ratio: 1042 / 706;
  background-color: currentColor;
  -webkit-mask: url("assets/logo-white.png") center / contain no-repeat;
  mask: url("assets/logo-white.png") center / contain no-repeat;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 84px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark .mark {
  width: 38px;
  color: var(--accent);
}

@media (max-width: 620px) {
  .masthead .wrap { height: 72px; }
  .wordmark { font-size: 20px; }
  .wordmark .mark { width: 32px; }
}

.masthead nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-control);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: opacity 0.16s ease, background-color 0.16s ease;
}

.btn:hover {
  text-decoration: none;
  opacity: 0.86;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-quiet {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--border-strong);
}

.btn-plain {
  padding: 10px 12px;
  color: var(--ink-2);
  font-weight: 500;
}

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

section {
  padding: 84px 0;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 34px;
}

.section-head .display {
  font-size: clamp(28px, 4vw, 38px);
}

/* --- Hero -------------------------------------------------------------- */

.hero {
  padding: 76px 0 60px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}

.hero .display {
  font-size: clamp(44px, 8.2vw, 82px);
  max-width: 15ch;
}

/* Colour, not italics — the accent is the only emphasis the system has. */
.hero .display em {
  color: var(--accent);
  font-style: normal;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.hero-note {
  font-size: 13px;
  color: var(--ink-3);
}

/* --- Metric strip ------------------------------------------------------ */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 8px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.metric-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.metric-figure {
  font-family: var(--rounded);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.trend {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: var(--radius-chip);
  background: color-mix(in srgb, var(--positive, #436b2c) 11%, transparent);
  color: #436b2c;
}

@media (prefers-color-scheme: dark) {
  .trend {
    background: color-mix(in srgb, #96c578 11%, transparent);
    color: #96c578;
  }
}

/* --- Icon tiles -------------------------------------------------------- */

.tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.tile svg {
  width: 19px;
  height: 19px;
  display: block;
}

.tile-lg {
  width: 42px;
  height: 42px;
}

.tile-lg svg {
  width: 23px;
  height: 23px;
}

.t-brand { color: var(--accent); }
.t-sky { color: var(--sky); }
.t-cactus { color: var(--cactus); }
.t-heather { color: var(--heather); }
.t-kraft { color: var(--kraft); }
.t-fig { color: var(--fig); }
.t-clay { color: var(--clay); }
.t-olive { color: var(--olive); }

/* --- Feature cards ----------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card h3 {
  font-family: var(--rounded);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
}

.card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

/* --- Privacy band ------------------------------------------------------ */

.band {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.band .display {
  font-size: clamp(26px, 3.4vw, 34px);
  max-width: 20ch;
}

.band ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.band li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-2);
  font-size: 15px;
}

.band li svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--cactus);
}

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

footer {
  padding: 44px 0 56px;
  color: var(--ink-3);
  font-size: 14px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  align-items: center;
}

footer nav {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

footer a {
  color: var(--ink-2);
}

/* --- Legal / prose pages ----------------------------------------------- */

.prose {
  max-width: 68ch;
  padding: 56px 0 24px;
}

.prose > .display {
  font-size: clamp(34px, 6vw, 52px);
  margin-bottom: 14px;
}

.prose .updated {
  color: var(--ink-3);
  font-size: 14px;
  margin: 0 0 34px;
}

.prose section {
  padding: 0;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.prose h2 {
  font-family: var(--rounded);
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 8px;
}

.prose p {
  margin: 0;
  color: var(--ink-2);
}

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

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  section { padding: 60px 0; }
  .hero { padding: 52px 0 44px; }
  .cards { grid-template-columns: 1fr; }
  .band { padding: 28px; }
  .masthead nav .btn-plain { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
