/* ==========================================================================
   Everwake — Design Tokens
   The single source of truth for colour, type, space and motion.
   Website, proposals, deck and social templates all consume this file.
   Change a value here and every Everwake surface follows.
   ========================================================================== */

:root {
  /* ---- Brand core ------------------------------------------------------
     Sampled from the Everwake company profile. Do not alter these two. */
  --ew-navy:            #0B222E;   /* primary surface, ink on light */
  --ew-gold:            #B8913F;   /* accent, rules, the selling half */

  /* ---- Navy ramp ------------------------------------------------------- */
  --ew-navy-deep:       #071822;   /* deepest — deck backdrops, gradients */
  --ew-navy-raised:     #102C3A;   /* cards and panels sitting on navy */
  --ew-navy-soft:       #16384A;   /* hover state for raised panels */
  --ew-hairline-dark:   #2B4A59;   /* rules and borders on navy */

  /* ---- Gold ramp -------------------------------------------------------
     --ew-gold passes AA on navy (5.9:1) but only 2.7:1 on white.
     Use --ew-gold-ink for gold text on light surfaces. */
  --ew-gold-bright:     #D4A94B;   /* hover / active on navy */
  --ew-gold-ink:        #8A6B23;   /* gold text on light surfaces (5.0:1) */
  --ew-gold-wash:       #F6F0E2;   /* tinted surface, callouts */
  --ew-gold-line:       #E3D4AE;   /* hairline on light, gold family */

  /* ---- Light surfaces --------------------------------------------------- */
  --ew-surface:         #FFFFFF;
  --ew-paper:           #F3F5F6;   /* page background, light mode */
  --ew-paper-sunk:      #E9EDEF;   /* wells, table stripes */
  --ew-hairline:        #DFE5E8;   /* rules and borders on light */

  /* ---- Text ------------------------------------------------------------- */
  --ew-ink:             #0B222E;   /* body on light */
  --ew-ink-muted:       #51666F;   /* secondary on light (6.3:1) */
  --ew-on-navy:         #FFFFFF;   /* body on navy (16.0:1) */
  --ew-on-navy-muted:   #9FB3BC;   /* secondary on navy (7.4:1) */

  /* ---- Status ----------------------------------------------------------
     Desaturated to sit beside the brand without shouting. */
  --ew-positive:        #2E7D5B;
  --ew-positive-wash:   #E8F2ED;
  --ew-caution:         #9A6B1E;
  --ew-caution-wash:    #FBF2E2;
  --ew-critical:        #A33B32;
  --ew-critical-wash:   #FAECEA;

  /* ---- Typography -------------------------------------------------------
     Apple's type system. On Mac, iPhone and iPad, -apple-system renders
     San Francisco itself — the exact font apple.com uses. SF Pro cannot be
     legally embedded on a website, so every other device falls back to
     Inter, the closest openly licensed match (it has the same optical-size
     behaviour: tighter at display sizes, looser at text sizes).
     One family for everything, as Apple does: no separate serif body. */
  --ew-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
                     "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ew-font-ui:      -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
                     "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ew-font-body:    var(--ew-font-ui);
  --ew-font-mono:    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ew-font-ar:      -apple-system, BlinkMacSystemFont, "SF Arabic", "IBM Plex Sans Arabic",
                     "Noto Sans Arabic", Tahoma, sans-serif;

  /* Type scale, taken from apple.com's own sizes and clamped for mobile. */
  --ew-text-xs:   0.75rem;                                    /* 12 */
  --ew-text-sm:   0.875rem;                                   /* 14 */
  --ew-text-base: 1rem;                                       /* 16 */
  --ew-text-md:   1.0625rem;                                  /* 17 — Apple body */
  --ew-text-lg:   clamp(1.1875rem, 1.12rem + 0.3vw,  1.3125rem); /* 19 → 21 */
  --ew-text-xl:   clamp(1.5rem,    1.38rem + 0.5vw,  1.75rem);   /* 24 → 28 */
  --ew-text-2xl:  clamp(2rem,      1.55rem + 1.9vw,  3rem);      /* 32 → 48 */
  --ew-text-3xl:  clamp(2.5rem,    2rem + 2.1vw,     3.5rem);    /* 40 → 56 */
  --ew-text-4xl:  clamp(2.75rem,   1.7rem + 4.4vw,   5rem);      /* 44 → 80 */

  --ew-leading-tight:   1.05;
  --ew-leading-snug:    1.1;
  --ew-leading-normal:  1.381;   /* Apple, 21px */
  --ew-leading-relaxed: 1.4706;  /* Apple, 17px body */

  /* Apple tracks San Francisco per size: tighter for big display type,
     slightly negative for body. These are apple.com's values. */
  --ew-track-hero:    -0.015em;  /* 80px */
  --ew-track-heading: -0.003em;  /* 48px */
  --ew-track-title:    0.009em;  /* 24px */
  --ew-track-intro:    0.011em;  /* 21px */
  --ew-track-body:    -0.022em;  /* 17px */
  --ew-track-small:   -0.016em;  /* 14px */
  --ew-track-label:    0.14em;   /* Everwake's wide caps label */
  --ew-track-tight:   var(--ew-track-heading);
  --ew-track-snug:    var(--ew-track-title);

  /* ---- Space — 4px base ------------------------------------------------- */
  --ew-space-1:  0.25rem;  --ew-space-2:  0.5rem;   --ew-space-3: 0.75rem;
  --ew-space-4:  1rem;     --ew-space-5:  1.5rem;   --ew-space-6: 2rem;
  --ew-space-7:  2.5rem;   --ew-space-8:  3rem;     --ew-space-9: 4rem;
  --ew-space-10: 5rem;     --ew-space-11: 6.5rem;   --ew-space-12: 8rem;

  /* ---- Layout ----------------------------------------------------------- */
  --ew-measure:       68ch;    /* readable line length for body copy */
  --ew-container:     1180px;
  --ew-container-wide:1360px;
  --ew-gutter:        clamp(1.25rem, 0.75rem + 2.2vw, 3rem);

  /* ---- Radius, shadow, motion ------------------------------------------- */
  --ew-radius-sm: 3px;
  --ew-radius:    6px;
  --ew-radius-lg: 12px;
  --ew-radius-xl:  18px;
  --ew-radius-2xl: 24px;
  --ew-radius-pill: 980px;

  --ew-shadow-sm: 0 1px 2px rgba(11, 34, 46, 0.06);
  --ew-shadow:    0 2px 8px rgba(11, 34, 46, 0.07), 0 1px 2px rgba(11, 34, 46, 0.05);
  --ew-shadow-lg: 0 18px 48px rgba(11, 34, 46, 0.13), 0 2px 8px rgba(11, 34, 46, 0.06);

  --ew-ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
  --ew-dur-fast:  140ms;
  --ew-dur:       240ms;
  --ew-dur-slow:  520ms;
}

/* Arabic: swap the font stacks, keep every other token identical. */
:lang(ar) {
  --ew-font-display: var(--ew-font-ar);
  --ew-font-ui:      var(--ew-font-ar);
  --ew-font-body:    var(--ew-font-ar);
  --ew-track-hero: 0; --ew-track-heading: 0; --ew-track-title: 0;
  --ew-track-intro: 0; --ew-track-body: 0; --ew-track-small: 0; --ew-track-label: 0;
  --ew-leading-tight: 1.25; --ew-leading-snug: 1.3;   /* Arabic needs taller lines */
}

@media (prefers-reduced-motion: reduce) {
  :root { --ew-dur-fast: 0ms; --ew-dur: 0ms; --ew-dur-slow: 0ms; }
}
