/* Public pages (landing at "/", sign-in at "/login") that functions/_middleware.ts serves to signed-out visitors.
   They load before the app bundle, so they carry their own copy of the app's tokens (src/styles/globals.css,
   DESIGN.md "The Private Ledger") and their own copy of Inter. Keep the values in step with globals.css. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/welcome/inter.woff2") format("woff2-variations");
}

:root {
  color-scheme: light;
  --canvas: #faf8f1;
  --surface: #fffdf8;
  --raised: #fffefa;
  --subtle: #f3f0e5;
  --hover: #f6f3e9;
  --ink: #17231d;
  --ink-2: #535e56;
  --ink-3: #636d65;
  --line: #e5dfd0;
  --line-strong: #d4ccba;
  --control: #918a77;
  --brand: #0d5b43;
  --brand-hover: #084a36;
  --brand-soft: #e7efe6;
  --brand-ink: #164c39;
  --on-brand: #fffaf0;
  --accent: #8d9d52;
  --positive: #417522;
  --positive-soft: #eef4e8;
  --negative: #c43846;
  --negative-soft: #fdf0f1;
  --chart: #1a5b41;
  --chart-area: #9dac6c;
  --rest: 0 1px 2px rgb(49 43 29 / 0.025);
  --lift: 0 12px 30px rgb(49 43 29 / 0.08);
  --font: "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 4vw, 2.5rem);
}
/* Dark: the theme chosen in the app (data-theme, set by theme.js), or the operating system's when none is saved.
   The same values as [data-theme="dark"] in globals.css; tests/welcome-tokens.test.mjs keeps them in step. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101713; --surface: #18221c; --raised: #202c24; --subtle: #202c24; --hover: #29372e;
  --ink: #edf2eb; --ink-2: #b2bfb4; --ink-3: #91a194; --line: #344338; --line-strong: #506255; --control: #6f8574;
  --brand: #80c7a5; --brand-hover: #a0d8bb; --brand-soft: #233d2f; --brand-ink: #b2e3c9; --on-brand: #10281c;
  --accent: #c9ce83; --positive: #a3ce82; --positive-soft: #253921; --negative: #f29da5; --negative-soft: #40262c;
  --chart: #80c7a5; --chart-area: #b1c77c; --rest: 0 1px 2px rgb(0 0 0 / 0.25); --lift: 0 12px 30px rgb(0 0 0 / 0.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #101713; --surface: #18221c; --raised: #202c24; --subtle: #202c24; --hover: #29372e;
    --ink: #edf2eb; --ink-2: #b2bfb4; --ink-3: #91a194; --line: #344338; --line-strong: #506255; --control: #6f8574;
    --brand: #80c7a5; --brand-hover: #a0d8bb; --brand-soft: #233d2f; --brand-ink: #b2e3c9; --on-brand: #10281c;
    --accent: #c9ce83; --positive: #a3ce82; --positive-soft: #253921; --negative: #f29da5; --negative-soft: #40262c;
    --chart: #80c7a5; --chart-area: #b1c77c; --rest: 0 1px 2px rgb(0 0 0 / 0.25); --lift: 0 12px 30px rgb(0 0 0 / 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) var(--canvas); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 1rem/1.6 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
::selection { background: var(--brand-soft); color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
svg { display: block; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }

.wrap { width: min(100% - 2 * var(--gutter), 72rem); margin-inline: auto; }
.display { font-size: clamp(2.5rem, 5.6vw, 4.75rem); font-weight: 500; line-height: 1.02; letter-spacing: -0.04em; }
.h2 { font-size: clamp(1.75rem, 3.3vw, 2.75rem); font-weight: 500; line-height: 1.08; letter-spacing: -0.032em; }
.lead { font-size: clamp(1.0625rem, 1.45vw, 1.25rem); line-height: 1.55; color: var(--ink-2); }
.body { font-size: 1rem; line-height: 1.65; color: var(--ink-2); }
.small { font-size: 0.875rem; line-height: 1.55; color: var(--ink-2); }
.caption { font-size: 0.8125rem; line-height: 1.45; color: var(--ink-3); }
.overline { font-size: 0.6875rem; line-height: 1rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.gain { color: var(--positive); }
.loss { color: var(--negative); }
.ic { width: 1.25rem; height: 1.25rem; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Brand: the app's Sprout tile */
.brand { display: inline-flex; align-items: center; gap: 0.625rem; flex: none; white-space: nowrap; font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.brand-tile { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 0.75rem; background: var(--brand); color: var(--on-brand); }
.brand-tile svg { width: 1.125rem; height: 1.125rem; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--canvas);
  border-bottom: 1px solid transparent;
  box-shadow: 0 1px 0 transparent;
  transition: border-color 180ms, background-color 180ms, box-shadow 180ms;
}
.nav.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 var(--line);
  background-color: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav-inner { display: flex; align-items: center; gap: 0.75rem; height: 4rem; }
.nav-actions { display: flex; align-items: center; gap: 0.375rem; margin-left: auto; }

/* Buttons, as the app draws them */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.5rem; padding: 0 1rem; border-radius: 0.75rem; border: 1px solid transparent;
  font: 500 0.875rem/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 120ms, border-color 120ms, color 120ms, box-shadow 120ms, transform 120ms var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn-lg { height: 2.75rem; padding: 0 1.25rem; border-radius: 0.875rem; font-size: 0.875rem; }
.btn-primary {
  background: var(--brand); color: var(--on-brand); border-color: color-mix(in srgb, var(--brand-hover) 70%, black);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--brand) 18%, transparent), inset 0 1px 0 color-mix(in srgb, var(--on-brand) 22%, transparent);
}
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 2px 5px color-mix(in srgb, var(--brand) 26%, transparent), inset 0 1px 0 color-mix(in srgb, var(--on-brand) 22%, transparent); }
.btn-secondary { background: var(--raised); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgb(0 0 0 / 0.03); }
.btn-secondary:hover { background: var(--hover); border-color: var(--line-strong); }
.btn-ghost { color: var(--ink-2); background: transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--hover); }
.btn .ic { width: 1rem; height: 1rem; }
@media (max-width: 400px) { .nav .btn { padding-inline: 0.75rem; } }

/* The app's sheet, metric strip and segmented control */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--rest); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.sheet-title { font-size: 0.875rem; font-weight: 600; letter-spacing: -0.005em; }
.strip { display: grid; grid-template-columns: repeat(var(--cells, 3), minmax(0, 1fr)); }
.strip > div { padding: 1rem 1.25rem; min-width: 0; }
.strip > div + div { border-left: 1px solid var(--line); }
.fig { font-size: 1.25rem; font-weight: 600; line-height: 1.75rem; letter-spacing: -0.01em; margin-top: 0.25rem; white-space: nowrap; }
.fig-display { font-size: 2rem; font-weight: 400; line-height: 1.1; letter-spacing: -0.03em; margin-top: 0.375rem; white-space: nowrap; }
@media (max-width: 640px) { .strip { grid-template-columns: minmax(0, 1fr); } .strip > div + div { border-left: 0; border-top: 1px solid var(--line); } }
.sample { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.sample::before { content: ""; width: 0.375rem; height: 0.375rem; border-radius: 50%; border: 1px solid var(--control); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-left: auto; font-size: 0.8125rem; color: var(--ink-2); }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* The private-beta line under the hero buttons */
.beta-note { margin-top: 0.875rem; }
