/* ============================================================================
   Lukes & Lukes — Base (reset + elements + layout primitives)
   "The Movement" refined system. Load order: tokens.css -> base.css -> components.css
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  overflow-x: hidden;
}

img, picture, svg, video, canvas { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

/* ---- Headings: lighter Didone for the refined, gallery register ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 500;
  text-wrap: balance;
  color: var(--text);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); font-weight: 600; letter-spacing: -0.008em; }
h4 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.006em; }

p, li { text-wrap: pretty; }
p { max-width: var(--measure); }

/* ---- Vertical rhythm: give headings and stacked copy room to breathe.
   Applied generously across page content so every template gains gallery
   spacing without per-page markup edits. Class-based components (hero lede,
   section-head, etc.) keep their own tuned margins via higher specificity. */
main :is(h1, h2, h3, h4) + :is(p, ul, ol) { margin-top: var(--space-md); }
main :is(p, ul, ol) + :is(p, ul, ol) { margin-top: var(--space-md); }
main .eyebrow + :is(h1, h2, h3) { margin-top: var(--space-sm); }
main :is(p, ul, ol) + :is(h2, h3) { margin-top: var(--space-xl); }
/* multi-line headings read better with a hair more leading than the hero */
h2 { line-height: 1.12; }
h3, h4 { line-height: 1.18; }

a { color: inherit; text-decoration-color: var(--hairline-brass); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }

strong { font-weight: 600; }

ul, ol { padding-left: 1.25em; }

hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--space-xl) 0; }

::selection { background: var(--brass-200); color: var(--ink-900); }

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

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }

.section { padding-block: var(--space-3xl); position: relative; }
.section--tight { padding-block: var(--space-2xl); }

.stack > * + * { margin-top: var(--flow, var(--space-md)); }
.stack--lg { --flow: var(--space-lg); }

/* Skip link for a11y */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy-800); color: var(--bone-100);
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius);
}
.skip-link:focus { left: var(--space-sm); top: var(--space-sm); }

/* Utility */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.muted { color: var(--text-muted); }
.measure { max-width: var(--measure); }

/* ---- Chrome hairline: a fine machined-gold rule used as a section seam ---- */
.rule {
  height: 1px; border: 0; margin: 0;
  background: var(--chrome);
  opacity: 0.7;
}
.inverse .rule { background: var(--chrome-dark); opacity: 0.55; }

/* ---- Inverse (dark / obsidian) regions ---- */
.inverse {
  background: var(--bg-inverse);
  color: var(--text-on-dark);
  position: relative;
}
.inverse h1, .inverse h2, .inverse h3, .inverse h4 { color: var(--bone-50); }
.inverse a { text-decoration-color: var(--hairline-dark); }
.inverse .muted { color: var(--text-on-dark-muted); }

/* Engine-turned guilloché texture — the faint clockmaker engraving. Applied as an
   atmospheric layer behind dark bands; near-invisible, felt more than seen. */
.engrave::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    repeating-radial-gradient(circle at 18% 12%,
      transparent 0, transparent 13px,
      color-mix(in srgb, var(--brass-400) 5%, transparent) 13px,
      color-mix(in srgb, var(--brass-400) 5%, transparent) 14px),
    repeating-linear-gradient(58deg,
      transparent 0, transparent 22px,
      color-mix(in srgb, var(--brass-400) 3.5%, transparent) 22px,
      color-mix(in srgb, var(--brass-400) 3.5%, transparent) 23px);
  -webkit-mask-image: radial-gradient(120% 100% at 20% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(120% 100% at 20% 0%, #000 0%, transparent 72%);
}
.engrave > * { position: relative; z-index: 1; }

/* Fine paper grain for light gallery surfaces — adds tactility without noise. */
.grain { position: relative; }
.grain::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
.grain > * { position: relative; z-index: 1; }
