/* ==========================================================================
   PCS Documentation — Design System
   A dark, developer-focused design inspired by modern Rust ecosystem sites.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Color palette — HSL for easy manipulation */
    --bg-color: hsl(222, 47%, 11%);
    --bg-surface: hsl(217, 33%, 17%);
    --bg-elevated: hsl(215, 28%, 20%);
    --text-color: hsl(214, 32%, 91%);
    --text-muted: hsl(215, 16%, 65%);
    --text-faint: hsl(215, 16%, 47%);

    --primary-color: hsl(199, 89%, 56%);
    --primary-muted: hsl(199, 89%, 56%, 0.12);
    --secondary-color: hsl(234, 89%, 74%);
    --secondary-muted: hsl(234, 89%, 74%, 0.12);
    --accent-color: hsl(330, 81%, 70%);
    --accent-muted: hsl(330, 81%, 70%, 0.10);

    --sidebar-bg: hsl(217, 33%, 14%);
    --card-bg: hsl(217, 33%, 17%);
    --border-color: hsl(217, 24%, 24%);
    --border-subtle: hsl(217, 24%, 20%);
    --code-bg: hsl(222, 47%, 9%);

    /* Spacing scale (4px base) */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */

    /* Type scale — 1.25 ratio */
    --text-xs: 0.8rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.0625rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: clamp(2rem, 4vw, 2.5rem);
    --text-5xl: clamp(2.5rem, 5vw, 3.25rem);

    /* Layout */
    --nav-height: 60px;
    --sidebar-width: 272px;
    --content-max-width: 900px;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px hsla(0, 0%, 0%, 0.2), 0 1px 2px hsla(0, 0%, 0%, 0.12);
    --shadow-md: 0 4px 12px hsla(0, 0%, 0%, 0.25), 0 2px 4px hsla(0, 0%, 0%, 0.15);
    --shadow-lg: 0 12px 40px hsla(0, 0%, 0%, 0.35), 0 4px 12px hsla(0, 0%, 0%, 0.2);
    --shadow-glow: 0 0 30px hsla(199, 89%, 56%, 0.15);

    /* Transitions */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.65;
    display: flex;
    min-height: 100vh;
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: hsla(199, 89%, 56%, 0.3);
    color: #fff;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   3. Sidebar Navigation
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: var(--space-8) var(--space-6);
    display: flex;
    flex-direction: column;
    z-index: 100;
    /* Subtle inner glow on the right edge */
    box-shadow: inset -1px 0 0 var(--border-subtle);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.logo {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-10);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: opacity var(--duration-fast) ease;
}

.logo:hover {
    opacity: 0.85;
    color: var(--primary-color);
}

.logo img {
    display: inline-block;
}

.nav-section-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--space-6) var(--space-4) var(--space-2);
}

.nav-section-label:first-of-type {
    padding-top: var(--space-4);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    transition:
        background-color var(--duration-fast) ease,
        color var(--duration-fast) ease,
        transform var(--duration-fast) ease;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    background-color: var(--primary-muted);
    color: var(--text-color);
}

.nav-links a.active {
    background-color: var(--primary-muted);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-links a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

/* Sidebar footer / version badge */
.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-8);
}

.version-badge {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--text-faint);
    background: var(--bg-color);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', monospace;
}

/* --------------------------------------------------------------------------
   4. Main Content Area
   -------------------------------------------------------------------------- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--space-12) var(--space-16);
    max-width: calc(var(--content-max-width) + var(--sidebar-width) + var(--space-16) * 2);
    min-width: 0;
    overflow-x: hidden;
}

.content-wrapper {
    max-width: var(--content-max-width);
}

/* --------------------------------------------------------------------------
   5. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 {
    font-size: var(--text-5xl);
    font-weight: 700;
    margin-bottom: var(--space-6);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-top: var(--space-16);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-color);
    color: #fff;
}

h3 {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-top: var(--space-10);
    margin-bottom: var(--space-4);
    color: var(--text-color);
}

h4 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
    color: var(--text-color);
}

p {
    margin-bottom: var(--space-6);
    font-size: var(--text-md);
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 68ch;
}

.subtitle {
    font-size: var(--text-xl);
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-8);
    max-width: 56ch;
}

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

/* Lists */
ul, ol {
    margin-bottom: var(--space-6);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
    font-size: var(--text-md);
    color: var(--text-muted);
    line-height: 1.7;
}

li strong {
    color: var(--text-color);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}

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

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

.card-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

.card {
    background-color: var(--card-bg);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition:
        transform var(--duration-normal) var(--ease-out),
        border-color var(--duration-normal) ease,
        box-shadow var(--duration-normal) ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), 0 0 20px hsla(199, 89%, 56%, 0.06);
}

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

.card h3 {
    margin-top: 0;
    font-size: var(--text-xl);
    color: #fff;
}

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

/* Card link variant — entire card is clickable */
a.card {
    display: block;
    color: inherit;
}

a.card:hover {
    color: inherit;
}

/* --------------------------------------------------------------------------
   7. Code Blocks & Inline Code
   -------------------------------------------------------------------------- */
pre {
    background-color: var(--code-bg) !important;
    border-radius: var(--radius-md);
    margin: var(--space-6) 0 !important;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    position: relative;
    box-shadow: var(--shadow-sm);
}

pre code {
    font-size: var(--text-sm);
    line-height: 1.7;
    tab-size: 4;
}

code {
    font-family: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace;
    font-size: 0.9em;
}

:not(pre) > code {
    background-color: hsla(199, 89%, 56%, 0.08);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    font-size: 0.88em;
    border: 1px solid hsla(199, 89%, 56%, 0.12);
}

/* Copy button for code blocks */
.copy-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    padding: var(--space-1) var(--space-2);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-faint);
    cursor: pointer;
    opacity: 0;
    transition:
        opacity var(--duration-fast) ease,
        color var(--duration-fast) ease,
        background-color var(--duration-fast) ease,
        border-color var(--duration-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.copy-btn.copied {
    color: hsl(160, 64%, 52%);
    border-color: hsl(160, 64%, 52%);
}

/* Code block header (for labeled code blocks) */
.code-label {
    display: block;
    font-size: var(--text-xs);
    font-family: 'Fira Code', monospace;
    color: var(--text-faint);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    background: hsla(0, 0%, 100%, 0.02);
}

/* --------------------------------------------------------------------------
   8. Mermaid Diagrams
   -------------------------------------------------------------------------- */
.mermaid {
    background-color: var(--card-bg);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    margin: var(--space-8) 0;
    text-align: center;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   9. Badges
   -------------------------------------------------------------------------- */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-6) 0 var(--space-8);
}

.badges img {
    display: inline-block;
    height: 20px;
}

/* --------------------------------------------------------------------------
   10. Hero Section (index.html)
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    padding: var(--space-16) 0 var(--space-12);
}

.hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -120px;
    width: 500px;
    height: 500px;
    background: radial-gradient(
        ellipse at center,
        hsla(199, 89%, 56%, 0.06) 0%,
        hsla(234, 89%, 74%, 0.03) 40%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    line-height: 1.1;
    margin-bottom: var(--space-6);
    letter-spacing: -0.025em;
}

.hero .subtitle {
    font-size: clamp(1.125rem, 2vw, 1.35rem);
    max-width: 52ch;
}

/* --------------------------------------------------------------------------
   11. Feature Grid (index.html)
   -------------------------------------------------------------------------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

.feature-card {
    background-color: var(--card-bg);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition:
        transform var(--duration-normal) var(--ease-out),
        border-color var(--duration-normal) ease,
        box-shadow var(--duration-normal) ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: hsla(199, 89%, 56%, 0.3);
    box-shadow: var(--shadow-md), 0 0 24px hsla(199, 89%, 56%, 0.06);
}

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

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: var(--space-5);
    background: var(--primary-muted);
    color: var(--primary-color);
}

.feature-icon.secondary {
    background: var(--secondary-muted);
    color: var(--secondary-color);
}

.feature-icon.accent {
    background: var(--accent-muted);
    color: var(--accent-color);
}

.feature-card h3 {
    margin-top: 0;
    margin-bottom: var(--space-2);
    font-size: var(--text-lg);
    color: #fff;
}

.feature-card p {
    margin-bottom: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   12. Getting Started Section
   -------------------------------------------------------------------------- */
.getting-started-code {
    position: relative;
    margin: var(--space-8) 0;
}

.getting-started-code pre {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   13. 404 Page
   -------------------------------------------------------------------------- */
.not-found-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 65vh;
    padding: var(--space-16) var(--space-8);
}

.not-found-code {
    font-family: 'Fira Code', monospace;
    font-size: clamp(5rem, 12vw, 9rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: var(--space-4);
    letter-spacing: -0.03em;
}

.not-found-message {
    font-family: 'Fira Code', monospace;
    font-size: var(--text-xl);
    color: var(--text-color);
    margin-bottom: var(--space-4);
}

.not-found-hint {
    font-size: var(--text-base);
    color: var(--text-faint);
    margin-bottom: var(--space-10);
    max-width: 40ch;
}

.not-found-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-8);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-color);
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition:
        transform var(--duration-fast) ease,
        box-shadow var(--duration-fast) ease,
        opacity var(--duration-fast) ease;
    box-shadow: 0 4px 16px hsla(199, 89%, 56%, 0.2);
}

.not-found-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px hsla(199, 89%, 56%, 0.3);
    opacity: 0.95;
    color: var(--bg-color);
}

.not-found-link:active {
    transform: translateY(0);
}

/* Decorative terminal-style error */
.not-found-terminal {
    font-family: 'Fira Code', monospace;
    font-size: var(--text-sm);
    color: var(--text-faint);
    margin-top: var(--space-12);
    padding: var(--space-4) var(--space-6);
    background: var(--code-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: left;
    max-width: 48ch;
}

.not-found-terminal .prompt {
    color: var(--primary-color);
}

.not-found-terminal .error {
    color: var(--accent-color);
}

/* --------------------------------------------------------------------------
   14. Utility Classes
   -------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   15. Mobile Menu Toggle
   -------------------------------------------------------------------------- */
.menu-toggle {
    display: none;
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 200;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-xl);
    line-height: 1;
    transition:
        background-color var(--duration-fast) ease,
        border-color var(--duration-fast) ease;
    box-shadow: var(--shadow-sm);
}

.menu-toggle:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
}

/* Mobile overlay backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: hsla(222, 47%, 6%, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* --------------------------------------------------------------------------
   16. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Staggered entrance animations for page content */
.animate-in {
    animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 60ms; }
.animate-in:nth-child(3) { animation-delay: 120ms; }
.animate-in:nth-child(4) { animation-delay: 180ms; }
.animate-in:nth-child(5) { animation-delay: 240ms; }
.animate-in:nth-child(6) { animation-delay: 300ms; }

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   17. Responsive Design
   -------------------------------------------------------------------------- */

/* Tablets and below */
@media (max-width: 1024px) {
    .main-content {
        padding: var(--space-10) var(--space-8);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--duration-normal) var(--ease-out);
        width: min(var(--sidebar-width), 85vw);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: var(--space-8) var(--space-6);
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-2xl);
        margin-top: var(--space-12);
    }

    .hero {
        padding: var(--space-8) 0 var(--space-8);
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.75rem);
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .badges {
        flex-wrap: wrap;
    }

    .not-found-terminal {
        max-width: 100%;
        font-size: var(--text-xs);
    }
}

/* Small phones */
@media (max-width: 480px) {
    .main-content {
        padding: var(--space-6) var(--space-4);
    }

    .hero h1 {
        font-size: clamp(1.75rem, 10vw, 2.25rem);
    }

    .card {
        padding: var(--space-6);
    }

    .feature-card {
        padding: var(--space-6);
    }

    pre {
        font-size: var(--text-xs);
    }
}

/* Large desktops */
@media (min-width: 1400px) {
    .main-content {
        padding: var(--space-16) var(--space-20);
    }
}

/* ==========================================================================
   18. Shared Page Components
   These styles were previously duplicated across individual page <style> tags.
   ========================================================================== */

/* --------------------------------------------------------------------------
   18a. Page Table of Contents
   -------------------------------------------------------------------------- */
.page-toc {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-8);
    margin-bottom: var(--space-12);
}

.page-toc-title {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: var(--space-3);
}

.page-toc ol {
    list-style: none;
    counter-reset: toc-counter;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-1) var(--space-8);
    padding: 0;
    margin: 0;
}

.page-toc li {
    counter-increment: toc-counter;
}

.page-toc li a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.35rem 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}

.page-toc li a::before {
    content: counter(toc-counter, decimal-leading-zero);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--border-color);
    font-family: 'Fira Code', monospace;
    transition: color var(--duration-fast) ease;
}

.page-toc li a:hover {
    color: var(--primary-color);
}

.page-toc li a:hover::before {
    color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   18b. Section Dividers
   -------------------------------------------------------------------------- */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, var(--border-color), transparent);
    margin: var(--space-12) 0 0;
}

/* --------------------------------------------------------------------------
   18c. Callout Boxes
   -------------------------------------------------------------------------- */
.callout {
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-lg);
    margin: var(--space-6) 0 var(--space-8);
    border-left: 4px solid;
    font-size: var(--text-base);
}

.callout p {
    margin: 0;
    font-size: var(--text-base);
    line-height: 1.6;
}

.callout-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.callout-info {
    background: hsla(199, 89%, 56%, 0.08);
    border-color: var(--primary-color);
}

.callout-info .callout-label {
    color: var(--primary-color);
}

.callout-tip {
    background: hsla(160, 64%, 52%, 0.08);
    border-color: hsl(160, 64%, 52%);
}

.callout-tip .callout-label {
    color: hsl(160, 64%, 52%);
}

.callout-warning {
    background: hsla(45, 93%, 58%, 0.08);
    border-color: hsl(45, 93%, 58%);
}

.callout-warning .callout-label {
    color: hsl(45, 93%, 58%);
}

/* --------------------------------------------------------------------------
   18d. Code Block Labels
   -------------------------------------------------------------------------- */
.code-block {
    position: relative;
    margin: var(--space-6) 0;
}

.code-block-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-bottom: 1px solid var(--code-bg);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: var(--space-1) var(--space-4);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    position: relative;
    top: 1px;
    z-index: 1;
}

.code-block-label .label-icon {
    font-size: var(--text-sm);
    opacity: 0.7;
}

.code-block pre {
    margin-top: 0 !important;
    border-top-left-radius: 0 !important;
}

/* --------------------------------------------------------------------------
   18e. Styled Tables
   -------------------------------------------------------------------------- */
.styled-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: var(--space-8) 0;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    font-size: var(--text-sm);
}

.styled-table thead tr {
    background: hsla(0, 0%, 100%, 0.04);
}

.styled-table th {
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-weight: 600;
    color: hsl(214, 32%, 91%);
    font-size: var(--text-xs);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.styled-table td {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid hsla(0, 0%, 100%, 0.04);
    color: var(--text-muted);
}

.styled-table tbody tr:first-child td {
    border-top: none;
}

.styled-table tbody tr:hover {
    background: hsla(0, 0%, 100%, 0.02);
}

/* --------------------------------------------------------------------------
   18f. Pattern Sections
   -------------------------------------------------------------------------- */
.pattern-section {
    margin: var(--space-8) 0;
}

.pattern-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.pattern-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: var(--primary-muted);
    color: var(--primary-color);
    font-weight: 700;
    font-size: var(--text-sm);
    font-family: 'Fira Code', monospace;
    flex-shrink: 0;
}

.pattern-header h3 {
    margin: 0;
}

/* --------------------------------------------------------------------------
   18g. Comparison Grid
   -------------------------------------------------------------------------- */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: var(--space-8) 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.comparison-col {
    padding: var(--space-8);
    background: var(--card-bg);
}

.comparison-col:first-child {
    border-right: 1px solid var(--border-color);
}

.comparison-col h3 {
    margin-top: 0;
    margin-bottom: var(--space-3);
}

.comparison-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comparison-col ul li {
    padding: var(--space-2) 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
}

.comparison-col ul li::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-top: 0.55rem;
    flex-shrink: 0;
}

.comparison-col:last-child ul li::before {
    background: var(--secondary-color);
}

/* --------------------------------------------------------------------------
   18h. Retry Cards (colored left border variant)
   -------------------------------------------------------------------------- */
.retry-cards .card {
    border-left: 3px solid var(--secondary-color);
}

.retry-cards .card:nth-child(1) {
    border-left-color: var(--primary-color);
}

.retry-cards .card:nth-child(2) {
    border-left-color: var(--secondary-color);
}

.retry-cards .card:nth-child(3) {
    border-left-color: hsl(160, 64%, 52%);
}

/* --------------------------------------------------------------------------
   18i. Node Lifecycle Flow
   -------------------------------------------------------------------------- */
.lifecycle-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 0;
    align-items: stretch;
    margin: var(--space-8) 0;
}

.lifecycle-phase {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    position: relative;
    transition:
        border-color var(--duration-fast) ease,
        transform var(--duration-fast) ease;
}

.lifecycle-phase:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.phase-step {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.phase-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: var(--text-xs);
    font-family: 'Fira Code', monospace;
    flex-shrink: 0;
}

.phase-prep .phase-number {
    background: hsla(199, 89%, 56%, 0.15);
    color: var(--primary-color);
}

.phase-exec .phase-number {
    background: hsla(234, 89%, 74%, 0.15);
    color: var(--secondary-color);
}

.phase-post .phase-number {
    background: hsla(160, 64%, 52%, 0.15);
    color: hsl(160, 64%, 52%);
}

.phase-step h3 { margin: 0; font-size: var(--text-lg); }
.phase-prep h3 { color: var(--primary-color); }
.phase-exec h3 { color: var(--secondary-color); }
.phase-post h3 { color: hsl(160, 64%, 52%); }

.lifecycle-phase p {
    font-size: var(--text-sm);
    margin: 0;
    color: var(--text-muted);
}

.phase-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.15rem var(--space-2);
    border-radius: var(--radius-sm);
    margin-top: var(--space-3);
}

.phase-prep .phase-tag {
    background: hsla(199, 89%, 56%, 0.1);
    color: var(--primary-color);
}

.phase-exec .phase-tag {
    background: hsla(234, 89%, 74%, 0.1);
    color: var(--secondary-color);
}

.phase-post .phase-tag {
    background: hsla(160, 64%, 52%, 0.1);
    color: hsl(160, 64%, 52%);
}

.lifecycle-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-2);
    color: var(--border-color);
    font-size: var(--text-xl);
}

.lifecycle-arrow svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--border-color);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Config cards colored border */
.config-cards .card {
    border-left: 3px solid var(--secondary-color);
}

/* --------------------------------------------------------------------------
   18j. Back to Top Button
   -------------------------------------------------------------------------- */
.back-to-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    z-index: 50;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
        opacity var(--duration-normal) ease,
        visibility var(--duration-normal) ease,
        transform var(--duration-normal) var(--ease-out),
        background-color var(--duration-fast) ease,
        border-color var(--duration-fast) ease,
        color var(--duration-fast) ease;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.back-to-top svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   18k. Details/Summary TOC Variant (workflows, scheduler, tracing pages)
   -------------------------------------------------------------------------- */
details.page-toc {
    position: relative;
    margin: var(--space-8) 0 var(--space-12);
}

details.page-toc::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 3px 0 0 3px;
}

details.page-toc summary {
    font-weight: 600;
    font-size: var(--text-lg);
    color: #fff;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    user-select: none;
}

details.page-toc summary::-webkit-details-marker {
    display: none;
}

details.page-toc summary::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: rotate(-45deg);
    transition: transform var(--duration-fast) ease;
    flex-shrink: 0;
}

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

details.page-toc ol {
    list-style: none;
    padding: 0;
    margin: var(--space-4) 0 0;
    columns: 2;
    column-gap: var(--space-8);
}

details.page-toc li {
    break-inside: avoid;
    margin-bottom: 0.35rem;
}

details.page-toc a {
    color: var(--text-color);
    text-decoration: none;
    font-size: var(--text-sm);
    display: block;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) ease;
}

details.page-toc a:hover {
    color: var(--primary-color);
    background: hsla(199, 89%, 56%, 0.07);
}

details.page-toc .toc-sub {
    padding-left: var(--space-5);
    font-size: var(--text-xs);
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   18l. Section Anchor Links
   -------------------------------------------------------------------------- */
.main-content h2[id],
.main-content h3[id] {
    scroll-margin-top: var(--space-8);
    position: relative;
}

.main-content h2[id] a.anchor-link,
.main-content h3[id] a.anchor-link {
    position: absolute;
    left: -1.5rem;
    color: var(--border-color);
    font-weight: 400;
    opacity: 0;
    text-decoration: none;
    transition: opacity var(--duration-fast) ease;
}

.main-content h2[id]:hover a.anchor-link,
.main-content h3[id]:hover a.anchor-link {
    opacity: 1;
    color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   18m. Diagram Frames
   -------------------------------------------------------------------------- */
.diagram-frame {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: var(--space-8) 0;
    overflow: hidden;
}

.diagram-frame .diagram-label {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--secondary-color);
    padding: var(--space-3) var(--space-5) 0;
    margin: 0;
}

.diagram-frame .mermaid {
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

/* --------------------------------------------------------------------------
   18n. Strategy Grid
   -------------------------------------------------------------------------- */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
    margin: var(--space-8) 0;
}

.strategy-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition:
        border-color var(--duration-fast) ease,
        transform var(--duration-fast) ease;
}

.strategy-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.strategy-card .strategy-name {
    font-size: var(--text-lg);
    font-weight: 600;
    color: #fff;
    margin: 0 0 var(--space-2);
}

.strategy-card p {
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
}

.strategy-card pre {
    margin: var(--space-3) 0 0 !important;
    font-size: var(--text-xs);
}

/* --------------------------------------------------------------------------
   18o. Comparison Table (workflows page variant)
   -------------------------------------------------------------------------- */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-8) 0;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.comparison-table thead tr {
    background: hsla(0, 0%, 100%, 0.05);
    text-align: left;
}

.comparison-table th {
    padding: var(--space-4) var(--space-5);
    font-weight: 600;
    color: #fff;
    font-size: var(--text-sm);
}

.comparison-table td {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-color);
    font-size: var(--text-sm);
}

.comparison-table tbody tr {
    transition: background var(--duration-fast) ease;
}

.comparison-table tbody tr:hover {
    background: hsla(199, 89%, 56%, 0.04);
}

/* --------------------------------------------------------------------------
   18p. Callout Variants (workflows page uses slightly different classes)
   -------------------------------------------------------------------------- */
.callout-warn {
    background: hsla(0, 90%, 70%, 0.08);
    border-color: hsla(0, 90%, 70%, 0.25);
}

.callout-warn .callout-title {
    color: hsl(0, 90%, 70%);
}

.callout .callout-title {
    font-weight: 600;
    margin-bottom: var(--space-2);
}

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

/* --------------------------------------------------------------------------
   19. Shared Component Responsive Overrides
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .page-toc ol {
        grid-template-columns: 1fr;
    }

    .page-toc {
        padding: var(--space-5) var(--space-5);
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .comparison-col:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .comparison-col {
        padding: var(--space-5);
    }

    .callout {
        padding: var(--space-4) var(--space-5);
    }

    .styled-table {
        font-size: var(--text-xs);
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .styled-table th,
    .styled-table td {
        padding: var(--space-2) var(--space-3);
        white-space: nowrap;
    }

    .lifecycle-flow {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .lifecycle-phase {
        padding: var(--space-5);
    }

    .lifecycle-arrow {
        padding: var(--space-2) 0;
        transform: rotate(90deg);
    }

    .back-to-top {
        bottom: var(--space-4);
        right: var(--space-4);
    }

    details.page-toc ol {
        columns: 1;
    }

    details.page-toc {
        padding: var(--space-5) var(--space-5);
    }

    .main-content h2[id] a.anchor-link,
    .main-content h3[id] a.anchor-link {
        display: none;
    }

    .strategy-grid {
        grid-template-columns: 1fr;
    }

    .strategy-card {
        padding: var(--space-5);
    }

    .diagram-frame {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table th,
    .comparison-table td {
        padding: var(--space-2) var(--space-3);
        white-space: nowrap;
        font-size: var(--text-xs);
    }
}

@media (max-width: 480px) {
    .styled-table th,
    .styled-table td {
        padding: var(--space-2) var(--space-2);
        font-size: var(--text-xs);
    }

    .comparison-table th,
    .comparison-table td {
        padding: var(--space-2) var(--space-2);
        font-size: var(--text-xs);
    }
}

/* ==========================================================================
   20. Landing Page Extensions (index.html)
   Added during the Arrow rewrite. Reuses existing design tokens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   20a. Hero tagline + lede
   -------------------------------------------------------------------------- */
.tagline-lede {
    font-weight: 600;
    color: var(--text-color);
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
    max-width: 42ch;
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lede {
    font-size: var(--text-lg);
    color: var(--text-muted);
    max-width: 58ch;
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

/* --------------------------------------------------------------------------
   20b. Positioning grid — "is" / "is not"
   -------------------------------------------------------------------------- */
.positioning-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin: var(--space-8) 0 var(--space-12);
}

.positioning-col {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-8);
    border-top: 3px solid var(--primary-color);
}

.positioning-col.positioning-isnot {
    border-top-color: var(--accent-color);
}

.positioning-label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: var(--space-3);
}

.positioning-col.positioning-isnot .positioning-label {
    color: var(--accent-color);
}

.positioning-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.positioning-col ul li {
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.55;
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.positioning-col ul li::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-top: 0.6rem;
    flex-shrink: 0;
}

.positioning-col.positioning-isnot ul li::before {
    background: var(--accent-color);
}

.positioning-col ul li strong {
    color: var(--text-color);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   20c. Next steps grid — linked destination cards
   -------------------------------------------------------------------------- */
.next-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    margin: var(--space-6) 0 var(--space-12);
}

.next-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-6) var(--space-5);
    color: var(--text-color);
    text-decoration: none;
    transition:
        transform var(--duration-normal) var(--ease-out),
        border-color var(--duration-normal) ease,
        box-shadow var(--duration-normal) ease;
    position: relative;
    overflow: hidden;
}

.next-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.next-card:hover {
    transform: translateY(-3px);
    border-color: hsla(199, 89%, 56%, 0.35);
    box-shadow: var(--shadow-md), 0 0 24px hsla(199, 89%, 56%, 0.06);
    color: var(--text-color);
}

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

.next-card-label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: var(--space-3);
}

.next-card h3 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
    color: #fff;
}

.next-card p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   20d. Landing page responsive overrides
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .next-steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .positioning-grid {
        grid-template-columns: 1fr;
    }

    .positioning-col {
        padding: var(--space-5) var(--space-6);
    }

    .next-steps-grid {
        grid-template-columns: 1fr;
    }

    .tagline-lede {
        font-size: clamp(1.1rem, 5vw, 1.35rem);
    }

    .hero-lede {
        font-size: var(--text-base);
    }
}

/* --------------------------------------------------------------------------
   21. Concept Grid (homepage mental-model section)
   -------------------------------------------------------------------------- */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-4);
    margin: var(--space-8) 0 var(--space-12) 0;
}

.concept-card {
    position: relative;
    display: block;
    padding: var(--space-6);
    background: linear-gradient(
        145deg,
        hsl(217, 33%, 18%) 0%,
        hsl(217, 33%, 15%) 100%
    );
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
}

.concept-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at top right,
        hsla(199, 89%, 56%, 0.10),
        transparent 60%
    );
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
    pointer-events: none;
}

.concept-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md), 0 0 0 1px hsla(199, 89%, 56%, 0.15);
}

.concept-card:hover::after {
    opacity: 1;
}

.concept-card .concept-num {
    font-family: var(--font-display, "Outfit", sans-serif);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--primary-color);
    margin-bottom: var(--space-3);
    opacity: 0.75;
    position: relative;
}

.concept-card h3 {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--text-lg);
    font-weight: 600;
    color: #fff;
    position: relative;
}

.concept-card p {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--text-muted);
    position: relative;
}

@media (max-width: 768px) {
    .concept-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   22. Rule tables (used on Pipeline, Distributed, Service pages)
   -------------------------------------------------------------------------- */
.rule-table {
    width: 100%;
    margin: var(--space-6) 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: var(--text-sm);
}

.rule-table thead {
    background: hsl(217, 33%, 14%);
}

.rule-table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.rule-table td {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-color);
    vertical-align: top;
    line-height: 1.55;
}

.rule-table tbody tr:first-child td {
    border-top: 0;
}

.rule-table tbody tr:hover {
    background: hsla(217, 33%, 25%, 0.4);
}

.rule-table code {
    font-size: 0.95em;
}

.rule-table strong {
    color: #fff;
}

@media (max-width: 768px) {
    .rule-table {
        font-size: var(--text-xs);
    }
    .rule-table th,
    .rule-table td {
        padding: var(--space-2) var(--space-3);
    }
}

/* --------------------------------------------------------------------------
   23. Refinements
   -------------------------------------------------------------------------- */

/* Hero gradient backdrop — softer + wider */
.hero::before {
    background: radial-gradient(
        ellipse at center top,
        hsla(199, 89%, 56%, 0.12),
        hsla(234, 89%, 74%, 0.06) 35%,
        transparent 70%
    );
}

/* Tighter section spacing */
.main-content h2 {
    margin-top: var(--space-12);
    padding-top: var(--space-2);
}

.main-content h2:first-of-type {
    margin-top: var(--space-8);
}

/* Selection */
::selection {
    background: hsla(199, 89%, 56%, 0.32);
    color: #fff;
}

/* Inline code in headings shouldn't get bg */
.main-content h1 code,
.main-content h2 code,
.main-content h3 code,
.main-content h4 code {
    background: transparent;
    padding: 0;
    border: 0;
    font-size: 0.92em;
    color: var(--primary-color);
}

/* Subtitle on per-page hero */
.main-content > .subtitle {
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin: calc(-1 * var(--space-2)) 0 var(--space-10) 0;
    max-width: 64ch;
    line-height: 1.55;
}

/* Lists in body content — slightly tighter */
.main-content ul,
.main-content ol {
    line-height: 1.65;
}

.main-content li + li {
    margin-top: var(--space-1);
}

/* Anchor links on hover */
.main-content h2[id]:hover::before,
.main-content h3[id]:hover::before {
    content: "#";
    position: absolute;
    margin-left: -1.25em;
    color: var(--primary-color);
    opacity: 0.6;
    font-weight: 400;
}
.main-content h2[id],
.main-content h3[id] {
    position: relative;
}
