/* Talkgate site stylesheet.
   1. Design tokens, generated from brand/tokens.json (version 2). Do not hand-edit this block.
   2. Brand components, copied verbatim from brand/components.css.
   3. Page layout extensions for the marketing site.
   Light is the default; dark follows the system unless <html data-theme> overrides it. */

/* ===== 1. Tokens ===== */
:root {
  color-scheme: light dark;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;
  --radius-none: 0px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --surface: #faf3f1;
  --surface-raised: #ffffff;
  --surface-ink: #2a1433;
  --line: #e6d9dc;
  --line-strong: #94828b;
  --ink: #2a1433;
  --ink-muted: #6b5a66;
  --on-ink: #faf3f1;
  --on-ink-muted: #c9b6c2;
  --signal: #ff6a5c;
  --on-signal: #2a1433;
  --signal-text: #c23b2b;
  --signal-soft: #ffe5e0;
  --wire: #7d4f91;
  --wire-soft: #f1e6f4;
  --ok: #1f7a4d;
  --danger: #a31212;
  --link: var(--signal-text);
  --shadow-float: 0 8px 24px -4px #2a143326, 0 2px 6px #2a143314;
  --focus-ring: 0 0 0 2px #faf3f1, 0 0 0 4px #7d4f91;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #170b1d;
    --surface-raised: #22122b;
    --surface-ink: #0e0612;
    --line: #3a2745;
    --line-strong: #78637f;
    --ink: #f5ecf1;
    --ink-muted: #b9a7b5;
    --on-ink: #f5ecf1;
    --on-ink-muted: #b9a7b5;
    --signal: #ff7a6b;
    --on-signal: #2a1433;
    --signal-text: #ff8f82;
    --signal-soft: #3d1a1c;
    --wire: #c39ad4;
    --wire-soft: #2d1a38;
    --ok: #5ad38f;
    --danger: #ff8a80;
    --link: var(--signal-text);
    --shadow-float: 0 12px 32px -4px #000000b3;
    --focus-ring: 0 0 0 2px #170b1d, 0 0 0 4px #c39ad4;
  }
}
:root[data-theme="dark"] {
  --surface: #170b1d;
  --surface-raised: #22122b;
  --surface-ink: #0e0612;
  --line: #3a2745;
  --line-strong: #78637f;
  --ink: #f5ecf1;
  --ink-muted: #b9a7b5;
  --on-ink: #f5ecf1;
  --on-ink-muted: #b9a7b5;
  --signal: #ff7a6b;
  --on-signal: #2a1433;
  --signal-text: #ff8f82;
  --signal-soft: #3d1a1c;
  --wire: #c39ad4;
  --wire-soft: #2d1a38;
  --ok: #5ad38f;
  --danger: #ff8a80;
  --link: var(--signal-text);
  --shadow-float: 0 12px 32px -4px #000000b3;
  --focus-ring: 0 0 0 2px #170b1d, 0 0 0 4px #c39ad4;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ===== 2. Brand components (brand/components.css, verbatim) ===== */
/* Talkgate - components. Every colour, size and radius comes from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); font-size: 17px; line-height: 27px; background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); text-wrap: balance; }
p { margin: 0; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }

.tm-wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--space-6); }
.tm-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.tm-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.tm-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Eyebrow */
.tm-eyebrow { font-family: var(--font-display); font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.tm-ink .tm-eyebrow { color: var(--on-ink-muted); }

/* Button */
.tm-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 48px; padding: 0 var(--space-6); font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.005em; line-height: 1; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background-color 120ms, border-color 120ms, color 120ms; white-space: nowrap; }
.tm-btn-primary { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.tm-btn-primary:hover { background: var(--signal-text); border-color: var(--signal-text); color: var(--surface-raised); }
[data-theme="dark"] .tm-btn-primary:hover { color: var(--on-signal); filter: brightness(1.08); }
.tm-btn-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.tm-btn-quiet:hover { background: var(--surface-raised); border-color: var(--ink); }
.tm-ink .tm-btn-quiet { color: var(--on-ink); border-color: var(--on-ink-muted); }
.tm-ink .tm-btn-quiet:hover { background: transparent; border-color: var(--on-ink); }
.tm-btn-link { height: auto; padding: 0; background: none; border: 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; font-family: var(--font-body); font-size: 17px; font-weight: 600; }
.tm-btn-sm { height: 40px; padding: 0 var(--space-4); font-size: 15px; }

/* Nav */
.tm-nav { position: sticky; top: 0; background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.tm-nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-6); height: 72px; display: flex; align-items: center; gap: var(--space-8); }
.tm-nav-links { display: flex; gap: var(--space-6); margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.tm-nav-links a { position: relative; display: inline-block; padding: var(--space-3) 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.tm-nav-links a:hover { color: var(--ink-muted); }
.tm-nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--signal); }

/* Hero */
.tm-hero { padding-block: var(--space-24); }
.tm-hero-inner { max-width: 1200px; margin: 0 auto; padding-inline: var(--space-6); display: grid; gap: var(--space-6); max-width: 820px; }
.tm-hero h1 { font-size: 64px; line-height: 68px; font-weight: 700; letter-spacing: -0.025em; }
.tm-hero .tm-lede { font-size: 20px; line-height: 30px; color: var(--ink-muted); max-width: 620px; }
.tm-hero .tm-row { margin-top: var(--space-2); }
@media (max-width: 720px) { .tm-hero { padding-block: var(--space-16); } .tm-hero h1 { font-size: 48px; line-height: 52px; letter-spacing: -0.02em; } }

/* Section header */
.tm-section-header { display: grid; gap: var(--space-2); max-width: 720px; }
.tm-section-header h2 { font-size: 36px; line-height: 42px; font-weight: 600; letter-spacing: -0.015em; }
.tm-section-header .tm-lede { margin-top: var(--space-2); font-size: 20px; line-height: 30px; color: var(--ink-muted); }

/* Feature card */
.tm-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-6); display: grid; gap: var(--space-3); align-content: start; }
.tm-card h3 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; }
.tm-card p { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.tm-card .tm-icon { width: 24px; height: 24px; stroke: var(--wire); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--space-2); }

/* Stat */
.tm-stats { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tm-stat { padding: var(--space-6) var(--space-6) var(--space-6) 0; display: grid; gap: var(--space-1); border-left: 1px solid var(--line); padding-left: var(--space-6); }
.tm-stat:first-child { border-left: 0; padding-left: 0; }
.tm-stat .tm-figure { font-family: var(--font-mono); font-size: 40px; line-height: 44px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--ink); }
.tm-stat .tm-figure.is-signal { color: var(--signal-text); }
.tm-stat .tm-label { font-size: 15px; line-height: 23px; color: var(--ink); }
.tm-stat .tm-caption { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }

/* Quote */
.tm-quote { display: grid; gap: var(--space-4); max-width: 760px; padding-left: var(--space-6); border-left: 3px solid var(--signal); }
.tm-quote blockquote { margin: 0; font-family: var(--font-display); font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.tm-quote figcaption { font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.tm-quote figcaption strong { color: var(--ink); font-weight: 600; }

/* Form */
.tm-form { display: grid; gap: var(--space-4); max-width: 520px; }
.tm-field { display: grid; gap: var(--space-2); }
.tm-field label { font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 20px; }
.tm-field .tm-help { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.tm-input, .tm-textarea, .tm-select { font: inherit; font-size: 17px; line-height: 24px; width: 100%; padding: var(--space-3) var(--space-4); background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.tm-input::placeholder, .tm-textarea::placeholder { color: var(--ink-muted); }
.tm-textarea { min-height: 120px; resize: vertical; }
.tm-field.is-error .tm-input, .tm-field.is-error .tm-textarea { border-color: var(--danger); }
.tm-error { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--danger); }
.tm-ok { font-size: 15px; line-height: 23px; font-weight: 600; color: var(--ok); }

/* Footer and dark bands */
.tm-ink { background: var(--surface-ink); color: var(--on-ink); }
.tm-ink a { color: var(--on-ink-muted); text-decoration: none; }
.tm-ink a:hover { color: var(--on-ink); text-decoration: underline; }
.tm-footer { padding-block: var(--space-16); }
.tm-footer-inner { max-width: 1200px; margin: 0 auto; padding-inline: var(--space-6); display: grid; gap: var(--space-12); grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.tm-footer h4 { font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-ink-muted); margin-bottom: var(--space-4); }
.tm-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); font-size: 15px; line-height: 23px; }
.tm-footer .tm-about { font-size: 15px; line-height: 23px; color: var(--on-ink-muted); max-width: 320px; margin-top: var(--space-4); }
.tm-footer-base { max-width: 1200px; margin: var(--space-12) auto 0; padding: var(--space-6) var(--space-6) 0; border-top: 1px solid var(--line-strong); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); font-size: 13px; line-height: 18px; color: var(--on-ink-muted); }
@media (max-width: 860px) { .tm-footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .tm-footer-inner { grid-template-columns: 1fr; } }

/* Logo lockups */
.tm-logo-row { display: grid; gap: var(--space-4); grid-template-columns: 1fr 1fr; }
.tm-logo-tile { display: flex; align-items: center; justify-content: center; min-height: 112px; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.tm-logo-tile.is-ink { background: var(--surface-ink); border-color: var(--surface-ink); }
.tm-logo-tile.is-icon { gap: var(--space-4); }
.tm-logo-tile .tm-app-icon { width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--surface-ink); display: grid; place-items: center; }

/* ===== 3. Site layout ===== */
html { scroll-behavior: smooth; }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
strong { font-weight: 600; }
.tm-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Skip link: off-canvas until focused */
.tm-skip { position: absolute; top: -200px; left: var(--space-4); z-index: 100; padding: var(--space-3) var(--space-4); background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 600; text-decoration: none; }
.tm-skip:focus-visible { top: var(--space-4); }

/* Sections: space-24 tall, a 1px line between them, never alternating backgrounds */
.tm-section { padding-block: var(--space-24); border-top: 1px solid var(--line); }
main > :first-child { border-top: 0; }
.tm-section-header { margin-bottom: var(--space-8); }
.tm-section-header + * { margin-top: 0; }

/* Hero: left-aligned by default; add is-centred on the home page only */
.tm-hero.is-centred { text-align: center; }
.tm-hero.is-centred .tm-hero-inner { justify-items: center; }
.tm-hero.is-centred .tm-row { justify-content: center; }

/* 12-column grid helper */
.tm-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-6); align-items: start; }
.tm-span-3 { grid-column: span 3; }
.tm-span-4 { grid-column: span 4; }
.tm-span-5 { grid-column: span 5; }
.tm-span-6 { grid-column: span 6; }
.tm-span-7 { grid-column: span 7; }
.tm-span-8 { grid-column: span 8; }
.tm-span-12 { grid-column: span 12; }
.tm-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); align-items: start; }

/* Prose: running text 65ch wide, h2 always under an eyebrow */
.tm-prose { max-width: 65ch; display: grid; gap: var(--space-4); }
.tm-prose p { font-size: 17px; line-height: 27px; }
.tm-prose h2 { font-size: 36px; line-height: 42px; font-weight: 600; letter-spacing: -0.015em; margin-top: var(--space-8); }
.tm-prose .tm-eyebrow { margin-top: var(--space-8); }
.tm-prose .tm-eyebrow + h2 { margin-top: calc(var(--space-2) - var(--space-4)); }
.tm-prose > :first-child, .tm-prose > .tm-eyebrow:first-child + h2 { margin-top: 0; }
.tm-prose h3 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; margin-top: var(--space-4); }
.tm-prose h4 { font-size: 20px; line-height: 26px; font-weight: 600; margin-top: var(--space-2); }
.tm-prose .tm-lede { font-size: 20px; line-height: 30px; color: var(--ink-muted); }
.tm-prose code { font-family: var(--font-mono); font-size: 14px; padding: 1px var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-raised); }
.tm-caption { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
.tm-data { font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 400; font-variant-numeric: tabular-nums; }
.tm-ink .tm-caption, .tm-band .tm-caption { color: var(--on-ink-muted); }

/* Lists: square bullets in wire, no icons, no ticks */
.tm-list { list-style: square; margin: 0; padding-left: 1.2em; display: grid; gap: var(--space-2); }
.tm-list li::marker { color: var(--wire); }
.tm-list.is-plain { list-style: none; padding-left: 0; }
.tm-list.is-two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); }

/* Tables: for integration and comparison matrices */
.tm-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.tm-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 23px; }
.tm-table caption { text-align: left; padding: var(--space-4); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); caption-side: bottom; }
.tm-table th { text-align: left; font-family: var(--font-body); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line-strong); vertical-align: bottom; }
.tm-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); vertical-align: top; }
.tm-table tbody tr:last-child td { border-bottom: 0; }
.tm-table th:first-child, .tm-table td:first-child { font-weight: 600; color: var(--ink); }
.tm-table .is-ok { color: var(--ok); font-weight: 600; }
.tm-table .is-muted { color: var(--ink-muted); }

/* Dark band: one per page at most. Use with tm-section: <section class="tm-section tm-band"> */
.tm-band { background: var(--surface-ink); color: var(--on-ink); border-top-color: transparent; }
.tm-band + .tm-section { border-top-color: transparent; }
.tm-band a { color: var(--on-ink-muted); }
.tm-band a:hover { color: var(--on-ink); }
.tm-band .tm-eyebrow { color: var(--on-ink-muted); }
.tm-band .tm-lede, .tm-band .tm-card p, .tm-band .tm-stat .tm-caption { color: var(--on-ink-muted); }
.tm-band .tm-card { background: transparent; border-color: var(--line-strong); }
.tm-band .tm-stats, .tm-band .tm-stat { border-color: var(--line-strong); }
.tm-band .tm-stat .tm-figure, .tm-band .tm-stat .tm-label { color: var(--on-ink); }
.tm-band .tm-stat .tm-figure.is-signal { color: var(--signal); }
.tm-band .tm-btn-quiet { color: var(--on-ink); border-color: var(--on-ink-muted); }
.tm-band .tm-btn-quiet:hover { background: transparent; border-color: var(--on-ink); }
.tm-band .tm-list li::marker { color: var(--on-ink-muted); }

/* Diagrams: SVG built from the identity's own parts, on wire-soft */
.tm-diagram { background: var(--wire-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.tm-diagram svg { display: block; width: 100%; height: auto; }
.tm-diagram .tm-caption { margin-top: var(--space-3); }
.tm-band .tm-diagram { background: transparent; border-color: var(--line-strong); }
/* Product imagery: a dark frame, no browser chrome */
.tm-frame { background: var(--surface-ink); border-radius: var(--radius-md); padding: var(--space-4); }
.tm-frame img, .tm-frame svg { border-radius: var(--radius-sm); }

/* Integration names: text in square bordered tiles. Never logos lifted from suppliers, never pills. */
.tm-logo-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tm-logo-grid li { display: grid; place-items: center; align-content: center; gap: var(--space-1); aspect-ratio: 1; padding: var(--space-4); text-align: center; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); font-family: var(--font-display); font-size: 17px; line-height: 22px; font-weight: 600; color: var(--ink); }
.tm-logo-grid a { color: inherit; text-decoration: none; }
.tm-logo-grid a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tm-logo-grid .tm-caption { font-family: var(--font-body); }

/* Nav: brand lockup, mobile sheet */
.tm-nav { z-index: 50; }
.tm-brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.tm-wordmark { display: block; height: 28px; width: auto; }
.tm-nav-toggle { display: none; margin-left: auto; }
.tm-nav-menu { display: contents; }
.tm-nav-links a { transition: color 120ms; }
.tm-nav .tm-btn-primary { font-size: 15px; }

/* Footer: five columns, headings are labels not headings */
.tm-footer-inner { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; }
.tm-footer-heading { margin: 0 0 var(--space-4); font-family: var(--font-display); font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-ink-muted); }
.tm-footer .tm-wordmark { height: 24px; }
.tm-footer-base .tm-data { color: var(--on-ink-muted); }

/* Breakpoints: 1024, 720, 480 */
@media (max-width: 1024px) {
  .tm-nav-toggle { display: inline-flex; }
  .tm-nav-menu { display: none; position: absolute; left: 0; right: 0; top: 100%; padding: var(--space-4) var(--space-6) var(--space-6); background: var(--surface-raised); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-float); }
  .tm-nav-menu.is-open { display: grid; gap: var(--space-4); }
  .tm-nav-links { flex-direction: column; gap: 0; margin-left: 0; }
  .tm-nav-links a { display: block; padding: var(--space-3) 0; font-size: 17px; }
  .tm-nav-links a[aria-current="page"]::after { right: auto; width: var(--space-6); }
  .tm-nav-menu .tm-btn { width: 100%; }
  .tm-cols { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tm-span-4, .tm-span-3 { grid-column: span 3; }
  .tm-span-5, .tm-span-6, .tm-span-7, .tm-span-8, .tm-span-12 { grid-column: span 6; }
  .tm-footer-inner { grid-template-columns: repeat(3, 1fr); }
  .tm-footer-inner > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .tm-section { padding-block: var(--space-16); }
  .tm-section-header h2, .tm-prose h2 { font-size: 30px; line-height: 36px; }
  .tm-two-col { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .tm-cols { grid-template-columns: minmax(0, 1fr); }
  .tm-cols > * { grid-column: auto; }
  .tm-list.is-two-col { grid-template-columns: minmax(0, 1fr); }
  .tm-footer-inner { grid-template-columns: 1fr 1fr; }
  .tm-footer-inner > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .tm-hero h1 { font-size: 40px; line-height: 44px; }
  .tm-row .tm-btn { width: 100%; }
  .tm-stats { grid-template-columns: 1fr; }
  .tm-stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .tm-stat:first-child { border-top: 0; }
  .tm-logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-footer-inner { grid-template-columns: 1fr; }
}

/* Motion: almost none, and none at all when the reader asks for less */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* Page-level helpers hoisted from the page sources (numbered flows, notes). */
.tm-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.tm-flow li { counter-increment: step; display: grid; gap: var(--space-2); align-content: start; padding-top: var(--space-4); border-top: 1px solid var(--line-strong); font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.tm-flow li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 14px; line-height: 20px; color: var(--wire); }
.tm-flow strong { display: block; font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 600; color: var(--ink); }
.tm-steps { list-style: none; margin: 0; padding: 0; max-width: 720px; display: grid; gap: var(--space-4); counter-reset: step; }
.tm-steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: 17px; line-height: 27px; }
.tm-steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 14px; line-height: 27px; color: var(--wire); font-variant-numeric: tabular-nums; }
.tm-steps strong { font-weight: 600; }
.tm-rules { margin-top: var(--space-12); }
.tm-grid-note { margin-top: var(--space-4); }
.tm-note { margin-top: var(--space-8); }
.tm-review dd { margin: 0; }
.tm-telephony-cards { margin-top: var(--space-8); }
.tm-sip-heading { font-size: 36px; line-height: 42px; font-weight: 600; letter-spacing: -0.015em; }
@media (max-width: 720px) { .tm-sip-heading { font-size: 30px; line-height: 36px; } }

/* ===== 4. Motion, the hero call and the live diagrams =====
   Appended for the second pass. Everything here is transform and opacity, visible at rest,
   and switched off by the reduce class (set in the head from prefers-reduced-motion). */
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); }

/* Nav: flush with the page at rest, a backdrop and a hairline once scrolled */
.tm-nav { background: var(--surface); border-bottom-color: transparent; transition: background-color 200ms, border-color 200ms; }
html:not(.js) .tm-nav, .tm-nav.is-scrolled, .tm-nav:has(.tm-nav-menu.is-open) { background: var(--surface-raised); border-bottom-color: var(--line); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (background: color-mix(in srgb, red 50%, blue)) {
  .tm-nav.is-scrolled { background: color-mix(in srgb, var(--surface-raised) 86%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
}
.tm-nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 160ms var(--ease-out); }
.tm-nav-links a:hover { color: var(--ink); }
.tm-nav-links a:hover::after, .tm-nav-links a:focus-visible::after { transform: scaleX(1); }
.tm-nav-links a[aria-current="page"]::after { height: 3px; background: var(--signal); transform: scaleX(1); }

/* Buttons press, cards lift. Hover only where there is a pointer that hovers. */
.tm-btn { transition: background-color 120ms, border-color 120ms, color 120ms, transform 120ms var(--ease-out); }
.tm-btn:active { transform: scale(0.98); }
.tm-card { transition: border-color 120ms, transform 120ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .tm-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
  .tm-band .tm-card:hover { border-color: var(--on-ink-muted); }
}

/* Scroll reveal. Hidden only once the head script has put js on <html>, never under reduce,
   and only until is-done, after which the element is back to its own styles (so hover works). */
html.js:not(.reduce) main .tm-section .tm-section-header:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-card:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-flow > li:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-steps > li:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-how > li:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-diagram:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-prose:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-quote:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-stats:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-table-wrap:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-logo-grid > li:not(.is-done),
html.js:not(.reduce) main .tm-section .tm-form:not(.is-done) { opacity: 0; transform: translateY(14px); }
html.js:not(.reduce) main .tm-section .is-in:not(.is-done) { opacity: 1; transform: none; transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out); }

/* Draw-on lines. Any stroke with class tm-draw and pathLength="1" inside a [data-draw] box
   is hidden until the box enters view, then draws from its start. */
html.js:not(.reduce) [data-draw]:not(.is-drawn):not(.is-settled) .tm-draw { stroke-dasharray: 1 2; stroke-dashoffset: 1.05; }
html.js:not(.reduce) [data-draw].is-drawn:not(.is-settled) .tm-draw { stroke-dasharray: 1 2; stroke-dashoffset: 0; transition: stroke-dashoffset 700ms var(--ease-out); transition-delay: var(--d, 0ms); }

/* The gate diagram on the home page: the conversation moves between the posts, a dot carries
   the call from the caller through the gate to each destination in turn. */
.tm-gate-talk { animation: tm-dash10 900ms linear infinite; }
.tm-gate-dest { transition: stroke 200ms, stroke-width 200ms; }
.tm-gate-dest.is-hit { stroke: var(--ink); stroke-width: 2.5; }
.tm-gate-dot { transition: opacity 200ms; }
.tm-flow-dash { animation: tm-dash8 1200ms linear infinite; }
@keyframes tm-dash10 { to { stroke-dashoffset: -10; } }
@keyframes tm-dash8 { to { stroke-dashoffset: -8; } }

/* Home hero: copy left, a call in progress right */
.tm-hero.is-split .tm-hero-inner { max-width: 1200px; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: var(--space-16); align-items: center; }
.tm-hero.is-split .tm-hero-copy { display: grid; gap: var(--space-6); }
.tm-hero.is-split h1 { font-size: 60px; line-height: 64px; }
@media (max-width: 1024px) {
  .tm-hero.is-split .tm-hero-inner { grid-template-columns: minmax(0, 1fr); gap: var(--space-12); }
  .tm-hero.is-split .tm-call { max-width: 560px; }
}
@media (max-width: 720px) { .tm-hero.is-split h1 { font-size: 48px; line-height: 52px; } }
@media (max-width: 480px) { .tm-hero.is-split h1 { font-size: 40px; line-height: 44px; } }

/* The call card: a dark product frame with the lintel across the top. It is always on
   surface-ink, so the status colours inside it are the dark-theme values in both themes. */
.tm-call { --ok: #5ad38f; margin: 0; position: relative; background: var(--surface-ink); color: var(--on-ink); border: 1px solid var(--surface-ink); border-top: 4px solid var(--signal); border-radius: var(--radius-md); padding: var(--space-6); display: grid; gap: var(--space-4); font-size: 15px; line-height: 23px; }
.tm-call-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line-strong); font-family: var(--font-display); font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-ink-muted); }
.tm-call-status { display: inline-flex; align-items: center; gap: var(--space-2); }
.tm-call-dot { display: inline-block; width: 8px; height: 8px; background: var(--ok); }
.tm-call.is-live .tm-call-dot { animation: tm-pulse 1400ms ease-in-out infinite; }
.tm-call-timer { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; color: var(--on-ink-muted); }
.tm-call-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); transition: opacity 250ms; }
.tm-call-line { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--space-3); align-items: start; color: var(--on-ink-muted); }
.tm-call-line.is-agent { color: var(--on-ink); }
.tm-call-who { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: 12px; line-height: 23px; color: var(--on-ink-muted); }
.tm-call-line.is-agent .tm-call-who { color: var(--on-ink); }
.tm-call-text { position: relative; display: block; }
.tm-call-ghost { visibility: hidden; }
.tm-call-typed { position: absolute; inset: 0; }
.tm-call-line.is-typing .tm-call-typed::after { content: ""; display: inline-block; width: 2px; height: 0.85em; margin-left: 2px; vertical-align: -0.1em; background: var(--on-ink-muted); animation: tm-blink 900ms steps(1) infinite; }
.tm-wave { display: inline-flex; align-items: center; gap: 2px; height: 14px; visibility: hidden; }
.tm-wave i { display: block; width: 3px; height: 100%; background: var(--on-ink); transform: scaleY(0.3); transform-origin: center; }
.tm-call-line.is-speaking .tm-wave { visibility: visible; }
.tm-call-line.is-speaking .tm-wave i { animation: tm-wave 620ms ease-in-out infinite alternate; }
.tm-call-line.is-speaking .tm-wave i:nth-child(2) { animation-delay: -180ms; animation-duration: 540ms; }
.tm-call-line.is-speaking .tm-wave i:nth-child(3) { animation-delay: -360ms; animation-duration: 700ms; }
.tm-call-line.is-speaking .tm-wave i:nth-child(4) { animation-delay: -90ms; animation-duration: 500ms; }
.tm-call-line.is-speaking .tm-wave i:nth-child(5) { animation-delay: -270ms; animation-duration: 640ms; }
.tm-call-result { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; padding-top: var(--space-3); border-top: 1px solid var(--line-strong); font-family: var(--font-display); font-size: 17px; line-height: 24px; font-weight: 600; transition: opacity 300ms var(--ease-out); }
.tm-call-result strong { color: var(--ok); }
.tm-call.is-live .tm-call-line:not(.is-on) { visibility: hidden; }
.tm-call.is-live .tm-call-result:not(.is-on) { opacity: 0; }
.tm-call.is-resetting .tm-call-lines, .tm-call.is-resetting .tm-call-result { opacity: 0; }
@keyframes tm-wave { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
@keyframes tm-blink { 50% { opacity: 0; } }
@keyframes tm-pulse { 50% { opacity: 0.35; } }
@media (max-width: 480px) {
  .tm-call { padding: var(--space-4); }
  .tm-call-line { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tm-call-who { line-height: 18px; }
}

/* How it works: four numbered steps, icons that draw on */
.tm-how { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
.tm-how li { counter-increment: step; display: grid; gap: var(--space-3); align-content: start; padding-top: var(--space-4); border-top: 1px solid var(--line-strong); font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.tm-how li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 14px; line-height: 20px; color: var(--wire); }
.tm-how .tm-icon { width: 32px; height: 32px; stroke: var(--wire); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tm-how strong { display: block; font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 600; color: var(--ink); }
.tm-how p { margin: 0; }
@media (max-width: 1024px) { .tm-how { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tm-how { grid-template-columns: minmax(0, 1fr); } }

/* Integration names as a slow marquee: two rows, opposite ways, paused on hover or focus.
   Each row is one set of names followed by a copy, so a move of half the row loops cleanly. */
.tm-marquee { overflow: hidden; display: grid; gap: var(--space-4); padding-block: var(--space-2); }
.tm-marquee-row { list-style: none; margin: 0; padding: 0; display: flex; width: max-content; animation: tm-marquee 64s linear infinite; }
.tm-marquee-row.is-reverse { animation-direction: reverse; }
.tm-marquee:hover .tm-marquee-row, .tm-marquee:focus-within .tm-marquee-row { animation-play-state: paused; }
.tm-marquee-row li { flex: 0 0 auto; width: 184px; height: 88px; margin-right: var(--space-4); display: grid; place-items: center; align-content: center; gap: var(--space-1); padding: var(--space-3); text-align: center; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); font-family: var(--font-display); font-size: 17px; line-height: 22px; font-weight: 600; color: var(--ink); }
.tm-marquee-row a { color: inherit; text-decoration: none; }
.tm-marquee-row a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tm-marquee-row .tm-caption { font-family: var(--font-body); }
@keyframes tm-marquee { to { transform: translateX(-50%); } }

/* Spotlight on cards: a soft wire-soft highlight under the pointer. Pointer devices only. */
.is-spotlight .tm-card { position: relative; isolation: isolate; --spot: var(--wire-soft); }
.tm-band .is-spotlight .tm-card { --spot: color-mix(in srgb, var(--wire) 22%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .is-spotlight .tm-card::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 200ms; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--spot) 0%, transparent 70%); }
  .is-spotlight .tm-card:hover::before { opacity: 1; }
}

/* Less motion: the marquee is a grid, the call card shows its final state, lines are drawn. */
@media (prefers-reduced-motion: reduce) {
  .tm-marquee { max-width: 1200px; margin-inline: auto; padding-inline: var(--space-6); }
  .tm-marquee-row { animation: none; width: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-4); }
  .tm-marquee-row li { width: auto; height: auto; aspect-ratio: 1; margin: 0; }
  .tm-marquee-row [data-dup], .tm-marquee-row.is-reverse { display: none; }
  .tm-wave i, .tm-gate-talk, .tm-flow-dash, .tm-call-dot, .tm-call-typed::after { animation: none !important; }
  html.js [data-draw] .tm-draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  .tm-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 480px) { .tm-marquee-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* integration logos */
/* A logo tile is always a white square with a line edge, in both themes, so a vendor's colours
   sit on the ground they were drawn for. The name and status under the logo therefore use the
   light-theme ink values directly rather than the theme tokens. */
.tm-logo-tile, .tm-logo-grid .tm-logo-tile { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-md); transition: border-color 120ms; }
.tm-logo-grid .tm-logo-tile { padding: 12px; gap: var(--space-2); color: #2a1433; }
.tm-logo-tile:hover, .tm-logo-grid .tm-logo-tile:hover { border-color: var(--line-strong); }
.tm-logo-tile img { display: block; width: 100%; max-width: 120px; height: 40px; object-fit: contain; filter: none; }
.tm-logo-grid .tm-logo-tile .tm-logo-name { font-family: var(--font-display); font-size: 15px; line-height: 20px; font-weight: 600; color: #2a1433; }
.tm-logo-grid .tm-logo-tile .tm-caption { color: #6b5a66; }
.tm-logo-grid.is-wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tm-logo-grid.is-wall + .tm-caption { margin-top: var(--space-4); }
/* The first cell of an integration table: the mark beside the name. */
.tm-logo-cell { display: flex; align-items: center; gap: var(--space-3); min-width: 150px; }
.tm-logo-cell img { display: block; flex: 0 0 auto; height: 28px; max-height: 28px; width: auto; max-width: 84px; object-fit: contain; padding: 2px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* photography */
/* Photographs of real places, desaturated toward plum. A figure is square-cornered with a line
   edge and a caption. A band carries one as a background layer under a plum overlay, so on-ink
   text keeps 4.5:1 over the brightest part of the picture; the muted on-ink is lifted a step for
   the same reason. Sizes come from width/height and aspect-ratio, so nothing shifts on load. */
.tm-photo { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: center; border: 1px solid var(--line); border-radius: 0; background: var(--wire-soft); }
.tm-photo-figure { margin: 0; display: grid; gap: var(--space-3); min-width: 0; }
.tm-photo-figure.is-wide { margin-top: var(--space-12); }
.tm-photo-figure.is-wide .tm-photo { aspect-ratio: 2 / 1; }
.tm-hero .tm-photo-figure { grid-column: 1 / -1; margin-top: var(--space-6); }
.tm-band.has-photo { position: relative; isolation: isolate; overflow: hidden; --on-ink-muted: #ddd0d8; }
.tm-band-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; max-width: none; margin: 0; border: 0; object-fit: cover; object-position: center; }
.tm-band.has-photo::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(42, 20, 51, 0.72); }
.tm-band.has-photo > .tm-wrap { position: relative; z-index: 2; }
.tm-band.has-photo .tm-prose { max-width: 58ch; }
.tm-band-credit { margin-top: var(--space-6); }
@media (max-width: 720px) {
  .tm-photo-figure.is-wide { margin-top: var(--space-8); }
  .tm-photo-figure.is-wide .tm-photo { aspect-ratio: 3 / 2; }
}
