/* ==========================================================================
   prasyn.com — Dinesh Godaba
   Palette from the Prasyn mark: deep navy ink, paper ground, signal blue.
   ========================================================================== */

:root {
  --bg: #f1eee6;
  --surface: #faf8f3;
  --surface-2: #e8e4d9;
  --ink: #1b2b45;
  --ink-2: #5c6b7a;
  --ink-3: #7a8591;
  --line: rgba(27, 43, 69, 0.14);
  --line-strong: rgba(27, 43, 69, 0.28);
  --signal: #2fa9d6;          /* decorative only: fails text contrast on paper */
  --link: #1b6f94;            /* text-safe blue, 4.8:1 on paper */
  --primary: #1b2b45;
  --on-primary: #f8f7f2;
  --focus: #1b6f94;

  --ok-ink: #0b6b47;
  --ok-bg: rgba(16, 185, 129, 0.13);
  --wait-ink: #8a5a00;
  --wait-bg: rgba(245, 158, 11, 0.16);
  --stop-ink: #a23b2e;
  --stop-bg: rgba(162, 59, 46, 0.11);
  --neutral-bg: rgba(92, 107, 122, 0.13);

  /* Hero backdrop network. Barely there on paper; it carries the dark theme. */
  --net-dot: rgba(27, 43, 69, 0.22);
  --net-link: rgba(27, 43, 69, 0.13);
  --net-live: rgba(27, 111, 148, 0.75);

  --shadow-1: 0 1px 3px rgba(27, 43, 69, 0.06), 0 4px 12px rgba(27, 43, 69, 0.05);
  --shadow-2: 0 4px 16px rgba(27, 43, 69, 0.1), 0 1px 4px rgba(27, 43, 69, 0.06);
  --shadow-3: 0 20px 60px rgba(27, 43, 69, 0.2);

  --font-display: "Barlow Condensed", "Arial Narrow", "Bahnschrift", sans-serif;
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 20px;
  --wrap: 1120px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1620;
    --surface: #16202c;
    --surface-2: #1d2937;
    --ink: #e8edf2;
    --ink-2: #93a3b4;
    --ink-3: #74859a;
    --line: rgba(232, 237, 242, 0.1);
    --line-strong: rgba(232, 237, 242, 0.22);
    --signal: #5bc8ec;
    --link: #6fd0f0;
    --primary: #5bc8ec;
    --on-primary: #0e1620;
    --focus: #6fd0f0;
    --ok-ink: #4ade9f;
    --ok-bg: rgba(74, 222, 159, 0.12);
    --wait-ink: #fbbf24;
    --wait-bg: rgba(251, 191, 36, 0.12);
    --stop-ink: #f08a75;
    --stop-bg: rgba(240, 138, 117, 0.12);
    --neutral-bg: rgba(147, 163, 180, 0.14);
    --net-dot: rgba(139, 199, 228, 0.55);
    --net-link: rgba(91, 200, 236, 0.26);
    --net-live: rgba(159, 225, 250, 0.95);
    --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-3: 0 20px 60px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1620;
  --surface: #16202c;
  --surface-2: #1d2937;
  --ink: #e8edf2;
  --ink-2: #93a3b4;
  --ink-3: #74859a;
  --line: rgba(232, 237, 242, 0.1);
  --line-strong: rgba(232, 237, 242, 0.22);
  --signal: #5bc8ec;
  --link: #6fd0f0;
  --primary: #5bc8ec;
  --on-primary: #0e1620;
  --focus: #6fd0f0;
  --ok-ink: #4ade9f;
  --ok-bg: rgba(74, 222, 159, 0.12);
  --wait-ink: #fbbf24;
  --wait-bg: rgba(251, 191, 36, 0.12);
  --stop-ink: #f08a75;
  --stop-bg: rgba(240, 138, 117, 0.12);
  --neutral-bg: rgba(147, 163, 180, 0.14);
  --net-dot: rgba(139, 199, 228, 0.55);
  --net-link: rgba(91, 200, 236, 0.26);
  --net-live: rgba(159, 225, 250, 0.95);
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
  --shadow-3: 0 20px 60px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

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

a {
  color: var(--link);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.005em;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.25rem);
}

h2 {
  font-size: clamp(1.875rem, 4.2vw, 2.75rem);
}

h3 {
  font-size: 1.5rem;
  line-height: 1.2;
}

p {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 300;
  padding: 8px 16px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-s);
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

/* ---------- Type helpers ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--signal);
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink);
  max-width: 62ch;
}

.muted {
  color: var(--ink-2);
}

.prose {
  max-width: 66ch;
  display: grid;
  gap: 16px;
}

.prose h2 {
  margin-top: 24px;
  font-size: 1.875rem;
}

.prose h3 {
  margin-top: 8px;
}

.prose ul {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out, background-color 150ms ease-out;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-1);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: var(--surface);
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.9375rem;
}

.btn[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.brand img {
  height: 38px;
  width: auto;
}

.brand-text {
  display: grid;
  line-height: 1.05;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.nav {
  display: none;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-s);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--surface);
}

.nav-link[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--signal);
  border-radius: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-moon,
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

.header-cta {
  display: none;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.footer-contact {
  margin-top: 12px;
}

.mobile-nav {
  border-top: 1px solid var(--line);
  padding: 8px 0 16px;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav .nav-list {
  flex-direction: column;
  align-items: stretch;
}

.mobile-nav .nav-link {
  padding: 0 8px;
  font-size: 1.0625rem;
}

.mobile-nav .btn {
  margin-top: 8px;
  width: 100%;
}

@media (min-width: 960px) {
  .nav,
  .header-cta {
    display: flex;
  }
  .menu-toggle,
  .mobile-nav {
    display: none !important;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: 64px;
}

@media (min-width: 768px) {
  .section {
    padding-block: 96px;
  }
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-alt {
  background: var(--surface);
}

.section-head {
  display: grid;
  gap: 16px;
  margin-bottom: 40px;
  max-width: 64ch;
}

/* ---------- Hero ---------- */

.hero,
.page-hero {
  position: relative;
  isolation: isolate;
}

/* Decorative node network, injected by site.js. It must never swallow a click,
   so the pointer events it reacts to are listened for on the hero itself. */
.backdrop {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.hero > .wrap,
.page-hero > .wrap {
  position: relative;
}

.hero {
  padding-block: 48px 72px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 24px;
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.hero-note span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-note svg {
  width: 16px;
  height: 16px;
  color: var(--ok-ink);
}

@media (min-width: 960px) {
  .hero {
    padding-block: 80px 104px;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 56px;
  }
}

.page-hero {
  padding-block: 56px 48px;
}

.page-hero .wrap {
  display: grid;
  gap: 20px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-1);
  padding: 24px;
}

.section-alt .card {
  background: var(--bg);
}

.grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 640px) and (max-width: 959px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.feature {
  display: grid;
  gap: 12px;
  align-content: start;
}

.feature h3 {
  font-size: 1.375rem;
}

.feature p {
  color: var(--ink-2);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-s);
  background: var(--surface-2);
  color: var(--ink);
}

.section-alt .feature-icon {
  background: var(--surface);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.fine-print {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* ---------- Status pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill svg {
  width: 14px;
  height: 14px;
}

.pill-ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.pill-wait {
  background: var(--wait-bg);
  color: var(--wait-ink);
}

.pill-stop {
  background: var(--stop-bg);
  color: var(--stop-ink);
}

.pill-neutral {
  background: var(--neutral-bg);
  color: var(--ink-2);
}

/* ---------- The check demo ---------- */

.gate {
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

.gate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.gate-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gate-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.gate fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.gate legend {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.option {
  position: relative;
}

.option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.option label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--bg);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}

.option label::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.option input:checked + label {
  border-color: var(--ink);
  background: var(--surface);
}

.option input:checked + label::before {
  border-color: var(--ink);
  background: radial-gradient(circle, var(--ink) 0 4px, transparent 5px);
}

.option input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.verdict {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-s);
  border: 1px dashed var(--line-strong);
}

.verdict-reason {
  font-size: 0.9375rem;
}

.verdict-log {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gate-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

@media (prefers-reduced-motion: no-preference) {
  .verdict.is-updated {
    animation: verdict-in 300ms ease-out;
  }
  @keyframes verdict-in {
    from {
      opacity: 0.35;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ---------- Rules sheet ---------- */

.gate-head-flat {
  margin: -24px -24px 8px;
  border-radius: var(--r-m) var(--r-m) 0 0;
}

.rules {
  display: grid;
  margin: 0;
}

.rules > div {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rules > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

@media (min-width: 640px) {
  .rules > div {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 16px;
  }
}

.rules dt {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.rules dd {
  margin: 0;
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  counter-reset: step;
}

@media (min-width: 960px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.step {
  counter-increment: step;
  display: grid;
  gap: 10px;
  align-content: start;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--link);
}

.step h3 {
  font-size: 1.375rem;
}

.step p {
  color: var(--ink-2);
}

/* ---------- Creed ---------- */

.creed {
  display: grid;
  gap: 16px;
  padding-left: 24px;
  border-left: 3px solid var(--signal);
  margin: 0;
}

.creed p {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

.creed cite {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.split {
  display: grid;
  gap: 40px;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.check-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}

.check-list svg {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--link);
}

.check-list strong {
  display: block;
}

.check-list .no svg {
  color: var(--ink-3);
}

/* ---------- CTA band ---------- */

.cta-band {
  display: grid;
  gap: 24px;
  padding: 32px;
  border-radius: var(--r-l);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-2);
}

.cta-band h2 {
  color: inherit;
}

.cta-band p {
  opacity: 0.88;
  max-width: 56ch;
}

.cta-band .btn-primary {
  background: var(--on-primary);
  color: var(--primary);
}

.cta-band .section-head,
.split .section-head {
  margin-bottom: 0;
}

.cta-band .eyebrow {
  color: inherit;
}

.cta-band .eyebrow::before {
  background: currentColor;
  opacity: 0.5;
}

.h1-second {
  color: var(--link);
}

@media (min-width: 960px) {
  .cta-band {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 48px;
  }
}

/* ---------- About ---------- */

.portrait {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  width: 100%;
  max-width: 320px;
  border-radius: var(--r-l);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.monogram {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  color: var(--ink-2);
}

.wrap.about-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 960px) {
  .wrap.about-grid {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
  }
}

.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* ---------- Notes ---------- */

.note {
  display: grid;
  gap: 16px;
  padding-block: 40px;
  border-top: 1px solid var(--line);
  max-width: 70ch;
}

.note:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.note time {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.note h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.25rem);
}

.note p {
  color: var(--ink);
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: 12px;
  max-width: 76ch;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-1);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--ink-2);
  transition: transform 200ms ease-out;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq .answer {
  padding: 0 20px 20px;
  color: var(--ink-2);
  display: grid;
  gap: 12px;
}

/* ---------- Form ---------- */

.form {
  display: grid;
  gap: 20px;
}

.form-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid .span-2 {
    grid-column: 1 / -1;
  }
}

.field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.field label,
.field .label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.req {
  color: var(--stop-ink);
  margin-left: 2px;
}

.hint {
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.input::placeholder {
  color: var(--ink-3);
}

.input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent);
}

textarea.input {
  min-height: 112px;
  resize: vertical;
}

select.input {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.input[aria-invalid="true"] {
  border-color: var(--stop-ink);
}

.error {
  font-size: 0.8125rem;
  color: var(--stop-ink);
  font-weight: 500;
}

.error:empty {
  display: none;
}

.consent {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-size: 0.9375rem;
}

.consent input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  display: grid;
  gap: 8px;
  padding: 16px 20px;
  border-radius: var(--r-s);
  font-size: 0.9375rem;
}

.form-status[hidden] {
  display: none;
}

.form-status.is-ok {
  background: var(--ok-bg);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--ok-ink) 40%, transparent);
}

.form-status.is-warn {
  background: var(--wait-bg);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--wait-ink) 40%, transparent);
}

.form-status.is-error {
  background: var(--stop-bg);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--stop-ink) 40%, transparent);
}

.form-status strong {
  font-size: 1rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Legal ---------- */

.legal {
  max-width: 72ch;
  display: grid;
  gap: 16px;
}

.legal h2 {
  font-size: 1.625rem;
  margin-top: 24px;
}

.legal ul {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table-wrap {
  overflow-x: auto;
}

.legal th,
.legal td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.legal th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Consent banner ---------- */

.consent-banner {
  position: fixed;
  z-index: 200;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 480px;
  display: grid;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-3);
}

.consent-banner[hidden] {
  display: none;
}

.consent-banner p {
  font-size: 0.9375rem;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 0;
  padding-block: 48px 32px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  }
}

.footer-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.footer-list a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.footer-list a:hover {
  color: var(--link);
  text-decoration: underline;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

/* ---------- 404 ---------- */

.not-found {
  min-height: 60vh;
  display: grid;
  align-content: center;
  gap: 20px;
}

/* ==========================================================================
   AI Diary
   ========================================================================== */

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  max-width: none;
}

.diary-list {
  display: grid;
  gap: 16px;
  max-width: 820px;
}

.diary-card {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out, border-color 200ms ease-out;
}

.diary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--line-strong);
}

.diary-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.diary-title {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
}

h3.diary-title {
  font-size: 1.375rem;
}

.diary-link {
  color: var(--ink);
  text-decoration: none;
}

.diary-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-m);
}

.diary-link:focus-visible {
  outline: none;
}

.diary-link:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}

.chip:hover {
  color: var(--ink);
  background: var(--surface);
}

.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.empty-state {
  display: grid;
  gap: 8px;
  text-align: center;
}

.post-wrap {
  max-width: 760px;
}

.post-hero .eyebrow a {
  color: inherit;
  text-decoration: none;
}

.post-hero .eyebrow a:hover {
  color: var(--ink);
}

.section.post-section {
  padding-top: 8px;
  border-top: 0;
}

.post-body {
  display: grid;
  gap: 18px;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.post-body h2 {
  margin-top: 20px;
  font-size: 1.875rem;
}

.post-body h3 {
  margin-top: 12px;
  font-size: 1.5rem;
}

.post-body ul,
.post-body ol {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 8px;
}

.post-body blockquote {
  margin: 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--signal);
  color: var(--ink-2);
}

.post-body pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  border-radius: var(--r-s);
  background: var(--surface-2);
  font-size: 0.875rem;
  line-height: 1.6;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.post-body :not(pre) > code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
}

.post-body img {
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}

.post-body hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---------- Post figures ----------
   Drawings the site ships, referenced from a post by name. Everything is
   plain SVG coloured from the theme tokens, so there is no image to go
   blurry, nothing to download, and both themes are correct. The static
   drawing is the real one: the animation below only delays parts into
   view, so a reader who never sees it move still sees the whole picture. */

.post-figure {
  margin: 32px 0;
}

.post-figure .fig {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
}

.post-figure figcaption {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.fig-card {
  fill: var(--surface);
  stroke: none;
}

.fig-rule {
  stroke: var(--line);
  stroke-width: 1;
}

.fig-title {
  fill: var(--ink);
  font-family: var(--font-display, inherit);
  font-size: 19px;
  font-weight: 600;
}

.fig-tag {
  fill: var(--neutral-bg);
}

.fig-tag-text {
  fill: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  text-anchor: middle;
  letter-spacing: 0.04em;
}

.fig-name {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
}

.fig-ver,
.fig-foot {
  fill: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 13px;
}

.fig-chip-ok {
  fill: var(--ok-bg);
}

.fig-chip-wait {
  fill: var(--wait-bg);
}

.fig-chip-text {
  fill: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  text-anchor: middle;
}

.fig-dot-ok {
  fill: var(--ok-ink);
}

.fig-dot-wait {
  fill: var(--wait-ink);
}

.fig-tick,
.fig-pause {
  fill: none;
  stroke: var(--surface);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fig-state {
  font-family: var(--font-mono);
  font-size: 13px;
}

.fig-state-ok {
  fill: var(--ok-ink);
}

.fig-state-wait {
  fill: var(--wait-ink);
}

.fig-stamp {
  fill: var(--stop-bg);
  stroke: var(--stop-ink);
  stroke-width: 1.5;
}

.fig-stamp-text {
  fill: var(--stop-ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-anchor: middle;
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: no-preference) {
  .js .fig-row,
  .js .fig-ask,
  .js .fig-verdict,
  .js .fig-foot {
    animation: fig-in 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .js .fig-verdict {
    animation-name: fig-stamp-in;
    animation-duration: 320ms;
    transform-origin: 490px 347px;
  }

  .js .fig-d1 { animation-delay: 120ms; }
  .js .fig-d2 { animation-delay: 420ms; }
  .js .fig-d3 { animation-delay: 720ms; }
  .js .fig-d4 { animation-delay: 1020ms; }
  .js .fig-d5 { animation-delay: 1460ms; }
  .js .fig-d6 { animation-delay: 1980ms; }
  .js .fig-d7 { animation-delay: 2460ms; }
}

@keyframes fig-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

@keyframes fig-stamp-in {
  from {
    opacity: 0;
    transform: scale(1.25) rotate(-3deg);
  }
}

.post-disclosure {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--ink-2);
}

.post-nav {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

@media (min-width: 640px) {
  .post-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .post-nav-next:only-child {
    grid-column: 2;
  }
}

.post-nav-link {
  display: grid;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}

.post-nav-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.post-nav-link .muted {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-nav-next {
  text-align: right;
}

/* ==========================================================================
   Playground
   ========================================================================== */

.demo-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card.untangle {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.untangle canvas {
  display: block;
  width: 100%;
  aspect-ratio: 14 / 9;
}

.untangle-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

/* Industry picker — one control that re-skins all three demos. */

.industry-bar {
  padding-block: 20px;
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.industry-inner {
  display: grid;
  gap: 12px 28px;
  align-items: center;
}

.industry-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.industry-pick label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.industry-pick .input {
  min-width: 15rem;
}

.industry-output {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 62ch;
}

@media (min-width: 860px) {
  .industry-inner {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

.demo-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 960px) {
  .demo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

.demo-form {
  display: grid;
  gap: 20px;
}

#ask-rules > div {
  margin-inline: -12px;
  padding-inline: 12px;
  border-radius: 6px;
  transition: background-color 250ms ease-out, box-shadow 250ms ease-out;
}

#ask-rules > div:last-child {
  padding-bottom: 12px;
}

#ask-rules > div.is-match {
  background: color-mix(in srgb, var(--signal) 14%, transparent);
  box-shadow: inset 3px 0 0 var(--signal);
}

.range {
  width: 100%;
  min-height: 32px;
  accent-color: var(--primary);
}

output {
  font-family: var(--font-mono);
  font-weight: 500;
}

.card.run {
  padding: 0;
  overflow: hidden;
}

.run-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.run-steps {
  list-style: none;
  margin: 0;
  padding: 8px 20px;
  display: grid;
  min-height: 96px;
}

.run-steps:empty::before {
  content: "Press \"Run the check\" to start.";
  padding: 28px 0;
  color: var(--ink-2);
}

.run-step {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.run-step.is-in {
  opacity: 1;
  transform: none;
}

.run-step:last-child {
  border-bottom: 0;
}

@media (min-width: 640px) {
  .run-step {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 16px;
  }
}

.run-step .pill {
  justify-self: start;
  white-space: normal;
}

.run-body {
  display: grid;
  gap: 6px;
}

.run-actions {
  margin-top: 4px;
}

.run-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

.run-tally {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.run-tally p {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tally-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.perm-list {
  display: grid;
}

.perm {
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.perm legend {
  float: left;
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.segmented {
  position: relative;
  clear: both;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  background: var(--bg);
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.segmented label:hover {
  color: var(--ink);
}

.segmented input:checked + label::before {
  content: "\2713\00a0";
}

.segmented input:checked + .seg-allow {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.segmented input:checked + .seg-approve {
  background: var(--wait-bg);
  color: var(--wait-ink);
}

.segmented input:checked + .seg-never {
  background: var(--stop-bg);
  color: var(--stop-ink);
}

.segmented input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ==========================================================================
   Motion: page transitions, entrances, hover details, scroll reveal
   ========================================================================== */

.brand img,
.btn svg {
  transition: transform 200ms ease-out;
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease-out;
}

.nav-link[aria-current="page"] {
  box-shadow: none;
  border-radius: var(--r-s);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  .site-header {
    view-transition-name: site-header;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 260ms;
    animation-timing-function: ease-in-out;
  }

  .brand:hover img {
    transform: translateY(-2px) rotate(-4deg);
  }

  .btn-primary:hover svg {
    transform: translateX(3px);
  }

  .btn-nudge-down:hover svg {
    transform: translateY(3px);
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes pop {
    40% {
      transform: scale(1.25);
    }
  }

  .js .hero-copy > *,
  .js .page-hero .wrap:not(.hero-grid) > *,
  .js .hero-grid > .card {
    animation: rise 640ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .js .hero-copy > :nth-child(2),
  .js .page-hero .wrap:not(.hero-grid) > :nth-child(2) {
    animation-delay: 80ms;
  }

  .js .hero-copy > :nth-child(3),
  .js .page-hero .wrap:not(.hero-grid) > :nth-child(3) {
    animation-delay: 160ms;
  }

  .js .hero-copy > :nth-child(4),
  .js .page-hero .wrap:not(.hero-grid) > :nth-child(4) {
    animation-delay: 240ms;
  }

  .js .hero-copy > :nth-child(n + 5),
  .js .page-hero .wrap:not(.hero-grid) > :nth-child(n + 5) {
    animation-delay: 320ms;
  }

  .js .hero-grid > .card {
    animation-delay: 260ms;
  }

  .tally-num.is-updated {
    animation: pop 420ms ease-out;
  }

  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 560ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 560ms cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 70ms);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
