/* =====================================================================
   base.css — design tokens, reset, typography
   Change colours / fonts here and the whole site follows.
   ===================================================================== */

:root {
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Light palette: warm paper + ink + burnt orange */
  --bg: #f4efe6;
  --bg-elev: #fbf8f2;
  --ink: #17150f;
  --ink-2: #45413a;
  --muted: #625c51;   /* 4.5:1 even over the hero's tinted glow (#6b655a was 4.48:1 there) */
  --line: rgba(23, 21, 15, 0.12);
  --line-strong: rgba(23, 21, 15, 0.5);   /* ghost-button edges: 3:1 on the paper (0.45 measured 2.89:1) */
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(194, 65, 12, 0.10);
  --blob-1: rgba(255, 138, 76, 0.55);
  --blob-2: rgba(255, 214, 102, 0.55);
  --blob-3: rgba(120, 170, 255, 0.40);
  --glow: rgba(255, 140, 80, 0.16);
  --grain-opacity: 0.06;
  --net-rgb: 23, 21, 15;
  --net-accent-rgb: 194, 65, 12;
  --net-alpha: 0.2;
  --shadow: 0 1px 2px rgba(23, 21, 15, 0.05), 0 18px 40px -16px rgba(23, 21, 15, 0.22);

  --radius: 20px;
  --radius-sm: 10px;
  --max: 1160px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 72px;
  --section-gap: clamp(4.5rem, 10vw, 8rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0e0d0b;
  --bg-elev: #161411;
  --ink: #efe9dc;
  --ink-2: #d3ccbe;
  --muted: #a49c8d;
  --line: rgba(239, 233, 220, 0.12);
  --line-strong: rgba(239, 233, 220, 0.45);
  --accent: #ff7a45;
  --accent-ink: #1a0d06;
  --accent-soft: rgba(255, 122, 69, 0.14);
  --blob-1: rgba(255, 110, 60, 0.32);
  --blob-2: rgba(255, 190, 80, 0.20);
  --blob-3: rgba(90, 130, 255, 0.26);
  --glow: rgba(255, 122, 69, 0.13);
  --grain-opacity: 0.09;
  --net-rgb: 239, 233, 220;
  --net-accent-rgb: 255, 122, 69;
  --net-alpha: 0.3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 20px 48px -16px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--accent); }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.1; }
dl, dd, dt { margin: 0; }
[hidden] { display: none !important; }
.print-only { display: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
#main:focus { outline: none; }   /* skip-link target, not a control */

/* ---------- Typography ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.dash { color: var(--muted); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}
.section-lede {
  max-width: 44ch;
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: 1.125rem;
}

em { font-family: var(--font-display); font-style: italic; font-weight: 400; }
strong { font-weight: 600; color: var(--ink); }

.icon { width: 1.1em; height: 1.1em; flex: none; }
.icon-inline { width: 0.8em; height: 0.8em; display: inline-block; vertical-align: 0.05em; margin-left: 0.15em; }

.skip-link {
  position: absolute; left: 1rem; top: -100px;
  z-index: 100; padding: 0.6rem 1rem;
  background: var(--ink); color: var(--bg); border-radius: 999px;
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 1rem; }

.noscript {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; text-align: center;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-display); font-size: 1.5rem;
}
