/* theme.css — design tokens. The single source of colour, type, space, radius and motion.
   Light is the default; dark is [data-theme="dark"] on <html>.
   Components read these and never hard-code a value. See DESIGN.md for the rationale. */

/* .on-paper carries the light set into a dark band or the dark theme (a white form card on black). */
:root, .on-paper {
  color-scheme: light;

  /* ---- Brand (fixed across themes) ---- */
  --accent: #4ab0ff;               /* the one accent: active states, highlights, particles */
  --accent-strong: #2f9cf0;        /* hover of accent fills */
  --accent-soft: #7cc4ff;          /* accent as text on dark */
  --accent-pale: #e8f4ff;          /* pale accent tile, fixed across themes */
  --accent-rgb: 74, 176, 255;
  --ink-fixed: #0b0b0a;            /* near-black: text on accent, dark bands */
  --ink-panel: #0b0b0a;            /* dark band background */
  --ink-hover: #262624;            /* hover of ink fills */
  --ink-rgb: 11, 11, 10;
  --on-ink: #ffffff;
  --on-ink-secondary: #d6d6d3;
  --on-ink-muted: #a3a3a0;
  --on-ink-faded: #8f8f8c;
  --on-ink-tone: #d2d2ce;          /* the quiet half of a two-tone heading on dark */
  --navy-1: #061426;               /* the deep-blue band gradient */
  --navy-2: #0a2240;
  --scrim-rgb: 11, 11, 10;         /* gradient laid over photographs */

  --brand-primary: var(--accent);
  --brand-primary-hover: var(--accent-strong);
  --brand-primary-dark: #1763c7;   /* accent as readable text on light surfaces */
  --text-brand: var(--brand-primary-dark);

  /* ---- Surfaces ---- */
  --bg-body: #f6f5f1;              /* linen: page canvas and the grey band */
  --bg-surface: #ffffff;           /* default band */
  --bg-surface-alt: #f7f7f5;       /* cards on a band */
  --bg-surface-hover: #efefec;

  --tint-soft: #f1f1ef;            /* icon tiles, soft band */
  --tint-sky: #f4f4f2;             /* the three card tints are neutral steps, not pastels */
  --tint-lilac: #efefec;
  --tint-sand: #f6f5f1;

  /* ---- Text ---- */
  --text-primary: #101112;
  --text-secondary: #4b4d4f;
  --text-muted: #686b6d;
  --text-faded: #696b69;
  --text-tone: var(--text-faded);   /* the quiet half of a two-tone heading */

  --text-primary-rgb: 16, 17, 18;
  --bg-menu-rgb: 250, 251, 250;

  /* ---- Borders ---- */
  --border-light: #efede8;
  --border-main: #e7e5e0;
  --border-heavy: #c9c7c1;
  --border-field: #8a8c8a;         /* form-control outline: 3:1 against the field */

  /* ---- Buttons (re-pointed by context bands and by dark theme) ---- */
  --btn-bg: #111110;
  --btn-fg: #ffffff;
  --btn-bg-hover: var(--ink-hover);

  /* ---- Feedback ---- */
  --success: #16a37a;
  --danger: #c0392b;
  --warning: #b7791f;
  --star: #b97d00;

  /* ---- Overlays & shadow ---- */
  --overlay-bg: rgba(11, 11, 10, 0.6);
  --shadow-color-rgb: 0, 0, 0;
  --shadow-1: 0 1px 2px rgba(var(--shadow-color-rgb), 0.06), 0 14px 30px -22px rgba(var(--shadow-color-rgb), 0.35);
  --shadow-2: 0 1px 2px rgba(var(--shadow-color-rgb), 0.05), 0 24px 48px -24px rgba(var(--shadow-color-rgb), 0.45);

  /* ---- Type ---- */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;   /* code-like UI only */
  --fs-display: clamp(2.75rem, 1rem + 5.2vw, 5.4rem);   /* the one oversized statement */
  --fs-h1: clamp(2.25rem, 1.2rem + 2.9vw, 3.5rem);
  --fs-h2: clamp(1.875rem, 1.25rem + 2.1vw, 3rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.4375rem);
  --fs-h4: 1.125rem;
  --fs-lead: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.8125rem;
  --tracking-display: -0.045em;
  --tracking-heading: -0.035em;
  --tracking-body: -0.006em;

  /* ---- Space (4px base) ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --pad-panel-x: clamp(20px, 3.6vw, 52px);             /* minimum side padding of a band */
  --pad-panel-y: clamp(64px, 7vw, 112px);              /* vertical padding of a band */
  --content-max: 1336px;                               /* width of the content column inside a band */

  /* ---- Radius: small and precise; pills for buttons and chips ---- */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);        /* expo out: fast start, long settle */
  --ease-spring: cubic-bezier(0.34, 1.32, 0.5, 1);   /* slight overshoot, for things that pop */
  --ease-soft: cubic-bezier(0.25, 1, 0.5, 1);        /* quart out: an even settle, for menus */
  --dur-menu: 380ms;
  --dur-1: 140ms;
  --dur-2: 260ms;
  --dur-3: 800ms;

  --header-h: 64px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --brand-primary-dark: var(--accent-soft);
  --text-brand: var(--accent-soft);

  --bg-body: #0b0b0a;
  --bg-surface: #111110;
  --bg-surface-alt: #171716;
  --bg-surface-hover: #1f1f1e;

  --tint-soft: #1a1a19;
  --tint-sky: #1a1a19;
  --tint-lilac: #1f1f1e;
  --tint-sand: #151514;

  --text-primary: #ffffff;
  --text-secondary: #d6d6d3;
  --text-muted: #a3a3a0;
  --text-faded: #8f8f8c;
  --text-tone: var(--on-ink-tone);

  --text-primary-rgb: 255, 255, 255;
  --bg-menu-rgb: 11, 11, 10;

  --border-light: #1c1c1b;
  --border-main: #262624;
  --border-heavy: #45453f;
  --border-field: #6b6b68;

  --btn-bg: #ffffff;
  --btn-fg: #111110;
  --btn-bg-hover: #e9e9e6;

  --success: #5fd0a7;
  --danger: #ff8a7a;
  --warning: #f0b955;
  --star: #e3a008;

  --overlay-bg: rgba(0, 0, 0, 0.72);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 28px -14px rgba(0, 0, 0, 0.9);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.5), 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
