/* ============================================================
   SheetOps Lab — base.css
   Design tokens, reset, typography, layout primitives.
   Shared by every page. Edit tokens here to re-theme the site.
   ============================================================ */

:root {
  /* Color tokens */
  --paper: #fafbf8;          /* page background */
  --surface: #ffffff;        /* cards, tables */
  --ink: #182420;            /* headings, body */
  --ink-soft: #4b5a52;       /* secondary text */
  --grid: #dfe6e0;           /* borders, "cell" lines */
  --grid-strong: #c6d1c8;
  --accent: #1b7a4e;         /* sheet green — links, primary CTA */
  --accent-dark: #12573a;
  --accent-tint: #eaf4ee;
  --flag: #b8531d;           /* "messy cell" orange */
  --flag-tint: #fbefe5;

  /* Type tokens */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;

  /* Layout tokens */
  --max-width: 1080px;
  --max-width-narrow: 720px;
  --space-section: clamp(4rem, 9vw, 7rem);
  --radius: 10px;
  --radius-sm: 6px;
}

/* ---------- Reset ---------- */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Typography ---------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 42ch;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--accent-tint);
}

/* ---------- Layout primitives ---------- */

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.section {
  padding-block: var(--space-section);
}

.section--tint {
  background: var(--surface);
  border-top: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
}

/* Cell-reference eyebrow — the site's structural signature.
   Each major section is labeled like a spreadsheet cell (A1, B2 …). */
.cellref {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}

.cellref::before {
  content: attr(data-cell);
  display: inline-block;
  padding: 0.15em 0.55em;
  border: 1px solid var(--grid-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Utilities ---------- */

.text-center {
  text-align: center;
}

.muted {
  color: var(--ink-soft);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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