/* ============================================================
   RIFFSHED — DESIGN TOKENS
   "warm cream + serif, без желтизны" + sepia dark
   ============================================================ */

:root {
  /* ── TYPE ───────────────────────────────────────────────── */
  --font-display: "Newsreader", "Cormorant Garamond", "PT Serif", Georgia, serif;
  --font-sans:    "Geist", "Inter Tight", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale (mobile, ~390px) */
  --text-xxs:   10px;
  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  15px;
  --text-md:    17px;
  --text-lg:    19px;
  --text-xl:    24px;
  --text-2xl:   32px;
  --text-3xl:   44px;
  --text-4xl:   64px;

  --tracking-display: -0.02em;
  --tracking-tight:   -0.01em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-wider:   0.18em;

  /* ── SPACING ────────────────────────────────────────────── */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  56px;
  --space-10: 72px;

  /* ── RADII ──────────────────────────────────────────────── */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-2xl: 28px;
  --radius-pill: 999px;

  /* ── DURATION ───────────────────────────────────────────── */
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 480ms;
  --ease-standard: cubic-bezier(.2, .7, .2, 1);
  --ease-emph:     cubic-bezier(.2, .9, .1, 1);

  /* ── ICON STROKE ────────────────────────────────────────── */
  --icon-stroke: 1.5;
  --icon-stroke-active: 2;
}

/* ============================================================
   LIGHT — paper, ivory, ink
   "warm cream без желтизны" — белые сдвинуты к нейтральнее,
   тени тёплые но не оранжевые.
   ============================================================ */
:root,
[data-theme="light"] {
  /* Surfaces */
  --bg:           oklch(97% 0.006 75);   /* paper, very subtle warm */
  --bg-raised:    oklch(99% 0.004 75);   /* card */
  --bg-sunken:    oklch(94% 0.008 75);   /* recessed wells, chips */
  --bg-overlay:   oklch(99% 0.003 75 / 0.92);

  /* Ink */
  --ink:          oklch(20% 0.01 60);    /* primary text */
  --ink-2:        oklch(38% 0.012 60);   /* secondary */
  --ink-3:        oklch(55% 0.012 60);   /* tertiary, captions */
  --ink-4:        oklch(70% 0.010 60);   /* hint */

  /* Lines */
  --line:         oklch(86% 0.012 70);
  --line-strong:  oklch(72% 0.014 70);

  /* Brand / accent — bronze, less yellow than original */
  --accent:       oklch(58% 0.10  62);   /* bronze */
  --accent-soft:  oklch(80% 0.06  62);
  --accent-deep:  oklch(45% 0.10  55);
  --accent-ink-on: oklch(99% 0.004 75);  /* text on accent */

  /* Secondary accent — moss/forest (from heatmap) */
  --moss:         oklch(48% 0.07 145);
  --moss-soft:    oklch(78% 0.05 145);

  /* Phase palette — semantic, fixed. Mirrors the PWA's tokens 1:1 so the
     marketing site speaks the same colour language as the app it sells.
     Ochre = Explore, azure = Integrate, forest = Mastery. */
  --phase-explore:        oklch(58% 0.10 60);
  --phase-explore-soft:   oklch(92% 0.030 60);
  --phase-integrate:      oklch(50% 0.10 240);
  --phase-integrate-soft: oklch(92% 0.025 240);
  --phase-mastery:        oklch(48% 0.10 155);
  --phase-mastery-soft:   oklch(92% 0.025 155);

  /* Status */
  --success:      oklch(55% 0.12 145);
  --warning:      oklch(65% 0.14 60);
  --danger:       oklch(50% 0.16 28);
  --info:         oklch(50% 0.10 240);

  /* Buttons */
  --btn-primary-bg: oklch(20% 0.01 60);
  --btn-primary-fg: oklch(98% 0.004 75);

  /* Shadows — warm, soft, layered */
  --shadow-1: 0 1px 2px oklch(40% 0.02 60 / 0.06);
  --shadow-2: 0 4px 12px oklch(30% 0.02 60 / 0.06), 0 2px 4px oklch(30% 0.02 60 / 0.04);
  --shadow-3: 0 16px 40px oklch(25% 0.02 60 / 0.10), 0 4px 12px oklch(25% 0.02 60 / 0.06);

  /* Component-level */
  --tabbar-bg: oklch(98% 0.004 75 / 0.85);
  --tabbar-active-line: var(--ink);
  --ring-bg: oklch(88% 0.012 70);
  --ring-fg: var(--accent);

  --shimmer-1: oklch(90% 0.012 70);
  --shimmer-2: oklch(94% 0.008 70);
}

/* ============================================================
   DARK — sepia dark, "бумажная эстетика в тени"
   Тёплый чёрный/коричневый, не графит и не синий.
   ============================================================ */
[data-theme="dark"] {
  --bg:           oklch(16% 0.012 50);   /* deep sepia espresso */
  --bg-raised:    oklch(20% 0.012 50);
  --bg-sunken:    oklch(13% 0.010 50);
  --bg-overlay:   oklch(18% 0.012 50 / 0.94);

  --ink:          oklch(94% 0.010 75);
  --ink-2:        oklch(78% 0.012 70);
  --ink-3:        oklch(60% 0.012 65);
  --ink-4:        oklch(45% 0.012 60);

  --line:         oklch(28% 0.014 55);
  --line-strong:  oklch(40% 0.016 55);

  --accent:       oklch(72% 0.10  68);   /* warmer in dark */
  --accent-soft:  oklch(40% 0.06  62);
  --accent-deep:  oklch(82% 0.09  68);
  --accent-ink-on: oklch(15% 0.01 50);

  --moss:         oklch(62% 0.08 145);
  --moss-soft:    oklch(35% 0.05 145);

  --success:      oklch(70% 0.11 145);
  --warning:      oklch(75% 0.14 60);
  --danger:       oklch(68% 0.15 28);
  --info:         oklch(68% 0.10 240);

  --btn-primary-bg: oklch(94% 0.010 75);
  --btn-primary-fg: oklch(15% 0.01 50);

  --shadow-1: 0 1px 2px oklch(0% 0 0 / 0.5);
  --shadow-2: 0 4px 12px oklch(0% 0 0 / 0.4), 0 2px 4px oklch(0% 0 0 / 0.3);
  --shadow-3: 0 16px 40px oklch(0% 0 0 / 0.5), 0 4px 12px oklch(0% 0 0 / 0.3);

  --tabbar-bg: oklch(18% 0.012 50 / 0.85);
  --tabbar-active-line: var(--ink);
  --ring-bg: oklch(28% 0.014 55);
  --ring-fg: var(--accent);

  --shimmer-1: oklch(24% 0.012 50);
  --shimmer-2: oklch(28% 0.014 55);
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background var(--dur-base) var(--ease-standard),
              color var(--dur-base) var(--ease-standard);
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.t-display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  color: var(--ink);
}
.t-display-lg { font-size: var(--text-3xl); }
.t-display-md { font-size: var(--text-2xl); }
.t-display-sm { font-size: var(--text-xl); }

.t-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 400;
}

.t-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-3);
}

.t-body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--ink-2);
}

.t-num {
  font-family: var(--font-display);
  font-feature-settings: "tnum", "lnum";
  font-weight: 400;
}

/* Tabular numbers for timers */
.tnum { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
