/* =====================================================================
   FOURIER DESIGN SYSTEM
   colors_and_type.css — token layer + semantic typography + base utilities
   --------------------------------------------------------------------- */

/* ── Fonts (Google Fonts) — Direction A: Engineered ─────────────────
   - Display + UI:  Inter Tight (display headlines, eyebrows, buttons)
   - Body:          Inter      (paragraph copy, captions)
   - Mono:          JetBrains Mono (product codes, technical specs)
   --------------------------------------------------------------- */
@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ─────────────────────────────────────────────────────────────────────
   TOKENS
   ───────────────────────────────────────────────────────────────────── */
:root {
  /* — Colors — */
  --forest-night:   #1A3A1B;   /* primary; deepest brand color */
  --fourier-green:  #2D5A2E;   /* CTA / primary button */
  --mid-forest:     #5A8C5A;   /* accents, eyebrow text on parchment */
  --lichen:         #A8C8A8;   /* italic emphasis on dark */
  --parchment:      #F5F2EC;   /* page background — never use white */
  --parchment-mid:  #E8EDE0;   /* card surface */
  --parchment-dark: #D8D4CB;   /* hairlines, borders on parchment */
  --charcoal:       #1A1A18;   /* sustainability / problem dark sections */
  --white-warm:     #FAF8F4;   /* primary button hover only */

  /* — Semantic foreground — */
  --fg-1: var(--forest-night);          /* primary text on parchment */
  --fg-2: #4A4A42;                       /* body text on parchment */
  --fg-3: #6A6A60;                       /* muted text on parchment */
  --fg-on-dark-1: var(--parchment);      /* primary text on dark */
  --fg-on-dark-2: rgba(245,242,236,0.65);
  --fg-on-dark-3: rgba(245,242,236,0.40);
  --accent: var(--mid-forest);
  --accent-on-dark: var(--lichen);

  /* — Hairlines — */
  --line-on-light: rgba(27, 67, 50, 0.15);
  --line-on-dark:  rgba(245, 242, 236, 0.10);

  /* — Surfaces — */
  --bg:         var(--parchment);
  --surface:    var(--parchment-mid);
  --bg-dark:    var(--forest-night);
  --bg-darker:  var(--charcoal);

  /* — Type families —
     --display = headlines / display type (Inter Tight, slightly tighter than Inter)
     --sans    = body / UI (Inter)
     --mono    = product codes, specs (JetBrains Mono)
     Variable names `--serif` and `--sans` keep legacy semantics, but the
     system has no serif. `--display` is the canonical alias. */
  --display: 'Inter Tight', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --serif:   var(--display);
  --sans:    'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* — Type scale (display = Inter Tight 500; body = Inter 400) — */
  --fs-display-1: clamp(40px, 4.8vw, 68px);   /* hero */
  --fs-display-2: clamp(32px, 3.6vw, 48px);   /* section hero */
  --fs-display-3: clamp(24px, 2.6vw, 36px);   /* sub-section */
  --fs-h1: 32px;
  --fs-h2: 22px;
  --fs-h3: 17px;
  --fs-h4: 13px;
  --fs-body: 15px;
  --fs-body-sm: 13px;
  --fs-caption: 12px;
  --fs-label: 11px;   /* eyebrows, button text */
  --fs-micro: 10px;   /* tiny labels */
  --fs-stat: 40px;    /* big stat numbers (Inter Tight 500) */

  /* — Weights — */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  /* — Line-heights — */
  --lh-display: 1.02;
  --lh-heading: 1.15;
  --lh-body: 1.7;
  --lh-loose: 1.85;
  --lh-tight: 1.0;

  /* — Letter-spacing — */
  --ls-display: -0.025em;     /* tight display crunch (Inter Tight) */
  --ls-body: -0.005em;
  --ls-label: 0.12em;        /* eyebrows, labels */
  --ls-label-wide: 0.20em;   /* section eyebrows */
  --ls-label-extra: 0.22em;  /* hero eyebrow */
  --ls-button: 0.10em;

  /* — Spacing (8pt-based) — */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 48px;
  --space-11: 60px;
  --space-12: 80px;
  --space-13: 100px;
  --space-14: 120px;

  /* — Radii — */
  --radius-0: 0;
  --radius-1: 2px;
  --radius-2: 4px;   /* buttons, small UI */
  --radius-3: 6px;   /* floating tags */
  --radius-4: 10px;  /* cards */

  /* — Elevation (used SPARINGLY — system is mostly flat) — */
  --elev-1: 0 1px 0 var(--line-on-light);                /* hairline only */
  --elev-2: 0 12px 32px rgba(26, 58, 27, 0.06);          /* subtle card lift */
  --elev-tag: 0 8px 24px rgba(0, 0, 0, 0.18);            /* hero floating tag */
  --elev-drop-product: 0 40px 80px rgba(0, 0, 0, 0.4);   /* product silhouette drop */

  /* — Motion — */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-fast:  0.15s;
  --dur-base:  0.25s;
  --dur-slow:  0.4s;
  --dur-entry: 0.8s;
}

/* ─────────────────────────────────────────────────────────────────────
   BASELINE
   ───────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--sans);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ─────────────────────────────────────────────────────────────────────
   GRAIN OVERLAY — apply to any section/body that should have it
   ───────────────────────────────────────────────────────────────────── */
.grain { position: relative; }
.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}
.grain > * { position: relative; z-index: 2; }

body.grain::before { position: fixed; }

/* ─────────────────────────────────────────────────────────────────────
   TYPOGRAPHY — SEMANTIC
   ───────────────────────────────────────────────────────────────────── */

/* — Display (Inter Tight 500) — */
.display-1,
.display-2,
.display-3 {
  font-family: var(--display);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-display);
  color: var(--fg-1);
  text-wrap: balance;
}
.display-1 { font-size: var(--fs-display-1); line-height: var(--lh-display); }
.display-2 { font-size: var(--fs-display-2); line-height: var(--lh-heading); }
.display-3 { font-size: var(--fs-display-3); line-height: var(--lh-heading); }

.display-1 em,
.display-2 em,
.display-3 em {
  font-style: italic;
  font-weight: var(--fw-medium);
  color: var(--mid-forest);
}

/* — Headings (Inter Tight 500/600) — */
h1, .h1 { font-family: var(--display); font-weight: var(--fw-medium); font-size: var(--fs-h1); line-height: var(--lh-heading); letter-spacing: -0.02em; color: var(--fg-1); }
h2, .h2 { font-family: var(--display); font-weight: var(--fw-medium); font-size: var(--fs-h2); line-height: var(--lh-heading); letter-spacing: -0.015em; color: var(--fg-1); }
h3, .h3 { font-family: var(--display); font-weight: var(--fw-semibold); font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.01em; color: var(--fg-1); }
h4, .h4 { font-family: var(--sans); font-weight: var(--fw-semibold); font-size: var(--fs-h4); line-height: 1.4; color: var(--fg-1); }

/* — Body (Inter 400) — */
p, .body { font-family: var(--sans); font-weight: var(--fw-regular); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--fg-2); letter-spacing: -0.003em; }
.body-sm { font-size: var(--fs-body-sm); line-height: 1.6; }

/* — Eyebrow / label — */
.eyebrow,
.label {
  font-family: var(--sans);
  font-weight: var(--fw-medium);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-label-wide);
  text-transform: uppercase;
  color: var(--mid-forest);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 0.5px;
  background: currentColor;
}
.eyebrow--dark { color: var(--mid-forest); }
.eyebrow--on-dark { color: var(--mid-forest); }

/* — Caption — */
.caption { font-family: var(--sans); font-weight: var(--fw-regular); font-size: var(--fs-caption); color: var(--fg-3); line-height: 1.65; }

/* — Mono code — */
code, .mono, .code {
  font-family: var(--mono);
  font-weight: var(--fw-regular);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--fg-1);
}
.product-code {
  font-family: var(--mono);
  font-weight: var(--fw-regular);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
}

/* — Stat number (Inter Tight 500, big) — */
.stat-num {
  font-family: var(--display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-stat);
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
  color: var(--fg-1);
}
.stat-label {
  font-family: var(--sans);
  font-weight: var(--fw-regular);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-3);
}

/* ─────────────────────────────────────────────────────────────────────
   LINKS
   ───────────────────────────────────────────────────────────────────── */
a {
  color: var(--fourier-green);
  text-decoration: none;
  transition: color var(--dur-base) ease, opacity var(--dur-base) ease;
}
a:hover { color: var(--forest-night); }

.link-arrow {
  font-family: var(--sans);
  font-weight: var(--fw-medium);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  color: var(--fourier-green);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: gap var(--dur-base) ease;
}
.link-arrow::after { content: '→'; font-size: 14px; }
.link-arrow:hover { gap: 16px; }

/* ─────────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────────── */
.btn,
.btn-primary,
.btn-ghost {
  font-family: var(--sans);
  font-weight: var(--fw-medium);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  padding: 14px 32px;
  border-radius: var(--radius-2);
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  border: 0.5px solid transparent;
  transition:
    background var(--dur-base) ease,
    color var(--dur-base) ease,
    border-color var(--dur-base) ease,
    transform var(--dur-base) ease;
}

/* on parchment */
.btn-primary {
  background: var(--fourier-green);
  color: var(--parchment);
}
.btn-primary:hover {
  background: var(--forest-night);
  color: var(--parchment);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--fourier-green);
  border-color: rgba(45, 90, 46, 0.30);
}
.btn-ghost:hover {
  border-color: var(--fourier-green);
  color: var(--forest-night);
}

/* on dark sections (forest/charcoal) */
.on-dark .btn-primary,
.btn-primary.on-dark {
  background: var(--parchment);
  color: var(--forest-night);
}
.on-dark .btn-primary:hover,
.btn-primary.on-dark:hover {
  background: var(--white-warm);
  transform: translateY(-1px);
}
.on-dark .btn-ghost,
.btn-ghost.on-dark {
  color: rgba(245,242,236,0.65);
  border-color: rgba(245,242,236,0.25);
}
.on-dark .btn-ghost:hover,
.btn-ghost.on-dark:hover {
  color: var(--parchment);
  border-color: rgba(245,242,236,0.55);
}

/* ─────────────────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-4);
  padding: 28px 24px;
  transition: transform var(--dur-base) ease, background var(--dur-base) ease;
}
.card:hover { transform: translateY(-3px); background: #DDE5D0; }

.card--dark {
  background: var(--forest-night);
  color: var(--parchment);
}
.card--dark:hover { background: #234024; }

/* ─────────────────────────────────────────────────────────────────────
   UTILITY
   ───────────────────────────────────────────────────────────────────── */
.section-on-dark { background: var(--forest-night); color: var(--parchment); }
.section-on-charcoal { background: var(--charcoal); color: var(--parchment); }
.section-on-parchment { background: var(--parchment); color: var(--fg-1); }

/* hairline divider */
.hr,
.divider {
  display: block;
  width: 100%;
  height: 0.5px;
  background: var(--line-on-light);
  border: 0;
}
.section-on-dark .hr,
.section-on-charcoal .hr,
.divider--on-dark { background: var(--line-on-dark); }

/* — A scroll-reveal helper (consumer wires the IntersectionObserver) — */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.75s ease, transform 0.75s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* — Entry animations — */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(105%); }
  to   { transform: translateY(0); }
}

/* — Reduced motion respect — */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
