/* ===================================================================
   DESIGN TOKENS

   A dark precision instrument. The surface recedes so file content and
   status are the only things that carry colour.

   Neutrals are cool graphite, very slightly blue, never pure black:
   pure #000 flattens the elevation steps and makes the panels read as
   holes rather than surfaces.

   Exactly one accent (signal cyan) plus three functional status hues.
   Status colours are never used decoratively, so when something turns
   amber or red on this page it always means something.
   =================================================================== */

:root {
  /* --- surface ladder, lowest to highest ------------------------- */
  --bg: #0b0d10;
  --surface-1: #101317;
  --surface-2: #161a1f;
  --surface-3: #1d222a;
  --surface-inset: #0d0f13;

  /* --- ink --------------------------------------------------------- */
  --ink: #e9edf2;
  --ink-soft: #9aa4b2;
  --ink-faint: #7a8593;
  --ink-ghost: #59626e;

  /* --- lines ------------------------------------------------------- */
  --line: #232932;
  --line-soft: #1a1f26;
  --line-strong: #303845;

  /* --- accent: signal cyan ----------------------------------------- */
  --accent: #38d6c4;
  --accent-bright: #4ee8d6;
  --accent-dim: #1f9d8f;
  --accent-wash: rgba(56, 214, 196, 0.11);
  --accent-edge: rgba(56, 214, 196, 0.32);
  --accent-ink: #04211e;

  /* --- functional status ------------------------------------------- */
  --ok: #52c47a;
  --ok-wash: rgba(82, 196, 122, 0.12);
  --warn: #e0a44b;
  --warn-wash: rgba(224, 164, 75, 0.12);
  --danger: #f2645a;
  --danger-wash: rgba(242, 100, 90, 0.12);

  /* --- type -------------------------------------------------------- */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.825rem;    /* was 11px */
  --text-sm: 0.975rem;    /* was 13px */
  --text-base: 1.125rem;  /* was 15px */
  --text-md: 1.275rem;    /* was 17px */
  --text-lg: 1.65rem;     /* was 22px */
  /* The title scales with the viewport so the hero cannot swallow a small
     phone screen before the dropzone is reachable. +30% (styling round). */
  --text-xl: clamp(2.35rem, 9.4vw, 3.15rem);

  /* --- shape: one radius system, applied everywhere ----------------- */
  --r-sm: 6px;    /* pills, badges, inputs */
  --r-md: 10px;   /* buttons, rows */
  --r-lg: 14px;   /* panels, cards */
  --r-xl: 20px;   /* the dropzone and modal only */

  /* --- spacing scale ------------------------------------------------ */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;

  /* --- depth. Shadows are tinted toward the background hue, never
         pure black, so panels sit on the surface instead of floating
         in front of a hole. ---------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(2, 4, 8, 0.5);
  --shadow-md: 0 4px 16px rgba(2, 4, 8, 0.45);
  --shadow-lg: 0 24px 64px rgba(2, 4, 8, 0.65);
  --ring-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* --- motion. One easing curve for everything that moves, so the
         whole interface decelerates with the same physical character.
         Durations are short: this is a tool, and every animation here
         reports a state change rather than decorating one. ---------- */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 120ms;
  --t-mid: 220ms;
  --t-slow: 380ms;

  /* --- layout ------------------------------------------------------- */
  --page-max: 68rem;
  --page-pad: var(--s-5);
  --z-modal: 100;
  --z-toast: 120;

  /* Tells the browser which native chrome (scrollbars, form controls) to
     draw. Dark by default; the light override below and the default/system
     media query further down both flip this back to light when active. */
  color-scheme: dark;
}

/* ===================================================================
   THEME: light + default(system)
   Director (styling round): "allow to toggle between light and dark and
   default mode". `:root` above is the dark palette (also the fallback for
   "default" when the system itself prefers dark, since it's simply what
   happens when no override below matches). Three states, one mechanism:
     - data-theme="light"  -> forced light, always
     - data-theme="dark"   -> forced dark. No override needed: it's just
                              re-asserting the :root values above, so the
                              only thing setting this attribute value does
                              is stop the "default" media query below from
                              also matching.
     - no data-theme       -> "default": follows prefers-color-scheme live,
                              including changing if the OS setting changes
                              while the page is open.
   theme.js is the only thing that ever sets/removes the attribute; it also
   persists the choice so it survives a reload.
   =================================================================== */
/* Plain (non-nested) media query wrapping the selector, deliberately not
   the newer CSS-nesting shorthand (`selector { @media {...} }`) -- this
   static bundle ships with no build/transpile step, so it only uses syntax
   every evergreen browser has understood natively for years. Scoped to
   `:not([data-theme])` only: a forced choice below must never be second-
   guessed by what the OS happens to prefer. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f3f5f7;
    --surface-1: #ffffff;
    --surface-2: #eef1f4;
    --surface-3: #e2e7ec;
    --surface-inset: #e9edf1;

    --ink: #14181d;
    --ink-soft: #4b5563;
    --ink-faint: #6a7482;
    --ink-ghost: #99a2ac;

    --line: #d8dee4;
    --line-soft: #e5e9ed;
    --line-strong: #c2cad2;

    --accent: #0f6b42;
    --accent-bright: #14814f;
    --accent-dim: #0b5233;
    --accent-wash: rgba(15, 107, 66, 0.1);
    --accent-edge: rgba(15, 107, 66, 0.3);
    --accent-ink: #ffffff;

    --ok: #2f9155;
    --ok-wash: rgba(47, 145, 85, 0.1);
    --warn: #b1740a;
    --warn-wash: rgba(177, 116, 10, 0.1);
    --danger: #d13f37;
    --danger-wash: rgba(209, 63, 55, 0.1);

    --shadow-sm: 0 1px 2px rgba(20, 24, 30, 0.08);
    --shadow-md: 0 4px 16px rgba(20, 24, 30, 0.1);
    --shadow-lg: 0 24px 64px rgba(20, 24, 30, 0.16);
    --ring-inset: inset 0 1px 0 rgba(0, 0, 0, 0.03);

    color-scheme: light;
  }
}

/* Forced light: applies regardless of what the OS prefers. */
:root[data-theme="light"] {
  --bg: #f3f5f7;
  --surface-1: #ffffff;
  --surface-2: #eef1f4;
  --surface-3: #e2e7ec;
  --surface-inset: #e9edf1;
  --ink: #14181d;
  --ink-soft: #4b5563;
  --ink-faint: #6a7482;
  --ink-ghost: #99a2ac;
  --line: #d8dee4;
  --line-soft: #e5e9ed;
  --line-strong: #c2cad2;
  --accent: #0f6b42;
  --accent-bright: #14814f;
  --accent-dim: #0b5233;
  --accent-wash: rgba(15, 107, 66, 0.1);
  --accent-edge: rgba(15, 107, 66, 0.3);
  --accent-ink: #ffffff;
  --ok: #2f9155;
  --ok-wash: rgba(47, 145, 85, 0.1);
  --warn: #b1740a;
  --warn-wash: rgba(177, 116, 10, 0.1);
  --danger: #d13f37;
  --danger-wash: rgba(209, 63, 55, 0.1);
  --shadow-sm: 0 1px 2px rgba(20, 24, 30, 0.08);
  --shadow-md: 0 4px 16px rgba(20, 24, 30, 0.1);
  --shadow-lg: 0 24px 64px rgba(20, 24, 30, 0.16);
  --ring-inset: inset 0 1px 0 rgba(0, 0, 0, 0.03);
  color-scheme: light;
}

/* Wider gutters and a slightly larger base once there is room for them. */
@media (min-width: 1440px) {
  :root {
    --page-max: 76rem;
    --page-pad: var(--s-6);
  }
}

/* On very large displays the content column grows rather than stranding
   the interface in the middle of an empty field. */
@media (min-width: 2200px) {
  :root {
    --page-max: 90rem;
    /* Also *1.2 from the pre-styling-round values, same as the base scale
       above. */
    --text-base: 1.2rem;
    --text-md: 1.35rem;
    --text-lg: 1.8rem;
    --text-xl: 3.7rem; /* fixed here: 6vw would be enormous at this width. +30% (styling round) */
  }
}

/* --- self-hosted type. No external font request is ever made. ------ */
@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('../assets/fonts/GeistMono-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
