/* ==========================================================================
   Content components — callouts, code, tables, cards, tabs, flows.
   The page shell (header, sidebars, layout) lives in shell.css.
   ========================================================================== */

:root {
    --sidebar-width: 280px;
    --max-content: 940px;
    --radius: 14px;
    --radius-sm: 9px;
    --radius-lg: 18px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 0.18s var(--ease);
    --t-base: 0.3s var(--ease);
}

/* ---------- Themes ---------- */

body.dark {
    --bg: #08090a;
    --bg-elevated: #0e0f11;
    --sidebar-bg: #0a0b0c;
    --card-bg: #101214;
    --card-bg-hover: #16181b;
    --text: #f4f5f5;
    --text-soft: #b4b8bd;
    --text-muted: #7c8188;
    --border: #1e2124;
    --border-strong: #2a2e33;
    --primary: #6366f1;
    --primary-soft: #a5b4fc;
    --primary-dim: rgba(99, 102, 241, 0.16);
    --accent: #38bdf8;
    --accent-dim: rgba(56, 189, 248, 0.12);
    --success: #34d399;
    --success-dim: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warning-dim: rgba(251, 191, 36, 0.12);
    --danger: #f87171;
    --danger-dim: rgba(248, 113, 113, 0.12);
    --code-bg: #0c0d0f;
    --code-text: #e4e5e7;
    --hover-bg: #141619;
    --selection: rgba(99, 102, 241, 0.34);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .5), 0 20px 48px rgba(0, 0, 0, .5);
    --glow: radial-gradient(60% 60% at 50% 0%, rgba(99, 102, 241, .22), transparent 70%);
}

body.light {
    --bg: #fcfcfd;
    --bg-elevated: #ffffff;
    --sidebar-bg: #f7f8f9;
    --card-bg: #ffffff;
    --card-bg-hover: #fafbfb;
    --text: #14171a;
    --text-soft: #454b4f;
    --text-muted: #71787e;
    --border: #e6e8ea;
    --border-strong: #d4d7d9;
    --primary: #4f46e5;
    --primary-soft: #4338ca;
    --primary-dim: rgba(79, 70, 229, 0.10);
    --accent: #0284c7;
    --accent-dim: rgba(2, 132, 199, 0.09);
    --success: #059669;
    --success-dim: rgba(5, 150, 105, 0.09);
    --warning: #b45309;
    --warning-dim: rgba(180, 83, 9, 0.09);
    --danger: #dc2626;
    --danger-dim: rgba(220, 38, 38, 0.08);
    --code-bg: #f6f7f8;
    --code-text: #18191b;
    --hover-bg: #f1f2f4;
    --selection: rgba(79, 70, 229, 0.18);
    --shadow: 0 1px 2px rgba(16, 20, 24, .04), 0 8px 24px rgba(16, 20, 24, .06);
    --shadow-lg: 0 2px 4px rgba(16, 20, 24, .05), 0 20px 48px rgba(16, 20, 24, .1);
    --glow: radial-gradient(60% 60% at 50% 0%, rgba(79, 70, 229, .1), transparent 70%);
}

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

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

::selection {
    background-color: var(--selection);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--t-base), color var(--t-base);
}

a {
    color: var(--primary-soft);
    text-decoration: none;
    transition: color var(--t-fast);
}

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

code {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875em;
}

p code,
li code,
td code,
h4 code,
summary code,
.lane code {
    background: var(--primary-dim);
    color: var(--primary-soft);
    padding: 0.14em 0.42em;
    border-radius: 5px;
    font-weight: 500;
    /* Long inline snippets must wrap. `nowrap` made them push the page sideways. */
    overflow-wrap: break-word;
    word-break: break-word;
}

strong {
    color: var(--text);
    font-weight: 650;
}

svg.lucide {
    width: 1em;
    height: 1em;
    stroke-width: 2;
    flex-shrink: 0;
}

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

.section {
    margin-bottom: 84px;
    scroll-margin-top: 90px;
    padding-top: 42px;
    border-top: 1px solid var(--border);
}

/* The section straight after the hero opens the page; a rule above it would
   read as a stray line rather than a divider. */
.hero+.section {
    padding-top: 0;
    border-top: none;
}

.section h2 {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 1.78rem;
    font-weight: 700;
    letter-spacing: -0.027em;
    margin-bottom: 10px;
    line-height: 1.28;
}

.section h2 svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.section h3 {
    font-size: 1.17rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    margin: 42px 0 12px;
}

.section h4 {
    font-size: 0.965rem;
    font-weight: 650;
    margin: 24px 0 8px;
}

.section p {
    color: var(--text-soft);
    margin-bottom: 15px;
    max-width: 74ch;
}

.section-intro {
    font-size: 1.02rem;
    color: var(--text-muted) !important;
    margin-bottom: 30px !important;
}

.section ul,
.section ol {
    color: var(--text-soft);
    margin: 0 0 18px 20px;
}

.section li {
    margin-bottom: 7px;
}

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

.hero {
    padding: 26px 0 62px;
    position: relative;
    scroll-margin-top: 90px;
}

/* Stays inside the hero: bleeding sideways pushed the whole document wider than
   the viewport, which showed up as a horizontal scrollbar on every page. */
.hero::before {
    content: '';
    position: absolute;
    inset: -120px 0 auto 0;
    height: 460px;
    background: var(--glow);
    pointer-events: none;
    z-index: -1;
}

.hero h1 {
    font-size: clamp(2.1rem, 5.2vw, 3.35rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.042em;
    margin-bottom: 22px;
}

.hero h1 .line {
    display: block;
    animation: riseIn 0.7s var(--ease-out) backwards;
}

.hero h1 .line:nth-child(2) {
    animation-delay: 0.1s;
}

.hero h1 .grad {
    background: linear-gradient(100deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    font-size: 1.1rem;
    color: var(--text-soft);
    max-width: 66ch;
    margin-bottom: 30px;
    animation: riseIn 0.7s 0.2s var(--ease-out) backwards;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-bottom: 32px;
    animation: riseIn 0.7s 0.3s var(--ease-out) backwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.895rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-dim);
}

.btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 7px 20px var(--primary-dim);
}

.btn-ghost {
    background: var(--card-bg);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--hover-bg);
    color: var(--text);
    transform: translateY(-1px);
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-size: 0.775rem;
    font-weight: 550;
    color: var(--text-soft);
    animation: riseIn 0.5s var(--ease-out) backwards;
    animation-delay: calc(0.42s + var(--b, 0) * 0.06s);
}

.badge svg {
    width: 13px;
    height: 13px;
}

.badge-accent {
    background: var(--primary-dim);
    border-color: transparent;
    color: var(--primary-soft);
}

.badge-green {
    background: var(--success-dim);
    border-color: transparent;
    color: var(--success);
}

/* ---------- Callouts ---------- */

.callout {
    display: flex;
    gap: 13px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    margin: 22px 0;
}

.callout>svg {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    color: var(--text-muted);
}

.callout p {
    margin: 0;
    font-size: 0.925rem;
}

.callout p+p {
    margin-top: 9px;
}

.callout-plain>svg {
    color: var(--accent);
}

.callout-tip {
    background: var(--success-dim);
    border-color: transparent;
}

.callout-tip>svg {
    color: var(--success);
}

.callout-warn {
    background: var(--warning-dim);
    border-color: transparent;
}

.callout-warn>svg {
    color: var(--warning);
}

.callout-danger {
    background: var(--danger-dim);
    border-color: transparent;
}

.callout-danger>svg {
    color: var(--danger);
}

/* ---------- Focus ---------- */

:where(a, button, [tabindex]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Code blocks ---------- */

.code-block {
    position: relative;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 18px 0;
    overflow: hidden;
}

.code-block::before {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 15px 7px;
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    pointer-events: none;
}

.code-block pre {
    padding: 42px 16px 16px;
    overflow-x: auto;
}

.code-block code {
    font-size: 0.83rem;
    line-height: 1.75;
    color: var(--code-text);
    white-space: pre;
}

.code-block pre::-webkit-scrollbar {
    height: 7px;
}

.code-block pre::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

.copy-btn {
    z-index: 2;
    position: absolute;
    top: 3px;
    right: 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: all var(--t-fast);
}

.copy-btn svg {
    width: 12px;
    height: 12px;
}

.code-block:hover .copy-btn,
.copy-btn:focus-visible {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
}

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

.table-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 20px 0;
    background: var(--card-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.878rem;
    min-width: 480px;
}

thead {
    background: var(--bg-elevated);
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-elevated);
    text-align: left;
    padding: 11px 15px;
    font-weight: 650;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 11px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    vertical-align: top;
}

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

tbody tr {
    transition: background-color var(--t-fast);
}

tbody tr:hover {
    background: var(--hover-bg);
}

.is-visible tbody tr {
    animation: fadeIn 0.4s var(--ease-out) backwards;
    animation-delay: calc(var(--r, 0) * 0.03s);
}

td.center,
th.center {
    text-align: center;
}

/* Measurements read as a column, not as prose. */
td.center {
    font-variant-numeric: tabular-nums;
}

.yes {
    color: var(--success);
    font-weight: 700;
}

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

.maybe {
    color: var(--warning);
    font-weight: 700;
}

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

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(238px, 100%), 1fr));
    gap: 14px;
    margin: 22px 0;
}

.card {
    position: relative;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    overflow: hidden;
    transition: all var(--t-base);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0), var(--primary-dim), transparent 62%);
    opacity: 0;
    transition: opacity var(--t-base);
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-strong);
    background: var(--card-bg-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
    .card:hover {
        transform: none;
    }
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--primary-dim);
    color: var(--primary-soft);
    font-size: 17px;
    margin-bottom: 13px;
}

.card h4 {
    margin: 0 0 6px;
    font-size: 0.965rem;
    font-weight: 650;
}

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

.card code {
    font-size: 0.8rem;
}

/* ---------- Gateway cards ---------- */

.gateway-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    margin-bottom: 13px;
    overflow: hidden;
    transition: all var(--t-base);
}

.gateway-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0), var(--primary-dim), transparent 60%);
    opacity: 0;
    transition: opacity var(--t-base);
    pointer-events: none;
}

.gateway-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.gateway-card:hover::before {
    opacity: 1;
}

.gateway-head {
    display: flex;
    align-items: center;
    gap: 11px;
}

.gateway-head h3 {
    margin: 0 !important;
    font-size: 1.05rem;
}

.gateway-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-dim);
    color: var(--primary-soft);
    font-size: 16px;
    flex-shrink: 0;
}

.gateway-card p {
    margin: 0;
    font-size: 0.89rem;
}

.gateway-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.chip svg {
    width: 12px;
    height: 12px;
}

.chip-ok {
    background: var(--success-dim);
    border-color: transparent;
    color: var(--success);
}

.chip-no {
    background: var(--danger-dim);
    border-color: transparent;
    color: var(--danger);
}

.chip-warn {
    background: var(--warning-dim);
    border-color: transparent;
    color: var(--warning);
}

/* ---------- Mode cards (single vs multi merchant) ---------- */

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(292px, 100%), 1fr));
    gap: 15px;
    margin: 24px 0;
}

.mode-card {
    position: relative;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    overflow: hidden;
    transition: all var(--t-base);
}

.mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0), var(--primary-dim), transparent 60%);
    opacity: 0;
    transition: opacity var(--t-base);
    pointer-events: none;
}

.mode-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.mode-card:hover::before {
    opacity: 1;
}

.mode-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-soft);
    margin-bottom: 9px;
}

.mode-card h3,
.mode-card h4 {
    margin: 0 0 8px !important;
    font-size: 1.1rem;
}

.mode-card p {
    font-size: 0.89rem;
}

/* ---------- Credential cascade ---------- */

.cascade {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 24px 0;
}

.tier {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    transition: all var(--t-base);
}

.tier.pulse {
    border-color: var(--primary);
    background: var(--primary-dim);
    transform: translateX(4px);
}

.tier-rank {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary-dim);
    color: var(--primary-soft);
    font-size: 0.8rem;
    font-weight: 800;
}

.tier-body h4 {
    margin: 0 0 3px !important;
    font-size: 0.935rem;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tier-body p {
    margin: 0;
    font-size: 0.865rem;
}

.tier-tag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
}

/* ---------- Flow diagram ---------- */

.flow {
    margin: 26px 0;
    overflow-x: auto;
    padding-bottom: 6px;
}

.flow-track {
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-width: 640px;
}

.flow-node {
    flex: 1;
    position: relative;
    padding: 0 12px;
    text-align: center;
}

.is-visible .flow-node {
    animation: riseIn 0.5s var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 0.09s);
}

.flow-node::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 26px);
    right: calc(-50% + 26px);
    height: 2px;
    background: linear-gradient(90deg, var(--border-strong), var(--border));
}

.flow-node:last-child::after {
    display: none;
}

.flow-dot {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: 0 auto 11px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    color: var(--primary-soft);
    font-size: 17px;
    position: relative;
    z-index: 1;
}

.flow-actor {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.flow-node h5 {
    font-size: 0.9rem;
    font-weight: 650;
    margin-bottom: 3px;
}

.flow-node p {
    font-size: 0.795rem;
    color: var(--text-muted);
    margin: 0 !important;
    max-width: none !important;
}

/* ---------- Steps ---------- */

.steps {
    list-style: none;
    counter-reset: step;
    margin: 22px 0 !important;
}

.steps>li {
    counter-increment: step;
    position: relative;
    padding-left: 40px;
    margin-bottom: 18px;
}

.is-visible .steps>li {
    animation: fadeIn 0.45s var(--ease-out) backwards;
    animation-delay: calc(var(--s, 0) * 0.08s);
}

.steps>li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--primary-dim);
    color: var(--primary-soft);
    font-size: 0.76rem;
    font-weight: 800;
}

.steps h4 {
    margin: 0 0 4px !important;
}

/* ---------- Tabs ---------- */

.tabs {
    margin: 22px 0;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    margin-bottom: 2px;
    width: fit-content;
    max-width: 100%;
}

.tab-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn[aria-selected="true"] {
    background: var(--card-bg);
    color: var(--primary-soft);
    box-shadow: var(--shadow);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
    animation: fadeIn 0.28s var(--ease-out);
}

/* ---------- Comparison lanes ---------- */

.lane {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    margin-bottom: 9px;
    font-size: 0.878rem;
    flex-wrap: wrap;
}

.lane-label {
    font-weight: 650;
    color: var(--text);
    min-width: 148px;
}

.lane-pipe {
    flex: 1;
    height: 2px;
    min-width: 40px;
    background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 12px);
}

.lane-end {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lane-end svg {
    width: 13px;
    height: 13px;
}

.lane-end.is-target {
    background: var(--success-dim);
    border-color: transparent;
    color: var(--success);
}

.lane-end.is-bad {
    background: var(--danger-dim);
    border-color: transparent;
    color: var(--danger);
}

/* ---------- Status pills ---------- */

.status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-family: 'Fira Code', monospace;
    font-size: 0.79rem;
    font-weight: 500;
    color: var(--text-soft);
    transition: all var(--t-fast);
}

.status-pill:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.status-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-pill.s-good .dot {
    background: var(--success);
}

.status-pill.s-move .dot {
    background: var(--accent);
}

.status-pill.s-wait .dot {
    background: var(--warning);
}

.status-pill.s-bad .dot {
    background: var(--danger);
}

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

details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    margin-bottom: 9px;
    overflow: hidden;
    transition: border-color var(--t-fast);
}

details:hover {
    border-color: var(--border-strong);
}

details[open] {
    background: var(--bg-elevated);
}

summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.925rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

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

summary::before {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    transform: rotate(-45deg);
    transition: transform var(--t-fast);
    flex-shrink: 0;
}

details[open] summary::before {
    transform: rotate(45deg);
}

.details-body {
    padding: 0 18px 16px 34px;
}

.details-body p {
    font-size: 0.9rem;
}

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

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(13px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0s !important;
        transition-duration: 0.001ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

@media print {

    .sidebar,
    .mobile-header,
    .copy-btn {
        display: none !important;
    }

    .content {
        margin: 0;
        max-width: 100%;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .tab-panel {
        display: block !important;
    }
}

/* ==========================================================================
   ControllerSets additions
   ========================================================================== */

/* ---------- Hero ----------
   The headline claims a transformation, so the hero shows it: the call you
   write on the left, the routes it generates on the right. */

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    padding: 4px 12px 4px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--primary-dim);
    color: var(--primary-soft);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    animation: riseIn 0.7s var(--ease-out) backwards;
}

.hero-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.hero h1 .line {
    animation-delay: 0.08s;
}

.hero h1 .line:nth-child(2) {
    animation-delay: 0.18s;
}

.hero-demo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    margin: 34px 0 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: riseIn 0.7s 0.4s var(--ease-out) backwards;
}

.hero-demo-pane {
    min-width: 0;
    padding: 16px 18px 18px;
}

.hero-demo-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
}

.hero-demo-head svg {
    width: 13px;
    height: 13px;
}

.hero-demo-arrow {
    display: grid;
    place-items: center;
    padding: 0 12px;
    border-inline: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--primary);
}

.hero-demo-arrow svg {
    width: 17px;
    height: 17px;
}

.hero-code {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
    line-height: 1.85;
    color: var(--code-text);
    overflow-x: auto;
}

/* The base `code` rule is 0.875em; without this the snippet compounds down. */
.hero-code code {
    font-size: 1em;
}

.hero-code .tok-fn {
    color: var(--accent);
}

.hero-code .tok-str {
    color: var(--success);
}

.hero-routes {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-routes li {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.hero-routes .m {
    min-width: 56px;
    padding: 0.1rem 0.4rem;
    font-size: 0.66rem;
}

/* Overrides the `li code` pill treatment — a route path reads better plain,
   next to the coloured method badge. */
.hero-routes code {
    padding: 0;
    background: transparent;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.hero-route-note {
    margin-left: auto;
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .hero-demo {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-demo-arrow {
        padding: 5px 0;
        border-inline: none;
        border-block: 1px solid var(--border);
    }

    /* Rotate the glyph, not the cell — rotating the cell would take its
       borders and background with it. */
    .hero-demo-arrow svg {
        transform: rotate(90deg);
    }

    .hero-route-note {
        display: none;
    }
}

/* ---------- HTTP method badges ---------- */

.m {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 0.16rem 0.5rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font-family: 'Fira Code', ui-monospace, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.m-get {
    color: var(--success);
    background: var(--success-dim);
    border-color: var(--success-dim);
}

.m-post {
    color: var(--accent);
    background: var(--accent-dim);
    border-color: var(--accent-dim);
}

.m-patch {
    color: var(--warning);
    background: var(--warning-dim);
    border-color: var(--warning-dim);
}

.m-delete {
    color: var(--danger);
    background: var(--danger-dim);
    border-color: var(--danger-dim);
}

/* QUERY is a read like GET, but body-borne, so it gets a colour of its own
   rather than borrowing the GET green. */
.m-query {
    color: var(--primary-soft);
    background: var(--primary-dim);
    border-color: var(--primary-dim);
}

