/* A4B site styles: the same "ledger" design language as Ail's homepage
 * (app/design-system.css + app/home-ledger.css): one blue accent over a
 * neutral gray scale, square corners, no shadows, hairline borders, IBM Plex
 * Serif headings over Work Sans body text, numbered "No. 01" rows. The token
 * names and values below are copied from Ail's design system so the two stay
 * visibly one family. Light/dark follows the system, and a toggle stores an
 * explicit choice in data-theme, exactly like Ail's ThemeToggle. */

@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/IBMPlexSerif-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/IBMPlexSerif-600.woff2) format("woff2"); }
@font-face { font-family: "Work Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/assets/fonts/WorkSans-400-600.woff2) format("woff2"); }

:root {
  --ds-accent: #3b82f6;
  --ds-accent-hover: #60a5fa;
  --ds-on-accent: #ffffff;
  --ds-bg-base: #030712;
  --ds-bg-surface: #111827;
  --ds-bg-elevated: #1f2937;
  --ds-border-subtle: #1f2937;
  --ds-border-muted: #374151;
  --ds-text-primary: #f9fafb;
  --ds-text-secondary: #d1d5db;
  --ds-text-muted: #6b7280;
  --ds-success: #34d399;
  --ds-error: #f87171;
  --transition-fast: 150ms ease;
  --hl-serif: "IBM Plex Serif", Georgia, serif;
  --hl-sans: "Work Sans", ui-sans-serif, system-ui, sans-serif;
  --hl-border: var(--ds-border-muted);
  --hl-border-strong: color-mix(in srgb, var(--ds-border-muted) 45%, var(--ds-text-primary) 55%);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --ds-accent: #2563eb;
  --ds-accent-hover: #1d4ed8;
  --ds-bg-base: #f9fafb;
  --ds-bg-surface: #f3f4f6;
  --ds-bg-elevated: #e5e7eb;
  --ds-border-subtle: #e5e7eb;
  --ds-border-muted: #d1d5db;
  --ds-text-primary: #111827;
  --ds-text-secondary: #374151;
  --ds-text-muted: #6b7280;
  --ds-success: #059669;
  --ds-error: #dc2626;
  color-scheme: light;
}
/* Same values as the block above, for visitors who haven't chosen: follow the
   system. Kept in sync by hand, like Ail's design-system.css. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ds-accent: #2563eb;
    --ds-accent-hover: #1d4ed8;
    --ds-bg-base: #f9fafb;
    --ds-bg-surface: #f3f4f6;
    --ds-bg-elevated: #e5e7eb;
    --ds-border-subtle: #e5e7eb;
    --ds-border-muted: #d1d5db;
    --ds-text-primary: #111827;
    --ds-text-secondary: #374151;
    --ds-text-muted: #6b7280;
    --ds-success: #059669;
    --ds-error: #dc2626;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html { scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--ds-bg-base);
  /* The soft blue ambient wash at the top of Ail's homepage. */
  background-image: radial-gradient(ellipse 95vw 34rem at 25% -2rem, rgba(99, 102, 241, 0.3), rgba(99, 102, 241, 0.16) 40%, rgba(99, 102, 241, 0.06) 65%, transparent 85%);
  background-repeat: no-repeat;
  color: var(--ds-text-primary);
  font-family: var(--hl-sans);
  font-size: 16px;
  line-height: 1.6;
}
h1, h2 { font-family: var(--hl-serif); font-weight: 600; margin: 0; }
h3, h4 { margin: 0; }
p { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 8px 14px; background: var(--ds-accent); color: var(--ds-on-accent); }
.skip:focus { left: 8px; top: 8px; }

.wrap { width: 100%; max-width: 74rem; margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; }
@media (min-width: 1024px) { .wrap { padding-left: 2.5rem; padding-right: 2.5rem; } }
.narrow { max-width: 46rem; }

/* masthead */
.nav { position: sticky; top: 0; z-index: 10; background: var(--ds-bg-base); border-bottom: 1px solid var(--hl-border-strong); }
.nav .bar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.logo-on-light { display: none; }
:root[data-theme="light"] .logo-on-dark { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .logo-on-dark { display: none; }
  :root:not([data-theme="dark"]) .logo-on-light { display: block; }
}
.brand-name { font-family: var(--hl-serif); font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand-tag { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ds-text-muted); white-space: nowrap; }
@media (max-width: 480px) { .brand-tag { display: none; } }
.nav-links { display: none; align-items: center; gap: 1.75rem; font-size: 0.875rem; color: var(--ds-text-secondary); }
@media (min-width: 1024px) { .nav-links { display: flex; } }
.nav-link { text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 0.2rem; transition: border-color var(--transition-fast), color var(--transition-fast); }
.nav-link:hover { color: var(--ds-text-primary); border-color: var(--hl-border-strong); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* theme toggle */
.theme-toggle { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; background: transparent; color: var(--ds-text-secondary); border: 0; cursor: pointer; }
.theme-toggle:hover { color: var(--ds-text-primary); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .icon-moon { display: block; }
}

/* buttons: square, no border radius (Ail's .hl-btn family) */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.7rem 1.25rem; border: none; border-radius: 0; font: inherit; font-size: 0.875rem; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast); }
.btn-fill { background: #f8fafc; color: #111827; box-shadow: 0 4px 6px -1px rgb(37 99 235 / 0.2), 0 2px 4px -2px rgb(37 99 235 / 0.2); }
.btn-fill:hover { background: #ffffff; box-shadow: 0 6px 10px -1px rgb(37 99 235 / 0.25), 0 3px 6px -2px rgb(37 99 235 / 0.25); }
.btn-line { color: var(--ds-text-primary); border: 1px solid var(--hl-border-strong); }
.btn-line:hover { border-color: var(--ds-text-primary); background: var(--ds-bg-surface); }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* shared type primitives */
.eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ds-text-muted); }
.eyebrow::before { content: ""; width: 0.9rem; height: 1px; background: var(--ds-accent); display: inline-block; }
.index { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ds-text-muted); }
.tabular { font-variant-numeric: tabular-nums; }
.secondary { color: var(--ds-text-secondary); }

/* sections */
.section { border-bottom: 1px solid var(--hl-border); padding-top: 4rem; padding-bottom: 4rem; }
.section h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); line-height: 1.2; margin-top: 0.5rem; margin-bottom: 0.75rem; }
.section-lead { max-width: 40rem; margin-bottom: 2rem; font-size: 0.95rem; color: var(--ds-text-secondary); }

/* hero */
.hero { display: grid; gap: 2.5rem; align-items: end; padding-top: 3.5rem; padding-bottom: 3.5rem; border-bottom: 1px solid var(--hl-border); }
@media (min-width: 1024px) { .hero { grid-template-columns: 1.1fr 0.7fr; padding-top: 5rem; padding-bottom: 5rem; } }
.hero h1 { margin: 1.25rem 0 1.5rem; font-size: clamp(2.25rem, 5.4vw, 3.75rem); line-height: 1.1; }
.hero h1 em { font-style: normal; color: var(--ds-accent); }
.hero .lead { max-width: 36rem; margin-bottom: 2rem; font-size: 1rem; color: var(--ds-text-secondary); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-side { padding-left: 0; }
@media (min-width: 1024px) { .hero-side { padding-left: 2rem; } }
.entry-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--hl-border); font-size: 0.85rem; color: var(--ds-text-secondary); }
.entry-row:last-child { border-bottom: none; }
.entry-row b { font-weight: 600; color: var(--ds-success); }

/* hairline grid: one shared rule between cells */
.group { margin: 2.25rem 0 0.9rem; }
.group:first-of-type { margin-top: 0; }
.grid { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--hl-border); border-left: 1px solid var(--hl-border); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.cell { padding: 1.75rem; border-right: 1px solid var(--hl-border); border-bottom: 1px solid var(--hl-border); transition: background var(--transition-fast); }
.cell:hover { background: var(--ds-bg-surface); }
.cell .no { display: block; margin-bottom: 0.9rem; font-family: var(--hl-serif); font-size: 0.85rem; color: var(--ds-text-muted); }
.cell h4 { margin-bottom: 0.5rem; font-size: 1rem; font-weight: 600; }
.cell p { font-size: 0.875rem; line-height: 1.6; color: var(--ds-text-secondary); }

/* numbered ledger rows */
.ledger { border-top: 1px solid var(--hl-border); margin: 0; padding: 0; list-style: none; }
.row { display: grid; grid-template-columns: 1fr; gap: 0.25rem; padding: 1.5rem 0; border-bottom: 1px solid var(--hl-border); align-items: baseline; }
@media (min-width: 640px) { .row { grid-template-columns: 6rem 1fr 2fr; gap: 2rem; } }
.row .no { font-family: var(--hl-serif); font-size: 0.875rem; color: var(--ds-text-muted); }
.row h3, .row dt { font-size: 1rem; font-weight: 600; }
.row p, .row dd { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--ds-text-secondary); }
dl.ledger { margin: 0; }

.built-by { margin-top: 2.5rem; padding: 1.5rem; border: 1px solid var(--hl-border); background: var(--ds-bg-surface); }
.built-by h3 { margin-bottom: 0.4rem; font-size: 1rem; font-weight: 600; }
.built-by p { font-size: 0.875rem; color: var(--ds-text-secondary); }
.built-by a { color: var(--ds-accent); }

/* contact form */
.direct { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }
form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.4rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } }
label, legend { font-size: 0.8rem; font-weight: 600; color: var(--ds-text-secondary); }
input[type="text"], input:not([type]), input[type="tel"], input[type="email"], select, textarea {
  width: 100%; padding: 0.7rem 0.8rem; background: var(--ds-bg-surface); color: var(--ds-text-primary);
  border: 1px solid var(--hl-border); border-radius: 0; font: inherit; font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--ds-accent); }
textarea { resize: vertical; }
::placeholder { color: var(--ds-text-muted); opacity: 1; }
.hint { margin-top: -0.6rem; font-size: 0.78rem; color: var(--ds-text-muted); }
.checks { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--hl-border); border-left: 1px solid var(--hl-border); margin-top: 0.4rem; }
@media (min-width: 640px) { .checks { grid-template-columns: 1fr 1fr; } }
.checks label { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.7rem 0.85rem; border-right: 1px solid var(--hl-border); border-bottom: 1px solid var(--hl-border); font-size: 0.85rem; font-weight: 400; color: var(--ds-text-secondary); cursor: pointer; }
.checks label:hover { background: var(--ds-bg-surface); }
.checks input, .consent input { margin-top: 0.3rem; accent-color: var(--ds-accent); }
.consent { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.85rem; font-weight: 400; }
.consent a { color: var(--ds-accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#form-status { min-height: 1.4em; font-size: 0.875rem; }
#form-status.error { color: var(--ds-error); }
.done { padding: 1.75rem; border: 1px solid var(--hl-border-strong); background: var(--ds-bg-surface); }
.done h3 { margin-bottom: 0.4rem; font-family: var(--hl-serif); font-size: 1.25rem; font-weight: 600; }
.done p { margin-bottom: 1rem; font-size: 0.9rem; color: var(--ds-text-secondary); }
[hidden] { display: none !important; }

/* footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--hl-border-strong); padding-top: 2rem; padding-bottom: 2.5rem; font-size: 0.8rem; color: var(--ds-text-muted); }
.site-footer .foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ds-text-primary); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* FAQ rows have no number: question on the left, answer on the right. */
.faq .row { grid-template-columns: 1fr; }
@media (min-width: 640px) { .faq .row { grid-template-columns: 1fr 2fr; } }

/* ---------- graphics ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.6rem; height: 1.6rem; flex: none; fill: none; stroke: var(--ds-accent); stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.section.last { border-bottom: 0; }

/* faint ledger grid behind the hero, fading out downwards */
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0 -1.5rem; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--hl-border) 1px, transparent 1px), linear-gradient(90deg, var(--hl-border) 1px, transparent 1px);
  background-size: 3rem 3rem;
  opacity: 0.22;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero { align-items: center; }
.ticks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 1.75rem 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--ds-text-secondary); }
.ticks li::before { content: "\2713"; margin-right: 0.45rem; font-weight: 600; color: var(--ds-success); }
@media (min-width: 1024px) { .hero { grid-template-columns: 1.1fr 0.8fr; } }

/* hero phone */
.hero-art { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.art-label { align-self: center; }
.phone { width: 100%; max-width: 20rem; border: 1px solid var(--hl-border-strong); background: var(--ds-bg-surface); }
.phone-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--hl-border); }
.phone-head > span:last-child { display: flex; flex-direction: column; line-height: 1.25; font-size: 0.85rem; }
.phone-head small { font-size: 0.7rem; color: var(--ds-success); }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--ds-accent); font-family: var(--hl-serif); font-weight: 600; color: var(--ds-accent); }
.chat { display: flex; flex-direction: column; gap: 0.6rem; min-height: 17rem; padding: 1rem; }
.msg { max-width: 82%; padding: 0.55rem 0.75rem; border: 1px solid var(--hl-border); font-size: 0.8rem; line-height: 1.45; }
.msg.in { align-self: flex-start; background: var(--ds-bg-base); color: var(--ds-text-secondary); }
.msg.out { align-self: flex-end; background: var(--ds-accent); border-color: var(--ds-accent); color: var(--ds-on-accent); }
.typing { align-self: flex-end; display: none; gap: 4px; padding: 0.6rem 0.75rem; border: 1px solid var(--hl-border); background: var(--ds-bg-base); }
.typing.on { display: flex; }
.typing i { width: 5px; height: 5px; background: var(--ds-text-muted); animation: blink 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.phone-foot { display: flex; justify-content: space-between; padding: 0.7rem 1rem; border-top: 1px solid var(--hl-border); font-size: 0.75rem; color: var(--ds-text-muted); }
.phone-foot b { color: var(--ds-accent); }
/* JS adds .anim only when motion is allowed; without it every message just shows */
.chat.anim .msg { opacity: 0; transform: translateY(8px); transition: opacity 0.35s ease, transform 0.35s ease; }
.chat.anim .msg.show { opacity: 1; transform: none; }

/* service cards: icon beside the number */
.cell-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.9rem; }
.cell-top .no { margin-bottom: 0; }
.cell:hover .ico { stroke: var(--ds-accent-hover); }

/* how it works: four nodes on a hairline */
.flow { position: relative; display: grid; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.step { position: relative; padding-left: 4rem; }
.step .node {
  position: absolute; left: 0; top: 0; z-index: 1; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--ds-accent); background: var(--ds-bg-base); font-family: var(--hl-serif); font-size: 0.9rem; color: var(--ds-accent);
}
.step::before { content: ""; position: absolute; left: 1.375rem; top: 2.75rem; bottom: -2rem; width: 1px; background: var(--hl-border-strong); }
.step:last-child::before { display: none; }
.step h3 { margin: 0.1rem 0 0.35rem; font-size: 1rem; font-weight: 600; }
.step p { font-size: 0.875rem; line-height: 1.6; color: var(--ds-text-secondary); }
@media (min-width: 1024px) {
  .flow { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
  .step { padding-left: 0; padding-top: 4rem; }
  .step::before { left: 2.75rem; right: -1.5rem; top: 1.375rem; bottom: auto; width: auto; height: 1px; }
  .step:last-child::before { display: none; }
}

/* who it's for: small drawings */
.ex-grid { margin-top: 0; }
.ex .art { display: flex; align-items: center; justify-content: center; gap: 0.75rem; height: 8rem; margin-bottom: 1.25rem; padding: 1rem; border: 1px solid var(--hl-border); background: var(--ds-bg-surface); overflow: hidden; }
.ex .art:has(.mini) { flex-direction: column; align-items: stretch; justify-content: center; gap: 0.5rem; }
.mini { max-width: 80%; padding: 0.4rem 0.65rem; border: 1px solid var(--hl-border); font-size: 0.75rem; }
.mini.in { align-self: flex-start; background: var(--ds-bg-base); color: var(--ds-text-secondary); }
.mini.out { align-self: flex-end; background: var(--ds-accent); border-color: var(--ds-accent); color: var(--ds-on-accent); }
.note, .doc { display: flex; flex-direction: column; justify-content: center; gap: 0.4rem; width: 4.5rem; height: 5.5rem; padding: 0.6rem; border: 1px solid var(--hl-border-strong); background: var(--ds-bg-base); }
.doc { border-color: var(--ds-accent); }
.doc b { font-family: var(--hl-serif); font-size: 0.65rem; font-weight: 600; color: var(--ds-accent); }
.note i, .doc i { display: block; height: 4px; background: var(--hl-border-strong); }
.note i.short, .doc i.short { width: 60%; }
.ex .arrow { color: var(--ds-accent); font-size: 1.1rem; }
.cal { display: grid; grid-template-columns: repeat(7, 1.1rem); gap: 3px; }
.cal span { height: 1.1rem; border: 1px solid var(--hl-border); }
.cal span.on { background: var(--ds-accent); border-color: var(--ds-accent); }
.ex .art:has(.cal) { flex-direction: column; gap: 0.6rem; }
.bell { display: flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: var(--ds-text-secondary); }
.bell .ico { width: 1rem; height: 1rem; }

/* scroll reveal (JS adds .reveal, so nothing is hidden without JS) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .chat.anim .msg { opacity: 1; transform: none; transition: none; }
  .typing i { animation: none; }
}

/* link cards: blog posts and "From Ail" */
.link-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.link-card .kind { margin-bottom: 0.9rem; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ds-text-muted); }
.link-card p { flex: 1; }
.link-card .go { margin-top: 1.1rem; font-size: 0.8rem; font-weight: 600; color: var(--ds-accent); }
.link-card:hover .go, .link-card:focus-visible .go { color: var(--ds-accent-hover); }
.link-card:focus-visible { outline-offset: -2px; }
@media (min-width: 1024px) { .grid.four { grid-template-columns: repeat(4, 1fr); } }

/* dock + "Ask Sparky" chat box */
.dock { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; gap: 0.5rem; padding: 0.5rem 1rem; border-top: 1px solid var(--hl-border-strong); background: var(--ds-bg-base); }
.dock .btn { flex: 1; justify-content: center; text-align: center; padding: 0.7rem 1rem; font-size: 0.85rem; }
.dock .btn-line { background: var(--ds-bg-base); }
body { padding-bottom: 4rem; }
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .dock { left: auto; right: 1.25rem; bottom: 1.25rem; padding: 0; border: 0; background: transparent; }
  .dock .btn { flex: none; }
}
.chatbox { position: fixed; z-index: 21; left: 0.75rem; right: 0.75rem; bottom: 4rem; display: flex; flex-direction: column; max-height: min(34rem, calc(100vh - 6rem)); border: 1px solid var(--hl-border-strong); background: var(--ds-bg-surface); }
.chatbox[hidden] { display: none; }
@media (min-width: 768px) { .chatbox { left: auto; right: 1.25rem; bottom: 4.75rem; width: 22rem; } }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1rem; border-bottom: 1px solid var(--hl-border); }
.chat-head > span { display: flex; flex-direction: column; line-height: 1.25; font-size: 0.9rem; }
.chat-head small { font-size: 0.7rem; color: var(--ds-text-muted); }
.chat-close { width: 2rem; height: 2rem; border: 0; background: transparent; color: var(--ds-text-secondary); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.chat-close:hover { color: var(--ds-text-primary); }
.chat-log { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; min-height: 8rem; padding: 1rem; overflow-y: auto; }
.chat-log .msg { max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-log .typing { align-self: flex-start; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.75rem; }
.chat-chips[hidden] { display: none; }
.chat-chips button { padding: 0.35rem 0.6rem; border: 1px solid var(--hl-border-strong); background: transparent; color: var(--ds-text-secondary); font: inherit; font-size: 0.75rem; cursor: pointer; }
.chat-chips button:hover { border-color: var(--ds-accent); color: var(--ds-text-primary); }
.chat-form { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--hl-border); }
.chat-form input { flex: 1; min-width: 0; padding: 0.55rem 0.7rem; border: 1px solid var(--hl-border-strong); background: var(--ds-bg-base); color: var(--ds-text-primary); font: inherit; font-size: 0.85rem; }
.chat-form .btn { padding: 0.55rem 0.9rem; font-size: 0.8rem; }
.chat-note { padding: 0 1rem 0.75rem; font-size: 0.68rem; line-height: 1.45; color: var(--ds-text-muted); }
.chat-note a { color: var(--ds-accent); }
@media (min-width: 768px) { .site-footer { padding-bottom: 5.5rem; } }

/* self-serve steps */
.steps-grid { margin-bottom: 1.75rem; }

/* live assistant demo: a sample site with the real chat inside */
.demo { margin-bottom: 1rem; border: 1px solid var(--hl-border-strong); background: var(--ds-bg-surface); }
.demo-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--hl-border); font-size: 0.75rem; color: var(--ds-text-muted); }
.demo-bar span { width: 8px; height: 8px; border: 1px solid var(--hl-border-strong); }
.demo-bar b { margin-left: 0.6rem; font-weight: 500; color: var(--ds-text-secondary); }
.demo-bar em { margin-left: auto; font-style: normal; color: var(--ds-accent); }
.demo-body { display: grid; min-height: 30rem; }
.demo-site { display: none; padding: 2rem; }
.demo-logo { margin-bottom: 2.5rem; font-family: var(--hl-serif); font-weight: 600; color: var(--ds-text-primary); }
.demo-site h4 { margin-bottom: 1rem; font-family: var(--hl-serif); font-size: 1.5rem; font-weight: 600; }
.demo-site i { display: block; height: 6px; margin-bottom: 0.6rem; background: var(--hl-border-strong); }
.demo-site i.short { width: 55%; }
.demo-btn { display: inline-block; margin-top: 1.25rem; padding: 0.6rem 1rem; border: 1px solid var(--ds-accent); font-size: 0.8rem; color: var(--ds-accent); }
.demo-chat { display: flex; justify-content: center; padding: 0; }
.demo-chat iframe { width: 100%; height: 30rem; border: 0; background: #030712; }
@media (min-width: 768px) {
  .demo-body { grid-template-columns: 1fr 22rem; }
  .demo-site { display: block; }
  .demo-chat { padding: 1.25rem; align-items: stretch; border-left: 1px solid var(--hl-border); }
  .demo-chat iframe { height: 100%; min-height: 27.5rem; border: 1px solid var(--hl-border-strong); }
}
.demo-note { margin-bottom: 1.5rem; font-size: 0.8rem; color: var(--ds-text-muted); }
.snippet { margin-bottom: 1.75rem; }
.snippet-row { display: flex; gap: 0.5rem; align-items: stretch; margin-top: 0.6rem; }
.snippet-row code { flex: 1; min-width: 0; padding: 0.7rem 0.9rem; border: 1px solid var(--hl-border-strong); background: var(--ds-bg-surface); font-size: 0.75rem; color: var(--ds-text-secondary); overflow-wrap: anywhere; }
.snippet-row .btn { padding: 0.5rem 1rem; }

/* the two parts of the page */
.part-head { padding: 4rem 0 0.5rem; border-top: 1px solid var(--hl-border-strong); }
.part-no { margin-bottom: 0.6rem; font-family: var(--hl-serif); font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ds-accent); }
.part-head h2 { margin-bottom: 0.9rem; font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.12; }
.part-head .section-lead { margin-bottom: 0; }
#for-you { border-top: 0; padding-top: 3.5rem; }
.hero-alt { margin-top: 1rem; font-size: 0.85rem; color: var(--ds-text-muted); }
.hero-alt a { color: var(--ds-accent); text-decoration: none; }
.hero-alt a:hover { color: var(--ds-accent-hover); text-decoration: underline; }
.ways-note { margin-top: 1rem; font-size: 0.8rem; color: var(--ds-text-muted); }
.ways-note + .ways-note { margin-top: 0.4rem; }
.link-card a.go { align-self: flex-start; text-decoration: none; }
.link-card a.go:hover { text-decoration: underline; }

/* the highlighted tagline under the hero heading */
.tagline { display: inline-block; margin: 0 0 1.5rem; padding: 0.55rem 1rem; border: 1px solid var(--ds-accent); background: color-mix(in srgb, var(--ds-accent) 12%, transparent); font-family: var(--hl-serif); font-size: clamp(1.05rem, 2.2vw, 1.35rem); font-weight: 600; line-height: 1.35; color: var(--ds-text-primary); }
.tagline em { font-style: normal; color: var(--ds-accent); }

/* iOS Safari zooms the page when a field under 16px is focused, so fields stay at 16px on small screens */
@media (max-width: 768px) {
  input[type="text"], input:not([type]), input[type="tel"], input[type="email"], select, textarea, .chat-form input { font-size: 16px; }
}

/* header: log in to the self-serve area */
.login-link { padding: 0.5rem 0.25rem; font-size: 0.875rem; font-weight: 500; color: var(--ds-text-secondary); text-decoration: none; white-space: nowrap; }
.login-link:hover { color: var(--ds-text-primary); text-decoration: underline; }
@media (max-width: 480px) {
  .nav .bar { gap: 0.75rem; }
  .nav-actions { gap: 0.4rem; }
  .nav-actions .btn { padding: 0.6rem 0.85rem; }
}
#ways > .index { margin-bottom: 1.25rem; }
