/* Threefold Cedar — design tokens
   Source of truth: ~/hardline/projects/woodworking-brand/design-system/MASTER.md
   Hard rule: --amber never carries body text (3.39:1 on cream, 4.22:1 on charcoal).
   Use --amber-ink for any amber that has to be read at body size. */

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/playfair-display-var.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/playfair-display-italic-var.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-var.woff2") format("woff2");
}

:root {
  /* palette */
  --char: #1F1C18;       /* primary text, dark sections, the mark */
  --cream: #F2EBDD;      /* page ground */
  --amber: #B0703A;      /* ACCENT ONLY: rules, hover, ≥24px display type */
  --amber-ink: #8A5528;  /* readable amber, 5.19:1 on cream */
  --forest: #3D4A3A;     /* secondary accent, sparing */
  --muted: #5A544A;      /* muted text on cream, 6.32:1 */

  /* dark-ground companions (the placeholder used these; kept, named) */
  --muted-on-dark: #9A938A;
  --rule-on-dark: #33302B;
  --amber-lift: #C98A4E; /* hover/cite on charcoal only, small caps ≥ 0.75rem */

  /* type */
  --font-display: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --track-caps: 0.12em;  /* small-caps labels, mirrors the logo's CEDAR */

  /* shape + motion */
  --radius: 0;           /* square corners carry the logo's geometry */
  --radius-soft: 2px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 220ms;

  /* layout */
  --measure: 68ch;
  --max-w: 72rem;
  --gap-section: clamp(3rem, 8vw, 6rem);

  /* semantic aliases: light surface (default) */
  --bg: var(--cream);
  --ink: var(--char);
  --ink-soft: var(--muted);
  --rule: color-mix(in srgb, var(--char) 14%, var(--cream));
  --accent: var(--amber);
  --accent-ink: var(--amber-ink);
}

/* dark surface: flip the aliases, never the palette */
[data-surface="dark"] {
  --bg: var(--char);
  --ink: var(--cream);
  --ink-soft: var(--muted-on-dark);
  --rule: var(--rule-on-dark);
  --accent: var(--amber);
  --accent-ink: var(--amber-lift);
}

/* scroll-craft engine overrides: same six values, two fonts */
:root {
  --sc-canvas: var(--cream);
  --sc-surface: #E9E1D1;
  --sc-ink: var(--char);
  --sc-ink-soft: var(--muted);
  --sc-accent: var(--amber);
  --sc-accent-ink: var(--cream);
  --sc-font-display: var(--font-display);
  --sc-font-text: var(--font-text);
}

/* base */
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1rem;           /* ≥16px on mobile, always */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 8vw, 7rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.75rem); }
p  { max-width: var(--measure); margin: 0 0 1em; }
a  { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-ink); }

.caps {
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}
.rule { height: 1px; background: var(--accent); border: 0; width: 3.5rem; margin: 1.5rem 0; }

/* buttons: the label is always "Add to cart — $XX" on product surfaces */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; min-width: 44px; padding: 0.75rem 1.25rem;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--bg);
  font: 500 1rem/1 var(--font-text); text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--cream); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: transparent; color: var(--accent-ink); border-color: var(--accent); }

/* focus: visible, never bare outline-none */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* reduced motion: honoured everywhere, including the landing */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
