/* ==========================================================================
   mailsignals.io

   Hand-written. No framework, no remote fonts, no scripts. The palette is the
   dashboard's, so the site and the product look like one thing. Every colour
   is declared on bare :root and re-pointed in the dark block, so no token is
   ever defined in only one theme.
   ========================================================================== */

:root {
  color-scheme: light;

  --canvas: #f6f7f9;
  --surface: #ffffff;
  --sunken: #eef1f4;
  --line: #e1e5ea;
  --line-strong: #c9d0d8;

  --ink: #0f151d;
  --muted: #59636f;
  --faint: #838d9a;

  --accent: #0b7a83;
  --accent-hover: #096a72;
  --accent-soft: #e2f2f3;
  --accent-line: #a9d8db;
  --on-accent: #ffffff;

  --positive: #16803c;
  --positive-soft: #e4f4e8;
  --positive-line: #a8dcb7;

  --caution: #a5590a;
  --caution-soft: #fbf0dd;
  --caution-line: #ebcd9b;

  --danger: #b52a2a;
  --danger-soft: #fbe9e9;
  --danger-line: #eeb4b4;

  --tip-bg: #0f151d;
  --tip-fg: #f6f7f9;

  --shadow: 0 1px 2px rgb(15 21 29 / 0.05), 0 1px 3px rgb(15 21 29 / 0.06);
  --shadow-lift: 0 14px 34px -14px rgb(15 21 29 / 0.22), 0 2px 6px rgb(15 21 29 / 0.06);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: Charter, "Bitstream Charter", "Sitka Text", Cambria,
    "Iowan Old Style", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --radius: 10px;
  --measure: 66ch;
  --container: 1120px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --canvas: #0c1116;
    --surface: #141b22;
    --sunken: #10171e;
    --line: #253039;
    --line-strong: #3a4753;

    --ink: #e8eef4;
    --muted: #9aa6b3;
    --faint: #6d7987;

    --accent: #4fc1c7;
    --accent-hover: #6fd2d7;
    --accent-soft: #10312f;
    --accent-line: #23514f;
    --on-accent: #06232a;

    --positive: #52c777;
    --positive-soft: #102c1a;
    --positive-line: #205133;

    --caution: #e2a54a;
    --caution-soft: #2e2312;
    --caution-line: #574122;

    --danger: #f0817a;
    --danger-soft: #331919;
    --danger-line: #5d2f2d;

    --tip-bg: #e8eef4;
    --tip-fg: #0f151d;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 1px 3px rgb(0 0 0 / 0.3);
    --shadow-lift: 0 14px 34px -14px rgb(0 0 0 / 0.7), 0 2px 6px rgb(0 0 0 / 0.4);
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

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

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

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 4.6vw, 3.5rem);
  line-height: 1.06;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.4em;
}

p,
ul,
ol,
table,
pre,
blockquote,
figure,
dl {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.3rem;
}

strong {
  font-weight: 600;
}

small,
.small {
  font-size: 0.875rem;
}

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

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--sunken);
  border: 1px solid var(--line);
  padding: 0.08em 0.35em;
  border-radius: 4px;
}

pre {
  background: #0f151d;
  color: #e8eef4;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  border: 1px solid #253039;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

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

.mono {
  font-family: var(--font-mono);
}

.nums {
  font-variant-numeric: tabular-nums;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Layout ---------- */

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.narrow {
  width: min(100% - 2 * var(--gutter), 780px);
  margin-inline: auto;
}

.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.section--tight {
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.section__head {
  max-width: 62ch;
  margin-bottom: clamp(1.5rem, 4vw, 2.75rem);
}

.section__head p {
  color: var(--muted);
  font-size: 1.1rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.grid--pairs {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* A grid or split item must be allowed to shrink below its content width, or
   one nowrap line widens the whole page on a phone. */
.grid > *,
.split > * {
  min-width: 0;
}

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split--text-wide {
    grid-template-columns: 6fr 5fr;
  }

  .split--reverse > :first-child {
    order: 2;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.lead {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  color: var(--muted);
  max-width: 58ch;
  line-height: 1.55;
}

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

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

.header__in {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 64px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}

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

.brand__mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--ink);
  background: var(--sunken);
}

.nav a[aria-current="page"],
.nav a[aria-current="true"] {
  color: var(--ink);
}

.nav .btn {
  margin-left: 0.6rem;
}

/* .nav a outranks .btn--primary on specificity, so restate the button colours. */
.nav a.btn--primary {
  color: var(--on-accent);
  background: var(--accent);
}

.nav a.btn--primary:hover {
  color: var(--on-accent);
  background: var(--accent-hover);
}

.nav-toggle {
  display: none;
}

@media (max-width: 860px) {
  .nav:not(.nav--mobile) {
    display: none;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .nav-toggle summary {
    list-style: none;
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    font-weight: 500;
    font-size: 0.95rem;
    background: var(--surface);
  }

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

  .nav--mobile {
    position: absolute;
    left: calc(-1 * var(--gutter));
    right: calc(-1 * var(--gutter));
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem var(--gutter) 1rem;
    gap: 0.15rem;
    box-shadow: var(--shadow-lift);
    margin: 0;
  }

  .nav--mobile a {
    padding: 0.7rem 0.6rem;
    font-size: 1.05rem;
  }

  .nav--mobile .btn {
    margin: 0.5rem 0 0;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

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

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

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

.btn--quiet:hover {
  background: var(--sunken);
  color: var(--ink);
}

.btn--lg {
  padding: 0.9rem 1.4rem;
  font-size: 1.05rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-row__note {
  color: var(--muted);
  font-size: 0.875rem;
  flex-basis: 100%;
}

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

.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.55;
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / 0.9), transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0 / 0.9), transparent 85%);
  pointer-events: none;
}

.hero > * {
  position: relative;
}

.hero h1 {
  max-width: 19ch;
}

.hero__proof {
  list-style: none;
  padding: 0;
  margin: 1.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  color: var(--muted);
  font-size: 0.925rem;
}

.hero__proof li {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  margin: 0;
}

.hero__proof li::before {
  content: "✓";
  color: var(--positive);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ---------- Product mocks ---------- */

.mock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  font-size: 0.9rem;
}

.mock__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--sunken);
  color: var(--muted);
  font-size: 0.78rem;
}

.mock__dots {
  display: flex;
  gap: 5px;
}

.mock__dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.mock__title {
  margin-left: 0.25rem;
}

.mock__caption {
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  background: var(--sunken);
}

/* Gmail-style sent list */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: 2.25rem minmax(6rem, 9rem) 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  margin: 0;
}

.row:last-child {
  border-bottom: 0;
}

.row--active {
  background: var(--accent-soft);
}

.row__to {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.row__subject {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.row__subject span {
  color: var(--muted);
}

.row__time {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.tick {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.2em;
  width: 2rem;
  text-align: center;
  line-height: 1;
}

.tick--sent {
  color: var(--faint);
}

.tick--unconfirmed {
  color: var(--caution);
}

.tick--opened {
  color: var(--positive);
}

.tick--clicked,
.tick--replied {
  color: var(--accent);
  letter-spacing: 0;
}

.tick--bounced {
  color: var(--danger);
  letter-spacing: 0;
}

.tooltip {
  position: absolute;
  left: 2.5rem;
  top: calc(100% - 0.3rem);
  z-index: 2;
  background: var(--tip-bg);
  color: var(--tip-fg);
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: var(--shadow-lift);
  max-width: min(88%, 34rem);
}

.tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0.9rem;
  border: 5px solid transparent;
  border-top: 0;
  border-bottom-color: var(--tip-bg);
}

.row--tip {
  margin-bottom: 2.6rem;
}

@media (max-width: 600px) {
  .row {
    grid-template-columns: 2rem 1fr auto;
    row-gap: 0.1rem;
  }

  .row .tick {
    grid-row: 1 / 3;
  }

  .row__subject {
    grid-column: 2 / 4;
    font-size: 0.85rem;
  }

  .tooltip {
    left: 0.9rem;
    max-width: calc(100% - 1.8rem);
  }

  .row--tip {
    margin-bottom: 3.6rem;
  }
}

/* Timeline (the dashboard's detail page) */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  gap: 0.3rem 0.9rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.event:last-child {
  border-bottom: 0;
}

.event__when {
  grid-row: 1 / 4;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.25rem;
  white-space: nowrap;
  line-height: 1.5;
}

.event__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-weight: 600;
}

.event__reason {
  color: var(--ink);
}

.event__who {
  color: var(--muted);
  font-size: 0.85rem;
}

.event__who b {
  color: var(--ink);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid;
  line-height: 1.5;
  white-space: nowrap;
}

.badge--positive {
  color: var(--positive);
  background: var(--positive-soft);
  border-color: var(--positive-line);
}

.badge--caution {
  color: var(--caution);
  background: var(--caution-soft);
  border-color: var(--caution-line);
}

.badge--danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

.badge--accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.badge--neutral {
  color: var(--muted);
  background: var(--sunken);
  border-color: var(--line-strong);
}

/* Compose window */

.compose__subject {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.compose__meta {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.compose__body {
  padding: 0.9rem;
  min-height: 6rem;
  color: var(--ink);
}

.compose__body p {
  margin-bottom: 0.6rem;
}

.compose__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--line);
  background: var(--sunken);
}

.compose__send {
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-weight: 600;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
}

.toggle--on {
  color: var(--positive);
  border-color: var(--positive-line);
  background: var(--positive-soft);
}

.toggle--off {
  color: var(--muted);
}

.notice {
  background: var(--caution-soft);
  border: 1px solid var(--caution-line);
  color: var(--caution);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin: 0.9rem;
}

/* Desktop notification */

.notif {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  max-width: 24rem;
  font-size: 0.9rem;
}

.notif__icon {
  width: 34px;
  height: 34px;
}

.notif__app {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.notif__title {
  font-weight: 600;
}

.notif__body {
  color: var(--muted);
}

.notif-stack {
  display: grid;
  gap: 0.75rem;
}

/* Heatmap */

.heat {
  display: grid;
  grid-template-columns: 2.4rem repeat(24, 1fr);
  gap: 3px;
  align-items: center;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.heat i {
  display: block;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.08;
}

.heat .h1 {
  opacity: 0.22;
}

.heat .h2 {
  opacity: 0.4;
}

.heat .h3 {
  opacity: 0.6;
}

.heat .h4 {
  opacity: 0.8;
}

.heat .h5 {
  opacity: 1;
}

.heat__day {
  text-align: right;
  padding-right: 0.3rem;
}

.heat__hours {
  grid-column: 2 / -1;
  display: flex;
  justify-content: space-between;
  padding-top: 0.2rem;
}

/* Stat tiles (dashboard) */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.6rem;
  padding: 0.9rem;
}

.tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  background: var(--canvas);
}

.tile__n {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tile__l {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* Decision table (classifier) */

.rules {
  width: 100%;
  min-width: 760px;
  font-size: 0.9rem;
}

.table-wrap--highlight table {
  min-width: 640px;
}

.rules td:first-child,
.rules th:first-child {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  margin: 0;
}

.card h3 {
  margin-top: 0.9rem;
  font-size: 1.15rem;
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.98rem;
}

.card__glyph {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  flex: none;
}

a.card {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

a.card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
  color: inherit;
}

.card__more {
  color: var(--accent);
  font-weight: 600;
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.95rem;
}

.card--flat {
  box-shadow: none;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 1rem;
}

.table-wrap table {
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 600;
  background: var(--sunken);
  font-size: 0.85rem;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.yes {
  color: var(--positive);
  font-weight: 600;
}

td.no {
  color: var(--danger);
  font-weight: 600;
}

td.meh {
  color: var(--caution);
  font-weight: 600;
}

.table-wrap--highlight th:last-child,
.table-wrap--highlight td:last-child {
  background: var(--accent-soft);
}

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

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

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  padding: 1rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

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

.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.25rem;
  flex: none;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq__a {
  padding: 0 0 1.25rem;
  color: var(--muted);
  max-width: var(--measure);
}

.faq__a p:last-child {
  margin-bottom: 0;
}

.qa {
  max-width: var(--measure);
}

.qa h3 {
  margin-top: 2rem;
}

.qa h2 {
  margin-top: 3rem;
}

/* ---------- Callouts, steps, stats ---------- */

.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.callout--warn {
  border-left-color: var(--caution);
}

.callout--good {
  border-left-color: var(--positive);
}

.callout--danger {
  border-left-color: var(--danger);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

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

.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  margin: 0;
}

.steps > li::before {
  content: counter(step);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--accent);
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
}

.steps h3 {
  margin-bottom: 0.3rem;
}

.steps p:last-child {
  margin-bottom: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 1rem;
}

.stat {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
}

.stat__n {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat__l {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.45rem;
}

.check-list {
  list-style: none;
  padding: 0;
}

.check-list li {
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--positive);
  font-family: var(--font-mono);
  font-weight: 700;
}

.check-list--no li::before {
  content: "✕";
  color: var(--danger);
}

.def-list {
  display: grid;
  gap: 0.35rem 1.25rem;
  grid-template-columns: max-content 1fr;
}

.def-list dt {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.def-list dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 600px) {
  .def-list {
    grid-template-columns: 1fr;
  }

  .def-list dd {
    margin-bottom: 0.5rem;
  }
}

/* ---------- Prose ---------- */

.prose {
  max-width: var(--measure);
}

.prose h2 {
  margin-top: 2.75rem;
}

.prose h3 {
  margin-top: 2rem;
}

.prose > .lead {
  margin-bottom: 1.5rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose blockquote {
  border-left: 3px solid var(--accent-line);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 1.15rem;
}

.prose figure {
  margin: 1.75rem 0;
}

.prose figcaption {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.6rem;
}

.prose .mock {
  font-size: 0.875rem;
}

.byline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  background: var(--surface);
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.toc strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

/* ---------- Page head, breadcrumbs ---------- */

.page-head {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem);
}

.page-head h1 {
  max-width: 22ch;
}

.crumbs {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.crumbs li {
  margin: 0;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 0.35rem;
  color: var(--faint);
}

.crumbs a {
  color: var(--muted);
}

/* ---------- Diagram ---------- */

.diagram-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.diagram {
  width: 100%;
  min-width: 720px;
  height: auto;
  font-family: var(--font-sans);
}

.diagram .box {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1;
}

.diagram .box--accent {
  fill: var(--accent-soft);
  stroke: var(--accent-line);
}

.diagram .box--ink {
  fill: var(--sunken);
  stroke: var(--line-strong);
}

.diagram text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.diagram .t-muted {
  fill: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
}

.diagram .t-mono {
  font-family: var(--font-mono);
  font-size: 11px;
}

.diagram .arrow {
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.diagram .arrow--muted {
  stroke: var(--faint);
}

.diagram .arrowhead {
  fill: var(--accent);
}

.diagram .arrowhead--muted {
  fill: var(--faint);
}

.diagram .dashed {
  stroke-dasharray: 4 3;
}

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

.cta-band {
  background: #0f151d;
  color: #e8eef4;
  border-radius: 16px;
  padding: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  align-items: center;
  border: 1px solid #253039;
}

@media (min-width: 820px) {
  .cta-band {
    grid-template-columns: 1fr auto;
  }
}

.cta-band h2 {
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.cta-band p {
  color: #b7c2cc;
  margin: 0;
  max-width: 54ch;
}

.cta-band .btn--primary {
  background: #ffffff;
  color: #0f151d;
}

.cta-band .btn--primary:hover {
  background: #e2f2f3;
  color: #0f151d;
}

.cta-band .btn--quiet {
  background: transparent;
  border-color: #3a4753;
  color: #e8eef4;
}

.cta-band .btn--quiet:hover {
  background: #1a222b;
  color: #ffffff;
}

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

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 3rem 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
}

.footer__brand {
  grid-column: 1 / -1;
  max-width: 40ch;
}

@media (min-width: 1000px) {
  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  }

  .footer__brand {
    grid-column: auto;
  }
}

.footer h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
  margin-bottom: 0.8rem;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin-bottom: 0.45rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

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

.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* ---------- Misc ---------- */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.pill-row li {
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

a.pill:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.glyph-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.glyph-row div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem;
  text-align: center;
}

.glyph-row .tick {
  width: auto;
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.glyph-row small {
  display: block;
  color: var(--muted);
}

.kicker {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.3;
  color: var(--ink);
  max-width: 34ch;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.quote {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.35;
  max-width: 40ch;
  margin: 0;
  color: var(--ink);
}

.quote cite {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.not-found {
  text-align: center;
  padding-block: clamp(4rem, 12vw, 8rem);
}

.not-found .tick {
  font-size: 3rem;
  width: auto;
  margin-bottom: 1rem;
}

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

@media print {
  .header,
  .footer,
  .cta-band,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
