/* ============================================================
   Site kit — base.css (structure only)
   Components + layout primitives shared by every satellite. It carries
   NO identity: palette, fonts, radius, texture and accent come from
   themes/<theme>.css and the site's own layer. Load order:
     base.css -> archetypes/<archetype>.css -> themes/<theme>.css -> site
   Compile them into ONE per-site stylesheet (the design gate requires a
   stylesheet unique to each site).
   ============================================================ */

:root {
  /* --- Type scale (fluid) --- */
  --text-xs:   clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm:   clamp(0.8125rem, 0.79rem + 0.15vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.91rem + 0.2vw, 1rem);
  --text-lg:   clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --text-xl:   clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --text-2xl:  clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);
  --text-3xl:  clamp(1.875rem, 1.3rem + 2.6vw, 3rem);
  --text-hero: clamp(2.25rem, 1.4rem + 4vw, 3.75rem);

  /* --- Spacing (4px system) --- */
  --space-1:  0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4:  1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8:  2rem;    --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;  --space-24: 6rem;

  /* --- Motion --- */
  --duration-fast: 120ms;
  --duration-normal: 180ms;
  --duration-slow: 320ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Content widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* defaults a theme overrides */
:root {
  --radius: 0.625rem;
  --radius-sm: 0.4375rem;
  --radius-full: 9999px;
  --font-body: -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--space-16) + var(--space-4));
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, var(--signal-weak), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255,255,255,0.03), transparent 55%);
}

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

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

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

h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; font-weight: 650; letter-spacing: -0.02em; }
p, li { text-wrap: pretty; }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, kbd { font-family: var(--font-mono); }
code { font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--code-bg); border: 1px solid var(--code-border); }
pre { overflow-x: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--content-wide); margin: 0 auto; padding-inline: var(--space-6); }

/* ---- Motion: interactive transitions ---- */
a, button, [role='button'], input, summary {
  transition: color var(--duration-normal) var(--ease),
              background-color var(--duration-normal) var(--ease),
              border-color var(--duration-normal) var(--ease),
              box-shadow var(--duration-normal) var(--ease),
              transform var(--duration-normal) var(--ease),
              opacity var(--duration-normal) var(--ease);
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 0.7s var(--ease-spring),
              transform 0.7s var(--ease-spring),
              filter 0.7s var(--ease-spring);
  will-change: opacity, transform, filter;
}
.reveal.is-visible { opacity: 1; transform: none; filter: none; }

@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;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--canvas);
}
.brand .logo svg { width: 16px; height: 16px; }
.brand .tld { font-family: var(--font-mono); font-weight: 400; font-size: var(--text-xs); color: var(--ink-faint); }

.nav-links { display: flex; align-items: center; gap: var(--space-6); }
.nav-links a {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }

/* ---- Guides dropdown ---- */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500;
  color: var(--ink-muted); cursor: pointer; padding: 0; border: none; background: none;
  line-height: 1;
}
.nav-dropdown-toggle:hover { color: var(--ink); }
.nav-dropdown-toggle .chev { transition: transform var(--duration-normal) var(--ease); }
.nav-dropdown.open .nav-dropdown-toggle .chev { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 272px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: var(--space-2);
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--duration-normal) var(--ease),
              transform var(--duration-normal) var(--ease),
              visibility var(--duration-normal);
  z-index: 60;
}
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: none;
}
.nav-dropdown-menu a {
  display: block; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--ink-muted);
  font-weight: 500; white-space: nowrap; line-height: 1.5;
}
.nav-dropdown-menu a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-dropdown-menu a.cur { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }

.theme-toggle {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--hairline); background: var(--hover); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--canvas); }
.btn-primary:hover { background: var(--ink); opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--ink-muted); background: var(--hover); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-block: clamp(var(--space-16), 9vw, var(--space-24)) var(--space-16);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-12);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--signal);
  margin-bottom: var(--space-5);
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-weak);
}
.hero h1 {
  font-size: var(--text-hero);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: var(--space-6);
  max-width: 16ch;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--ink) 20%, var(--ink-muted) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  font-size: var(--text-lg);
  color: var(--ink-muted);
  max-width: 44ch;
  line-height: 1.55;
  margin-bottom: var(--space-8);
}
.hero .cta-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.hero .meta {
  margin-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

/* ---- Terminal demo (echo of Kortix's cli-demo) ---- */
.terminal {
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--hairline-soft);
}
.terminal-head .dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal-head .dot.r { background: #ff5f57; }
.terminal-head .dot.y { background: #febc2e; }
.terminal-head .dot.g { background: #28c840; }
.terminal-head .title {
  margin-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}
.terminal-body {
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
}
.terminal-body .line { white-space: pre-wrap; }
.terminal-body .prompt { color: var(--signal); }
.terminal-body .cmd { color: var(--ink); }
.terminal-body .out { color: var(--ink-muted); }
.terminal-body .ok { color: var(--ok); }
.terminal-body .dim { color: var(--ink-faint); }
.terminal-body .cursor {
  display: inline-block;
  width: 8px; height: 1.1em;
  background: var(--signal);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
  border-top: 1px solid var(--hairline-soft);
}
.section-head { max-width: 46em; margin-bottom: var(--space-12); }
.section-head h2 {
  font-size: var(--text-3xl);
  font-weight: 660;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}
.section-head .sub { font-size: var(--text-lg); color: var(--ink-muted); }
.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--signal);
  margin-bottom: var(--space-3);
}

/* ---- Comparison table ---- */
.table-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.table-scroll { overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 720px; }
table.cmp thead th {
  text-align: left;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-muted);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-1);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0;
}
table.cmp thead th.hl {
  color: var(--ink);
  font-weight: 700;
}
table.cmp thead th.hl::after {
  content: '← open';
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--signal);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}
table.cmp tbody td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top;
  line-height: 1.5;
}
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp tbody tr:hover { background: var(--hover); }
table.cmp td.dim {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  white-space: nowrap;
  padding-top: var(--space-5);
}
table.cmp td small { display: block; color: var(--ink-muted); font-weight: 400; margin-top: 2px; font-family: var(--font-body); }
.flag-open, .flag-partial, .flag-closed { font-weight: 600; }
.flag-open { color: var(--ok); }
.flag-partial { color: var(--warn); }
.flag-closed { color: var(--bad); }
.footnote { font-size: var(--text-xs); color: var(--ink-faint); margin-top: var(--space-4); }

/* ---- Platform cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-5); }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  transition: transform var(--duration-normal) var(--ease),
              border-color var(--duration-normal) var(--ease),
              box-shadow var(--duration-normal) var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--ink-muted);
  box-shadow: var(--shadow-md);
}
.card .tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
  background: var(--surface-1);
}
.card h3 { font-size: var(--text-xl); font-weight: 650; letter-spacing: -0.02em; }
.card .site {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--signal);
  margin-bottom: var(--space-1);
}
.card p { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.6; }
.card ul { list-style: none; display: grid; gap: var(--space-2); }
.card li {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  padding-left: var(--space-5);
  position: relative;
}
.card li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--signal);
  opacity: 0.7;
}

/* ---- Callouts ---- */
.callout {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  margin-top: var(--space-6);
}
.callout .ic {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--signal-weak);
  color: var(--signal);
}
.callout p { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.65; }
.callout strong { color: var(--ink); }

/* ---- Steps ---- */
ol.steps { list-style: none; counter-reset: step; display: grid; gap: var(--space-5); max-width: 56em; }
ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: calc(var(--space-10) + var(--space-2));
  font-size: var(--text-base);
  color: var(--ink-muted);
  line-height: 1.6;
}
ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--signal);
  width: var(--space-10); height: var(--space-10);
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
ol.steps li strong { color: var(--ink); }

/* ---- FAQ ---- */
details.faq {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
details.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--ink);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .chev {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  display: grid; place-items: center;
  color: var(--ink-muted);
  transition: transform var(--duration-normal) var(--ease);
}
details.faq[open] summary .chev { transform: rotate(45deg); color: var(--signal); border-color: var(--signal); }
details.faq .faq-body { padding: 0 var(--space-6) var(--space-6); }
details.faq .faq-body p { font-size: var(--text-base); color: var(--ink-muted); line-height: 1.65; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--space-12) var(--space-16);
  background: var(--base);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.site-footer .brand { margin-bottom: var(--space-4); }
.site-footer p { font-size: var(--text-sm); color: var(--ink-muted); }
.disclaimer { font-size: var(--text-xs); color: var(--ink-faint); max-width: 56em; margin-top: var(--space-4); line-height: 1.6; }
.footer-src { font-size: var(--text-xs); color: var(--ink-faint); }
.footer-src a { color: var(--ink-muted); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-10); }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: var(--space-4); }
  .footer-grid { flex-direction: column; }
}


/* ---- Display type (themes pick a display face; editorial uses a serif) ---- */
h1, h2, h3, .hero h1, .section-head h2 { font-family: var(--font-display); }

/* ---- Small screens: compact header ---- */
@media (max-width: 560px) {
  .nav-actions .btn { padding: 6px 12px; font-size: var(--text-xs); white-space: nowrap; }
  .brand > span:not(.logo):not(.tld) { max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand .tld { display: none; }
}

/* ---- Mobile menu (no JS): <details class="nav-menu"> in .nav-actions ----
   Hidden on desktop; below 900px .nav-links hide and this takes over.
   Put EVERY primary nav link and the CTA inside .nav-menu-panel. */
.nav-menu { display: none; position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; display: grid; place-items: center;
  width: 40px; height: 40px; border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  color: var(--ink); background: var(--surface); }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px;
  display: grid; gap: 2px; padding: var(--space-2); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 50; }
.nav-menu-panel a:not(.btn) { display: block; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; }
.nav-menu-panel a:not(.btn):hover { background: var(--hover); }
.nav-menu-panel .btn { margin-top: var(--space-2); justify-content: center; text-align: center; }
@media (max-width: 900px) { .nav-menu { display: block; } }
@media (max-width: 560px) { .nav-actions > .btn { display: none; } }
/* ============================================================
   Archetype: comparison-hub
   Two-column hero (claim + product artifact such as a terminal, a config
   file or a decision widget), the comparison table as the centrepiece,
   a verdict band, alternative cards, FAQ. Best for "X alternatives" and
   "open source X" head terms.
   ============================================================ */
.hero { padding: var(--space-20) 0 var(--space-16); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-12); align-items: center; }

/* verdict band: the answer, stated once, above the fold of the table */
.verdict { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-6);
  align-items: center; padding: var(--space-6) var(--space-8);
  border: 1px solid var(--hairline); border-left: 4px solid var(--signal);
  border-radius: var(--radius); background: var(--surface-1); margin: var(--space-8) 0; }
.verdict .label { font-family: var(--font-mono); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--signal); }
.verdict p { font-size: var(--text-lg); color: var(--ink); }

/* sticky first column + highlighted Kortix column */
table.cmp thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-1); }
table.cmp td:first-child, table.cmp th:first-child { position: sticky; left: 0;
  background: var(--surface); z-index: 1; }
table.cmp td.hl-col { background: var(--signal-weak); }

.alt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .alt-grid { grid-template-columns: 1fr 1fr; }
  .verdict { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .alt-grid { grid-template-columns: 1fr; } }
/* ============================================================
   Theme: paper
   Light editorial: warm off-white paper, serif display headlines over a
   humanist sans, generous leading, small radii, ink-brown text. Reads like
   a publication, not an app.
   Fonts (in <head>):
     https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Source+Sans+3:wght@400;600&family=IBM+Plex+Mono:wght@400&display=swap
   Accent: set --signal / --signal-weak in the site layer.
   ============================================================ */
:root {
  color-scheme: light;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 0.25rem; --radius-sm: 0.1875rem;
  --canvas: #faf7f2; --base: #faf7f2; --surface: #fffdf9;
  --surface-1: #f3eee6; --surface-2: #ebe4d8; --surface-3: #e1d8c9;
  --ink: #1f1a14; --ink-strong: #120e0a; --ink-muted: #5d5347; --ink-faint: #8f8475;
  --hairline: #ddd3c4; --hairline-soft: #ebe4d8;
  --signal: #b4532a; --signal-weak: rgba(180, 83, 42, 0.10);
  --ok: #1a7f37; --warn: #9a6700; --bad: #b3261e;
  --hover: rgba(31, 26, 20, 0.05); --active: rgba(31, 26, 20, 0.09);
  --selection: rgba(180, 83, 42, 0.18);
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, 0.08);
  --shadow-md: 0 10px 28px -14px rgba(60, 40, 20, 0.18);
  --shadow-lg: 0 28px 60px -28px rgba(60, 40, 20, 0.25);
  --glass-bg: rgba(250, 247, 242, 0.82); --glass-border: rgba(31, 26, 20, 0.08);
  --code-bg: #f3eee6; --code-border: #ddd3c4;
}
body { line-height: 1.7; }
h1, h2, .hero h1 { letter-spacing: -0.01em; font-weight: 600; }
/* ============================================================
   n8n Alternative — site layer (identity on top of paper + comparison-hub)
   Accent: teal #0d8177 (hue ~175°, set as --signal). Signature: the
   "Work-shape router" — a CSS-only two-state widget that routes fixed
   workflows to n8n and open-ended tasks to Kortix, plus a canvas-node to
   Kortix-primitive migration strip. No sibling has either.
   ============================================================ */
:root {
  --signal: #0d8177;
  --signal-weak: rgba(13, 129, 119, 0.11);
  --selection: rgba(13, 129, 119, 0.20);
  --font-body: 'Work Sans', 'Segoe UI', sans-serif;
  --font-display: 'Spectral', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --rule: 1px solid var(--hairline);
}

body {
  background-image:
    radial-gradient(1100px 520px at 50% -12%, var(--signal-weak), transparent 62%),
    linear-gradient(180deg, rgba(31, 26, 20, 0.02), transparent 22rem);
}

/* A publication folio rule under the masthead, unique to this site. */
.masthead-rule {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); border-top: 3px double var(--ink);
  border-bottom: var(--rule); padding: var(--space-2) 0;
  font-family: var(--font-mono); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-muted);
}
.masthead-rule .dot { color: var(--signal); }

/* Section headline gets a small numbered chip in this site's editorial voice. */
.sec-num {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border: var(--rule); border-radius: 50%; background: var(--surface);
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--signal); margin-right: var(--space-3); vertical-align: middle;
}

/* ---------- Signature: the Work-shape router (CSS-only) ---------- */
.shape-router {
  position: relative;
  border: var(--rule); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow-md);
}
.shape-router > input { position: absolute; opacity: 0; width: 1px; height: 1px;
  pointer-events: none; }
.router-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); padding: var(--space-4) var(--space-5);
  border-bottom: var(--rule); background: var(--surface-1);
}
.router-head .rh-label {
  font-family: var(--font-mono); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted);
}
.router-head .rh-title { font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: 600; color: var(--ink); }
.router-tabs { display: flex; gap: 0; border-bottom: var(--rule); }
.router-tabs label {
  flex: 1; text-align: center; cursor: pointer; padding: var(--space-4) var(--space-3);
  font-family: var(--font-mono); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted);
  background: var(--surface); border-right: var(--rule); user-select: none;
}
.router-tabs label:last-child { border-right: none; }
.router-tabs label:hover { background: var(--hover); color: var(--ink); }
.router-panel { display: none; padding: var(--space-6) var(--space-5); }
.router-panel h4 { font-family: var(--font-display); font-size: var(--text-xl);
  margin-bottom: var(--space-3); letter-spacing: -0.02em; }
.router-panel p { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.65; }
.router-panel .verdict-mini {
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--signal); background: var(--signal-weak);
  font-size: var(--text-sm); color: var(--ink);
}
#shape-fixed:checked ~ .router-tabs label[for="shape-fixed"],
#shape-open:checked ~ .router-tabs label[for="shape-open"] {
  background: var(--ink); color: var(--canvas);
}
#shape-fixed:checked ~ .router-panel.panel-fixed,
#shape-open:checked ~ .router-panel.panel-open { display: block; }

/* node graph inside the hero artifact */
.node-graph { width: 100%; height: auto; margin: var(--space-4) 0 var(--space-2); }
.node-graph .wire { stroke: var(--hairline); stroke-width: 1.6; fill: none; }
.node-graph .wire.hot { stroke: var(--signal); stroke-width: 2; stroke-dasharray: 5 4; }
.node-graph .node-box { fill: var(--surface); stroke: var(--hairline); stroke-width: 1.4; }
.node-graph .node-box.hot { stroke: var(--signal); stroke-width: 2; }
.node-graph text { font-family: var(--font-mono); font-size: 8.5px; fill: var(--ink-muted); }
.node-graph text.hot { fill: var(--signal); font-weight: 600; }

/* ---------- Migration strip: n8n node -> Kortix primitive ---------- */
.migrate-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4); margin-top: var(--space-6);
}
.migrate-strip .m-cell {
  border: var(--rule); border-radius: var(--radius); background: var(--surface);
  padding: var(--space-4) var(--space-5);
}
.migrate-strip .m-from {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.migrate-strip .m-arrow { color: var(--signal); font-family: var(--font-mono); font-size: var(--text-xs); }
.migrate-strip .m-to { font-family: var(--font-display); font-size: var(--text-lg); color: var(--ink); }

/* Kortix-first card emphasis */
.card.is-pick { border-color: var(--signal); }
.card.is-pick .tag { border-color: var(--signal); color: var(--signal); background: var(--signal-weak); }
.card .rank {
  position: absolute; top: var(--space-4); right: var(--space-5);
  font-family: var(--font-display); font-size: var(--text-2xl); color: var(--hairline);
}
.card.is-pick .rank { color: var(--signal); }

/* prose column for inner pages */
.prose { max-width: 74ch; }
.prose p { color: var(--ink-muted); margin-bottom: var(--space-4); line-height: 1.7; }
.prose h2 { font-size: var(--text-2xl); margin: var(--space-12) 0 var(--space-4); }
.prose h3 { font-size: var(--text-xl); margin: var(--space-8) 0 var(--space-3); }
.prose ul, .prose ol { margin: 0 0 var(--space-4) var(--space-6); color: var(--ink-muted); }
.prose li { margin-bottom: var(--space-2); }
.prose strong { color: var(--ink); }
.prose pre {
  background: var(--code-bg); border: var(--rule); border-radius: var(--radius);
  padding: var(--space-4) var(--space-5); font-size: var(--text-sm); margin-bottom: var(--space-4);
  overflow-x: auto;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin-bottom: var(--space-6); }
.prose table th, .prose table td { border-bottom: 1px solid var(--hairline-soft);
  padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; }
.prose table th { background: var(--surface-1); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }
.prose .table-scroll { overflow-x: auto; margin-bottom: var(--space-6); }
.prose a { text-decoration: underline; text-decoration-color: var(--hairline); }
.prose a:hover { text-decoration-color: var(--signal); }

@media (max-width: 700px) {
  .migrate-strip { grid-template-columns: 1fr; }
  .masthead-rule { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
}
