/* =========================================================
   Alherin Solutions — Design Tokens
   Derived from brand mark: geometric orange/black "A·S" logo.

   Three layers:
   1. Brand scales   — the logo orange and logo ink, extended into tints/shades.
                       No other hues: depth comes from tone, not new colours.
   2. Semantic roles — what components use (primary, accent, surface, text …).
   3. Tones          — .tone-* classes re-map the roles for a whole section
                       (base ink / raised ink / warm ember / light paper), so every
                       component placed inside adapts without its own overrides.

   Colour budget (roughly): 70% neutral ink/paper surfaces, 20% secondary
   (warm sand / bone neutrals, borders, tonal layers), 10% orange — reserved for
   CTAs, active/selected states, key numbers and small highlights.
   ========================================================= */
:root{
  /* ---- 1. Brand scales ---- */
  /* Orange (logo #FF5C00 = 500) */
  --orange-050: #FFF4EC;
  --orange-100: #FFE3CF;
  --orange-200: #FFC49E;
  --orange-300: #FF9D63;
  --orange-400: #FF7A2E;
  --orange-500: #FF5C00;
  --orange-600: #E04E00;
  --orange-700: #B83F00;
  --orange-800: #7A2A00;
  --orange-900: #3D1705;
  --orange-950: #1A0C05;

  /* Ink (logo near-black = 950), faintly warm so it sits with the orange */
  --ink-950: #0B0B0D;
  --ink-900: #111114;
  --ink-850: #151518;
  --ink-800: #1B1B1F;
  --ink-750: #222226;
  --ink-700: #2A2A2F;
  --ink-600: #3A3A40;
  --ink-500: #56565E;
  --ink-400: #8E8E96;
  --ink-300: #B9B8BD;
  --ink-200: #D8D6D3;

  /* Sand / bone: the warm light end of the same palette (paper sections, secondary text on dark) */
  --sand-050: #FBF8F4;
  --sand-100: #F5F0E9;
  --sand-200: #ECE4D9;
  --sand-300: #DDD2C3;
  --sand-400: #C4B6A4;
  --sand-500: #9C8F7E;
  --sand-700: #5E5448;

  /* Ember: ink warmed by the logo orange (process, closing CTA, pricing highlights) */
  --ember-950: #120B08;
  --ember-900: #170E09;
  --ember-850: #1A110C;
  --ember-800: #1D120C;
  --ember-750: #22160F;
  --ember-700: #2C1C12;
  --ember-600: #33221A;
  --ember-500: #4A3122;

  /* Fixed-on-dark (overlays on imagery keep these whatever the section tone) */
  --on-dark: #F7F5F2;
  --scrim: rgba(11,11,13,.55);
  --brand-mark-ink: var(--on-dark);      /* the logo's "A" strokes: light on dark, ink on paper */

  /* Legacy names (kept so nothing downstream breaks) */
  --color-primary: var(--orange-500);
  --color-primary-600: var(--orange-600);
  --color-primary-400: var(--orange-400);
  --color-primary-200: var(--orange-200);
  --color-primary-050: var(--orange-050);
  --color-ink: var(--ink-950);
  --color-ink-soft: var(--ink-900);

  /* ---- 2. Semantic roles (default = dark "base" tone) ---- */
  --primary: var(--orange-500);          /* CTAs, active, selected */
  --primary-hover: var(--orange-400);
  --primary-active: var(--orange-600);
  --on-primary: var(--ink-950);          /* 6.5:1 on orange-500 */
  --secondary: var(--sand-200);          /* secondary buttons, bone highlights */
  --secondary-hover: var(--sand-100);
  --on-secondary: var(--ink-950);
  --accent: var(--orange-300);           /* key numbers, highlights, icons on dark */
  --text-accent: var(--orange-400);      /* small orange text: eyebrows, links, categories (AA on ink) */

  --bg: var(--ink-950);
  --surface: var(--ink-850);             /* cards */
  --surface-2: var(--ink-800);           /* inputs, nested panels */
  --surface-3: var(--ink-750);           /* chips, tracks */
  --surface-elevated: var(--ink-800);    /* modals, menus, featured cards */
  --surface-tint: rgba(255,92,0,.06);    /* warm wash behind highlighted blocks */
  --border: var(--ink-700);
  --border-strong: var(--ink-600);
  --border-accent: rgba(255,92,0,.45);
  --divider: rgba(255,255,255,.06);

  --text-heading: var(--on-dark);
  --text-primary: #F6F6F5;
  --text-secondary: #C9C7C4;
  --text-muted: var(--ink-400);
  --text-on-primary: var(--on-primary);
  --text-warm: var(--sand-400);           /* secondary-role labels: roles, meta, footer heads (9:1 on ink) */

  /* Tints of the primary for hover washes, selections, rings */
  --tint-subtle: rgba(255,92,0,.07);
  --tint: rgba(255,92,0,.13);
  --tint-strong: rgba(255,92,0,.22);
  --ring: 0 0 0 3px rgba(255,92,0,.32);

  /* ---- Semantic status ---- */
  --color-success: #3FCF7A;
  --color-success-soft: rgba(63,207,122,.12);
  --color-warning: #F5B042;
  --color-warning-soft: rgba(245,176,66,.12);
  --color-error: #FF6B5E;
  --color-error-soft: rgba(255,107,94,.12);
  --color-info: var(--sand-300);         /* informational = bone, not a new hue */
  --color-info-soft: rgba(221,210,195,.10);

  /* ---- Typography ---- */
  --font-display: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Poppins', Roboto, Helvetica, Arial, sans-serif;

  --fs-display: clamp(2.75rem, 3.2vw + 2rem, 6.25rem);
  --fs-h1: clamp(2.25rem, 2vw + 1.75rem, 3.75rem);
  --fs-h2: clamp(1.75rem, 1.4vw + 1.4rem, 2.75rem);
  --fs-h3: clamp(1.375rem, .8vw + 1.15rem, 1.75rem);
  --fs-h4: 1.25rem;
  --fs-body-lg: 1.125rem;
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-micro: .75rem;

  --lh-tight: 1.05;
  --lh-snug: 1.25;
  --lh-normal: 1.55;

  /* ---- Spacing scale ---- */
  --space-3xs: .25rem;
  --space-2xs: .5rem;
  --space-xs: .75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --space-3xl: 6rem;
  --space-4xl: 9rem;

  --section-pad: clamp(4rem, 6vw, 8rem);
  --container-w: 1280px;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);

  /* ---- Shape ---- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --notch: 16px; /* diagonal corner-cut echoing the logo's angular mark */

  /* ---- Elevation: ink shadows + a top highlight so dark cards read as raised ---- */
  --highlight: inset 0 1px 0 rgba(255,255,255,.045);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 10px 28px -12px rgba(0,0,0,.65);
  --shadow-lg: 0 28px 64px -20px rgba(0,0,0,.7);
  --shadow-glow: 0 0 0 1px rgba(255,92,0,.25), 0 12px 40px -8px rgba(255,92,0,.35);
  --shadow-cta: 0 10px 28px -10px rgba(255,92,0,.6);

  /* ---- Motion (mirrored for JS in scripts/motion-tokens.js — keep the two in step) ----
     Tiers: micro (state feedback) · fast (hover, small UI) · standard (component enter/exit)
            · cinematic (section reveals, image reveals) · hero (the opening sequence only). */
  --dur-micro: 160ms;
  --dur-fast: 280ms;
  --dur-standard: 450ms;
  --dur-cinematic: 800ms;
  --dur-hero: 1200ms;
  --ease-out: cubic-bezier(.16,1,.3,1);        /* expo.out — the house curve: quick start, long confident settle */
  --ease-out-soft: cubic-bezier(.33,1,.68,1);  /* power2.out — hovers, colour and border changes */
  --ease-out-strong: cubic-bezier(.22,1,.36,1);/* power4.out — reveals with more weight */
  --ease-in-out: cubic-bezier(.65,0,.35,1);    /* power3.inOut — things that move and stop (menus, drawers) */
  --ease-press: cubic-bezier(.3,0,.5,1);       /* press-down */
  /* legacy aliases */
  --dur-base: var(--dur-fast);
  --dur-slow: var(--dur-cinematic);

  --z-nav: 100;
  --z-overlay: 200;
  --z-modal: 300;
}

/* =========================================================
   3. Section tones — alternate these between major sections for rhythm.
   ========================================================= */
.tone-base{ background: var(--bg); }

/* One step up from the page: logo ink, hairline dividers. */
.tone-raised{
  --bg: var(--ink-900);
  --surface: var(--ink-800);
  --surface-2: var(--ink-750);
  --surface-3: var(--ink-700);
  --surface-elevated: var(--ink-750);
  --border: #2E2E33;
  --border-strong: #404047;
  background: var(--bg);
  border-block: 1px solid var(--divider);
}

/* Warm ember: ink washed with the logo orange — for process, stats, closing CTA. */
.tone-ember{
  --bg: var(--ember-950);
  --surface: var(--ember-850);
  --surface-2: var(--ember-750);
  --surface-3: var(--ember-700);
  --surface-elevated: var(--ember-750);
  --border: var(--ember-600);
  --border-strong: var(--ember-500);
  --text-secondary: #D4CBC3;
  --text-muted: #A39488;
  background:
    radial-gradient(70% 60% at 85% 0%, rgba(255,92,0,.14), transparent 70%),
    linear-gradient(180deg, var(--ember-900) 0%, var(--ink-950) 100%);
  border-block: 1px solid rgba(255,92,0,.10);
}

/* Light paper: the brand's light side (the logo also runs dark-on-light). */
.tone-light{
  --bg: var(--sand-100);
  --surface: #FFFFFF;
  --surface-2: var(--sand-050);
  --surface-3: var(--sand-200);
  --surface-elevated: #FFFFFF;
  --surface-tint: rgba(255,92,0,.05);
  --border: var(--sand-200);
  --border-strong: var(--sand-300);
  --border-accent: rgba(184,63,0,.35);
  --divider: rgba(17,17,20,.07);
  --text-heading: var(--ink-950);
  --text-primary: var(--ink-900);
  --text-secondary: #45423D;             /* 9:1 on sand-100 */
  --text-muted: var(--sand-700);         /* 6.4:1 */
  --text-accent: var(--orange-700);      /* orange text on paper: 5.3:1 */
  --text-warm: var(--sand-700);
  --accent: var(--orange-700);
  --secondary: var(--ink-950);
  --secondary-hover: var(--ink-800);
  --on-secondary: #FFFFFF;
  --tint-subtle: rgba(255,92,0,.05);
  --tint: rgba(255,92,0,.09);
  --tint-strong: rgba(255,92,0,.16);
  --color-success: #177A40;
  --color-error: #C23A2E;
  --color-warning: #A86200;
  --color-info: var(--sand-700);
  --highlight: inset 0 1px 0 rgba(255,255,255,.9);
  --shadow-sm: 0 1px 2px rgba(40,28,16,.06);
  --shadow-md: 0 12px 30px -14px rgba(40,28,16,.22);
  --shadow-lg: 0 28px 60px -24px rgba(40,28,16,.28);
  --brand-mark-ink: var(--ink-950);
  background: var(--bg);
  color: var(--text-primary);
  color-scheme: light;
}
