/* WordPress Custom editorial system, shared by every site of the domain.
   Family of the BMAD+ site (paper, ink, system type, no font download), with its own accent:
   a deep ink blue, the colour of a fountain pen, instead of BMAD+ vermilion.
   CSS custom properties are the token source. Colours are OKLCH. */
:root {
  color-scheme: light;
  --paper: oklch(96.4% .01 85);
  --paper-raised: oklch(98.6% .006 85);
  --paper-sunk: oklch(93% .014 82);
  --ink: oklch(23% .02 260);
  --ink-muted: oklch(42% .02 255);
  --line-soft: oklch(84% .015 80);
  --line-strong: oklch(55% .02 255);
  --blue: oklch(45% .16 262);
  --blue-dark: oklch(37% .14 262);
  --blue-pale: oklch(92.5% .03 262);
  --ok: oklch(45% .11 150);
  --terminal: oklch(21% .02 260);
  --terminal-text: oklch(93% .01 85);
  --terminal-muted: oklch(76% .02 255);
  --terminal-accent: oklch(80% .1 230);

  --background: var(--paper);
  --surface: var(--paper-raised);
  --surface-sunk: var(--paper-sunk);
  --foreground: var(--ink);
  --text-muted: var(--ink-muted);
  --border: var(--line-soft);
  --control-border: var(--line-strong);
  --primary: var(--blue);
  --primary-hover: var(--blue-dark);
  --accent-surface: var(--blue-pale);
  --ring: var(--blue);
  --button-text: var(--paper-raised);

  --font-text: Arial, Helvetica, sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --text-4xl: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --radius: .25rem;
  --radius-lg: .5rem;
  --duration: 140ms;
  --ease: ease-out;
  --page-width: 76rem;
  --measure: 68ch;
}

/* Dark scheme: a rebuilt scale, not an inversion. Text pairs stay at WCAG 2.2 AA. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: oklch(18.5% .015 260);
    --paper-raised: oklch(22.5% .018 260);
    --paper-sunk: oklch(15.5% .012 260);
    --ink: oklch(93% .01 85);
    --ink-muted: oklch(78% .015 255);
    --line-soft: oklch(34% .02 260);
    --line-strong: oklch(62% .02 255);
    --blue: oklch(74% .12 255);
    --blue-dark: oklch(80% .1 255);
    --blue-pale: oklch(28% .05 262);
    --ok: oklch(76% .12 150);
    --terminal: oklch(13.5% .012 260);
    --button-text: oklch(17% .02 260);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: 0s !important; } }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-text); font-size: var(--text-base); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--primary); }
::selection { background: var(--accent-surface); color: var(--foreground); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 2px; }
code, pre, kbd { font-family: var(--font-mono); font-size: .92em; }

.skip { position: absolute; left: var(--space-4); top: -4rem; padding: var(--space-2) var(--space-4); background: var(--surface); border: 1px solid var(--control-border); z-index: 10; }
.skip:focus { top: var(--space-4); }

.wrap { width: min(100% - 2 * var(--space-6), var(--page-width)); margin-inline: auto; }

/* Header: one line, under 72px. */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: 4rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 1.75rem; height: 1.75rem; flex: none; }
.brand .logo-bg { fill: var(--primary); }
.brand .logo-w { fill: none; stroke: var(--paper-raised); stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; }
.brand small { font-weight: 400; color: var(--text-muted); }
.nav { display: flex; gap: var(--space-6); flex-wrap: wrap; font-size: var(--text-sm); }
.nav a { text-decoration: none; padding-block: var(--space-2); }
.nav a:hover { text-decoration: underline; }

/* Buttons. */
.button { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 2.75rem; padding: var(--space-3) var(--space-6); border-radius: var(--radius); background: var(--primary); color: var(--button-text); font-weight: 700; text-decoration: none; border: 1px solid var(--primary); transition: background var(--duration) var(--ease); }
.button:hover { background: var(--primary-hover); color: var(--button-text); }
.button.secondary { background: transparent; color: var(--foreground); border-color: var(--control-border); }
.button.secondary:hover { background: var(--surface); color: var(--foreground); }
.button svg { width: 1.1em; height: 1.1em; }

/* Typography. */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; letter-spacing: -.015em; margin: 0; }
h1 { font-size: var(--text-4xl); }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, var(--text-3xl)); }
h3 { font-size: var(--text-xl); }
p { margin: 0; }
.lead { font-size: var(--text-lg); color: var(--text-muted); max-width: 46ch; }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-sm); }
.eyebrow { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--primary); }
.badge { display: inline-block; font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: var(--space-1) var(--space-2); border-radius: var(--radius); background: var(--accent-surface); color: var(--foreground); }
.stack > * + * { margin-top: var(--space-4); }
.prose { max-width: var(--measure); }

/* Sections share one rhythm. */
section { padding-block: var(--space-16); }
section + section { border-top: 1px solid var(--border); }
.section-head { display: grid; gap: var(--space-3); margin-bottom: var(--space-8); max-width: var(--measure); }

/* Asymmetric hero: text on the left, real product image offset on the right. */
.hero { padding-block: var(--space-12) var(--space-16); }
.hero .wrap { display: grid; gap: var(--space-12); align-items: center; }
@media (min-width: 60rem) { .hero .wrap { grid-template-columns: 5fr 7fr; } }
.hero-copy { display: grid; gap: var(--space-6); justify-items: start; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.hero-figure { margin: 0; position: relative; }
.hero-figure img { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--paper-raised); box-shadow: 0 1px 2px oklch(0% 0 0 / .06), 0 12px 32px -12px oklch(25% .03 260 / .25); }
@media (min-width: 60rem) { .hero-figure { margin-right: calc(-1 * var(--space-12)); } }
.hero-figure figcaption { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); font-size: var(--text-sm); color: var(--text-muted); padding: 0; margin: 0; list-style: none; }
.facts li::before { content: "·"; margin-right: var(--space-2); color: var(--primary); }
.facts li:first-child::before { content: none; }

/* Feature layout: one lead feature, then weighted rows. */
.features { display: grid; gap: var(--space-8); }
@media (min-width: 60rem) { .features { grid-template-columns: 7fr 5fr; } }
.feature-lead { align-self: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-8); display: grid; gap: var(--space-4); align-content: start; }
.feature-lead ul { margin: 0; padding-left: 1.1rem; display: grid; gap: var(--space-2); }
.feature-rows { display: grid; gap: 0; }
.feature-row { padding-block: var(--space-6); border-top: 1px solid var(--border); display: grid; gap: var(--space-2); }
.feature-row:first-child { border-top: 0; padding-top: 0; }

/* Two-column split used by guardrails and limits. */
.split { display: grid; gap: var(--space-12); }
@media (min-width: 60rem) { .split { grid-template-columns: 1fr 1fr; } }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.check-list li { padding-left: 1.75rem; position: relative; }
.check-list li svg { position: absolute; left: 0; top: .2rem; width: 1.1rem; height: 1.1rem; color: var(--ok); }
.check-list.limits li svg { color: var(--text-muted); }

/* Steps: three at most. */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-8); }
@media (min-width: 60rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps > li { counter-increment: step; display: grid; gap: var(--space-3); align-content: start; }
.after-steps { margin-top: var(--space-8); }
.steps > li::before { content: counter(step); font-family: var(--font-display); font-size: var(--text-3xl); line-height: 1; color: var(--primary); }

/* Terminal-style code blocks are real commands, not decoration. */
pre.terminal { background: var(--terminal); color: var(--terminal-text); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-6); overflow-x: auto; margin: 0; line-height: 1.5; font-size: var(--text-sm); }
pre.terminal .c { color: var(--terminal-muted); }

table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
th, td { text-align: left; padding: var(--space-3) var(--space-4) var(--space-3) 0; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* Download block, repeated at the end with the same intent as the hero. */
.download { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-8); display: grid; gap: var(--space-6); }
@media (min-width: 60rem) { .download { grid-template-columns: 1fr auto; align-items: center; } }
.hash { font-family: var(--font-mono); font-size: var(--text-xs); overflow-wrap: anywhere; color: var(--text-muted); }

/* Project list on the hub. */
.projects { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-6); }
.project { display: grid; gap: var(--space-4); padding: var(--space-8); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
@media (min-width: 60rem) { .project.featured { grid-template-columns: 7fr 5fr; align-items: center; } }
.project.next { background: transparent; border-style: dashed; }

.site-footer { border-top: 1px solid var(--border); padding-block: var(--space-12); font-size: var(--text-sm); color: var(--text-muted); }
.site-footer .wrap { display: grid; gap: var(--space-4); }
@media (min-width: 60rem) { .site-footer .wrap { grid-template-columns: 1fr auto; } }
.site-footer nav { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.project img { border: 1px solid var(--border); border-radius: var(--radius-lg); }
