/* Hallmark · pre-emit critique: P5 H4 E5 S4 R5 V4 */
/* Hallmark · genre: editorial (custom-tuned) · macrostructure: Long Document · theme: custom
 * vibe: "dark, quietly premium, restrained operator tone" · paper oklch(15% 0.014 250) · accent oklch(74% 0.15 82) warm-brass
 * display: ui-serif system stack (no external requests) · body: system sans stack · outlier: system mono
 * axes: paper-band=dark · display-style=roman-serif · accent-hue=warm
 * nav: N9 edge-aligned minimal · footer: Ft2 inline single line
 */
:root {
  /* colour — dark slate-indigo paper, warm brass accent, tinted neutrals */
  --color-paper:    oklch(15% 0.014 250);
  --color-paper-2:  oklch(19% 0.016 250);
  --color-rule:     oklch(30% 0.014 250);
  --color-neutral:  oklch(58% 0.010 250);
  --color-muted:    oklch(70% 0.008 250);
  --color-ink:      oklch(94% 0.006 250);
  --color-accent:   oklch(74% 0.150 82);
  --color-focus:    oklch(80% 0.140 82);

  /* type — system-only stacks: no external requests, no CLS from webfont swap */
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", "URW Palladio", "Noto Serif", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  /* scale — 1.25 major third from a 17px body */
  --text-xs:   0.68rem;
  --text-sm:   0.85rem;
  --text-base: 1.0625rem;
  --text-md:   1.328rem;
  --text-lg:   1.66rem;
  --text-xl:   2.07rem;
  --text-display: clamp(2.6rem, 4.2vw + 1rem, 4.4rem);

  /* space — 4pt scale */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;
  --space-3xl: 9rem;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long:  420ms;

  --radius: 3px;
  --page-gutter: clamp(1.25rem, 5vw, 3rem);
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-weight: 350;
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: var(--color-rule);
  text-underline-offset: 0.2em;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* ---------- nav — N9 edge-aligned minimal ---------- */
.nav-edge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--page-gutter) var(--space-sm);
  max-width: 1100px;
  margin: 0 auto;
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.cta-outline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-accent);
  border: 1px solid color-mix(in oklch, var(--color-accent) 45%, transparent);
  padding: 0.55em 1em;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: border-color var(--dur-short) var(--ease-out),
    transform var(--dur-micro) var(--ease-out),
    background-color var(--dur-short) var(--ease-out),
    color var(--dur-short) var(--ease-out),
    box-shadow var(--dur-short) var(--ease-out);
}

.cta-outline:hover {
  border-color: var(--color-accent);
  background-color: var(--color-accent);
  color: var(--color-paper);
  box-shadow: 0 6px 24px oklch(74% 0.15 82 / 0.35);
  transform: translateY(-1px);
}

.cta-outline:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px oklch(74% 0.15 82 / 0.25);
}

/* ---------- article — Long Document ---------- */
main {
  max-width: 65ch;
  margin: 0 auto;
  padding: var(--space-2xl) var(--page-gutter) var(--space-3xl);
}

.hero {
  padding-block: var(--space-sm) 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 var(--space-sm);
}

h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: normal;
  font-size: var(--text-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-sm);
  color: var(--color-ink);
  text-shadow: 0 0 34px oklch(74% 0.15 82 / 0.3), 0 0 3px oklch(94% 0.006 250 / 0.2);
}

.positioning {
  font-size: var(--text-lg);
  color: var(--color-neutral);
  margin: 0 0 var(--space-2xl);
  max-width: 42ch;
}

article.prose section {
  margin-block-end: var(--space-2xl);
}

article.prose section:last-of-type { margin-block-end: var(--space-xl); }

h2.inline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-shadow: 0 0 14px oklch(74% 0.15 82 / 0.35);
  margin: 0 0 var(--space-md);
}

mark.signature {
  background: linear-gradient(to top, oklch(74% 0.15 82 / 0.32) 0 40%, transparent 40%);
  color: inherit;
  font-weight: 600;
  padding: 0 0.06em;
}

.prose p {
  margin: 0 0 var(--space-md);
  color: var(--color-ink);
}

.prose p.lede {
  font-size: var(--text-md);
  line-height: 1.6;
}

.prose p:last-child { margin-bottom: 0; }

.prose .muted { color: var(--color-muted); }

.prose a.inline-link {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--color-rule);
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

.prose a.inline-link:hover {
  border-bottom-color: transparent;
  background-size: 100% 1px;
}

blockquote {
  margin: var(--space-lg) 0;
  padding-inline-start: var(--space-md);
  border-inline-start: 2px solid var(--color-accent);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-style: italic;
  line-height: 1.5;
  color: var(--color-ink);
}

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-lg);
  row-gap: var(--space-sm);
  margin: 0;
  padding: 0;
}

dl.facts dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--color-muted);
  white-space: nowrap;
  padding-top: 0.15em;
}

dl.facts dd {
  margin: 0;
  color: var(--color-ink);
}

/* ---------- footer — Ft2 inline single line ---------- */
.foot-line {
  border-top: 1px solid var(--color-rule);
  padding: var(--space-md) var(--page-gutter) var(--space-xl);
  max-width: 1100px;
  margin: 0 auto;
}

.foot-line p {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 0.8em;
}

.foot-line p + p { margin-top: var(--space-xs); }

.foot-line a {
  text-decoration: none;
  border-bottom: 1px solid var(--color-rule);
  transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

.foot-line a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ---------- priority 2: scroll-triggered reveal ---------- */
/* .in-view is toggled by the tiny inline IntersectionObserver script in index.html
   (no external requests). Reduced-motion users get .in-view immediately, no transition. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition-duration: 1ms;
    transition-delay: 0ms;
    transform: none;
  }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  h1 { font-size: clamp(2.1rem, 9vw, 2.6rem); }
  .positioning { font-size: var(--text-base); }
  .nav-edge { padding-top: var(--space-md); }
  dl.facts { grid-template-columns: 1fr; row-gap: var(--space-xs); }
  dl.facts dt { padding-top: 0; }
}
