/* ============================================================
   NE OUTDOOR — DESIGN TOKENS
   Premium / editorial / dark-first
   ============================================================ */

:root {
  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 7.5rem);

  /* Spacing — 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;

  /* Transitions */
  --transition-interactive: 320ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1120px;
  --content-wide: 1320px;

  /* Fonts */
  --font-display: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --font-body: 'Inter', 'Söhne', system-ui, -apple-system, sans-serif;

  /* Tracking */
  --tracking-eyebrow: 0.22em;
  --tracking-caps: 0.08em;
}

/* ============================================================
   COLOR — Dark primary, optional light
   ============================================================ */

:root,
[data-theme='dark'] {
  /* Surfaces — deep forest, slight green undertone */
  --color-bg: oklch(0.20 0.022 145);
  --color-surface: oklch(0.24 0.024 145);
  --color-surface-2: oklch(0.27 0.026 145);
  --color-surface-offset: oklch(0.30 0.028 145);
  --color-divider: oklch(0.34 0.028 140);
  --color-border: oklch(0.40 0.030 140);
  --color-border-strong: oklch(0.48 0.032 140);

  /* Text — warm cream, no green */
  --color-text: oklch(0.93 0.018 92);            /* primary copy */
  --color-text-strong: oklch(0.96 0.020 92);     /* headings */
  --color-text-muted: oklch(0.74 0.020 95);
  --color-text-faint: oklch(0.56 0.020 100);

  /* Accent — warm brass / antique gold */
  --color-accent: oklch(0.74 0.115 80);          /* brass */
  --color-accent-soft: oklch(0.66 0.105 78);
  --color-accent-faint: oklch(0.50 0.075 78);

  /* Secondary — deep forest / olive */
  --color-moss: oklch(0.45 0.055 140);

  --shadow-md: 0 4px 24px oklch(0 0 0 / 0.55);
}

/* Light mode — cream / canvas */
[data-theme='light'] {
  --color-bg: oklch(0.96 0.015 100);
  --color-surface: oklch(0.93 0.018 100);
  --color-surface-2: oklch(0.90 0.020 100);
  --color-surface-offset: oklch(0.86 0.022 100);
  --color-divider: oklch(0.78 0.024 110);
  --color-border: oklch(0.68 0.026 115);
  --color-border-strong: oklch(0.50 0.028 130);

  --color-text: oklch(0.22 0.024 145);
  --color-text-strong: oklch(0.16 0.024 145);
  --color-text-muted: oklch(0.40 0.022 140);
  --color-text-faint: oklch(0.56 0.020 130);

  --color-accent: oklch(0.55 0.10 75);
  --color-accent-soft: oklch(0.60 0.10 75);
  --color-accent-faint: oklch(0.78 0.07 80);

  --color-moss: oklch(0.45 0.055 140);

  --shadow-md: 0 4px 24px oklch(0 0 0 / 0.1);
}

/* ============================================================
   BASE
   ============================================================ */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scroll-padding-top: var(--space-20);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-feature-settings: 'ss01', 'cv11';
  position: relative;
}

/* Subtle canvas / paper grain — felt, not seen (~4% opacity) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.45  0 0 0 0 0.32  0 0 0 1.2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

[data-theme='light'] body::before { opacity: 0.07; mix-blend-mode: multiply; }

/* Make sure interactive layers sit above the grain */
header, main, footer, .sample-note { position: relative; z-index: 2; }

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.05;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--color-text-strong);
  letter-spacing: -0.015em;
}

/* Constrain prose copy for legibility — but only for plain prose,
   not list items used as layout components. */
p,
figcaption {
  text-wrap: pretty;
  max-width: 64ch;
}
li {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: oklch(from var(--color-accent) l c h / 0.35);
  color: var(--color-text-strong);
}

:focus-visible {
  outline: 1px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button {
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

a, button, [role='button'], input, textarea, select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    opacity var(--transition-interactive);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
