/* ==========================================================================
   tokens.css — single source of truth for colour, type, spacing and layout.
   Nothing in main.css or in any page may hardcode a colour, size or spacing
   value. If a value needs to change, it changes here.
   ==========================================================================

   SECTION 1  Canonical scales (Build Brief §4, verbatim)
   SECTION 2  Surface palette as used in the approved Claude Design mockups
   SECTION 3  Semantic aliases — what the CSS actually references
   SECTION 4  Type
   SECTION 5  Spacing
   SECTION 6  Layout, borders, shadows, motion
*/

:root {

  /* ---------------------------------------------------------------------
     1. CANONICAL SCALES — Build Brief §4
     Green hue locked at 118°, only lightness varies.
     --------------------------------------------------------------------- */

  --green-950: #0C180B;
  --green-900: #142A14;
  --green-700: #1D3B1C;   /* primary */
  --green-600: #2B5629;   /* hover */
  --green-500: #3C7939;
  --green-400: #55AD52;
  --green-300: #88C686;
  --green-200: #BBDEBA;
  --green-100: #DDEFDC;
  --green-50:  #F1F8F1;

  --white:       #FFFFFF;
  --neutral-50:  #F6F6F6;
  --neutral-100: #EAEAEA;
  --neutral-300: #D4D4D4;
  --neutral-400: #A3A3A3;
  --neutral-500: #737373;
  --neutral-700: #454545;
  --neutral-800: #262626;   /* body text */
  --neutral-900: #0F0F0F;


  /* ---------------------------------------------------------------------
     2. SURFACE PALETTE — as used in the approved mockups

     NOTE FOR THE CLIENT: the signed-off design does not sit on the pure
     greys of §4. It sits on a warm paper ground, and uses green tints
     between the §4 steps for rules, numerals and text on dark. Those values
     are recorded here so they are still tokens rather than magic numbers.
     They stay inside the single green hue family — no third hue is
     introduced anywhere in the build.

     To move the site onto the strict §4 greys instead, repoint the
     semantic aliases in §3 at the §4 scale. Nothing else needs to change.
     --------------------------------------------------------------------- */

  /* Warm paper ground */
  --paper:         #F2F0EC;   /* page background            */
  --paper-raised:  #FAF8F5;   /* cards that sit above it    */
  --paper-alt:     #EDEAE4;   /* alternating band           */
  --paper-tile:    #F6F4F0;   /* mortar-joint tile grid     */
  --paper-strip:   #F1EEE8;   /* form header strip          */

  /* Warm rules */
  --rule-strong:   #D6D0C6;   /* 2px section divider        */
  --rule:          #DDD7CD;   /* 1px hairline               */
  --rule-faint:    #E2DDD5;
  --rule-menu:     #EAE6DF;

  /* Warm ink */
  --ink-strong:    #33302B;   /* large intro paragraphs     */
  --ink-muted:     #5A5348;   /* eyebrows, captions, meta   */

  /* Green tints used on dark grounds and as accents */
  --green-accent:  #8FBF8C;   /* rules, numerals, list dashes  */
  --green-on-dark: #C4DCC2;   /* body text on green-700        */
  --green-lede:    #DCE9DA;   /* hero lede                     */
  --green-eyebrow: #9EC79B;   /* eyebrow on photographic dark  */
  --green-quiet:   #B9CFB6;   /* lede inside the dark section  */
  --green-bright:  #F4F8F2;   /* headings on the dark section  */
  --green-hover:   #E7EFE5;   /* menu row hover                */

  /* Dark section gradient stops */
  /* The hero photograph's own ground. Its whole left third samples flat at
     #090909, so the canvas can be extended sideways with this and no seam
     shows at any viewport width. */
  --hero-ground:   #090909;
  /* The photograph carries a soft green glow behind the engine, and the crop
     lands between 38% and 57% of it depending on viewport width, so the tone
     the panel opens on is not fixed. This is the middle of that range: no
     width mismatches by more than about four units of green, which the
     feathered panel edge then absorbs. Flat #090909 against the glow was a
     hard step of eight, and that is visible in a field this dark. */
  --hero-glow:     #090C08;

  /* Not a colour: the opaque end of a mask gradient, where only the alpha is
     read. It lives here because tokens.css is the only file allowed to carry
     a literal, and the audit does not care why one appears. */
  --mask-opaque:   #000;

  --dark-core:     #1A2717;
  --dark-edge:     #0D140C;

  /* Chalk diagram (Home) */

  /* Scrims over the media blocks, and the structural lines in the texture
     that stands in for photography. Kept as tokens so the whole treatment
     is tunable from one place. All are the same green family at low alpha. */
  --scrim-a: rgba(9, 18, 9, 0.95);
  --scrim-b: rgba(12, 24, 11, 0.86);
  --scrim-c: rgba(20, 42, 20, 0.52);
  --scrim-d: rgba(43, 86, 41, 0.22);

  --scrim-cta-a:  rgba(9, 18, 9, 0.93);
  --scrim-cta-b:  rgba(12, 24, 11, 0.80);

  --scrim-band-a: rgba(9, 18, 9, 0.88);
  --scrim-band-b: rgba(20, 42, 20, 0.42);
  --scrim-band-c: rgba(43, 86, 41, 0.18);

  --scrim-panel-top:  rgba(12, 24, 11, 0.04);
  --scrim-panel-base: rgba(12, 24, 11, 0.30);

  --texture-line-a: rgba(143, 191, 140, 0.050);
  --texture-line-b: rgba(143, 191, 140, 0.035);


  /* ---------------------------------------------------------------------
     3. SEMANTIC ALIASES — the names the rest of the CSS uses
     --------------------------------------------------------------------- */

  --bg-page:        var(--paper);
  --bg-raised:      var(--paper-raised);
  --bg-alt:         var(--paper-alt);
  --bg-dark:        var(--green-700);
  --bg-darkest:     var(--green-950);
  --bg-deep:        var(--green-900);

  --text-body:      var(--neutral-800);
  --text-heading:   var(--neutral-900);
  --text-secondary: var(--neutral-700);
  --text-muted:     var(--ink-muted);
  --text-lede:      var(--ink-strong);
  --text-brand:     var(--green-700);
  --text-on-dark:   var(--white);
  --text-on-dark-2: var(--green-on-dark);

  --link:           var(--green-700);
  --link-hover:     var(--green-600);
  --accent:         var(--green-accent);

  --border-strong:  var(--rule-strong);
  --border:         var(--rule);
  --border-dark:    var(--green-500);

  --focus-ring:     var(--green-600);
  --focus-ring-dark: var(--green-200);


  /* ---------------------------------------------------------------------
     4. TYPE
     Display: EB Garamond. Text: IBM Plex Sans. Both self-hosted (§5 of the
     brief — no request may ever reach fonts.googleapis.com).
     Sizes are fluid: the first value is the mobile size, the last is the
     1440px design size.
     --------------------------------------------------------------------- */

  --font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-text:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fw-light:  300;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi:   600;

  /* Fluid display sizes — clamp(min, preferred, max) */
  --fs-hero:    clamp(2.5rem,   1.32rem + 5.24vw, 4.875rem); /* 40 → 78 */
  --fs-h1:      clamp(2.25rem,  1.45rem + 3.56vw, 3.875rem); /* 36 → 62 */
  --fs-h1-sm:   clamp(2rem,     1.44rem + 2.50vw, 3.375rem); /* 32 → 54 */
  --fs-display: clamp(2.125rem, 1.34rem + 3.47vw, 3.625rem); /* 34 → 58 */
  --fs-h2:      clamp(1.875rem, 1.35rem + 2.33vw, 2.875rem); /* 30 → 46 */
  --fs-h2-sm:   clamp(1.75rem,  1.36rem + 1.74vw, 2.5rem);   /* 28 → 40 */
  --fs-h3:      clamp(1.5rem,   1.30rem + 0.89vw, 1.875rem); /* 24 → 30 */
  --fs-h3-sm:   clamp(1.375rem, 1.24rem + 0.59vw, 1.625rem); /* 22 → 26 */
  --fs-h4:      clamp(1.25rem,  1.15rem + 0.44vw, 1.4375rem);/* 20 → 23 */
  --fs-quote:   clamp(1.25rem,  1.09rem + 0.71vw, 1.5625rem);/* 20 → 25 */
  --fs-band:    clamp(1.625rem, 1.03rem + 2.65vw, 2.5rem);   /* 26 → 40 */
  --fs-numeral: clamp(2rem,     1.60rem + 1.78vw, 2.75rem);  /* 32 → 44 */

  /* Text sizes — fixed, they are already comfortable on small screens */
  --fs-lede:    1.3125rem;  /* 21 */
  --fs-lg:      1.1875rem;  /* 19 */
  --fs-body:    1.125rem;   /* 18 — base */
  --fs-md:      1.0625rem;  /* 17 */
  --fs-base:    1rem;       /* 16 */
  --fs-sm:      0.9375rem;  /* 15 */
  --fs-nav:     calc(var(--fs-sm) * 1.1);  /* 16.5 — header nav links */
  --fs-xs:      0.875rem;   /* 14 */
  --fs-2xs:     0.8125rem;  /* 13 */
  --fs-3xs:     0.75rem;    /* 12 */

  --lh-tight:   1.06;
  --lh-snug:    1.14;
  --lh-heading: 1.25;
  --lh-normal:  1.55;
  --lh-body:    1.6;

  --ls-display: -0.015em;
  --ls-eyebrow: 0.22em;
  --ls-label:   0.2em;
  --ls-wide:    0.1em;


  /* ---------------------------------------------------------------------
     5. SPACING — 8px scale, with half-steps where the design needs them
     --------------------------------------------------------------------- */

  --sp-0-5:  0.125rem;  /*   2 */
  --sp-1:    0.25rem;   /*   4 */
  --sp-2:    0.5rem;    /*   8 */
  --sp-2-5:  0.625rem;  /*  10 */
  --sp-3:    0.75rem;   /*  12 */
  --sp-3-5:  0.875rem;  /*  14 */
  --sp-4:    1rem;      /*  16 */
  --sp-4-5:  1.125rem;  /*  18 */
  --sp-5:    1.25rem;   /*  20 */
  --sp-5-5:  1.375rem;  /*  22 */
  --sp-6:    1.5rem;    /*  24 */
  --sp-6-5:  1.625rem;  /*  26 */
  --sp-7:    1.75rem;   /*  28 */
  --sp-8:    2rem;      /*  32 */
  --sp-9:    2.25rem;   /*  36 */
  --sp-10:   2.5rem;    /*  40 */
  --sp-11:   2.75rem;   /*  44 */
  --sp-12:   3rem;      /*  48 */
  --sp-13:   3.25rem;   /*  52 */
  --sp-14:   3.5rem;    /*  56 */
  --sp-15:   3.75rem;   /*  60 */
  --sp-16:   4rem;      /*  64 */
  --sp-18:   4.5rem;    /*  72 */
  --sp-20:   5rem;      /*  80 */
  --sp-22:   5.5rem;    /*  88 */
  --sp-24:   6rem;      /*  96 */
  --sp-26:   6.5rem;    /* 104 */
  --sp-28:   7rem;      /* 112 */
  --sp-30:   7.5rem;    /* 120 */
  --sp-34:   8.5rem;    /* 136 */

  /* Fluid rhythm */
  --section-y:    clamp(3.5rem, 1.85rem + 7.33vw, 7rem);   /*  56 → 112 */
  --section-y-lg: clamp(4rem,   1.65rem + 10.4vw, 8.5rem); /*  64 → 136 */
  --stack:        clamp(2.5rem, 1.32rem + 5.24vw, 5rem);   /*  40 →  80 */


  /* ---------------------------------------------------------------------
     6. LAYOUT, BORDERS, SHADOWS, MOTION
     --------------------------------------------------------------------- */

  --content-max: 1200px;   /* matches the 1440px design at 120px gutters */
  --measure:     680px;    /* reading measure                            */
  --measure-sm:  620px;
  --measure-lg:  860px;

  /* 20px on a phone, exactly 120px at the 1440px design width */
  --gutter: clamp(1.25rem, 8.333vw, 7.5rem);

  /* The distance from the viewport edge to the content column. Below 1440px
     it is the fluid gutter; above it, it grows so the column stays capped at
     1200px. Used as padding on full-bleed sections, which is what keeps the
     design's edge-to-edge rules while the text still lines up. */
  --edge: max(var(--gutter), (100vw - var(--content-max)) / 2);

  --header-h: 5.375rem;    /* 86px — logo 74 + 2 x 12 padding */

  --bw-hair:   1px;
  --bw-rule:   2px;

  --shadow-card:  0 6px 20px rgba(31, 28, 24, 0.05);
  --shadow-panel: 0 8px 28px rgba(31, 28, 24, 0.06);
  --shadow-menu:  0 12px 28px rgba(12, 24, 11, 0.22);
  --shadow-lift:  0 -12px 32px rgba(12, 24, 11, 0.28);

  --dur-fast: 120ms;
  --dur:      220ms;
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);

  --z-nav:    100;
  --z-menu:   200;
  --z-banner: 300;
}
