/* ==========================================================================
   QuillBuster LLC — core stylesheet
   Design tokens -> base -> layout -> components -> sections -> responsive
   Palette: mulberry + marigold on cool lilac-white
   Type: Epilogue (display) / Karla (body) / DM Mono (labels & data)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand colours */
  --brand: #79268f;
  --brand-strong: #5a1b6b;
  --brand-soft: #f4e7f8;
  --brand-line: #e2cbea;
  --gold: #d98800;
  --gold-bright: #ffb020;
  --gold-soft: #fff3dc;

  /* Neutrals */
  --ink: #1b1420;
  --ink-2: #3a2f42;
  --muted: #6c5f76;
  --bg: #fbf8fd;
  --surface: #ffffff;
  --surface-2: #f5eff8;
  --line: #e8dfee;
  --line-strong: #d6c8de;

  /* Status */
  --ok: #1d7a52;
  --ok-soft: #e3f5ec;
  --warn: #9a6100;
  --warn-soft: #fdf1d8;
  --err: #b3261e;
  --err-soft: #fbe6e4;

  /* Type scale */
  --font-display: "Epilogue", "Segoe UI", system-ui, sans-serif;
  --font-body: "Karla", "Segoe UI", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(0.98rem, 0.95rem + 0.15vw, 1.06rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.7vw, 1.85rem);
  --step-3: clamp(1.75rem, 1.45rem + 1.4vw, 2.6rem);
  --step-4: clamp(2.15rem, 1.6rem + 2.6vw, 3.7rem);

  /* Shape & depth */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(27, 20, 32, 0.06), 0 2px 8px rgba(27, 20, 32, 0.04);
  --shadow-md: 0 12px 30px rgba(27, 20, 32, 0.09);
  --shadow-lg: 0 26px 60px rgba(27, 20, 32, 0.14);

  /* Rhythm */
  --shell: 1180px;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --section-y: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
}

/* Dark theme — toggled by main.js writing data-theme on <html> */
[data-theme="dark"] {
  --brand: #cf8ee0;
  --brand-strong: #e3b6ee;
  --brand-soft: #2b1c33;
  --brand-line: #47304f;
  --gold: #ffc04d;
  --gold-bright: #ffc861;
  --gold-soft: #33260f;

  --ink: #f4eef7;
  --ink-2: #d9cfe0;
  --muted: #a695b0;
  --bg: #140f19;
  --surface: #1d1624;
  --surface-2: #251c2e;
  --line: #362b40;
  --line-strong: #493b55;

  --ok: #6fd6a5;
  --ok-soft: #14301f;
  --warn: #ffc861;
  --warn-soft: #33260f;
  --err: #ef9a94;
  --err-soft: #3a1a17;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The off-canvas menu sits outside the viewport when closed. `clip` trims it
     without creating a scroll container, so the sticky header still works. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 0.6em;
  color: var(--ink);
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 1.1em; color: var(--ink-2); }

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

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

ul, ol { padding-left: 1.15rem; }
li { margin-bottom: 0.4rem; color: var(--ink-2); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.12em 0.4em;
}

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

::selection {
  background: var(--brand);
  color: #fff;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 1.1rem;
  z-index: 999;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}

.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;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--narrow { max-width: 780px; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.2rem, 1.6rem + 2vw, 3.4rem); }
.section--alt { background: var(--surface-2); }
.section--ink {
  background: #1b1420;
  color: #f6f1f8;
}
[data-theme="dark"] .section--ink { background: #100c14; }
.section--ink h2,
.section--ink h3,
.section--ink h4 { color: #ffffff; }
.section--ink p { color: #cdc0d4; }

.head {
  max-width: 660px;
  margin-bottom: clamp(2rem, 1.4rem + 1.6vw, 3rem);
}
.head--center {
  margin-inline: auto;
  text-align: center;
}
.head p { font-size: var(--step-1); color: var(--muted); margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-block;
  margin-bottom: 0.9rem;
}
.section--ink .eyebrow { color: var(--gold-bright); }

.grid { display: grid; gap: clamp(1rem, 0.7rem + 1.2vw, 1.6rem); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack > * + * { margin-top: 1rem; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   4. Buttons, tags, cards
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--brand-strong); color: #fff; }
[data-theme="dark"] .btn--primary { color: #1b1420; }
[data-theme="dark"] .btn--primary:hover { color: #1b1420; }

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

.btn--gold {
  background: var(--gold-bright);
  color: #2a1c05;
  font-weight: 700;
}
.btn--gold:hover { background: var(--gold); color: #2a1c05; }

.btn--light {
  background: #fff;
  color: #1b1420;
}
.btn--light:hover { background: #f0e7f4; color: #1b1420; }

.btn--sm { padding: 0.6rem 1rem; font-size: 0.85rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--brand-line);
}
.tag--gold { background: var(--gold-soft); color: var(--warn); border-color: #f0d9a6; }
.tag--ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe6d3; }
.tag--muted { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 1rem + 0.8vw, 1.8rem);
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 0.5rem; }
.card p:last-child { margin-bottom: 0; }
.card--flat { box-shadow: none; }
.card--hover { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 1rem;
  border: 1px solid var(--brand-line);
}
.icon-badge svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   5. Announcement bar + header
   -------------------------------------------------------------------------- */
.announce {
  background: var(--brand-strong);
  color: #f6ecf9;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.55rem var(--gutter);
  position: relative;
}
.announce a { color: #fff; font-weight: 700; }
.announce__close {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: #e0cbe8;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
}
.announce__close:hover { color: #fff; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg); /* fallback for browsers without color-mix() */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--brand) 0%, #a63fb8 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.brand__mark svg { width: 17px; height: 17px; }
.brand strong { font-weight: 800; }
.brand span.brand__b { color: var(--brand); }

.nav { margin-left: auto; }
.nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.nav__link:hover { background: var(--surface-2); color: var(--brand); }
.nav__link[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.nav__link svg { width: 12px; height: 12px; opacity: 0.7; }

.nav__item { position: relative; }
.nav__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 268px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  list-style: none;
  margin: 0;
  display: none;
}
.nav__item.is-open .nav__panel { display: block; }
.nav__panel li { margin: 0; }
.nav__panel a {
  display: block;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
}
.nav__panel a span {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.nav__panel a:hover { background: var(--surface-2); }

.nav__cta {
  display: flex;
  gap: 0.5rem;
  margin-left: 0.6rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  place-items: center;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-x { display: none; }
.nav-toggle[aria-expanded="true"] .icon-x { display: block; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }

/* --------------------------------------------------------------------------
   6. Hero + the signature "buster" panel
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(2.6rem, 1.8rem + 4vw, 5rem) clamp(3rem, 2rem + 4vw, 5.5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% 40% 40% -20%;
  background: radial-gradient(closest-side, rgba(121, 38, 143, 0.16), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: -10%;
  top: 12%;
  width: 46vw;
  height: 46vw;
  max-width: 520px;
  max-height: 520px;
  background: radial-gradient(closest-side, rgba(255, 176, 32, 0.18), transparent 72%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(1.8rem, 1rem + 3vw, 3.4rem);
  align-items: center;
}
.hero h1 { margin-bottom: 0.7rem; }
.hero h1 em {
  font-style: normal;
  color: var(--brand);
  white-space: nowrap;
  background-image: linear-gradient(var(--gold-bright), var(--gold-bright));
  background-repeat: no-repeat;
  background-size: 100% 0.16em;
  background-position: 0 88%;
  padding-inline: 0.06em;
}
.hero__lede {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 34ch;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 1.1rem;
}
.hero__note {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin: 0;
}

/* Signature element: source card fanning into channel outputs */
.buster {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.buster__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.buster__dots { display: flex; gap: 5px; }
.buster__dots i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
  display: block;
}
.buster__file {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  margin-left: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.buster__body { padding: 1.1rem; }

.buster__source {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: var(--surface-2);
}
.buster__source h4 {
  font-size: 0.98rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}
.buster__source p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}
.buster__meta {
  display: flex;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.buster__split {
  display: grid;
  place-items: center;
  padding: 0.6rem 0 0.5rem;
}
.buster__split span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

.buster__tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.buster__tab {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.buster__tab:hover { border-color: var(--brand); color: var(--brand); }
.buster__tab[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.buster__out {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  background: var(--surface);
  min-height: 156px;
}
.buster__out h5 {
  font-family: var(--font-body);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.5rem;
}
.buster__out p {
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
  line-height: 1.6;
}
.buster__out ul { margin: 0; font-size: 0.88rem; }
.buster__out li { margin-bottom: 0.25rem; }
.buster__out.is-typing { opacity: 0.45; }
.buster__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   7. Stat band, marquee, chips
   -------------------------------------------------------------------------- */
.statband {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.statband__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.statband__cell {
  padding: 1.5rem 1rem;
  text-align: center;
  border-right: 1px solid var(--line);
}
.statband__cell:last-child { border-right: 0; }
.statband__num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
  display: block;
  line-height: 1;
}
.statband__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.5rem;
  display: block;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.section--ink .chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #e6dced;
}

/* --------------------------------------------------------------------------
   8. Manifesto strip
   -------------------------------------------------------------------------- */
.manifesto {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  align-items: start;
}
.manifesto__lead {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
.manifesto__lead b { color: var(--brand); font-weight: 700; }
.manifesto__side p { color: var(--muted); }
.manifesto__side p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   9. Feature grid + wide feature
   -------------------------------------------------------------------------- */
.featline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.featline__cell {
  padding: clamp(1.2rem, 1rem + 0.8vw, 1.75rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.featline__cell:nth-child(3n) { border-right: 0; }
.featline__cell:nth-last-child(-n + 3) { border-bottom: 0; }
.featline__cell h3 {
  font-size: 1.08rem;
  margin-bottom: 0.45rem;
}
.featline__cell p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}
.featline__no {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--brand);
  display: block;
  margin-bottom: 0.8rem;
}

.wide-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  align-items: center;
  margin-top: clamp(1.2rem, 1rem + 1vw, 2rem);
}

/* --------------------------------------------------------------------------
   10. Steps rail (a real sequence, so numbers carry meaning)
   -------------------------------------------------------------------------- */
.rail { position: relative; padding-left: 0; list-style: none; margin: 0; }
.rail::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(var(--brand-line), var(--line));
}
.rail__item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 1.1rem;
  padding-bottom: 1.9rem;
  margin: 0;
}
.rail__item:last-child { padding-bottom: 0; }
.rail__no {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand-line);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}
.rail__item h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.rail__item p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.rail__hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--brand);
  margin-top: 0.5rem;
  display: block;
}

/* --------------------------------------------------------------------------
   11. Channel tabs (supported content types)
   -------------------------------------------------------------------------- */
.channels {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(1rem, 0.8rem + 1.5vw, 2rem);
  align-items: start;
}
.channels__nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.channels__btn {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.channels__btn:hover { background: var(--surface-2); }
.channels__btn[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.channels__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 1rem + 1vw, 2rem);
  box-shadow: var(--shadow-sm);
}
.channels__panel[hidden] { display: none; }
.channels__panel h3 { margin-bottom: 0.4rem; }
.outputs {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.outputs li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.92rem;
  color: var(--ink-2);
  margin: 0;
}
.outputs li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--gold-bright);
  margin-top: 0.55em;
  flex: none;
}

/* --------------------------------------------------------------------------
   12. App mockup (pure CSS)
   -------------------------------------------------------------------------- */
.mock {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #241a2c;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.mock__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: #1b1420;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mock__bar i { width: 9px; height: 9px; border-radius: 50%; background: #4b3c56; display: block; }
.mock__bar span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #a191ab;
  margin-left: 0.4rem;
}
.mock__body {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  min-height: 300px;
}
.mock__main,
.mock__row { min-width: 0; }
.mock__side {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.9rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.mock__side b {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #8d7c98;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.mock__side em {
  font-style: normal;
  font-size: 0.76rem;
  color: #c6b8cf;
  padding: 0.35rem 0.5rem;
  border-radius: 7px;
}
.mock__side em.is-on { background: rgba(207, 142, 224, 0.16); color: #e9d6f0; }
.mock__main { padding: 1rem; display: grid; gap: 0.6rem; align-content: start; }
.mock__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
}
.mock__row p {
  margin: 0;
  min-width: 0;
  font-size: 0.8rem;
  color: #ddd0e3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mock__pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  flex: none;
  letter-spacing: 0.04em;
}
.mock__pill--ok { background: rgba(111, 214, 165, 0.18); color: #8ee7bd; }
.mock__pill--wait { background: rgba(255, 200, 97, 0.16); color: #ffd68a; }
.mock__pill--draft { background: rgba(255, 255, 255, 0.09); color: #c3b4cc; }
.mock__bars { display: flex; align-items: flex-end; gap: 6px; height: 62px; margin-top: 0.3rem; }
.mock__bars i {
  flex: 1;
  background: linear-gradient(180deg, #cf8ee0, #79268f);
  border-radius: 3px 3px 0 0;
  display: block;
}

/* --------------------------------------------------------------------------
   13. Use cases, workflow, comparison
   -------------------------------------------------------------------------- */
.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  counter-reset: flow;
}
.flow__step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
}
.flow__step b {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.4rem;
}
.flow__step p { margin: 0; font-size: 0.9rem; }
.flow__step--brand { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.flow__step--brand b { color: var(--brand); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table.compare {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.93rem;
}
table.compare th,
table.compare td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.compare thead th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}
table.compare tbody th {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink);
  width: 30%;
}
table.compare td { color: var(--ink-2); }
table.compare .col-brand {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}
table.compare tr:last-child th,
table.compare tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   14. Testimonials (card deck)
   -------------------------------------------------------------------------- */
.deck { position: relative; }
.deck__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 0.6rem;
  scrollbar-width: none;
}
.deck__track::-webkit-scrollbar { display: none; }
.quote {
  scroll-snap-align: start;
  flex: 0 0 min(420px, 84%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.section--ink .quote {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}
.quote blockquote {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--ink);
  flex: 1;
}
.section--ink .quote blockquote { color: #f3ecf6; }
.quote figcaption {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.86rem;
}
.section--ink .quote figcaption { color: #cbbcd3; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid var(--brand-line);
  flex: none;
}
.quote figcaption b { display: block; color: inherit; }
.quote figcaption span { color: var(--muted); font-size: 0.8rem; }
.section--ink .quote figcaption span { color: #a897b1; }
.deck__nav { display: flex; gap: 0.5rem; margin-top: 1rem; }
.deck__btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.deck__btn:hover { border-color: var(--brand); color: var(--brand); }
.section--ink .deck__btn { border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.deck__btn svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   15. Pricing
   -------------------------------------------------------------------------- */
.billing {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem;
  margin-bottom: 2rem;
}
.billing__btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}
.billing__btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.plan--featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-md);
  position: relative;
}
.plan__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}
.plan__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}
.plan__for { font-size: 0.85rem; color: var(--muted); margin: 0 0 1rem; min-height: 2.6em; }
.plan__price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}
.plan__price b { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.plan__price span { font-size: 0.85rem; color: var(--muted); font-family: var(--font-body); letter-spacing: 0; }
.plan__billed {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.5rem 0 1.1rem;
  min-height: 1.2em;
}
.plan__list {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  flex: 1;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
.plan__list li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}
.plan__list svg { width: 15px; height: 15px; color: var(--brand); flex: none; margin-top: 0.28em; }
.plan__list li.is-off { color: var(--muted); }
.plan__list li.is-off svg { color: var(--line-strong); }

/* --------------------------------------------------------------------------
   16. FAQ accordion
   -------------------------------------------------------------------------- */
.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  background: none;
  border: 0;
  padding: 1.15rem 0.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  cursor: pointer;
}
.faq__q:hover { color: var(--brand); }
.faq__q svg {
  width: 18px; height: 18px;
  flex: none;
  color: var(--brand);
  transition: transform 0.2s ease;
}
.faq__q[aria-expanded="true"] svg { transform: rotate(45deg); }
.faq__a { padding: 0 0.2rem 1.25rem; max-width: 74ch; }
.faq__a p:last-child { margin-bottom: 0; }
.faq__a[hidden] { display: none; }

/* --------------------------------------------------------------------------
   17. CTA band + footer
   -------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(135deg, #79268f 0%, #46145a 55%, #2a0f36 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 1.4rem + 2.4vw, 3.4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(1.4rem, 1rem + 2vw, 3rem);
  align-items: center;
}
.cta-band h2 { color: #fff; margin-bottom: 0.5rem; }
.cta-band p { color: #e3d1eb; margin-bottom: 0; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.cta-band ul { list-style: none; padding: 0; margin: 0.9rem 0 0; }
.cta-band li {
  color: #e3d1eb;
  font-size: 0.88rem;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.cta-band li svg { width: 15px; height: 15px; color: var(--gold-bright); flex: none; margin-top: 0.25em; }

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  margin-top: var(--section-y);
}
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr));
  gap: clamp(1.2rem, 1rem + 1.5vw, 2.4rem);
  padding-bottom: 2.5rem;
}
.footer__about p {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 34ch;
  margin: 1rem 0;
}
.footer__contact {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}
.footer__contact a { color: var(--brand); }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
  font-weight: 500;
}
.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { margin-bottom: 0.5rem; }
.footer__list a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer__list a:hover { color: var(--brand); text-decoration: underline; }
.social { display: flex; gap: 0.5rem; margin-top: 1rem; }
.social a {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.social a:hover { border-color: var(--brand); color: var(--brand); }
.social svg { width: 16px; height: 16px; }
.footer__bottom {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--muted);
}
.footer__bottom p { margin: 0; color: var(--muted); }
.footer__legal { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer__legal a { color: var(--muted); text-decoration: none; }
.footer__legal a:hover { color: var(--brand); }

/* --------------------------------------------------------------------------
   18. Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: 1.05rem; }
.field label,
.field > .label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--ink);
}
.hint {
  font-size: 0.82rem;
  color: var(--muted);
}
.field .hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c5f76' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 15px;
  padding-right: 2.2rem;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] { border-color: var(--err); }

.error-text {
  display: block;
  color: var(--err);
  font-size: 0.8rem;
  margin-top: 0.3rem;
  min-height: 1.1em;
}

.range-row { display: flex; align-items: center; gap: 0.8rem; }
input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
  height: 22px;
}
.range-row output {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--brand);
  min-width: 5.5em;
  text-align: right;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--ink-2);
  margin-bottom: 0.6rem;
}
.check input { margin-top: 0.25em; accent-color: var(--brand); flex: none; }

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 3rem; }
.pwd-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
}
.pwd-toggle:hover { color: var(--brand); }

.form-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.9rem;
}

.alert {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border: 1px solid;
  margin-bottom: 1.1rem;
}
.alert--ok { background: var(--ok-soft); border-color: #bfe6d3; color: var(--ok); }
.alert--err { background: var(--err-soft); border-color: #f0c9c5; color: var(--err); }
.alert[hidden] { display: none; }

/* Auth pages */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100%;
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  align-items: center;
  padding-block: clamp(2rem, 1.5rem + 3vw, 4.5rem);
}
.auth__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 1.1rem + 1.2vw, 2.2rem);
  box-shadow: var(--shadow-md);
  max-width: 460px;
  width: 100%;
}
.auth__aside { max-width: 460px; }
.auth__aside ul { list-style: none; padding: 0; margin: 1.4rem 0 0; }
.auth__aside li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
  color: var(--ink-2);
  font-size: 0.94rem;
}
.auth__aside svg { width: 17px; height: 17px; color: var(--brand); flex: none; margin-top: 0.25em; }
.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  margin: 1.2rem 0;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --------------------------------------------------------------------------
   19. Generator tool
   -------------------------------------------------------------------------- */
.tool {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: clamp(1rem, 0.8rem + 1.5vw, 2rem);
  align-items: start;
}
.tool__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 1rem + 0.6vw, 1.6rem);
  box-shadow: var(--shadow-sm);
}
.tool__panel h2 { font-size: 1.2rem; }
.tool__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}
.tool__out {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.tool__outbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.tool__outbar .spacer { flex: 1; }
.counts {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.tool__doc {
  padding: clamp(1.1rem, 1rem + 0.8vw, 2rem);
  flex: 1;
  overflow-wrap: break-word;
}
.tool__doc h1, .tool__doc h2 { font-size: var(--step-2); }
.tool__doc h3 { font-size: var(--step-1); }
.tool__doc h4 { font-size: 1.02rem; }
.tool__doc p, .tool__doc li { font-size: 0.97rem; }
.tool__doc > *:first-child { margin-top: 0; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: clamp(2rem, 1.6rem + 2vw, 4rem) 1rem;
  max-width: 44ch;
  margin-inline: auto;
}
.empty svg { width: 46px; height: 46px; color: var(--brand-line); margin-bottom: 1rem; }
.empty h3 { color: var(--ink); font-size: 1.1rem; }

.skeleton { display: grid; gap: 0.7rem; padding: clamp(1.1rem, 1rem + 0.8vw, 2rem); }
.skeleton i {
  display: block;
  height: 13px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
.skeleton i:nth-child(1) { width: 55%; height: 20px; }
.skeleton i:nth-child(4) { width: 88%; }
.skeleton i:nth-child(7) { width: 70%; }
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  margin: 0;
}
.history-list li:last-child { border-bottom: 0; }
.history-list button {
  border: 0;
  background: none;
  color: var(--brand);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  flex: 1;
  padding: 0;
}
.history-list button:hover { text-decoration: underline; }
.history-list time { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); flex: none; }

/* --------------------------------------------------------------------------
   20. Blog
   -------------------------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 0.8rem + 1vw, 1.6rem);
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-card__art {
  height: 132px;
  background: linear-gradient(135deg, var(--brand-soft), var(--gold-soft));
  border-bottom: 1px solid var(--line);
  position: relative;
  display: grid;
  place-items: center;
}
.post-card__art span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-strong);
}
.post-card__body { padding: 1.2rem; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.06rem; margin-bottom: 0.5rem; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--brand); }
.post-card p { font-size: 0.9rem; color: var(--muted); flex: 1; }
.post-card__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.article { max-width: 720px; margin-inline: auto; }
.article__head { margin-bottom: 2rem; }
.article__meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.88rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.article__body h2 { margin-top: 2.2rem; font-size: var(--step-2); }
.article__body h3 { margin-top: 1.7rem; font-size: var(--step-1); }
.article__body ul, .article__body ol { margin-bottom: 1.2rem; }
.article__body blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.3rem;
  border-left: 3px solid var(--brand);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.article__body blockquote p:last-child { margin-bottom: 0; color: inherit; }
.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  margin-top: 2.5rem;
}
.author-box .avatar { width: 52px; height: 52px; font-size: 1rem; }
.author-box p { font-size: 0.9rem; margin-bottom: 0; color: var(--muted); }
.author-box b { display: block; }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* Page hero for inner pages */
.page-hero {
  padding-block: clamp(2.2rem, 1.8rem + 2.5vw, 4rem) clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(closest-side at 12% 0%, rgba(121, 38, 143, 0.13), transparent 70%),
    var(--surface);
}
.page-hero h1 { max-width: 18ch; }
.page-hero p { font-size: var(--step-1); color: var(--muted); max-width: 60ch; margin-bottom: 0; }

/* Legal pages */
.legal { max-width: 760px; }
.legal h2 { font-size: var(--step-2); margin-top: 2.2rem; }
.legal h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.legal p, .legal li { font-size: 0.97rem; }
.legal__updated {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.6rem 0.9rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 1.6rem;
}
.toc {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-bottom: 2rem;
}
.toc h2 { font-size: 0.95rem; margin: 0 0 0.6rem; }
.toc ul { margin: 0; padding-left: 1.1rem; }
.toc li { font-size: 0.9rem; margin-bottom: 0.3rem; }

/* 404 */
.notfound { text-align: center; padding-block: clamp(3rem, 2rem + 5vw, 7rem); }
.notfound__code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 3rem + 10vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--brand);
  margin: 0;
}
.notfound__links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.6rem;
}

/* --------------------------------------------------------------------------
   21. Modal, toast, cookie bar, back-to-top
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(20, 12, 24, 0.6);
  backdrop-filter: blur(3px);
}
.modal[hidden] { display: none; }
.modal__box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: clamp(1.3rem, 1.1rem + 1vw, 2rem);
  position: relative;
}
.modal__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.modal__close:hover { color: var(--brand); border-color: var(--brand); }
.modal h3 { margin-bottom: 0.5rem; padding-right: 2rem; }
.summary-list { list-style: none; padding: 0; margin: 1.2rem 0; }
.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}
.summary-list li b { font-family: var(--font-mono); }

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(340px, calc(100vw - 2rem));
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  animation: toast-in 0.22s ease;
}
[data-theme="dark"] .toast { background: #3a2f42; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 0.15em; color: var(--gold-bright); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.cookiebar {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 250;
  width: min(420px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.1rem 1.2rem;
}
.cookiebar[hidden] { display: none; }
.cookiebar p { font-size: 0.86rem; margin-bottom: 0.9rem; }
.cookiebar__row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 180;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.to-top.is-on { opacity: 1; visibility: visible; }
.to-top:hover { border-color: var(--brand); color: var(--brand); }
.to-top svg { width: 18px; height: 18px; }

/* Reveal-on-scroll (disabled when motion is reduced) */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* --------------------------------------------------------------------------
   22. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .footer__top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__about { grid-column: 1 / -1; }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool { grid-template-columns: minmax(0, 1fr); }
  .tool__out { min-height: 340px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(330px, 86vw);
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 5rem 1.2rem 2rem;
    transform: translateX(100%);
    overflow-y: auto;
    z-index: 70;
    margin-left: 0;
    /* Taken out of flow while closed, so an off-screen panel can never widen
       the page on small screens. */
    display: none;
  }
  .nav.is-open {
    display: block;
    animation: nav-slide-in 0.25s ease forwards;
  }
  @keyframes nav-slide-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .nav__link { padding: 0.75rem 0.8rem; border-radius: var(--radius-sm); font-size: 1rem; }
  .nav__panel {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--line);
    border-radius: 0;
    margin: 0.2rem 0 0.4rem 0.8rem;
    min-width: 0;
    padding: 0 0 0 0.4rem;
  }
  .nav__item.is-open .nav__panel { display: block; }
  .nav__cta { margin-top: 1rem; display: grid; gap: 0.5rem; }
  .site-header__inner { justify-content: space-between; }
  .header-actions { margin-left: auto; }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 12, 24, 0.45);
    z-index: 65;
  }
  .nav-backdrop[hidden] { display: none; }

  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .hero__lede { max-width: 46ch; }
  .manifesto,
  .wide-feature,
  .cta-band,
  .auth { grid-template-columns: minmax(0, 1fr); }
  .featline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featline__cell:nth-child(3n) { border-right: 1px solid var(--line); }
  .featline__cell:nth-child(2n) { border-right: 0; }
  .featline__cell:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .featline__cell:last-child { border-bottom: 0; }
  .channels { grid-template-columns: minmax(0, 1fr); }
  .channels__nav { flex-direction: row; overflow-x: auto; gap: 0.4rem; padding-bottom: 0.4rem; }
  .channels__btn { white-space: nowrap; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .statband__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statband__cell:nth-child(2n) { border-right: 0; }
  .statband__cell:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .plans,
  .grid--2,
  .grid--3,
  .grid--4,
  .post-grid,
  .flow { grid-template-columns: minmax(0, 1fr); }
  .featline { grid-template-columns: minmax(0, 1fr); }
  .featline__cell { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .featline__cell:last-child { border-bottom: 0 !important; }
  .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outputs { grid-template-columns: minmax(0, 1fr); }
  .mock__body { grid-template-columns: 96px minmax(0, 1fr); }
  .cookiebar { left: 0.6rem; right: 0.6rem; width: auto; bottom: 0.6rem; }
  .toasts { right: 0.6rem; left: 0.6rem; bottom: 4rem; max-width: none; }
  .quote { flex: 0 0 88%; }
}

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

@media print {
  .site-header,
  .site-footer,
  .announce,
  .to-top,
  .cookiebar,
  .toasts { display: none !important; }
  body { background: #fff; }
}
