/* ========================================================================
   Build With Abdallah — Central API
   Public site design system.

   Tokens mirror the main site (buildwithabdallah.com) so both properties read
   as one brand. Authored by hand rather than compiled through Tailwind/Vite:
   this app serves its public face with no node build step, which keeps deploys
   to `composer install` + `artisan migrate`.

   Inherited house rules (same as the main site):
     - no blurred floating blobs, no spinning conic borders, no "light show"
     - depth comes from layered shadows, not glow rings
     - caps tracking stays near .12em
     - motion explains the architecture; it never just decorates
   ======================================================================== */

/* ========================================================================
   1. Tokens — :root is light, html.dark overrides
   ======================================================================== */
:root {
    --bg: #eaf0f9;
    --surface: #ffffff;
    --panel: #f4f7fc;
    --elev: #e3ebf7;
    --line: #cbd8ea;
    --line-h: #a9bfdb;

    --ink: #0a1525;
    --ink2: #16213a;
    --dim: #45566f;
    --mute: #61718a;
    --faint: #8496ad;

    --ok: #047857;
    --ok-bg: rgba(4, 120, 87, .1);
    --ok-line: rgba(4, 120, 87, .28);
    --warn: #b45309;
    --crit: #c62828;

    --code-bg: #eef3fb;
    --code-line: #c3d2e6;
    --code-ink: #16213a;
    --tok-kw: #0044cc;
    --tok-fn: #0a1525;
    --tok-str: #047857;
    --tok-num: #a21caf;
    --tok-com: #64748b;
    --tok-pun: #45566f;
    --tok-var: #b45309;

    --shadow-card: 0 1px 2px rgba(16, 33, 58, .06), 0 12px 28px -18px rgba(16, 33, 58, .28);
    --shadow-pop: 0 24px 60px -24px rgba(16, 33, 58, .38), 0 0 0 1px rgba(16, 33, 58, .06);
    --shadow-glow: 0 2px 4px -2px rgba(0, 92, 255, .28), 0 10px 24px -10px rgba(0, 92, 255, .45);
    --wash: radial-gradient(62% 46% at 50% 0%, rgba(0, 92, 255, .11), transparent 72%);
    --grid-line: rgba(16, 33, 58, .055);

    /* Brand — identical in both themes */
    --brand-50: #eef3ff;
    --brand-100: #dbe5ff;
    --brand-300: #7099ff;
    --brand-400: #3d7fff;
    --brand-500: #005cff;
    --brand-600: #0044cc;
    --brand-700: #01204f;
    --brand-ink: #ffffff;

    /* Brand tint that has to sit on the page background */
    --brand-soft: rgba(0, 92, 255, .09);
    --brand-soft-line: rgba(0, 92, 255, .22);
    --brand-read: var(--brand-600);

    --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Manrope', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

    --radius-xs: 3px;
    --radius-sm: 5px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shell: 1240px;
    --gutter: 24px;
}

html.dark {
    --bg: #09090b;
    --surface: #0e0e10;
    --panel: #161618;
    --elev: #1c1c20;
    --line: #26262b;
    --line-h: #3a3a42;

    --ink: #fafafa;
    --ink2: #d4d4d8;
    --dim: #a1a1aa;
    --mute: #71717a;
    --faint: #52525b;

    --ok: #34d399;
    --ok-bg: rgba(52, 211, 153, .1);
    --ok-line: rgba(52, 211, 153, .26);
    --warn: #fbbf24;
    --crit: #f87171;

    --code-bg: #0b0b0d;
    --code-line: #26262b;
    --code-ink: #d4d4d8;
    --tok-kw: #69a0ff;
    --tok-fn: #fafafa;
    --tok-str: #86efac;
    --tok-num: #f0abfc;
    --tok-com: #71717a;
    --tok-pun: #a1a1aa;
    --tok-var: #fcd34d;

    --shadow-card: 0 1px 0 0 rgba(255, 255, 255, .04) inset, 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -16px rgba(0, 0, 0, .7);
    --shadow-pop: 0 24px 60px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
    --shadow-glow: 0 2px 4px -2px rgba(0, 0, 0, .4), 0 10px 24px -8px rgba(0, 92, 255, .35);
    --wash: radial-gradient(62% 46% at 50% 0%, rgba(0, 92, 255, .10), transparent 72%);
    --grid-line: rgba(255, 255, 255, .035);

    --brand-soft: rgba(0, 92, 255, .15);
    --brand-soft-line: rgba(0, 92, 255, .32);
    --brand-read: var(--brand-300);
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--ink);
    font: 400 16px/1.65 var(--font-sans);
    overflow-x: hidden;
}

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

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; }
code, kbd, pre, samp { font-family: var(--font-mono); }

::selection { background: rgba(0, 92, 255, .45); color: #fff; }

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

html.dark ::-webkit-scrollbar { width: 10px; height: 10px; }
html.dark ::-webkit-scrollbar-track { background: #09090b; }
html.dark ::-webkit-scrollbar-thumb { background: #27272a; border-radius: 5px; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #3a3a42; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 100;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: var(--brand-500);
    color: var(--brand-ink);
    font-weight: 600;
}
.skip-link:focus { left: 12px; }

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

/* ========================================================================
   3. Layout primitives
   ======================================================================== */
.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section { padding: 104px 0; position: relative; }
.section--tight { padding: 72px 0; }
.section--line { border-top: 1px solid var(--line); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .625rem;
    margin-bottom: 20px;
    font: 500 11px/1 var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--brand-read);
}
.eyebrow::before {
    content: "";
    width: 1.5rem;
    height: 1px;
    background: currentColor;
    opacity: .6;
}

.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 46px); }
.section-head p {
    margin-top: 18px;
    color: var(--dim);
    font-size: 17px;
    max-width: 660px;
}

.lede { color: var(--dim); font-size: 18px; }

/* Static brand wash — one calm gradient for depth, not a light show. */
.wash { position: relative; isolation: isolate; }
.wash::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--wash);
}

.grid-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

/* Static, top-weighted brand edge. Replaces the spinning conic border. */
.gradient-border { position: relative; isolation: isolate; }
.gradient-border::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(160deg, rgba(0, 92, 255, .55), rgba(0, 92, 255, .08) 45%, var(--line));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ========================================================================
   4. Buttons, pills, links
   ======================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink2);
    font: 600 15px/1 var(--font-sans);
    cursor: pointer;
    transition: color .15s, background-color .15s, border-color .15s, transform .15s;
}
.btn:hover { color: var(--ink); border-color: var(--line-h); background: var(--elev); }
.btn svg { flex: none; }

.btn--primary {
    border-color: transparent;
    background: var(--brand-500);
    color: var(--brand-ink);
    box-shadow: var(--shadow-glow);
}
.btn--primary:hover { background: var(--brand-400); color: var(--brand-ink); border-color: transparent; }

.btn--ghost { background: transparent; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 13px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font: 500 12px/1 var(--font-mono);
    letter-spacing: .04em;
    color: var(--dim);
}
.pill--brand {
    border-color: var(--brand-soft-line);
    background: var(--brand-soft);
    color: var(--brand-read);
}
.pill--ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}
.dot--live { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
    50%      { opacity: .65; box-shadow: 0 0 0 4px transparent; }
}

.ul-link {
    color: var(--brand-read);
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 1px;
    transition: background-size .3s;
}
.ul-link:hover { background-size: 0 1px; background-position: 100% 100%; }

.mono { font-family: var(--font-mono); font-size: .875em; }
.hl { color: var(--brand-read); }

/* Inline code.
   Deliberately NOT nowrap: tokens like CUSTOMER_SERVICE_WINDOW_EXPIRED and
   AuthenticateConnectedApplication run past a 320px viewport, and the
   overflow-x guard on body would clip them rather than let them wrap.
   `anywhere` only breaks when the token genuinely cannot fit. */
.ic {
    padding: .15em .4em;
    border: 1px solid var(--code-line);
    border-radius: var(--radius-xs);
    background: var(--code-bg);
    color: var(--code-ink);
    font-size: .84em;
    overflow-wrap: anywhere;
}

/* ========================================================================
   5. Header / navigation
   ======================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 76px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--line);
    transition: box-shadow .2s;
}
.brand:hover img { box-shadow: 0 0 0 1px var(--brand-soft-line); }
.brand-name {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--ink);
}
.brand-sub {
    display: block;
    margin-top: 4px;
    font: 500 10px/1 var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--mute);
}

.nav-links { display: none; align-items: center; gap: 2px; }
.nav-link {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--dim);
    font-size: 15px;
    font-weight: 500;
    transition: color .15s, background-color .15s;
}
.nav-link:hover { color: var(--ink); background: var(--elev); }
.nav-link[aria-current="page"] { color: var(--ink); background: var(--elev); }

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

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink2);
    cursor: pointer;
    transition: color .15s, border-color .15s, background-color .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-h); background: var(--elev); }
.icon-btn svg { width: 20px; height: 20px; }

/* Theme toggle icon swap, driven off html[data-theme] */
[data-theme-toggle] .ti { display: none; }
html[data-theme="auto"]  [data-theme-toggle] .ti-auto  { display: block; }
html[data-theme="light"] [data-theme-toggle] .ti-light { display: block; }
html[data-theme="dark"]  [data-theme-toggle] .ti-dark  { display: block; }
html:not([data-theme]) [data-theme-toggle] .ti-auto { display: block; }

.nav-cta { display: none; }
.nav-toggle { display: inline-flex; }

.mobile-menu {
    display: none;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.mobile-menu.open { display: block; }
.mobile-menu .shell { padding-block: 14px; }
.mobile-menu a {
    display: block;
    padding: 13px 12px;
    border-radius: var(--radius-sm);
    color: var(--dim);
    font-size: 16px;
    font-weight: 500;
}
.mobile-menu a:hover { color: var(--ink); background: var(--elev); }
.mobile-menu a[aria-current="page"] { color: var(--ink); background: var(--elev); }

@media (min-width: 1024px) {
    .nav-links { display: flex; }
    .nav-cta { display: inline-flex; }
    .nav-toggle { display: none; }
    .mobile-menu { display: none !important; }
}

/* ========================================================================
   6. Hero
   ======================================================================== */
.hero { padding: 84px 0 96px; }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    align-items: center;
}
.hero h1 {
    font-size: clamp(40px, 6.4vw, 68px);
    letter-spacing: -.045em;
}
.hero .lede { margin-top: 24px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

@media (min-width: 1024px) {
    .hero-grid { grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 72px; }
}

/* ========================================================================
   7. Flow diagram — the animated pipeline
      Nodes light in sequence and a pulse travels each connector, tracing the
      real request path. Everything here is disabled under reduced motion.
   ======================================================================== */
.flow {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
}

.flow-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
    font: 500 11px/1 var(--font-mono);
    color: var(--mute);
}
.flow-lights { display: flex; gap: 6px; }
.flow-lights i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-h); }
.flow-lights i:nth-child(2) { background: var(--brand-700); }
.flow-lights i:nth-child(3) { background: var(--brand-500); }

.node {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    transition: border-color .4s, background-color .4s;
}
.node-icon {
    flex: none;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand-read);
    font: 600 11px/1 var(--font-mono);
    letter-spacing: .02em;
}
/* Scoped to .node-body: a bare `.node span` would outrank .node-icon and
   flatten the badge. */
.node-body { flex: 1; min-width: 0; }
.node-body strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
}
.node-body span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }

/* Connector with a travelling pulse */
.wire {
    position: relative;
    height: 30px;
    margin-left: 32px;
    border-left: 1px dashed var(--line-h);
}
.wire::after {
    content: "";
    position: absolute;
    left: -3px;
    top: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-soft);
    opacity: 0;
}
.wire--split {
    margin-left: 0;
    height: 24px;
    border-left: 0;
    background:
        linear-gradient(var(--line-h), var(--line-h)) no-repeat 32px 0 / 1px 12px,
        linear-gradient(var(--line-h), var(--line-h)) no-repeat 25% 12px / 50% 1px,
        linear-gradient(var(--line-h), var(--line-h)) no-repeat 25% 12px / 1px 12px,
        linear-gradient(var(--line-h), var(--line-h)) no-repeat 75% 12px / 1px 12px;
}
/* The branching connector has no single path for a pulse to walk. */
.wire--split::after { content: none; }

.flow-note {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font: 500 11px/1.5 var(--font-mono);
    color: var(--mute);
}

/* Sequenced animation. Runs once the diagram scrolls into view (.flow.live). */
.flow.live .node { animation: nodeIn .6s ease both; }
.flow.live .wire::after { animation: pulseDown 2.6s cubic-bezier(.4, 0, .2, 1) infinite; }

/* Kept under ~1.3s end to end. The nodes hold their `from` state (opacity 0)
   until their delay elapses, so a long stagger means visibly missing content
   on a phone where the whole diagram is on screen at once. */
.flow.live .node[data-step="1"] { animation-delay: .05s; }
.flow.live .node[data-step="2"] { animation-delay: .20s; }
.flow.live .node[data-step="3"] { animation-delay: .35s; }
.flow.live .node[data-step="4"] { animation-delay: .50s; }
.flow.live .node[data-step="5"] { animation-delay: .55s; }
.flow.live .node[data-step="6"] { animation-delay: .70s; }

.flow.live .wire[data-step="1"]::after { animation-delay: .18s; }
.flow.live .wire[data-step="2"]::after { animation-delay: .33s; }
.flow.live .wire[data-step="3"]::after { animation-delay: .48s; }
.flow.live .wire[data-step="4"]::after { animation-delay: .63s; }

@keyframes nodeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
@keyframes pulseDown {
    0%        { opacity: 0; transform: translateY(0); }
    12%       { opacity: 1; }
    88%       { opacity: 1; }
    100%      { opacity: 0; transform: translateY(28px); }
}

/* ========================================================================
   8. Stats band
   ======================================================================== */
.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--line);
    overflow: hidden;
}
.stat { padding: 28px 22px; background: var(--surface); }
.stat b {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.stat b i { font-style: normal; color: var(--brand-read); }
.stat span {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--mute);
}

/* Below 640px a two-column band gives each label ~110px, which wraps these
   sentences to six lines. One column with the figure set beside its label
   reads far better and is shorter overall. */
@media (max-width: 639px) {
    .stats { grid-template-columns: minmax(0, 1fr); }
    .stat {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 18px;
        align-items: center;
        padding: 18px 20px;
    }
    .stat b { font-size: 30px; }
    .stat span { margin-top: 0; }
}

@media (min-width: 720px)  { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ========================================================================
   9. Cards
   ======================================================================== */
.cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}
@media (min-width: 640px)  { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
    display: flex;
    flex-direction: column;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    transition: transform .2s cubic-bezier(.2, .7, .3, 1), border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-h); }
.card-tag {
    font: 500 11px/1 var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--brand-read);
}
.card h3 { margin: 22px 0 10px; font-size: 18px; }
.card p { color: var(--dim); font-size: 14.5px; }
.card ul { margin-top: 16px; list-style: none; }
.card li {
    padding-left: 18px;
    position: relative;
    font: 500 12px/1.9 var(--font-mono);
    color: var(--mute);
}
.card li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .82em;
    width: 8px;
    height: 1px;
    background: var(--brand-400);
}

/* ========================================================================
   10. Boundary / step lists
   ======================================================================== */
.steps { display: grid; gap: 14px; }
.step {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-left: 2px solid var(--brand-500);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--panel);
}
.step-num {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-read);
    font: 600 12px/1 var(--font-mono);
}
.step strong { display: block; margin-bottom: 8px; font-size: 16px; color: var(--ink); }
.step p { color: var(--dim); font-size: 14.5px; }
.step .meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Two-column split (copy + panel) */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
@media (min-width: 1024px) {
    .split { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 64px; }
    .split--sticky > :first-child { position: sticky; top: 108px; }
}

/* ========================================================================
   11. Tables
   ======================================================================== */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
/* min-width keeps columns readable and lets .table-wrap scroll horizontally,
   instead of squeezing a three-column table into 272px of phone. */
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
thead th {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    text-align: left;
    font: 500 11px/1 var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--mute);
    white-space: nowrap;
}
tbody td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    color: var(--dim);
    vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { color: var(--ink2); font-weight: 500; }
tbody td .ic { white-space: nowrap; }

/* ========================================================================
   12. Code blocks
   ======================================================================== */
.code-block {
    border: 1px solid var(--code-line);
    border-radius: var(--radius-md);
    background: var(--code-bg);
    overflow: hidden;
}
.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--code-line);
}
.code-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.code-tab {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--mute);
    font: 500 12px/1 var(--font-mono);
    cursor: pointer;
    transition: color .15s, background-color .15s;
}
.code-tab:hover { color: var(--ink2); }
.code-tab[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-read); }

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--code-line);
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--mute);
    font: 500 11px/1 var(--font-mono);
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.copy-btn:hover { color: var(--ink2); border-color: var(--line-h); }
.copy-btn[data-copied="true"] { color: var(--ok); border-color: var(--ok-line); }
.copy-btn svg { width: 13px; height: 13px; }

pre.code {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    font: 13px/1.7 var(--font-mono);
    color: var(--code-ink);
    tab-size: 2;
}
pre.code[hidden] { display: none; }

.tok-kw  { color: var(--tok-kw); }
.tok-fn  { color: var(--tok-fn); font-weight: 500; }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-pun { color: var(--tok-pun); }
.tok-var { color: var(--tok-var); }

/* ========================================================================
   13. Docs layout
   ======================================================================== */
.docs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    /* padding-block, not the shorthand: this element also carries .shell, and
       `padding: x 0 y` would zero out the horizontal gutter, pinning the docs
       to the viewport edge on a phone. */
    padding-block: 56px 104px;
    align-items: start;
}
@media (min-width: 1024px) {
    .docs { grid-template-columns: 232px minmax(0, 1fr); gap: 56px; }
}

/* Mobile: a single-row chip rail that scrolls horizontally, so the table of
   contents survives on a phone instead of disappearing. Not sticky — body has
   an overflow-x guard, and sticky inside a scroll container is unreliable.
   Desktop (>=1024px): the vertical rail in the left column. */
.docs-nav {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.docs-nav::-webkit-scrollbar { display: none; }
.docs-nav h2 { display: none; }
.docs-nav ul {
    display: flex;
    gap: 6px;
    width: max-content;
    list-style: none;
}
.docs-nav a {
    display: block;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--mute);
    font-size: 13px;
    white-space: nowrap;
    transition: color .15s, border-color .15s, background-color .15s;
}
.docs-nav a:hover { color: var(--ink2); border-color: var(--line-h); }
.docs-nav a.active {
    color: var(--brand-read);
    border-color: var(--brand-soft-line);
    background: var(--brand-soft);
    font-weight: 600;
}

@media (min-width: 1024px) {
    .docs-nav {
        position: sticky;
        top: 108px;
        max-height: calc(100vh - 140px);
        overflow-x: visible;
        overflow-y: auto;
    }
    .docs-nav h2 {
        display: block;
        margin-bottom: 14px;
        font: 500 11px/1 var(--font-mono);
        text-transform: uppercase;
        letter-spacing: .12em;
        color: var(--mute);
    }
    .docs-nav ul { display: block; width: auto; }
    .docs-nav a {
        padding: 7px 12px;
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0;
        font-size: 13.5px;
        white-space: normal;
    }
    .docs-nav a:hover { border-left-color: var(--line-h); }
    .docs-nav a.active {
        background: none;
        border-left-color: var(--brand-500);
    }
    .docs-nav .sub { padding-left: 26px; font-size: 13px; }
}

.docs-body { min-width: 0; max-width: 820px; }
.docs-section { padding-bottom: 64px; }
.docs-section > h2 {
    font-size: clamp(26px, 3vw, 34px);
    scroll-margin-top: 100px;
}
.docs-section > h3 {
    margin-top: 40px;
    font-size: 19px;
    scroll-margin-top: 100px;
}
.docs-section p { margin-top: 16px; color: var(--dim); font-size: 15.5px; }
.docs-section > .code-block,
.docs-section > .table-wrap,
.docs-section > .callout { margin-top: 24px; }
.docs-section ul.bullets { margin-top: 16px; padding-left: 20px; list-style: disc; }
.docs-section ul.bullets li { margin-top: 8px; color: var(--dim); font-size: 15.5px; }

.callout {
    padding: 18px 20px;
    border: 1px solid var(--brand-soft-line);
    border-left-width: 2px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--brand-soft);
}
.callout p { margin: 0; color: var(--ink2); font-size: 14.5px; }
.callout strong { color: var(--ink); }

/* Endpoint header */
.endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    scroll-margin-top: 100px;
}
.verb {
    padding: 5px 9px;
    border-radius: var(--radius-xs);
    font: 600 11px/1 var(--font-mono);
    letter-spacing: .06em;
}
.verb--post { background: var(--brand-soft); color: var(--brand-read); }
.verb--get  { background: var(--ok-bg); color: var(--ok); }
.endpoint code {
    font-size: 13.5px;
    color: var(--ink);
    word-break: break-all;
}
.endpoint .pill { margin-left: auto; }

/* ========================================================================
   14. Status panel
   ======================================================================== */
.status-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}
@media (min-width: 720px) {
    .status-panel { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 32px; }
}
.status-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    font: 500 12px/1 var(--font-mono);
    color: var(--dim);
}
.check[data-state="ok"]     { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.check[data-state="failed"] { border-color: color-mix(in srgb, var(--crit) 40%, transparent); color: var(--crit); }

/* ========================================================================
   15. CTA band
   ======================================================================== */
.cta {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-card);
}
.cta h2 { font-size: clamp(24px, 2.8vw, 32px); }
.cta p { margin-top: 12px; color: var(--dim); max-width: 560px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 900px) {
    .cta { flex-direction: row; align-items: center; justify-content: space-between; gap: 40px; }
    .cta-actions { flex: none; }
}

/* ========================================================================
   16. Footer
   ======================================================================== */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 56px 0 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
}
@media (min-width: 780px) {
    .footer-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
}
.footer-grid h3 {
    margin-bottom: 16px;
    font: 500 11px/1 var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--mute);
}
.footer-grid ul { list-style: none; display: grid; gap: 10px; }
.footer-grid li a { color: var(--dim); font-size: 14.5px; transition: color .15s; }
.footer-grid li a:hover { color: var(--ink); }
.footer-blurb { margin-top: 16px; max-width: 380px; color: var(--mute); font-size: 14px; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    margin-top: 44px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    color: var(--faint);
    font: 500 12px/1.6 var(--font-mono);
}

/* ========================================================================
   17. Small screens

   The layout above is mobile-first, so these rules only tighten spacing and
   resolve the two places that genuinely run out of room on a narrow phone:
   the nav lockup (brand + two icon buttons on 320px) and the side-by-side
   provider nodes in the hero pipeline.
   ======================================================================== */
@media (max-width: 760px) {
    html { scroll-padding-top: 84px; }

    .section { padding: 68px 0; }
    .section--tight { padding: 52px 0; }
    .section-head { margin-bottom: 36px; }
    .hero { padding: 52px 0 64px; }
    .hero-grid { gap: 40px; }
    .split { gap: 34px; }
    .card { padding: 22px; }
    .step { padding: 18px; gap: 14px; grid-template-columns: 34px minmax(0, 1fr); }
    .cta { padding: 30px; }
    .site-footer { padding: 44px 0 32px; }
    .docs { padding-block: 32px 72px; gap: 28px; }
    .docs-section { padding-bottom: 48px; }

}

/* Any touch device, regardless of width — a tablet at 1024px still has
   fingers. Sized to the 44px comfortable-target guidance. */
@media (pointer: coarse) {
    .copy-btn, .code-tab { min-height: 44px; padding-inline: 16px; }
    .docs-nav a { padding-block: 11px; }
    .nav-link { padding-block: 12px; }
}

@media (max-width: 460px) {
    :root { --gutter: 16px; }

    /* Brand lockup plus theme toggle and menu button have to fit 320px. */
    .nav { height: 66px; }
    .brand { gap: 10px; }
    .brand img { width: 36px; height: 36px; }
    .brand-name { font-size: 14px; }
    .brand-sub { font-size: 9px; letter-spacing: .12em; }
    .icon-btn { padding: 8px; }
    .icon-btn svg { width: 18px; height: 18px; }

    .hero h1 { font-size: clamp(31px, 8.6vw, 40px); }

    /* Two nodes abreast leave roughly 60px of label at this width. */
    .node-pair { grid-template-columns: minmax(0, 1fr); }

    /* With the providers stacked there is nothing to branch to, so the
       T-connector reverts to a straight run and gets its pulse back. */
    .wire--split {
        height: 30px;
        margin-left: 32px;
        border-left: 1px dashed var(--line-h);
        background: none;
    }
    .wire--split::after { content: ""; }
    .flow { padding: 14px; }

    .stat { padding: 22px 16px; }

    /* Full-width stacked actions beat two cramped buttons on one row. */
    .hero-actions, .cta-actions { width: 100%; }
    .hero-actions .btn, .cta-actions .btn { width: 100%; }

    pre.code { padding: 14px 16px; font-size: 12.5px; }
    .endpoint { padding: 10px 12px; gap: 8px; }
    .endpoint .pill { margin-left: 0; }
}

/* ========================================================================
   18. Motion
   ======================================================================== */
.reveal { opacity: 1; transform: none; }
.reveal.in { animation: revealUp .8s cubic-bezier(.2, .7, .3, 1) both; }
.reveal[data-delay="1"].in { animation-delay: .06s; }
.reveal[data-delay="2"].in { animation-delay: .12s; }
.reveal[data-delay="3"].in { animation-delay: .18s; }
.reveal[data-delay="4"].in { animation-delay: .24s; }
.reveal[data-delay="5"].in { animation-delay: .30s; }
.reveal[data-delay="6"].in { animation-delay: .36s; }

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal.in { animation: none; }
    .flow.live .node,
    .flow.live .wire::after { animation: none; }
    .flow.live .wire::after { opacity: .9; }
    .dot--live { animation: none; }
    .card:hover { transform: none; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ========================================================================
   19. Print — the pages double as a portfolio artefact, so make them print
   ======================================================================== */
@media print {
    .site-header, .site-footer, .nav-actions, .docs-nav, .cta, .copy-btn { display: none !important; }
    body { background: #fff; color: #000; }
    .card, .step, .flow, .status-panel { box-shadow: none; break-inside: avoid; }
    .section { padding: 24px 0; }
}
