/* FittedCV brand stylesheet — the shared design system (tokens, font, reset, buttons, eyebrow,
   theme model). This file is a manually maintained copy: an identical fittedcv-brand.css lives
   at the root of the fittedcv-ext repo. There is no build step and no sync script — an extension
   can't load CSS from an external URL at runtime, so "the same CSS in both" means keeping the
   two copies in step by hand. If you change this file, make the matching change in fittedcv-ext.
   Keep it at the served root, sibling to fonts/, so `url("fonts/InterVariable.woff2")` resolves
   the same way in both repos.

   Strict black/white/gray palette, with ONE sanctioned hue: the accent (--accent / --accent-hover
   / --accent-fg), driving .btn-accent and reserved for the single primary call-to-action on a
   screen (currently onboarding's primary step button and its drop-zone). Change those three
   values here to re-accent every surface at once. Everything else stays grayscale in either theme.

   --- Theme model ---
   Two self-consistent grayscale "surfaces": A (white family) and B (black family). Role tokens
   (--bg/--fg/--muted/...) point at surface A in light mode and surface B in dark mode; the
   --invert-* tokens always point at whichever surface ISN'T current, so a ".section-invert" band
   (or any inverted-context element) automatically becomes the opposite tone in both themes rather
   than needing separate dark-mode overrides of its own.

   Light is the bare :root default. Dark is applied two ways: automatically via
   `prefers-color-scheme` (guarded by :not([data-theme="light"]) so an explicit light override
   still wins), and explicitly via `[data-theme="dark"]` (for a manual toggle, wins regardless of
   OS setting). A consumer that never sets `data-theme` — the extension — only ever gets the
   automatic branch: OS-driven dark mode with no toggle, for free, from these same tokens. */

@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.4%;
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
}

:root {
  --font-sans: "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* literal constants — for the rare case that needs an absolute value regardless of theme */
  --black: #0a0a0a;
  --white: #ffffff;

  /* surface A (white family) */
  --a-bg: #ffffff;
  --a-fg: #0a0a0a;
  --a-muted: #555555;
  --a-faint: #888888;
  --a-border: #e4e4e4;
  --a-subtle: #f4f4f4;

  /* surface B (dark family — purple-tinted, not pure black) */
  --b-bg: #131020;
  --b-fg: #f4f3ff;
  --b-muted: #9b98b8;
  --b-faint: #6a677f;
  --b-border: #2e2a45;
  --b-subtle: #1c1930;

  /* role tokens — light default: page = surface A, inverted context = surface B */
  --bg: var(--a-bg);
  --fg: var(--a-fg);
  --muted: var(--a-muted);
  --faint: var(--a-faint);
  --border: var(--a-border);
  --subtle: var(--a-subtle);

  --invert-bg: var(--b-bg);
  --invert-fg: var(--b-fg);
  --invert-muted: var(--b-muted);
  --invert-faint: var(--b-faint);
  --invert-border: var(--b-border);
  --invert-subtle: var(--b-subtle);

  /* accent — the one sanctioned hue (see file header). Only for a screen's single primary CTA. */
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-fg: #ffffff;
  --accent-subtle: #ede9fe;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--b-bg);
    --fg: var(--b-fg);
    --muted: var(--b-muted);
    --faint: var(--b-faint);
    --border: var(--b-border);
    --subtle: var(--b-subtle);

    --invert-bg: var(--a-bg);
    --invert-fg: var(--a-fg);
    --invert-muted: var(--a-muted);
    --invert-faint: var(--a-faint);
    --invert-border: var(--a-border);
    --invert-subtle: var(--a-subtle);

    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-subtle: #1e1b4b;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: var(--b-bg);
  --fg: var(--b-fg);
  --muted: var(--b-muted);
  --faint: var(--b-faint);
  --border: var(--b-border);
  --subtle: var(--b-subtle);

  --invert-bg: var(--a-bg);
  --invert-fg: var(--a-fg);
  --invert-muted: var(--a-muted);
  --invert-faint: var(--a-faint);
  --invert-border: var(--a-border);
  --invert-subtle: var(--a-subtle);

  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-subtle: #1e1b4b;

  color-scheme: dark;
}

/* --- reset --- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

/* --- shared type --- */

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.section-invert .eyebrow, [data-invert] .eyebrow { color: var(--invert-faint); }

/* --- shared buttons — solid/outline invert automatically with theme via --fg/--bg; the
   "-invert" variants are for use inside a .section-invert band (or any --invert-* context),
   where they need to key off --invert-fg/--invert-bg instead to stay high-contrast there. --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;   /* every button is fully rounded (pill) */
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  font-family: var(--font-sans);
}
/* .btn's own `display` is an author-stylesheet rule, which beats the UA stylesheet's
   `[hidden]{display:none}` in the cascade regardless of specificity — so a hidden .btn button
   would otherwise still render. */
.btn[hidden] { display: none; }

.btn:active { transform: scale(0.97); }

.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { opacity: 0.85; }

.btn-outline { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn-outline:hover { background: var(--fg); color: var(--bg); }

/* the one hued button — a screen's single primary CTA only (see --accent in the file header) */
.btn-accent { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-solid-invert { background: var(--invert-fg); color: var(--invert-bg); }
.btn-solid-invert:hover { opacity: 0.85; }

.btn-outline-invert { background: transparent; color: var(--invert-fg); border-color: var(--invert-fg); }
.btn-outline-invert:hover { background: var(--invert-fg); color: var(--invert-bg); }

.btn-sm { padding: 9px 16px; font-size: 13.5px; }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* --- shared surfaces --- */

.card {
  border: 1.5px solid var(--fg);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--fg);
  font: 700 11px var(--font-sans);
  white-space: nowrap;
  color: var(--fg);
  background: transparent;
}

.pill-filled { background: var(--fg); color: var(--bg); border-color: var(--fg); }
