/**
 * Lunan design tokens — CSS custom properties.
 * Mirrors src/tokens/tokens.ts exactly. Same rules apply: this file (with
 * tokens.ts) is the only place literal values may appear. Contrast ratios
 * and derivation notes live in tokens.ts next to each value.
 *
 * Font loading lives here so that font NAMES never leave src/tokens/.
 * Google Fonts only. Light theme only — no dark mode, permanently.
 */

@import url("https://fonts.googleapis.com/css2?family=Petrona:ital,wght@0,300;0,400;1,300&family=Spectral:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Figtree:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  /* -- color ---------------------------------------------------------- */
  /* COLORWAY "A Harbor" (default 2026-09-29). Values only: switching to
     B / C / D replaces these hex values with that option's row from the
     table in tokens.ts — nothing else changes. Ratios live in tokens.ts. */
  --color-ground: #f5f1e8;
  --color-paper: #fffdf8;
  --color-ink: #15201f;
  --color-ink-soft: #4b5856;
  /* Harbor: darkened from #66736F so it still clears 4.5:1 on the new
     ground (4.94:1) and on both bands. */
  --color-faint: #5e6b67;
  --color-rule: #e0d9c9;
  /* derived: 50% rule over paper */
  --color-rule-lt: #f0ebe0;
  --color-accent: #14504c;
  /* second accent — defined, no consumer yet */
  --color-accent-2: #1f5f96;
  /* section band backgrounds (homepage bands alternate with the ground) */
  --color-band: #dcece7;
  --color-band-2: #fbeecb;
  /* LINT RULE — live-state ONLY. Means "live / recording / in progress
     right now". NEVER on a button, link, heading, or any static element.
     Any reference outside a live-state component is a bug. */
  --color-live: #b4713b;
  /* derived: 8% accent over paper */
  --color-accent-wash: #ecefea;
  /* derived: 10% live over paper — live-state ONLY, same lint rule */
  --color-live-wash: #f8efe5;
  /* derived: ink at 8% / 10% alpha — shadow colors only */
  --color-shadow-ink-8: rgba(21, 32, 31, 0.08);
  --color-shadow-ink-10: rgba(21, 32, 31, 0.1);

  /* -- space ---------------------------------------------------------- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* -- type ----------------------------------------------------------- */
  --font-display: "Petrona", "Iowan Old Style", Georgia, serif;
  --font-body: "Spectral", Georgia, "Times New Roman", serif;
  --font-ui: "Figtree", -apple-system, "Segoe UI", "Helvetica Neue", Arial,
    sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.4375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  --tracking-tight: -0.01em;
  --tracking-normal: 0em;
  --tracking-wide: 0.08em;
  --tracking-wider: 0.14em;

  /* -- radius --------------------------------------------------------- */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-full: 999px;

  /* -- border --------------------------------------------------------- */
  --border-thin: 1px;
  --border-thick: 2px;

  /* -- shadow (sparingly) --------------------------------------------- */
  --shadow-sm: 0 1px 2px var(--color-shadow-ink-8);
  --shadow-md: 0 2px 12px var(--color-shadow-ink-10);

  /* -- motion --------------------------------------------------------- */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 400ms;
  --duration-breath: 3200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0, 0, 0.2, 1);
  --ease-breath: ease-in-out;
}

/* Minimal reset. Spacing in this system comes from flex/grid gap, so margins
   are zeroed here and never relied on to collapse. */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
}

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

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

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

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

/* Element defaults and the type scale. Light theme only — permanently.
   All values are tokens from src/tokens/tokens.css. */

body {
  background: var(--color-ground);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

/* Display headings default to Petrona light — the face gets quieter as it
   gets bigger, so the largest sizes carry the lightest weight. */
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--color-ink);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
}

h4,
h5,
h6 {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

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

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

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

/* Every interactive element gets the same visible focus treatment.
   :focus-visible only — no rings on mouse clicks. */
:focus-visible {
  outline: var(--border-thick) solid var(--color-accent);
  outline-offset: var(--border-thick);
  border-radius: var(--radius-sm);
}

/* Global reduced-motion kill-switch: every animation and transition in the
   system collapses to (near-)instant. Individual components also provide
   sensible static equivalents where an animation carries meaning. */
@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;
  }
}


/* -- industry pages (scripts/niches/build.mjs) -------------------------- */
.page {
  max-width: 72rem;
  margin-inline: auto;
  padding: var(--space-md) var(--space-sm) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}
@media (min-width: 48rem) {
  .page { padding-inline: var(--space-lg); }
}
main { display: flex; flex-direction: column; gap: var(--space-2xl); min-width: 0; }
p, li, a, summary { overflow-wrap: break-word; }

.mast { display: flex; align-items: center; padding-block: var(--space-2xs); }
.home { text-decoration: none; }
.logotype { display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--color-accent); }
.logotype .word {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.logotype .stop { color: var(--color-ink); }

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); }
@media (min-width: 48rem) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-xl); }
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
}
.lede {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-ink-soft);
  max-width: 62ch;
}
.prose-p, .card p, .faq p, .reading p, .step p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  max-width: 68ch;
}
.note, .checked, .faint, .stat-source {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-faint);
}

.hero, .section, .post, .cta-box { display: flex; flex-direction: column; gap: var(--space-sm); }
.hero { gap: var(--space-md); padding-top: var(--space-lg); }
.hero h1 { max-width: 22ch; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-paper);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.button:hover { background: var(--color-ink); }

.stat {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  border-left: var(--border-thick) solid var(--color-accent);
  padding-left: var(--space-sm);
  max-width: 62ch;
}
.stat-source { display: block; margin-top: var(--space-3xs); }

.grid { display: grid; gap: var(--space-sm); grid-template-columns: 1fr; }
@media (min-width: 48rem) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stack { display: flex; flex-direction: column; gap: var(--space-sm); }
.card {
  background: var(--color-paper);
  border: var(--border-thin) solid var(--color-rule);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}
.card ul { padding-left: var(--space-md); font-family: var(--font-body); line-height: var(--leading-relaxed); display: flex; flex-direction: column; gap: var(--space-3xs); }
.card .for { color: var(--color-ink-soft); }
.card p.before-after {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  background: var(--color-accent-wash);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
}

.steps { display: flex; flex-direction: column; gap: var(--space-md); }
.step { display: flex; gap: var(--space-sm); align-items: flex-start; }
.step > div { display: flex; flex-direction: column; gap: var(--space-3xs); min-width: 0; }
.step-n {
  flex: none;
  width: var(--space-lg);
  height: var(--space-lg);
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-paper);
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.band {
  background: var(--color-band);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
}

.faq { display: flex; flex-direction: column; gap: var(--space-2xs); }
.faq details {
  background: var(--color-paper);
  border: var(--border-thin) solid var(--color-rule);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}
.faq summary { font-family: var(--font-ui); font-weight: var(--weight-medium); cursor: pointer; }
.faq details[open] summary { margin-bottom: var(--space-2xs); }

.reading { display: flex; flex-direction: column; gap: var(--space-sm); }
.reading a { font-family: var(--font-ui); font-weight: var(--weight-medium); font-size: var(--text-base); }

.cta, .cta-box {
  background: var(--color-band-2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
}

.hub { display: grid; gap: var(--space-sm); grid-template-columns: 1fr; }
@media (min-width: 48rem) { .hub { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hub-title { font-size: var(--text-xl); }
.hub-title a { color: var(--color-ink); text-decoration: none; }
.hub-title a:hover { color: var(--color-accent); text-decoration: underline; }

.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-2xs); list-style: none; font-family: var(--font-ui); font-size: var(--text-sm); color: var(--color-faint); }
.breadcrumb li + li::before { content: "›"; margin-right: var(--space-2xs); }

.post { max-width: 46rem; gap: var(--space-md); }
.prose { display: flex; flex-direction: column; gap: var(--space-sm); font-family: var(--font-body); font-size: var(--text-base); line-height: var(--leading-relaxed); min-width: 0; }
.prose h2 { font-size: var(--text-2xl); margin-top: var(--space-md); }
.prose h3 { font-size: var(--text-lg); margin-top: var(--space-xs); }
.prose ul, .prose ol { padding-left: var(--space-md); display: flex; flex-direction: column; gap: var(--space-3xs); }
.prose blockquote { border-left: var(--border-thick) solid var(--color-rule); padding-left: var(--space-sm); color: var(--color-ink-soft); }
.prose hr { border: 0; border-top: var(--border-thin) solid var(--color-rule); }
.prose pre { background: var(--color-paper); border: var(--border-thin) solid var(--color-rule); border-radius: var(--radius-sm); padding: var(--space-sm); overflow-x: auto; white-space: pre; }
.prose code { overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.prose table { border-collapse: collapse; font-family: var(--font-ui); font-size: var(--text-sm); line-height: var(--leading-normal); min-width: 100%; }
.prose th, .prose td { border: var(--border-thin) solid var(--color-rule); padding: var(--space-2xs) var(--space-xs); text-align: left; vertical-align: top; }
.prose th { background: var(--color-paper); font-weight: var(--weight-semibold); }
.sources ol { padding-left: var(--space-md); font-family: var(--font-ui); font-size: var(--text-sm); line-height: var(--leading-normal); display: flex; flex-direction: column; gap: var(--space-3xs); }
.sources a { overflow-wrap: anywhere; }

.footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  border-top: var(--border-thin) solid var(--color-rule);
  padding-top: var(--space-md);
}
.footer-brand { display: flex; flex-direction: column; gap: var(--space-2xs); }
.tagline { font-family: var(--font-body); font-size: var(--text-base); line-height: var(--leading-relaxed); color: var(--color-ink-soft); max-width: 56ch; }
.footer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2xs); font-size: var(--text-sm); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-sm); font-family: var(--font-ui); font-size: var(--text-sm); }
.footer-note { font-family: var(--font-mono); font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--color-ink-soft); max-width: 24rem; }
