/* ==========================================================================
   FCV Tobacco Limited — design tokens
   "The science of the leaf": the palette is derived from the company's own
   colour-grade scale (L / LO / O / V / R / M), which means colour here is
   classification data, not decoration.

   Discipline: the amber-to-mahogany end of the scale is reserved for grade
   encoding — swatches, classification chips, the leaf explorer. It is never
   spent on buttons or section backgrounds. The interface accent is forest.
   ========================================================================== */

:root {
  /* ---- Leaf colour scale (grade encoding only) ------------------------- */
  --fcv-lemon:      #F2D66B;   /* L   Lemon        */
  --fcv-lemon-o:    #EDC65A;   /* LO  Lemon-Orange */
  --fcv-gold:       #E8B347;
  --fcv-orange:     #D98828;   /* O   Orange       */
  --fcv-variegated: #C6742A;   /* V   Variegated   */
  --fcv-red:        #B5501D;   /* R   Red          */
  --fcv-amber:      #B5651D;
  --fcv-mahogany:   #7A3F1D;   /* M   Mahogany     */
  --fcv-greenish:   #9BA84E;   /* G   Greenish     */
  --fcv-dark:       #4A3524;   /* D   Dark/Mixed   */

  /* ---- Agricultural greens (interface) --------------------------------- */
  --fcv-leaf:       #3F6B4A;
  --fcv-forest:     #1E3A2A;
  --fcv-forest-dp:  #0F241A;

  /* ---- Neutrals: paper with a green bias, never a warm cream ----------- */
  --fcv-paper:      #F7F8F3;
  --fcv-surface:    #FFFFFF;
  --fcv-surface-2:  #EEF1E9;
  --fcv-cream:      #F2F0E4;
  --fcv-charcoal:   #151E18;
  --fcv-ink-2:      #37473D;
  --fcv-muted:      #64756A;
  --fcv-border:     #DCE2D6;
  --fcv-border-2:   #BEC9B7;

  /* ---- Semantic (state), kept separate from the accent hue ------------- */
  --fcv-ok:         #2C6448;
  --fcv-ok-bg:      #DDEEE2;
  --fcv-warn:       #7E6007;
  --fcv-warn-bg:    #F8EDCC;
  --fcv-crit:       #96262A;
  --fcv-crit-bg:    #F7E0DE;

  /* ---- Applied roles --------------------------------------------------- */
  --ground:      var(--fcv-paper);
  --surface:     var(--fcv-surface);
  --surface-2:   var(--fcv-surface-2);
  --ink:         var(--fcv-charcoal);
  --ink-2:       var(--fcv-ink-2);
  --muted:       var(--fcv-muted);
  --rule:        var(--fcv-border);
  --rule-strong: var(--fcv-border-2);
  --accent:      var(--fcv-forest);
  --accent-ink:  #FFFFFF;
  --on-forest:   #E9EFE7;

  /* ---- Gradients: refined and agricultural, never artificial ----------- */
  --grad-cure:  linear-gradient(105deg, var(--fcv-lemon) 0%, var(--fcv-orange) 55%, var(--fcv-mahogany) 100%);
  --grad-sun:   linear-gradient(160deg, var(--fcv-cream) 0%, var(--fcv-lemon) 100%);
  --grad-field: linear-gradient(180deg, rgba(15,36,26,0) 0%, rgba(15,36,26,.72) 62%, rgba(15,36,26,.94) 100%);

  /* ---- Type ------------------------------------------------------------ */
  --font-display: Archivo, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-body:    "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: clamp(0.80rem, 0.78rem + 0.10vw, 0.86rem);
  --step-0:  clamp(1.02rem, 0.99rem + 0.14vw, 1.10rem);
  --step-1:  clamp(1.20rem, 1.14rem + 0.30vw, 1.38rem);
  --step-2:  clamp(1.44rem, 1.33rem + 0.55vw, 1.80rem);
  --step-3:  clamp(1.75rem, 1.55rem + 1.00vw, 2.45rem);
  --step-4:  clamp(2.10rem, 1.72rem + 1.90vw, 3.40rem);
  --step-5:  clamp(2.50rem, 1.85rem + 3.10vw, 4.60rem);

  --measure: 68ch;

  /* ---- Space ----------------------------------------------------------- */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 24px;  --sp-6: 32px;  --sp-7: 48px;  --sp-8: 64px;
  --sp-9: 96px;  --sp-10: 128px;

  /* ---- Shape ----------------------------------------------------------- */
  --r-sm: 6px;  --r-md: 12px;  --r-lg: 18px;  --r-xl: 24px;
  --shadow-1: 0 1px 2px rgba(21,30,24,.05), 0 6px 18px -14px rgba(21,30,24,.28);
  --shadow-2: 0 2px 6px rgba(21,30,24,.06), 0 22px 48px -28px rgba(21,30,24,.34);

  /* ---- Motion ---------------------------------------------------------- */
  --motion-micro:    140ms;
  --motion-standard: 260ms;
  --motion-reveal:   520ms;
  --ease:      cubic-bezier(.4, 0, .2, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);

  --header-h: 118px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #0E120E;
    --surface:     #161B16;
    --surface-2:   #1D231D;
    --ink:         #E7EDE4;
    --ink-2:       #C1CCBE;
    --muted:       #8B9A8E;
    --rule:        #2A322A;
    --rule-strong: #3C463C;
    --accent:      #A8CDB2;
    --accent-ink:  #0E120E;
    --on-forest:   #E9EFE7;
    --fcv-ok:      #6FBF92;  --fcv-ok-bg:   #16301F;
    --fcv-warn:    #D9B84A;  --fcv-warn-bg: #332A11;
    --fcv-crit:    #E68A86;  --fcv-crit-bg: #3A1E1E;
    --shadow-1: 0 1px 2px rgba(0,0,0,.42), 0 6px 18px -14px rgba(0,0,0,.7);
    --shadow-2: 0 2px 6px rgba(0,0,0,.5),  0 22px 48px -28px rgba(0,0,0,.8);
  }
}

:root[data-theme="dark"] {
  --ground:      #0E120E;
  --surface:     #161B16;
  --surface-2:   #1D231D;
  --ink:         #E7EDE4;
  --ink-2:       #C1CCBE;
  --muted:       #8B9A8E;
  --rule:        #2A322A;
  --rule-strong: #3C463C;
  --accent:      #A8CDB2;
  --accent-ink:  #0E120E;
  --on-forest:   #E9EFE7;
  --fcv-ok:      #6FBF92;  --fcv-ok-bg:   #16301F;
  --fcv-warn:    #D9B84A;  --fcv-warn-bg: #332A11;
  --fcv-crit:    #E68A86;  --fcv-crit-bg: #3A1E1E;
  --shadow-1: 0 1px 2px rgba(0,0,0,.42), 0 6px 18px -14px rgba(0,0,0,.7);
  --shadow-2: 0 2px 6px rgba(0,0,0,.5),  0 22px 48px -28px rgba(0,0,0,.8);
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-micro: 0ms; --motion-standard: 0ms; --motion-reveal: 0ms; }
}
