:root {
    --sf-ai-page-bg: #ffffff;
    --sf-ai-text-color: oklch(14.5% 0 0);
    --font-family-title: 'Ubuntu Sans Variable', 'Ubuntu', system-ui, sans-serif;
    --sf-ai-bg-primary: oklch(13% 0.028 261.692);
    --sf-ai-bg-secondary: oklch(92.8% 0.006 264.531);
    --sf-ai-accent: #7f5bff;
    --sf-ai-link-color: oklch(54.6% 0.245 262.881);
    --sf-ai-card-radius: 1.5rem;
    --sf-ai-card-bg: #ffffff;
    --sf-ai-card-border: rgba(15, 23, 42, 0.06);
    --sf-ai-logo-pill-bg: #f9fafb;
    --sf-ai-logo-pill-color: inherit;
    --sf-ai-brand-1: #5a55a5;
    --sf-ai-brand-2: #4c1d95;
    --sf-ai-brand-3: #db2777;
    --sf-ai-brand-4: #1d4ed8;
}

[data-bs-theme="dark"] {
    --sf-ai-page-bg: oklch(13% 0.028 261.692);
    --sf-ai-text-color: #ffffff;
    --sf-ai-bg-secondary: oklch(20% 0.015 264.531);
    --sf-ai-link-color: oklch(70% 0.245 262.881);
    --sf-ai-card-bg: oklch(25% 0.02 261.692);
    --sf-ai-card-border: rgba(255, 255, 255, 0.1);
    --sf-ai-logo-pill-bg: oklch(30% 0.02 261.692);
    --sf-ai-logo-pill-color: rgba(255, 255, 255, 0.9);
}

/* ubuntu-sans-latin-wght-normal */
@font-face {
    font-family: 'Ubuntu Sans Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 800;
    src: url("../fonts/ubuntu-sans_5.2.9_latin-wght-normal-kOiIr6e.woff2") format('woff2-variations');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* JetBrainsMono Regular */
@font-face {
    font-family: 'JetBrainsMono';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("../fonts/JetBrainsMono-Regular-irUEmlx.woff2") format('woff2-variations');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

html { scroll-behavior: smooth; scroll-padding-top: 77px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.z-above { position: relative; z-index: 1; }

body {
    background: var(--sf-ai-page-bg);
    color: var(--sf-ai-text-color);
    font-family: system-ui, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 26px;
    overflow-x: hidden;
}

.text-balance {
    text-wrap: balance;
}

a {
    color: inherit;
    text-decoration: none;
}
a:hover {
    color: var(--sf-ai-link-color);
    text-decoration: underline;
}
a.btn:hover {
    text-decoration: none;
}
a.btn.btn-outline-secondary:hover,
button.btn.btn-outline-secondary:hover {
    background: var(--sf-ai-bg-primary);
    color: #fff !important;
    border-color: var(--sf-ai-bg-primary);
}

a.stretched-link:after {
    background: transparent;
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    pointer-events: auto;
}

.ff-title {
    font-family: var(--font-family-title), sans-serif;
}

section.section-secondary {
    background: linear-gradient(180deg, oklch(95% 0.004 264.531) 0%, oklch(89% 0.008 264.531) 100%);
}

[data-bs-theme="dark"] section.section-secondary {
    background: linear-gradient(180deg, oklch(22% 0.012 264.531) 0%, oklch(17% 0.018 264.531) 100%);
}

.hero-wrapper {
    position: relative;
    background-color: var(--sf-ai-brand-1);
}
.hero-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 30%,
        rgba(0, 0, 0, 0.15) 100%
    );
    pointer-events: none;
}

/*
 * Brand-color shift. Every participating element runs the same 60s keyframes on
 * its own timeline — reliable in all engines. (Animating one inherited custom
 * property instead is a Chromium-only trick: Firefox/Safari never repaint the
 * descendants that read it via var(), so the whole page freezes on one color.)
 * Elements present at load start together; ones added or toggled active later are
 * re-phased onto the shared wall-clock cycle by initColorShiftSync() in app.js,
 * so nothing drifts. Keyframe colors are literal (mirroring --sf-ai-brand-1..4)
 * and set both fill and background-color, so one animation drives the SVG logo,
 * the architecture rects, and the div backgrounds alike.
 */
@keyframes colorShift {
    0% { fill: #5a55a5; background-color: #5a55a5; }
    25% { fill: #4c1d95; background-color: #4c1d95; }
    50% { fill: #db2777; background-color: #db2777; }
    75% { fill: #1d4ed8; background-color: #1d4ed8; }
    100% { fill: #5a55a5; background-color: #5a55a5; }
}

.color-shift,
.arch-shift-strong, .arch-shift-medium, .arch-shift-light, .arch-shift-muted,
.sf-ai-card-shift::before,
.feature-tab.active,
.cookbook-card-icon,
.cookbook-filter.is-active,
.logo-icon, .logo-ai {
    animation: colorShift 60s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .color-shift,
    .arch-shift-strong, .arch-shift-medium, .arch-shift-light, .arch-shift-muted,
    .sf-ai-card-shift::before,
    .feature-tab.active,
    .cookbook-card-icon,
    .cookbook-filter.is-active,
    .logo-icon, .logo-ai {
        animation: none;
    }
}

/* Architecture layer color-shift variants */
/* Card with color-shift background via pseudo-element */
.sf-ai-card-shift {
    position: relative;
    overflow: hidden;
}
.sf-ai-card-shift::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: var(--sf-ai-brand-1);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}
.sf-ai-card-shift > * { position: relative; z-index: 1; }

.arch-shift-strong, .arch-shift-medium, .arch-shift-light, .arch-shift-muted {
    fill: var(--sf-ai-brand-1);
}
.arch-shift-medium { opacity: 0.55; }
.arch-shift-light { opacity: 0.3; }
.arch-shift-muted { opacity: 0.15; }

.logo-icon,
.logo-ai { fill: var(--sf-ai-brand-1); }
.logo-emblem { fill: #fff; }
.logo-text { fill: var(--sf-ai-text-color); }

.nav-link {
    --bs-nav-link-color: var(--sf-ai-text-color);
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
}
.nav-link:hover {
    background-color: rgba(90, 85, 165, 0.1);
    color: #5a55a5;
    text-decoration: none;
}
.nav-item svg {
    color: var(--sf-ai-text-color);
}
.nav-item:hover svg {
    color: #5a55a5;
}
button#themeToggle {
    margin: var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);
}

header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1030;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] header {
    background: rgba(22, 14, 46, 0.9) !important;
    border-color: var(--sf-ai-card-border) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-wrapper section {
    position: relative;
    z-index: 1;
}

.hero-highlight {
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.05em 0.35em;
    border-radius: 0.25em;
}

.hero-slides {
    position: relative;
}
.hero-slide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}
.hero-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: none;
    }
}

.hero-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.hero-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.hero-indicator.active {
    background: #fff;
    border-color: #fff;
}
.hero-indicator:hover {
    border-color: #fff;
}

.hero-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 2;
}
.hero-progress-bar {
    height: 100%;
    width: 0;
    background: #fff;
}
@media (prefers-reduced-motion: reduce) {
    .hero-progress {
        display: none;
    }
}

.hero-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

@media (min-width: 992px) {
    .hero-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}


.sf-ai-card {
    background: var(--sf-ai-card-bg);
    border: 1px solid var(--sf-ai-card-border);
    border-radius: var(--sf-ai-card-radius);
    display: flex;
    flex-direction: column;
}

.sf-ai-card-hover {
    transition: box-shadow 0.18s ease;
}

.sf-ai-card-hover:hover {
    box-shadow: inset 0 0 0 2px var(--sf-ai-link-color);
}
.sf-ai-card-hover.sf-ai-card-hover-dark:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
[data-bs-theme="dark"] .sf-ai-card-hover.sf-ai-card-hover-dark:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sf-ai-card-body {
    flex-grow: 1;
}

.sf-ai-logo-grid {
    display: grid;
    grid-auto-rows: 1fr;
    row-gap: 1.5rem;
}
.logo-pill {
    border-radius: var(--sf-ai-card-radius);
    color: var(--sf-ai-logo-pill-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    min-height: 64px;
    text-align: center;
}
.logo-pill:hover {
    background: rgba(255, 255, 255, 0.7);
}
[data-bs-theme="dark"] .logo-pill:hover {
    background: rgba(255, 255, 255, 0.1);
}
.logo-pill svg {
    display: block;
    max-width: 80%;
    max-height: 35px;
    width: auto;
    height: auto;
    overflow: visible;
}

.demo-icon {
    width: 72px;
    height: 72px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 1em;
}
.demo-icon svg {
    color: white;
}
.sf-ai-card a {
    color: var(--sf-ai-text-color);
    text-decoration: none;
}
.sf-ai-card a:hover {
    color: var(--sf-ai-accent);
    text-decoration: none;
}
/* .sf-ai-card a above would override Bootstrap's white btn-dark text. */
.sf-ai-card a.btn-dark,
.sf-ai-card a.btn-dark:hover {
    color: #fff;
}

.demo-blog .demo-icon { background: linear-gradient(180deg, #433F77, #C43BC2); }
.demo-crop .demo-icon { background: linear-gradient(180deg, #85A72B, #97BC43); }
.demo-recipe .demo-icon { background: linear-gradient(180deg, #83A659, #71BCB8); }
.demo-speech .demo-icon { background: linear-gradient(180deg, #42DEEE, #7069B0); }
.demo-turbo .demo-icon { background: linear-gradient(180deg, #E94E77, #D68189); }
.demo-video .demo-icon { background: linear-gradient(180deg, #3B9D87, #35A781); }
.demo-wikipedia .demo-icon { background: linear-gradient(180deg, #1CA574, #56AB48); }
.demo-youtube .demo-icon { background: linear-gradient(180deg, #C05920, #CF781A); }

.demo-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.demo-icon-sm svg { color: white; }
.demo-desc { font-size: 0.75rem; line-height: 1.3; display: block; }
.demo-icon-sm.demo-blog { background: linear-gradient(180deg, #433F77, #C43BC2); }
.demo-icon-sm.demo-crop { background: linear-gradient(180deg, #85A72B, #97BC43); }
.demo-icon-sm.demo-recipe { background: linear-gradient(180deg, #83A659, #71BCB8); }
.demo-icon-sm.demo-speech { background: linear-gradient(180deg, #42DEEE, #7069B0); }
.demo-icon-sm.demo-turbo { background: linear-gradient(180deg, #E94E77, #D68189); }
.demo-icon-sm.demo-video { background: linear-gradient(180deg, #3B9D87, #35A781); }
.demo-icon-sm.demo-wikipedia { background: linear-gradient(180deg, #1CA574, #56AB48); }
.demo-icon-sm.demo-youtube { background: linear-gradient(180deg, #C05920, #CF781A); }

.cta-section {
    background-color: var(--sf-ai-brand-1);
}
.cta-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.12) 100%
    );
    pointer-events: none;
}
.cta-card {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--sf-ai-card-radius);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, transform 0.2s ease;
}
.cta-card:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    color: #fff;
}
.cta-card svg {
    color: #fff;
}

.footer-meta {
    font-size: 0.8rem;
    opacity: 0.8;
    color: var(--sf-ai-text-color);
}
.footer-meta svg {
    color: var(--sf-ai-text-color);
}

.terminal {
    background: #151028;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    padding: 15px 20px;
    position: relative;
    box-shadow: 0 8px 32px rgba(127, 91, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.2);
}
[data-bs-theme="dark"] .terminal {
    box-shadow: 0 8px 40px rgba(127, 91, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Copy button */
.copy-btn {
    position: absolute;
    top: 12px;
    right: 24px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    padding: 6px 8px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1;
}
.copy-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}
.copy-btn.copied {
    color: #34d399;
}

.terminal code {
    font-family: JetBrainsMono, ui-monospace;
    font-optical-sizing: auto;
    font-feature-settings: normal;
    font-variation-settings: normal;
    font-synthesis: none;
    font-variant-ligatures: none;
}
.terminal code { color: oklch(87% 0 0); }
.terminal code .variable { color: #79c0ff; }
.terminal code .title, .terminal code .title.class { color: #d2a8ff; }
.terminal code .keyword { color: #ff7b72; }
.terminal code .string { color: #9c9; }
.terminal code .comment { color: #8b949e; }

/* Section headings */
.section-heading {
    position: relative;
    display: inline-block;
    padding-bottom: 0.75rem;
}
.section-heading::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--sf-ai-brand-1), var(--sf-ai-accent), var(--sf-ai-brand-3));
}


/* Architecture */
.architecture-diagram { max-width: 680px; margin-left: auto; }
.architecture-diagram svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(127, 91, 255, 0.1));
    transition: filter 0.3s ease;
}
.architecture-diagram:hover svg {
    filter: drop-shadow(0 8px 32px rgba(127, 91, 255, 0.2));
}
.component-link {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: var(--sf-ai-text-color);
    transition: background-color 0.15s ease, border-color 0.2s ease, transform 0.15s ease;
}
.component-link:hover {
    background: var(--sf-ai-bg-secondary);
    text-decoration: none;
    color: var(--sf-ai-text-color);
    transform: translateX(4px);
}
.component-link:nth-child(1):hover { border-left-color: var(--sf-ai-brand-4); }
.component-link:nth-child(2):hover { border-left-color: var(--sf-ai-brand-3); }
.component-link:nth-child(3):hover { border-left-color: var(--sf-ai-brand-2); }
.component-link:nth-child(4):hover { border-left-color: var(--sf-ai-brand-1); }
.component-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0.5em;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}
.component-dot-platform { background: var(--sf-ai-brand-4); }
.component-dot-store { background: var(--sf-ai-brand-3); }
.component-dot-agent { background: var(--sf-ai-brand-2); }
.component-dot-bundle { background: var(--sf-ai-brand-1); }

/* Feature tabs */
.feature-tab {
    border: none;
    border-radius: 0.5rem;
    padding: 0.55rem 1.25rem;
    background: var(--sf-ai-card-bg);
    color: var(--sf-ai-text-color);
    font-family: var(--font-family-title);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.feature-tab.active {
    background-color: var(--sf-ai-brand-1);
    color: #fff;
    box-shadow: 0 4px 20px rgba(90, 85, 165, 0.4);
}
.feature-panel {
    display: none;
    animation: featureFadeIn 0.35s ease;
}
.feature-panel.active { display: block; }
@keyframes featureFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gradient hover border for cards */
.sf-ai-card-glow {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.sf-ai-card-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(127, 91, 255, 0.1);
}
[data-bs-theme="dark"] .sf-ai-card-glow:hover {
    box-shadow: 0 8px 32px rgba(127, 91, 255, 0.18);
}

/* Section decorative backgrounds */
.section-gradient-mesh {
    position: relative;
    overflow: hidden;
}
.section-gradient-mesh::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(127, 91, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}
.section-gradient-mesh::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(219, 39, 119, 0.04) 0%, transparent 70%);
    pointer-events: none;
}
[data-bs-theme="dark"] .section-gradient-mesh::before {
    background: radial-gradient(circle, rgba(127, 91, 255, 0.1) 0%, transparent 70%);
}
[data-bs-theme="dark"] .section-gradient-mesh::after {
    background: radial-gradient(circle, rgba(219, 39, 119, 0.07) 0%, transparent 70%);
}

/* Section divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--sf-ai-card-border), var(--sf-ai-accent), var(--sf-ai-card-border), transparent);
    border: none;
    margin: 0;
    opacity: 0.6;
}

/* Cookbook: Homepage cards */
/* The demos section sits on a white background, so its card needs a light gray
   fill to stand out instead of disappearing (white-on-white). */
#demos .sf-ai-card {
    background: var(--sf-ai-bg-secondary);
}

[data-bs-theme="dark"] #demos .sf-ai-card {
    background: var(--sf-ai-card-bg);
}

.cookbook-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--sf-ai-brand-1);
    color: #fff;
}

.cookbook-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15em 0.55em;
    border-radius: 0.375rem;
    background: var(--sf-ai-bg-secondary);
    color: var(--sf-ai-text-color);
    border: 1px solid var(--sf-ai-card-border);
    letter-spacing: 0.02em;
}

/* Cookbook: Component filter toggles */
.cookbook-filter {
    font: inherit;
    font-size: 0.82rem;
    line-height: 1;
    padding: 0.45rem 0.9rem;
    border-radius: 2rem;
    background: var(--sf-ai-card-bg);
    color: var(--sf-ai-text-color);
    border: 1px solid var(--sf-ai-card-border);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cookbook-filter:hover {
    border-color: var(--sf-ai-link-color);
}

.cookbook-filter.is-active {
    background-color: var(--sf-ai-brand-1);
    border-color: transparent;
    color: #fff;
}

/* Cookbook: Breadcrumbs */
.cookbook-breadcrumb {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    /* Align the breadcrumb with the visual start of the header logo, whose
       content is inset ~9px within its SVG viewBox (x 14.58 of 284.46 @ 180px). */
    padding: 0 0 0 9px;
    margin: 0;
    font-size: 0.85rem;
}

.cookbook-breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 0.4rem;
    opacity: 0.4;
}

.cookbook-breadcrumb a {
    color: var(--sf-ai-link-color);
    text-decoration: none;
}

.cookbook-breadcrumb a:hover {
    text-decoration: underline;
}

.cookbook-breadcrumb li:last-child {
    color: var(--sf-ai-text-color);
    opacity: 0.6;
}

/* Cookbook: Article header */
.cookbook-article-header {
    padding: 2rem 0 2.5rem;
}

/* Cookbook: Article body */
.cookbook-article-body h2 {
    font-family: var(--font-family-title), system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--sf-ai-card-border);
}

.cookbook-article-body h2:first-child {
    margin-top: 0;
}

.cookbook-article-body p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.cookbook-article-body .terminal {
    margin: 1.5rem 0;
}

.cookbook-article-body ol,
.cookbook-article-body ul {
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.cookbook-article-body li {
    margin-bottom: 0.35rem;
}

/* Cookbook: Content links mirror the Symfony documentation prose-link styling
   (symfony.com/doc): body-colored text with a thick blue underline, swapping to
   a colored label and a rounded outline box on hover. */
.cookbook-article-body p a,
.cookbook-article-body li a {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-color: #60a5fa;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.cookbook-article-body p a:hover,
.cookbook-article-body li a:hover {
    color: #0066cc;
    text-decoration: none;
    outline: 2px solid #60a5fa;
    outline-offset: 1px;
    border-radius: 0.375rem;
}

/* Cookbook: Callout boxes */
.cookbook-callout {
    border-left: 3px solid var(--sf-ai-accent);
    background: var(--sf-ai-bg-secondary);
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

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

.cookbook-callout strong {
    color: var(--sf-ai-accent);
}

/* Cookbook: Prev/Next navigation */
.cookbook-nav-card {
    padding: 1.25rem;
    border-radius: var(--sf-ai-card-radius);
    background: var(--sf-ai-card-bg);
    border: 1px solid var(--sf-ai-card-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cookbook-nav-card:hover {
    border-color: var(--sf-ai-link-color);
    box-shadow: 0 2px 12px rgba(127, 91, 255, 0.1);
}

.cookbook-nav-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sf-ai-text-color);
    opacity: 0.5;
    margin-bottom: 0.35rem;
}

.cookbook-nav-card-next .cookbook-nav-label {
    justify-content: flex-end;
}

.cookbook-nav-title {
    display: block;
    font-size: 0.95rem;
    color: var(--sf-ai-text-color);
}

/* Cookbook: Inline code */
.cookbook-article-body code:not(.terminal code) {
    font-family: 'JetBrainsMono', monospace;
    font-size: 0.85em;
    padding: 0.15em 0.4em;
    border-radius: 0.3rem;
    background: var(--sf-ai-bg-secondary);
    border: 1px solid var(--sf-ai-card-border);
}

/*
 * Cookbook: bridge for the markup generated from RST by the docs-builder.
 * The article fragments under templates/cookbook/content/ use the docs-builder
 * (ReadTheDocs + highlight.php) markup; these rules map it onto the website theme.
 */
.cookbook-article-body h3 {
    font-family: var(--font-family-title), system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

/* Code blocks: dark rounded container matching .terminal */
.cookbook-article-body [class*="highlight-"] {
    background: #151028;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 8px 32px rgba(127, 91, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cookbook-article-body .highlighttable {
    width: 100%;
    margin: 0;
    border: 0;
    table-layout: fixed;
}

.cookbook-article-body .highlighttable td {
    border: 0;
    padding: 0;
    vertical-align: top;
}

/* Hide line numbers to match the website's code style */
.cookbook-article-body .highlighttable .linenos {
    display: none;
}

.cookbook-article-body .highlight pre {
    margin: 0;
    padding: 15px 20px;
    overflow-x: auto;
    background: transparent;
    color: oklch(87% 0 0);
    font-family: JetBrainsMono, ui-monospace, monospace;
    font-variant-ligatures: none;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* highlight.php token colors (GitHub-like palette, matches .terminal) */
.cookbook-article-body .hljs-variable,
.cookbook-article-body .hljs-variable-other-marker,
.cookbook-article-body .hljs-number { color: #79c0ff; }
.cookbook-article-body .hljs-title,
.cookbook-article-body .hljs-class,
.cookbook-article-body .hljs-function,
.cookbook-article-body .hljs-meta { color: #d2a8ff; }
.cookbook-article-body .hljs-keyword { color: #ff7b72; }
.cookbook-article-body .hljs-string { color: #9c9; }
.cookbook-article-body .hljs-comment { color: #8b949e; }
.cookbook-article-body .hljs-attr,
.cookbook-article-body .hljs-params { color: #ffa657; }

/* Admonitions (.. note::, .. tip::, .. warning::) styled like callouts */
.cookbook-article-body .admonition {
    border-left: 3px solid var(--sf-ai-accent);
    background: var(--sf-ai-bg-secondary);
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.cookbook-article-body .admonition p:last-child {
    margin-bottom: 0;
}

.cookbook-article-body .admonition-title {
    font-weight: 700;
    color: var(--sf-ai-accent);
    margin-bottom: 0.25rem;
}

