/* Summit: the FreelanceCFO design system (DESIGN.md at the repo root).
   One look, light and dark: the dusk palette is the default surface, and
   .paper switches a region to the daylight surface with the same tokens.
   Token names follow shadcn/ui (background, foreground, card, muted, border,
   primary, ring, radius) so the app can map them onto its theme one to one.
   The Runway Ridge is the one brand shape: landing/design/ridge.path.txt. */

@font-face { font-family: "Hanken Grotesk"; src: url('/fonts/hanken-grotesk.woff2') format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Archivo Wordmark"; src: url('/fonts/archivo-wordmark.woff2') format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+0043, U+0046, U+004F; }
/* Metric-matched fallback so the swap to Hanken Grotesk does not shift lines. */
@font-face { font-family: "Hanken Fallback"; src: local("Arial"), local("Helvetica"), local("Liberation Sans"); size-adjust: 98%; ascent-override: 98%; descent-override: 26%; line-gap-override: 0%; }

:root {
  /* Palette: dusk on the Runway Ridge */
  --ink: #0e1a1f;          /* night valley, page background */
  --ink-raised: #13232a;   /* cards, the board */
  --ink-sunk: #0a1418;     /* plans, wells */
  --ink-muted: #1a2d34;    /* hover fills */
  --line: #26393f;         /* hairlines on ink */
  --snow: #f4f3ef;         /* text on ink, the snow on the peak */
  --mist: #a9b5b4;         /* secondary text on ink (8:1 on --ink) */
  --sky: #28344e;          /* upper dusk sky, the hero */
  --sky-text: #dfe7fb;     /* secondary text on the sky */
  --pine: #126b33;         /* the one brand green (buttons, marks) */
  --pine-deep: #0f5a2b;
  --pine-line: #6cc48b;    /* the balance line and green on ink */
  --pine-wash: #e1eee5;
  --ember: #ff9d86;        /* overdue, runs out: alpenglow, never neon red */
  --ember-deep: #b42318;   /* the same signal on paper */
  --paper: #f6f6f4;
  --paper-line: #dfe4e0;
  --paper-ink: #12201b;
  --paper-mist: #4a5651;

  /* shadcn roles, dusk */
  --background: var(--ink);
  --foreground: var(--snow);
  --card: var(--ink-raised);
  --card-foreground: var(--snow);
  --muted: var(--ink-muted);
  --muted-foreground: var(--mist);
  --border: var(--line);
  --primary: var(--snow);
  --primary-hover: #ffffff;
  --primary-foreground: var(--ink);
  --accent: var(--pine-line);
  --danger: var(--ember);
  --ring: var(--pine-line);

  /* Type */
  --font: "Hanken Grotesk", "Hanken Fallback", ui-sans-serif, system-ui, sans-serif;
  --text-sm: 13.5px;
  --text-base: 16px;
  --text-lg: 18px;
  --title: 19px;
  --headline: clamp(32px, 4vw, 52px);
  --display: clamp(44px, 5.6vw, 80px);
  --figure: clamp(52px, 7vw, 96px);

  /* Space and shape */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px; --space-10: 128px;
  --radius: 10px;
  --radius-card: 14px;
  --radius-pill: 999px;
  --shadow-lift: 0 18px 48px -18px rgba(4, 10, 14, .55);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

/* Daylight surface: same system, paper ground. Used by calculator and guide
   templates and by any region that sits on a light image. */
.paper {
  --background: var(--paper);
  --foreground: var(--paper-ink);
  --card: #ffffff;
  --card-foreground: var(--paper-ink);
  --muted: #eef1ee;
  --muted-foreground: var(--paper-mist);
  --border: var(--paper-line);
  --primary: var(--pine);
  --primary-hover: var(--pine-deep);
  --primary-foreground: #ffffff;
  --accent: var(--pine);
  --danger: var(--ember-deep);
  --ring: var(--pine);
  color-scheme: light;
  background: var(--background);
  color: var(--foreground);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--line) var(--ink); accent-color: var(--pine-line); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: var(--text-base); line-height: 1.55; background: var(--background); color: var(--foreground); -webkit-font-smoothing: antialiased; caret-color: var(--pine-line); }
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: var(--pine); color: #ffffff; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
.tnum, table, .fig { font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-5); }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 16px; z-index: 60; background: var(--snow); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Type roles ---------- */
.display { font-size: var(--display); line-height: .98; letter-spacing: -0.04em; }
.headline { font-size: var(--headline); line-height: 1.05; letter-spacing: -0.03em; }
.fig { font-size: var(--figure); line-height: .95; letter-spacing: -0.04em; font-weight: 600; }
.lead { font-size: var(--text-lg); color: var(--muted-foreground); max-width: 58ch; }
.fineprint { font-size: var(--text-sm); color: var(--muted-foreground); }

/* ---------- Wordmark ---------- */
.wordmark { font-weight: 650; letter-spacing: -0.01em; text-decoration: none; }
.wordmark b, .wm-cfo { font-family: "Archivo Wordmark", var(--font); font-stretch: 76%; font-weight: 800; }

/* ---------- Buttons (shadcn Button anatomy) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 20px; border-radius: var(--radius); font: inherit; font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; border: 1px solid transparent; cursor: pointer; transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out), transform .2s var(--ease-out); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-pine { background: var(--pine); color: #ffffff; }
.btn-pine:hover { background: var(--pine-deep); }
.btn-outline { background: transparent; border-color: var(--border); color: inherit; }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: var(--muted); }
.btn .arrow { width: 14px; height: 14px; flex: none; }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.input { height: 46px; width: 100%; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--card-foreground); font: inherit; font-size: 16px; transition: border-color .2s var(--ease-out); }
.input::placeholder { color: var(--muted-foreground); opacity: 1; }
.input:hover { border-color: var(--muted-foreground); }
.input:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; border-color: transparent; }
.input[aria-invalid="true"] { border-color: var(--danger); }

/* ---------- Cards and tables ---------- */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius-card); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted-foreground); font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .sub { display: block; color: var(--muted-foreground); font-size: 13px; margin-top: 2px; }
.bad { color: var(--danger); }

/* "Example figures": once per view, on every surface that shows demo data */
.example-label { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; background: rgba(14, 26, 31, .86); color: var(--snow); }
.paper .example-label { background: var(--pine-wash); color: var(--pine-deep); }

/* ---------- The Runway Ridge ---------- */
/* As a chart line: the balance climbs to the summit (today) and the slope is the runway. */
.ridge-chart { width: 100%; height: auto; overflow: visible; }
.ridge-chart text { font: 500 12px var(--font); fill: var(--muted-foreground); }
.ridge-chart .grid line { stroke: var(--border); stroke-width: 1; }
.ridge-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.ridge-chart .line.next { stroke-dasharray: 5 5; opacity: .85; }
.ridge-chart .area { fill: var(--accent); opacity: .12; }
.ridge-chart .now { stroke: var(--muted-foreground); stroke-width: 1; stroke-dasharray: 2 3; }
.ridge-chart .dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.ridge-chart .tag { fill: var(--card-foreground); font-weight: 600; font-size: 13px; }
.ridge-chart .tag.end { fill: var(--danger); }
/* As a divider: the same silhouette as a hairline */
.ridge-rule { height: 44px; color: var(--muted-foreground); opacity: .45; background: currentColor; -webkit-mask: url('/assets/summit/ridge-line.svg') center / 100% 100% no-repeat; mask: url('/assets/summit/ridge-line.svg') center / 100% 100% no-repeat; }

/* ---------- Calculator result CTA (".result-cta"): sits directly under a result ---------- */
.result-cta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-card); border: 1px solid var(--border); background: var(--card); }
.result-cta p { font-size: 15px; max-width: 46ch; }
.result-cta p b { display: block; font-size: 16px; }

/* ---------- Site nav ---------- */
.site-nav { position: relative; z-index: 10; }
.site-nav .nav-in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); height: 72px; }
.site-nav .wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; }
.site-nav .wordmark img { width: 22px; height: 22px; border-radius: 5px; }
.site-nav .links { display: flex; gap: 26px; font-size: 14.5px; }
.site-nav .links a { text-decoration: none; color: inherit; opacity: .8; transition: opacity .2s var(--ease-out); }
.site-nav .links a:hover { opacity: 1; }
.site-nav .cta { display: flex; gap: 8px; align-items: center; }
@media (max-width: 900px) { .site-nav .links { display: none; } }
@media (max-width: 400px) { .site-nav .cta .btn-ghost { display: none; } }

/* ---------- Site footer: the ridge painted in layers, wordmark on the front ridge ---------- */
.site-foot { position: relative; isolation: isolate; overflow: hidden; min-height: 560px; display: flex; align-items: flex-end; color: var(--snow); background: var(--ink); }
.site-foot .painted { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.site-foot .foot-in { text-align: center; padding-bottom: var(--space-8); }
.site-foot .mark { font-size: clamp(52px, 12vw, 184px); line-height: .9; letter-spacing: -0.05em; font-weight: 700; color: rgba(244, 243, 239, .94); }
.site-foot nav { margin-top: 28px; display: flex; gap: 10px 22px; justify-content: center; flex-wrap: wrap; font-size: 14.5px; }
.site-foot nav a { text-decoration: none; color: #e6ebe8; }
.site-foot nav a:hover { text-decoration: underline; }
.site-foot small { display: block; margin-top: 16px; font-size: 13px; color: #c3cdc8; }
@media (max-width: 640px) { .site-foot { min-height: 500px; } }

/* Drawn check mark for plan lists (no glyph stand ins) */
.checks { list-style: none; padding: 0; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks li::before { content: ""; flex: none; width: 9px; height: 5px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-3px) rotate(-45deg); opacity: .75; }
