/* ============================================================
   MARGARINE EXPORT PLATFORM — main.css
   Design tokens, reset, base typography, layout, buttons.
   Original design system — see docs/03-DESIGN-SYSTEM.md
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Color */
  --ink-900: #101820;
  --ink-700: #2e3a45;
  --ink-500: #5b6b79;
  --paper:   #fafaf7;
  --surface: #ffffff;
  --line:    #e3e0d8;
  --gold-600: #c8a24b;
  --gold-700: #a9852f;
  --gold-100: #f6efdc;
  --navy-900: #0e1b2c;
  --navy-800: #14263b;
  --navy-700: #1d3350;
  --green-600: #2e7d5b;
  --red-600: #c0392b;

  /* Type */
  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-data: "Segoe UI Mono", "Cascadia Mono", Consolas, "Courier New", monospace;

  --fs-xs: 0.78rem;
  --fs-sm: 0.89rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.4rem;
  --fs-2xl: 1.8rem;
  --fs-3xl: 2.4rem;
  --fs-4xl: clamp(2.2rem, 4.5vw, 3.2rem);

  /* Spacing */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  /* Layout */
  --container: 1200px;
  --gutter: 24px;
  --radius: 2px;
  --radius-lg: 4px;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(16, 24, 32, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 24, 32, 0.08);
  --transition: 160ms ease-out;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--paper);
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Typography ---------- */
h1, h2, h3 { line-height: 1.2; font-weight: 700; }

h1 {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.01em;
}

h3 { font-size: var(--fs-lg); }

p { max-width: 72ch; }

.text-muted { color: var(--ink-500); }
.text-gold { color: var(--gold-700); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--s-8); }
.section--tight { padding-block: var(--s-7); }
.section--dark { background: var(--navy-800); color: #f2f0e9; }
.section--tint { background: var(--gold-100); }
.section--white { background: var(--surface); }

.section-head { max-width: 720px; margin-bottom: var(--s-6); }
.section-head .kicker { margin-bottom: var(--s-3); }
.section-head h2 { margin-bottom: var(--s-3); }
.section-head p { color: var(--ink-500); }
.section--dark .section-head p { color: #b8c2d0; }

.kicker {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-700);
}
.section--dark .kicker { color: var(--gold-600); }

.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink-900);
  color: #fff;
  padding: var(--s-3) var(--s-5);
}
.skip-link:focus { left: var(--s-3); top: var(--s-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: var(--s-3) var(--s-6);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 2px;
}

.btn--primary { background: var(--gold-600); color: var(--ink-900); }
.btn--primary:hover { background: var(--gold-700); color: #fff; }

.btn--outline { border-color: var(--ink-900); color: var(--ink-900); }
.btn--outline:hover { background: var(--ink-900); color: #fff; }

.btn--ghost-light { border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.btn--ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }

.btn--arrow::after { content: "\2192"; transition: transform var(--transition); }
.btn--arrow:hover::after { transform: translateX(3px); }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--gold-700);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.link-more:hover { border-bottom-color: var(--gold-700); }

/* ---------- Chips / facts ---------- */
.chip {
  display: inline-block;
  padding: var(--s-1) var(--s-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-700);
}
.section--dark .chip { background: transparent; border-color: rgba(255,255,255,.25); color: #d7dde6; }

.tbd-note {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  font-style: italic;
}

/* ---------- Quick answer (AEO block) ---------- */
.quick-answer {
  border-left: 3px solid var(--gold-600);
  background: var(--surface);
  padding: var(--s-5);
  margin-block: var(--s-5);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-sm);
}
.quick-answer strong { display: block; font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-700); margin-bottom: var(--s-2); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  padding-block: var(--s-4);
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--s-2); color: var(--line); }
.breadcrumbs a:hover { color: var(--gold-700); }
.breadcrumbs [aria-current="page"] { color: var(--ink-900); font-weight: 600; }

/* ---------- Scroll reveal (subtle, JS-gated so content is visible without JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 400ms ease-out, transform 400ms ease-out; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }
