/* ==========================================================================
   The palette. One file, three surfaces.

   The site, the app window and the dashboard all wear this product's colours.
   Each of them used to carry its own inline copy — three sheets that agreed
   token for token and could drift apart on any one of them. This is the copy
   they all read now; a colour changes here and nowhere else.

   Dark is the default. `data-theme="light"` puts the kraft block back.
   ========================================================================== */

:root {
  /* Light — the template's :root, token for token. Kraft page, bark ink. */
  --bg: #E7DAC0;
  --bg-2: #DFD1B2;
  --surface-1: #F6EFDC;
  --surface-2: #EFE4C6;
  --surface-3: #E6D7B5;
  --line: rgba(78, 61, 40, 0.24);
  --line-dash: rgba(78, 61, 40, 0.45);
  --line-strong: #4E3D28;

  --ink: #4E3D28;
  --ink-dim: #7C6A4E;
  --ink-faint: #786446;

  /* The primary action: the primary action. */
  --stamp: #C7481D;
  --stamp-600: #A83A16;
  --stamp-soft: rgba(199, 72, 29, 0.12);
  --on-stamp: #FFF6E8;

  /* Settled, delivered, done. */
  --green: #3E6B4F;
  --green-600: #2F5540;
  --green-soft: rgba(62, 107, 79, 0.12);

  /* Money: credits earned and not yet spent. */
  --gold-300: #DDA32E;
  --gold-400: #C98A1B;
  --gold-500: #A8730F;
  --gold-600: #8A5E0B;
  --gold-grad: var(--gold-400);
  --gold-grad-soft: rgba(201, 138, 27, 0.14);
  --gold-soft: rgba(201, 138, 27, 0.14);
  --on-gold: #2A1F10;

  --teal: var(--green);
  --teal-soft: var(--green-soft);
  --blue: #4E6172;
  --blue-soft: rgba(78, 97, 114, 0.12);
  --orange: #C7661C;
  --orange-soft: rgba(199, 102, 28, 0.12);
  --red: #B4471C;
  --red-soft: rgba(180, 71, 28, 0.11);
  --purple: #7A5C8F;
  --purple-soft: rgba(122, 92, 143, 0.12);

  --text-chip: #6E5C43;
  --text-ok: #2F5540;
  --text-alert: #A83A16;
  --text-danger: #8F3415;
  /* Hard shadows, no blur — the template's signature, in its own ink. */
  --shadow-1: 3px 3px 0 rgba(78, 61, 40, 0.22);
  --shadow-2: 5px 5px 0 rgba(78, 61, 40, 0.24);
  --shadow-pop: 6px 8px 0 rgba(78, 61, 40, 0.14);

  --tape: rgba(222, 203, 150, 0.85);
  --tape-edge: rgba(78, 61, 40, 0.28);

  /* Aliases the components read. */
  --surface: var(--surface-1);
  --surface-0: rgba(78, 61, 40, 0.04);
  --panel-2: var(--surface-2);
  --gold: var(--gold-400);
  --muted: var(--ink-dim);
  --faint: var(--ink-faint);
  --ink-soft: var(--ink-dim);
  --ink-2: var(--ink-dim);
  --amber: var(--gold-400);
  --card-bg: var(--surface-1);
  --scrim: rgba(20, 16, 12, 0.78);
  --on-scrim: #FFF6E8;
  --white-card: #FFFFFF;
  --paper-tint: #FFF6E8;
  --line-mid: rgba(78, 61, 40, 0.35);
  --line-soft: rgba(78, 61, 40, 0.22);
  --line-hairline: rgba(0, 0, 0, 0.12);

  /* Accents as text */
  --stamp-ink: #C7481D;
  --stamp-ink-hover: #A83A16;
  --green-ink: #3E6B4F;
  --red-ink: #B4471C;
  --gold-ink: #8A5E0B;
  --blue-ink: #4E6172;

  --ink-on-blue: #374E60;
  --ink-on-orange: #8F4A12;
  --ink-on-orange-deep: #6E3A12;
  --ink-on-red: #8F3816;
  --ink-on-green: #2F5540;
  --ink-on-green-deep: #0E7A4A;
  --ink-on-stamp-soft: #5B2408;
  --ink-on-warn-gold: #8A6508;
  --ink-on-silver: #6A6A78;
  --ink-on-bronze: #A35D2B;
  --ink-on-neutral: #6B7280;

  --wash-white: rgba(255, 255, 255, 0.58);
  --wash-white-strong: rgba(255, 255, 255, 0.75);
  --wash-good-soft: rgba(230, 240, 232, 0.68);
  --wash-good: rgba(230, 240, 232, 0.90);
  --wash-good-strong: rgba(230, 240, 232, 0.94);
  --wash-bad: rgba(246, 227, 220, 0.92);
  --wash-cream: rgba(255, 247, 223, 0.75);
  --wash-net-ok: #D8F3DC;
  --wash-net-bad: #F6E3DC;
  --hero-wash: rgba(246, 239, 220, 0.58);

  --paper-1: #FFF9EC;
  --paper-2: #F6EED8;
  --paper-dot: rgba(78, 61, 40, 0.05);
  --console-bg: #4E3D28;
  --console-ink: #E9DEC3;
  --console-ok: #2F7A45;
  --console-err: #C7481D;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1a1c20;
  --bg-2: #1f2226;
  --surface-1: #262a30;
  --surface-2: #2f343b;
  --surface-3: #383e46;
  --line: rgba(255, 255, 255, 0.10);
  --line-dash: rgba(255, 255, 255, 0.22);
  --line-strong: #454b54;

  --ink: #e8e9ec;
  --ink-dim: #aeb3bb;
  --ink-faint: #828892;

  --stamp: #C7481D;
  --stamp-600: #A83A16;
  --stamp-soft: rgba(199, 72, 29, 0.20);
  --on-stamp: #FFF6E8;

  --green: #4F9A6A;
  --green-600: #5FB583;
  --green-soft: rgba(79, 154, 106, 0.20);

  --gold-300: #DDA32E;
  --gold-400: #C98A1B;
  --gold-500: #D2A340;
  --gold-600: #D9A63A;
  --gold-grad: var(--gold-400);
  --gold-grad-soft: rgba(201, 138, 27, 0.20);
  --gold-soft: rgba(201, 138, 27, 0.20);
  --on-gold: #2A1F10;

  --teal: var(--green);
  --teal-soft: var(--green-soft);
  --blue: #6F8FA8;
  --blue-soft: rgba(111, 143, 168, 0.20);
  --orange: #C7661C;
  --orange-soft: rgba(199, 102, 28, 0.20);
  --red: #C24E22;
  --red-soft: rgba(194, 78, 34, 0.18);
  --purple: #9A78B5;
  --purple-soft: rgba(154, 120, 181, 0.20);

  --text-chip: #aeb3bb;
  --text-ok: #5FB583;
  --text-alert: #E08A5F;
  --text-danger: #E08A5F;

  --shadow-1: 3px 3px 0 rgba(0, 0, 0, 0.35);
  --shadow-2: 5px 5px 0 rgba(0, 0, 0, 0.38);
  --shadow-pop: 6px 8px 0 rgba(0, 0, 0, 0.30);

  --tape: rgba(58, 64, 72, 0.92);
  --tape-edge: rgba(255, 255, 255, 0.16);

  --surface: var(--surface-1);
  --surface-0: rgba(255, 255, 255, 0.05);
  --panel-2: var(--surface-2);
  --gold: var(--gold-400);
  --muted: var(--ink-dim);
  --faint: var(--ink-faint);
  --ink-soft: var(--ink-dim);
  --ink-2: var(--ink-dim);
  --amber: var(--gold-400);
  --card-bg: var(--surface-1);
  --scrim: rgba(0, 0, 0, 0.70);
  --on-scrim: #F4F1EC;
  --white-card: #f4f4f2;
  --paper-tint: #33302c;
  --line-mid: rgba(255, 255, 255, 0.28);
  --line-soft: rgba(255, 255, 255, 0.15);
  --line-hairline: rgba(255, 255, 255, 0.14);

  --stamp-ink: #E8703F;
  --stamp-ink-hover: #F58A5C;
  --green-ink: #5FB583;
  --red-ink: #DE6A4A;
  --gold-ink: #D9A63A;
  --blue-ink: #82A5C0;

  --ink-on-blue: #A9C7DE;
  --ink-on-orange: #F0B183;
  --ink-on-orange-deep: #F5C296;
  --ink-on-red: #F2A385;
  --ink-on-green: #9BD8B4;
  --ink-on-green-deep: #79D3A6;
  --ink-on-stamp-soft: #FFB294;
  --ink-on-warn-gold: #E8C87E;
  --ink-on-silver: #C6C9D2;
  --ink-on-bronze: #E0A87C;
  --ink-on-neutral: #A7AFBB;

  --wash-white: rgba(255, 255, 255, 0.07);
  --wash-white-strong: rgba(255, 255, 255, 0.10);
  --wash-good-soft: rgba(79, 154, 106, 0.14);
  --wash-good: rgba(79, 154, 106, 0.20);
  --wash-good-strong: rgba(79, 154, 106, 0.24);
  --wash-bad: rgba(199, 72, 29, 0.22);
  --wash-cream: rgba(201, 138, 27, 0.10);
  --wash-net-ok: rgba(79, 154, 106, 0.22);
  --wash-net-bad: rgba(199, 72, 29, 0.22);
  --hero-wash: rgba(255, 255, 255, 0.04);

  --paper-1: #22262C;
  --paper-2: #1C2025;
  --paper-dot: rgba(255, 255, 255, 0.045);
  --console-bg: #14171A;
  --console-ink: #E9DEC3;
  --console-ok: #7BD88F;
  --console-err: #FF8F6B;

  /* Type and geometry are the same in both themes; only ink changes. */
  color-scheme: dark;
}

/* The type scale and geometry, once, shared by both themes. */
:root {
  --font: "NunitoLocal", "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI",
    system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "FrauncesLocal", "Fraunces", Georgia, "Iowan Old Style",
    "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* ---- Tipografi ------------------------------------------------------
     Satır aralığı her zaman *oransal* (unitless). Bir zamanlar gövdenin
     1.6'sı mutlak bir değerdi ve küçük yazı onu devraldığında satırlar kısa
     kalıyordu: 13.7 px'lik bir paragraf 19.2 px'lik satırlarda koşuyor, iki
     satır içi kod kutusu birbirine 3.9 px kalıyordu. Oranla bu olmaz. */
  --fs-xs: 0.75rem;
  --fs-sm: 0.855rem;
  --fs-md: 1rem;
  --fs-lg: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  --fs-xl: clamp(1.3rem, 1.1rem + 1.2vw, 1.8rem);
  --fs-2xl: clamp(1.6rem, 1.2rem + 2.2vw, 2.6rem);
  --fs-hero: clamp(2.1rem, 1.5rem + 3.4vw, 3.5rem);
  --r-s: 6px;
  --r-m: 8px;
  --r-l: 10px;
  --r-xl: 14px;
  --pill: 999px;
  /* ---- Ölçü ------------------------------------------------------------
     Aralıklar tek yerde. Bir kart ile başka bir kart arasındaki boşluk
     `--inset`den küçük olamaz: bu bir stil tercihi değil, okunabilirlik
     kuralıdır. 8'in altına inen iki yüzey iki ayrı şey gibi görünmez.
     Dokunma hedefi `--tap`: 44 px, her yerde, tavizsiz. */
  /* The gap between stacked, separate things, and between separate surfaces. */
  --gap: 16px;
  --inset: 16px;
  --inset-tight: 12px;
  --tap: 44px;
  --container: min(1160px, 100% - clamp(24px, 6vw, 64px));
  --header-h: 64px;
  --tabbar-h: 60px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(0.22, 0.9, 0.28, 1);
}
