/* ==========================================================================
   CryptoBind Design System — Design Tokens
   Single source of truth. Never hard-code a colour, size, or radius in a
   page stylesheet; always reference a token from this file.
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------------
     1. COLOUR — 10-point ramps (50 lightest → 900 darkest)
     Brand anchors: --navy-700 = #014085 (primary), --orange-500 = #FF6201 (accent)
     --------------------------------------------------------------------- */

  /* Navy — primary brand ramp */
  --navy-50:  #EBF3FC;
  --navy-100: #D2E4F8;
  --navy-200: #A6C8F1;
  --navy-300: #74A8E7;
  --navy-400: #3D82D6;
  --navy-500: #1A61B8;
  --navy-600: #0B4F9E;
  --navy-700: #014085; /* ← BRAND PRIMARY */
  --navy-800: #01346B;
  --navy-900: #01234A;

  /* Orange — accent ramp */
  --orange-50:  #FFF3EB;
  --orange-100: #FFE2CC;
  --orange-200: #FFC499;
  --orange-300: #FFA366;
  --orange-400: #FF8233;
  --orange-500: #FF6201; /* ← BRAND ACCENT (fills / marks only, 3.0:1 on white) */
  --orange-600: #D94F00;
  --orange-700: #B33F00; /* ← accent text on light backgrounds (5.8:1) */
  --orange-800: #8C3100;
  --orange-900: #662400;

  /* Neutral — navy-tinted greys, used for 90% of the interface */
  --neutral-0:   #FFFFFF;
  --neutral-50:  #F7F9FB;
  --neutral-100: #EFF2F6;
  --neutral-200: #E2E7EE;
  --neutral-300: #CBD3DE;
  --neutral-400: #9AA6B7;
  --neutral-500: #6B7889;
  --neutral-600: #4E5A6B;
  --neutral-700: #3A4453;
  --neutral-800: #262E3A;
  --neutral-900: #141A22;

  /* Support ramps — status only, never decorative */
  --success-50:  #E8F6EF;
  --success-500: #12A16A;
  --success-700: #0B6B47;
  --warning-50:  #FDF4E7;
  --warning-500: #C77700;
  --warning-700: #8A5300;
  --danger-50:   #FCECEC;
  --danger-500:  #D33A3A;
  --danger-700:  #962626;

  /* ---------------------------------------------------------------------
     2. SEMANTIC COLOUR — always prefer these over raw ramp values
     --------------------------------------------------------------------- */

  /* Surfaces */
  --color-bg:              var(--neutral-0);
  --color-bg-subtle:       var(--neutral-50);
  --color-bg-muted:        var(--neutral-100);
  --color-bg-inverse:      var(--navy-900);
  --color-bg-brand:        var(--navy-700);
  --color-bg-brand-subtle: var(--navy-50);
  --color-bg-accent:       var(--orange-500);
  --color-bg-accent-subtle:var(--orange-50);

  /* Text */
  --color-text:            var(--neutral-800);
  --color-text-strong:     var(--neutral-900);
  --color-text-muted:      var(--neutral-600);
  --color-text-subtle:     var(--neutral-500);
  --color-text-inverse:    var(--neutral-0);
  --color-text-inverse-muted: var(--navy-200);   /* body copy on an inverse surface  */
  --color-text-accent-inverse: var(--orange-400);/* eyebrow/accent on inverse (6.4:1) */
  --color-text-brand:      var(--navy-700);
  --color-text-accent:     var(--orange-700);
  --color-text-link:       var(--navy-700);
  --color-text-link-hover: var(--navy-900);

  /* Borders */
  --color-border:          var(--neutral-200);
  --color-border-strong:   var(--neutral-300);
  --color-border-brand:    var(--navy-700);
  --color-border-accent:   var(--orange-500);
  --color-border-inverse:  rgba(255, 255, 255, 0.16);

  /* Interaction */
  --color-focus-ring:      var(--orange-500);
  --color-selection-bg:    var(--orange-100);
  --color-highlight-bg:    var(--orange-100);
  --color-highlight-text:  var(--orange-900);

  /* Status */
  --color-success:         var(--success-700);
  --color-success-bg:      var(--success-50);
  --color-warning:         var(--warning-700);
  --color-warning-bg:      var(--warning-50);
  --color-danger:          var(--danger-700);
  --color-danger-bg:       var(--danger-50);
  --color-info:            var(--navy-700);
  --color-info-bg:         var(--navy-50);

  /* ---------------------------------------------------------------------
     3. TYPOGRAPHY
     --------------------------------------------------------------------- */
  --font-sans: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --fw-light:     300;
  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;

  /* Type scale — 1.200 minor third, rebased for a content-first reading page */
  --fs-display:  2.5rem;   /* 40px — hero only            */
  --fs-h1:       2.125rem; /* 34px                        */
  --fs-h2:       1.625rem; /* 26px — category headings    */
  --fs-h3:       1.1875rem;/* 19px — question rows        */
  --fs-h4:       1.0625rem;/* 17px                        */
  --fs-body-lg:  1.125rem; /* 18px — hero support copy    */
  --fs-body:     1.0625rem;/* 17px — default body         */
  --fs-body-sm:  0.9375rem;/* 15px                        */
  --fs-caption:  0.8125rem;/* 13px                        */
  --fs-overline: 0.75rem;  /* 12px — uppercase eyebrow    */

  --lh-tight:    1.15;
  --lh-snug:     1.3;
  --lh-normal:   1.5;
  --lh-relaxed:  1.7;   /* answer body copy */

  --ls-tight:   -0.02em;
  --ls-normal:   0;
  --ls-wide:     0.02em;
  --ls-caps:     0.08em;

  --measure:     68ch;  /* comfortable line length for answers */

  /* ---------------------------------------------------------------------
     4. SPACING — 4px base unit
     --------------------------------------------------------------------- */
  --space-0:  0;
  --space-1:  0.25rem;  /*  4px */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* ---------------------------------------------------------------------
     5. LAYOUT
     --------------------------------------------------------------------- */
  --container-max: 960px;   /* THE rail — header, nav, content and footer all use it */
  --container-wide: 1160px; /* reserved for future full-bleed sections */
  --gutter: var(--space-5);
  --header-height: 84px;
  --logo-height: 44px;      /* header logo, desktop */
  --logo-height-sm: 34px;   /* header logo, ≤560px  */
  --tap-target: 44px;       /* minimum interactive size */

  /* ---------------------------------------------------------------------
     6. RADIUS
     --------------------------------------------------------------------- */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   10px;  /* default: inputs, buttons, accordions */
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* ---------------------------------------------------------------------
     7. BORDERS
     --------------------------------------------------------------------- */
  --border-hairline: 1px solid var(--color-border);
  --border-strong:   1px solid var(--color-border-strong);
  --border-brand:    1px solid var(--color-border-brand);
  --border-accent-marker: 3px solid var(--color-border-accent); /* left rule on active items */
  --border-width-focus: 2px;

  /* ---------------------------------------------------------------------
     8. ELEVATION — used sparingly; dividers are preferred over shadows
     --------------------------------------------------------------------- */
  --elevation-0: none;
  --elevation-1: 0 1px 2px rgba(1, 35, 74, 0.05);
  --elevation-2: 0 2px 8px rgba(1, 35, 74, 0.07);
  --elevation-3: 0 8px 24px rgba(1, 35, 74, 0.10);
  --elevation-4: 0 16px 40px rgba(1, 35, 74, 0.14);
  --focus-ring: 0 0 0 var(--border-width-focus) var(--color-bg), 0 0 0 4px var(--color-focus-ring);

  /* ---------------------------------------------------------------------
     9. MOTION — fast, subtle, always reduced-motion aware
     --------------------------------------------------------------------- */
  --duration-instant: 80ms;
  --duration-fast:    140ms;
  --duration-base:    220ms;
  --duration-slow:    320ms;
  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);

  /* ---------------------------------------------------------------------
     10. Z-INDEX
     --------------------------------------------------------------------- */
  --z-base: 1;
  --z-sticky: 100;
  --z-header: 200;
  --z-overlay: 300;
  --z-toast: 400;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}

/* ==========================================================================
   BASE / RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 84px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--color-text-strong);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: var(--ls-normal); }
h4 { font-size: var(--fs-h4); letter-spacing: var(--ls-normal); }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-text-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--color-text-link-hover); }

ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
li { margin-bottom: var(--space-2); }
li:last-child { margin-bottom: 0; }

img, svg { max-width: 100%; }
svg { display: block; }

::selection { background: var(--color-selection-bg); color: var(--color-text-strong); }

:focus-visible {
  outline: var(--border-width-focus) solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

hr {
  border: 0;
  border-top: var(--border-hairline);
  margin: var(--space-8) 0;
}
