/* ==========================================================================
   UĞUR YOLU — DESIGN TOKENS
   Single source of truth for every color, radius, space, type, motion and
   shadow value in the codebase. No hardcoded hex/px-radius/ms anywhere else.
   See design.md for the full token table and decision log.

   Breakpoint constants (CSS custom properties cannot drive media queries —
   keep these in sync manually wherever a media query is written):
     --bp-sm: 480px   --bp-md: 768px   --bp-lg: 1024px   --bp-xl: 1280px
   ========================================================================== */

:root {
  /* ---- Base palette (brochure-derived; deepened in S5 for glass contrast) ---- */
  --base-plum: #5A2D5F;          /* brochure primary, deepened from #663366 (S5) */
  --base-slate: #5B5B9E;         /* brochure secondary, deepened from #666699 (S5) */
  --base-red-signal: #F5322E;    /* sampled from wordmark — provisional */
  --base-red-text: #C22A21;      /* red nudged darker for AA text/CTA contrast on paper */
  --base-gold: #D9B26A;          /* dusty pastel gold, candidate 1 (see design.md) */
  --base-ink: #000000;
  --base-paper: #FFFFFF;
  --base-ivory: #FAF7F1;
  --base-grey-100: #F4F4F4;
  --base-grey-300: #D9D9D9;
  --base-grey-600: #5C5C5C;

  /* RGB triplets — feed rgba() for glass surfaces, tints and soft shadows */
  --base-plum-rgb: 90, 45, 95;
  --base-slate-rgb: 91, 91, 158;
  --base-red-rgb: 194, 42, 33;
  --base-gold-rgb: 217, 178, 106;
  --base-ink-rgb: 0, 0, 0;
  --base-paper-rgb: 255, 255, 255;

  /* Pastel tints — base hexes mixed toward paper for large surfaces */
  --base-plum-pastel: #F0E8F0;
  --base-slate-pastel: #E9E9F3;
  --base-red-pastel: #FBE9E7;
  --base-gold-pastel: #F6EEDD;

  /* ---- Radius — sharp angles by decree ---- */
  --radius-none: 0;
  --radius-hair: 2px; /* ONLY documented exception: form inputs. Logged in design.md. */

  /* ---- Spacing — 4/8pt scale ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* ---- Type scale (mobile-first; display sizes fluid) ---- */
  --text-2xs: 0.5625rem;  /* ~9px — brand tagline under the wordmark only */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;   /* 17px body on mobile */
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.375rem, 1.2rem + 1vw, 1.625rem);
  --text-2xl: clamp(1.625rem, 1.35rem + 1.6vw, 2.125rem);
  --text-3xl: clamp(1.95rem, 1.5rem + 2.4vw, 2.75rem);
  --text-4xl: clamp(2.35rem, 1.7rem + 3.4vw, 3.5rem);
  --text-5xl: clamp(2.75rem, 1.9rem + 4.6vw, 4.25rem);

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-body: 1.65;

  --tracking-normal: 0;
  --tracking-caps: 0.14em;   /* tracked uppercase labels: nav, tags, eyebrows */
  --tracking-wide: 0.22em;   /* extra-tracked: wordmark, section stamps */

  /* ---- Motion ---- */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.22, 1, 0.36, 1);

  /* ---- Glass (S5 — glassmorphism layer) ----
     Frosted surfaces = translucent white + backdrop blur + 1px light border.
     Corners stay sharp (--radius-none); glass never softens the geometry. */
  --glass-blur: 16px;            /* cards, buttons, tags, inputs */
  --glass-blur-strong: 22px;     /* header, mobile nav panel, footer */
  --glass-white: rgba(var(--base-paper-rgb), 0.66);        /* standard pane */
  --glass-white-strong: rgba(var(--base-paper-rgb), 0.82); /* text-heavy panes */
  --glass-border: rgba(var(--base-paper-rgb), 0.55);       /* light pane edge */
  --glass-border-ink: rgba(var(--base-ink-rgb), 0.14);     /* hairline on pale bg */
  --glass-highlight: inset 0 1px 0 rgba(var(--base-paper-rgb), 0.35); /* top gleam */
  --glass-nav-border: rgba(var(--base-paper-rgb), 0.22);   /* edge on plum glass */

  /* ---- Shadow — layered soft, plum-tinted (S5; replaces the hard sticker) ---- */
  --shadow-rgb: var(--base-plum-rgb); /* remap per platter if ever needed */
  --shadow-glass:
    0 1px 2px rgba(var(--shadow-rgb), 0.10),
    0 8px 24px rgba(var(--shadow-rgb), 0.16);
  --shadow-glass-hover:
    0 3px 6px rgba(var(--shadow-rgb), 0.12),
    0 16px 40px rgba(var(--shadow-rgb), 0.22);
  --shadow-glass-sm: 0 1px 4px rgba(var(--shadow-rgb), 0.14);
  /* Legacy aliases — retired sticker names resolve to the soft shadows */
  --shadow-sticker: var(--shadow-glass);
  --shadow-sticker-hover: var(--shadow-glass-hover);

  /* ---- Layout ---- */
  --measure: 65ch;
  --container-max: 1160px;
  --tap-min: 44px;
}

/* ==========================================================================
   TYPOGRAPHY — Pairing C chosen by client (Session 2):
   Cormorant Garamond display / IBM Plex Sans body / IBM Plex Mono codes.
   ========================================================================== */

:root {
  --font-display: "Cormorant Garamond", "Georgia", serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

/* ==========================================================================
   SEMANTIC COLOR ROLES — every component consumes ONLY these.
   Platter 1 "Ministerial Plum" chosen by client (Session 2). The four
   alternate platters below are retained inert for reference; the switcher
   UI has been removed.
   ========================================================================== */

:root,
html[data-theme="p1"] {
  /* -------- Platter 1 — "Ministerial Plum" (CHOSEN) -------- */
  --color-primary: var(--base-plum);
  --color-primary-pastel: var(--base-plum-pastel);
  --color-secondary: var(--base-slate);
  --color-secondary-pastel: var(--base-slate-pastel);
  --color-accent: var(--base-red-text);
  --color-accent-pastel: var(--base-red-pastel);
  --color-tertiary: var(--base-gold);
  --color-tertiary-pastel: var(--base-gold-pastel);
  --color-ink: var(--base-ink);
  --color-paper: var(--base-paper);
  --color-muted: var(--base-grey-600);
  --color-border: var(--base-grey-300);
  --color-shadow: var(--base-plum);

  /* S5 glass: nav/footer are plum-tinted glass; hero/section are translucent
     tints so the ambient mesh reads through; cards are frosted white panes. */
  --surface-nav: rgba(var(--base-plum-rgb), 0.86);
  --surface-nav-ink: var(--base-paper);
  --surface-hero: rgba(var(--base-plum-rgb), 0.07);
  --surface-hero-ink: var(--base-ink);
  --surface-section: rgba(var(--base-slate-rgb), 0.09);
  --surface-card: var(--glass-white);
  --surface-footer: rgba(var(--base-plum-rgb), 0.88);
  --surface-footer-ink: var(--base-paper);

  --color-headline: var(--base-plum);
  --color-eyebrow: var(--base-red-text);
  --color-link: var(--base-red-text);
  --color-cta-bg: var(--base-red-text);
  --color-cta-ink: var(--base-paper);
  --color-cta2-bg: var(--base-plum);
  --color-cta2-ink: var(--base-paper);
  --color-tag-bg: rgba(var(--base-slate-rgb), 0.12);
  --color-tag-ink: var(--base-slate);
  --color-tag-border: rgba(var(--base-slate-rgb), 0.45);
  --color-code-bg: rgba(var(--base-red-rgb), 0.09);
  --color-code-ink: var(--base-red-text);
  --color-micro: var(--base-gold); /* gold: micro-accents only */
}

html[data-theme="p2"] {
  /* -------- Platter 2 — "Ivory Protocol" -------- */
  --color-primary: var(--base-plum);
  --color-primary-pastel: var(--base-ivory);
  --color-secondary: var(--base-slate);
  --color-secondary-pastel: var(--base-ivory);
  --color-accent: var(--base-red-text);
  --color-accent-pastel: var(--base-red-pastel);
  --color-tertiary: var(--base-gold);
  --color-tertiary-pastel: var(--base-gold-pastel);
  --color-ink: var(--base-ink);
  --color-paper: var(--base-paper);
  --color-muted: var(--base-grey-600);
  --color-border: var(--base-grey-300);
  --color-shadow: var(--base-ink);

  --surface-nav: var(--base-paper);
  --surface-nav-ink: var(--base-plum);
  --surface-hero: var(--base-ivory);
  --surface-hero-ink: var(--base-ink);
  --surface-section: var(--base-ivory);
  --surface-card: var(--base-paper);
  --surface-footer: var(--base-ivory);
  --surface-footer-ink: var(--base-ink);

  --color-headline: var(--base-plum);
  --color-eyebrow: var(--base-grey-600);
  --color-link: var(--base-plum);
  --color-cta-bg: var(--base-red-text);   /* red on the single primary CTA only */
  --color-cta-ink: var(--base-paper);
  --color-cta2-bg: var(--base-paper);
  --color-cta2-ink: var(--base-ink);
  --color-tag-bg: var(--base-gold-pastel); /* gold tag chips */
  --color-tag-ink: var(--base-ink);
  --color-tag-border: var(--base-gold);
  --color-code-bg: var(--base-gold-pastel);
  --color-code-ink: var(--base-ink);
  --color-micro: var(--base-slate);        /* slate = thin rule lines only */
}

html[data-theme="p3"] {
  /* -------- Platter 3 — "Signal Protocol" -------- */
  --color-primary: var(--base-red-text);
  --color-primary-pastel: var(--base-red-pastel);
  --color-secondary: var(--base-plum);
  --color-secondary-pastel: var(--base-slate-pastel);
  --color-accent: var(--base-red-text);
  --color-accent-pastel: var(--base-red-pastel);
  --color-tertiary: var(--base-gold);
  --color-tertiary-pastel: var(--base-gold-pastel);
  --color-ink: var(--base-ink);
  --color-paper: var(--base-paper);
  --color-muted: var(--base-grey-600);
  --color-border: var(--base-grey-300);
  --color-shadow: var(--base-ink);

  --surface-nav: var(--base-red-text);
  --surface-nav-ink: var(--base-paper);
  --surface-hero: var(--base-red-pastel);
  --surface-hero-ink: var(--base-ink);
  --surface-section: var(--base-slate-pastel); /* slate pastel card backgrounds */
  --surface-card: var(--base-paper);
  --surface-footer: var(--base-red-text);
  --surface-footer-ink: var(--base-paper);

  --color-headline: var(--base-red-text);
  --color-eyebrow: var(--base-plum);           /* plum as secondary headline color */
  --color-link: var(--base-red-text);
  --color-cta-bg: var(--base-red-text);
  --color-cta-ink: var(--base-paper);
  --color-cta2-bg: var(--base-plum);
  --color-cta2-ink: var(--base-paper);
  --color-tag-bg: var(--base-slate-pastel);
  --color-tag-ink: var(--base-plum);
  --color-tag-border: var(--base-slate);
  --color-code-bg: var(--base-red-pastel);
  --color-code-ink: var(--base-red-text);
  --color-micro: var(--base-gold); /* gold reserved for the featured ribbon */
}

html[data-theme="p4"] {
  /* -------- Platter 4 — "Slate Formal" -------- */
  --color-primary: var(--base-slate);
  --color-primary-pastel: var(--base-slate-pastel);
  --color-secondary: var(--base-plum);
  --color-secondary-pastel: var(--base-plum-pastel);
  --color-accent: var(--base-red-text);
  --color-accent-pastel: var(--base-red-pastel);
  --color-tertiary: var(--base-gold);
  --color-tertiary-pastel: var(--base-gold-pastel);
  --color-ink: var(--base-ink);
  --color-paper: var(--base-paper);
  --color-muted: var(--base-grey-600);
  --color-border: var(--base-grey-300);
  --color-shadow: var(--base-slate);

  --surface-nav: var(--base-slate);
  --surface-nav-ink: var(--base-paper);
  --surface-hero: var(--base-slate-pastel);
  --surface-hero-ink: var(--base-ink);
  --surface-section: var(--base-slate-pastel);
  --surface-card: var(--base-paper);
  --surface-footer: var(--base-slate);
  --surface-footer-ink: var(--base-paper);

  --color-headline: var(--base-plum);          /* plum for headline text only */
  --color-eyebrow: var(--base-slate);
  --color-link: var(--base-plum);
  --color-cta-bg: var(--base-red-text);        /* red strictly for CTAs + codes */
  --color-cta-ink: var(--base-paper);
  --color-cta2-bg: var(--base-slate);
  --color-cta2-ink: var(--base-paper);
  --color-tag-bg: var(--base-paper);
  --color-tag-ink: var(--base-slate);
  --color-tag-border: var(--base-slate);
  --color-code-bg: var(--base-red-pastel);
  --color-code-ink: var(--base-red-text);
  --color-micro: var(--base-gold); /* gold only as hover-state underline */
}

html[data-theme="p5"] {
  /* -------- Platter 5 — "Monochrome Plus One" -------- */
  --color-primary: var(--base-plum);           /* the single accent */
  --color-primary-pastel: var(--base-grey-100);
  --color-secondary: var(--base-grey-600);
  --color-secondary-pastel: var(--base-grey-100);
  --color-accent: var(--base-red-text);
  --color-accent-pastel: var(--base-grey-100);
  --color-tertiary: var(--base-grey-600);      /* no gold */
  --color-tertiary-pastel: var(--base-grey-100);
  --color-ink: var(--base-ink);
  --color-paper: var(--base-paper);
  --color-muted: var(--base-grey-600);
  --color-border: var(--base-grey-300);
  --color-shadow: var(--base-ink);

  --surface-nav: var(--base-paper);
  --surface-nav-ink: var(--base-ink);
  --surface-hero: var(--base-grey-100);
  --surface-hero-ink: var(--base-ink);
  --surface-section: var(--base-grey-100);
  --surface-card: var(--base-paper);
  --surface-footer: var(--base-ink);
  --surface-footer-ink: var(--base-paper);

  --color-headline: var(--base-ink);
  --color-eyebrow: var(--base-grey-600);
  --color-link: var(--base-plum);              /* plum for links/icons/active nav */
  --color-cta-bg: var(--base-red-text);        /* red only on the primary CTA */
  --color-cta-ink: var(--base-paper);
  --color-cta2-bg: var(--base-ink);
  --color-cta2-ink: var(--base-paper);
  --color-tag-bg: var(--base-grey-100);
  --color-tag-ink: var(--base-ink);
  --color-tag-border: var(--base-grey-600);
  --color-code-bg: var(--base-grey-100);
  --color-code-ink: var(--base-ink);
  --color-micro: var(--base-plum);
}
