/* ============ CSS VARIABLES ============ */
:root {
    --bg-primary: #09090b;
    --bg-secondary: #111113;
    --bg-card: #18181b;
    --bg-code: #0c0c0e;
    
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    --border-color: #27272a;
    --border-subtle: #1c1c1f;
    
    --success: #22c55e;
    --warning: #eab308;
    --error: #ef4444;
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent scroll jump on orientation change */
html, body {
    overflow-anchor: auto;
    overscroll-behavior: none;
}

/* Disable text selection on interactive elements */
button,
.btn,
.nav-links a,
.mobile-menu a,
.logo,
.badge,
.tab-btn,
.accordion-header,
.copy-btn,
.mobile-menu-btn,
[role="button"],
[onclick] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent double-tap zoom on interactive elements */
button, a, input, select, textarea, .btn, .tab-btn, .types-tab, .op-btn, .ctx-btn {
    touch-action: manipulation;
}

/* Disable font ligatures in code blocks */
code, pre, .code-block {
    font-variant-ligatures: none;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-anchor: none; /* Prevent scroll jump on orientation change */
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Prevent horizontal overflow on all containers */
section, .section, .config-box, .reference-box, .types-showcase, 
.control-flow-showcase, .mainnet-box, .deploy-step {
    max-width: 100%;
    overflow-x: hidden;
}

/* Allow code blocks to scroll horizontally */
.code-block, .code-window, pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ============ NAVBAR ============ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

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

.logo-icon {
    font-size: 1.5rem;
}

.badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 1.75rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    cursor: pointer;
    padding-bottom: 1rem;
    margin-bottom: -1rem;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-width: 150px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding-top: 0.75rem;
}

.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: flex;
    flex-direction: column;
}

.nav-dropdown.closing .nav-dropdown-content {
    display: none !important;
}

.nav-dropdown-content a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-dropdown-content a:hover {
    background: var(--bg-secondary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    left: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: var(--text-secondary);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    min-height: 44px;
    display: block;
    text-align: left;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.mobile-menu a.mobile-submenu {
    padding-right: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============ HERO SECTION ============ */
.hero {
    min-height: 100vh;
    min-height: 100dvh; /* Modern browsers - stable on orientation change */
    padding: 120px 2rem 80px;
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 4rem;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    margin-bottom: 1.5rem;
    color: var(--accent-secondary);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.hero-stats {
    display: flex;
    gap: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Code Window */
.hero-code {
    position: relative;
}

.code-window {
    background: var(--bg-code);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.filename {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.code-window pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
}

.code-window code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    text-align: left;
}

/* ============ SECTIONS ============ */
.section {
    padding: 100px 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-alt {
    background: var(--bg-secondary);
    max-width: none;
}

.section-alt > * {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-number {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ============ QUICKSTART ============ */
.steps-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.step-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.step-card:hover {
    border-color: var(--accent-primary);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent-primary);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.step-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.step-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* ============ OS TABS ============ */
.os-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.os-tab {
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.os-tab:hover {
    border-color: var(--accent-primary);
}

.os-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.os-content {
    display: none;
}

.os-content.active {
    display: block;
}

/* ============ OPERATION TABS ============ */
.op-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.op-tab {
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.op-tab:hover {
    border-color: var(--accent-primary);
}

.op-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.op-content {
    display: none;
}

.op-content.active {
    display: block;
}

.config-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.config-box h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.config-box > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ============ CODE BLOCKS ============ */
.code-block {
    background: var(--bg-code);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.code-block pre {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ============ SECTION DIVIDER ============ */
.section-divider {
    margin: 3rem 0 2rem;
    text-align: center;
    position: relative;
}

.section-divider::before,
.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 160px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.3;
}

.section-divider::before {
    left: 0;
}

.section-divider::after {
    right: 0;
}

.divider-content {
    display: inline-block;
    padding: 0 2rem;
    position: relative;
}

.divider-icon {
    margin-right: 0.5rem;
    -webkit-text-fill-color: initial;
    background: none;
}

.divider-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.divider-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============ CONCEPTS GRID ============ */
.concepts-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    padding-top: 0.5rem;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
    position: relative;
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

.concepts-grid::-webkit-scrollbar {
    display: none;  /* Chrome/Safari */
}

.concepts-grid::after {
    content: '';
    flex: 0 0 40px;  /* Extra space so last card can scroll fully into view */
}

.concept-card {
    flex: 0 0 700px;
    min-width: 700px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.concept-card:hover {
    border-color: var(--accent-primary);
}

/* Disable hover transforms on touch devices */
@media (hover: none) {
    .concept-card:hover {
        transform: none;
    }
    
    .control-card:hover {
        transform: none;
    }
    
    .type-card:hover {
        transform: none;
    }
    
    .step-card:hover {
        transform: none;
    }
}

.concept-card h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
}

.concept-card > p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Compact code blocks in concept cards */
.concept-card .code-block {
    margin: 0;
}

.concept-card .code-block pre {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.concept-card .code-block code {
    font-size: 0.75rem;
}

.card-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--accent-primary);
}

.card-hint code {
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.concept-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tip {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.tip code {
    color: var(--accent-secondary);
    font-family: var(--font-mono);
}

/* ============ SCROLL DOTS ============ */
.scroll-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.5rem 0;
}

.scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.scroll-dot:hover {
    background: var(--text-muted);
    transform: scale(1.2);
}

.scroll-dot.active {
    background: var(--accent-primary);
    transform: scale(1.2);
}

/* ============ ICMF BOX ============ */
.icmf-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.icmf-flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.icmf-chain {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
}

.icmf-chain .code-block {
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: auto;
}

.icmf-chain pre {
    font-size: 0.75rem;
    padding: 1rem;
    flex: 1;
    margin: 0;
}

.chain-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icmf-arrow {
    font-size: 2rem;
    color: var(--accent-primary);
    padding-top: 3rem;
    animation: pulse-arrow 2s ease-in-out infinite;
}

@keyframes pulse-arrow {
    0%, 100% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(5px); }
}

.icmf-notes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.icmf-notes .card-hint {
    margin-top: 0;
}

@media (max-width: 900px) {
    .icmf-flow {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ============ REFERENCE BOX ============ */
.reference-box {
    margin-top: 4rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

.reference-box h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.reference-box .ref-subtitle {
    color: var(--text-secondary);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.reference-box .ref-subtitle code {
    font-family: var(--font-mono);
    background: var(--bg-code);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

/* Types Section within Reference Box */
.types-section {
    margin-bottom: 1.5rem;
}

.types-section:last-of-type {
    margin-bottom: 0;
}

.types-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* ============ TYPES SHOWCASE ============ */
.types-showcase {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 3rem;
}

.types-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.types-header h3 {
    font-size: 1.25rem;
    margin: 0;
}

.types-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 999px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.types-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 0 1rem;
}

.types-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-family: var(--font-base);
}

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

.types-tab.active {
    color: var(--accent-primary);
}

.types-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.types-content {
    padding: 2rem;
}

.types-category {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.types-category.active {
    display: grid;
}

.type-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.type-card:hover {
    border-color: var(--accent-primary);
}

.type-card-wide {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .type-card-wide {
        grid-column: span 1;
    }
}

.type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.type-header code {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

.type-usage {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.type-alias-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.type-card > p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.type-example {
    background: var(--bg-code);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.75rem;
    overflow-x: auto;
}

.type-example code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.type-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.type-tags span {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-code);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.types-footer {
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.types-tip {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.types-tip strong {
    margin-right: 0.5rem;
}

/* Control Flow Showcase */
.control-flow-showcase {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 3rem;
}

.control-category {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.control-category.active {
    display: grid;
}

.control-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    min-width: 0;
    overflow: hidden;
}

.control-card .code-block {
    overflow-x: auto;
}

.control-card:hover {
    border-color: var(--accent-primary);
}

.control-card-wide {
    grid-column: span 2;
}

.control-card-small {
    grid-column: span 1;
}

@media (max-width: 900px) {
    .control-card-wide {
        grid-column: span 1;
    }
    
    .control-category {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .control-card {
        max-width: 100%;
        overflow-x: auto;
    }
}

.control-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.control-header code {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

.control-usage {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.control-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.control-badge.recommended {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.control-badge.essential {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.control-card > p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.control-card .code-block.compact {
    margin-bottom: 0.75rem;
}

.control-card .code-block.compact pre {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
}

.control-insight {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-primary);
}

.control-insight strong {
    margin-right: 0.3rem;
}

.control-insight code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* Syntax Variants Box */
.syntax-variants {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.syntax-variant {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    min-width: 0;
    overflow: hidden;
}

.syntax-variant h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.syntax-variant h4 code {
    background: var(--bg-code);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--accent-secondary);
}

.syntax-variant > p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.syntax-variant .code-block {
    margin: 0;
}

/* Operator Selector (Interactive Cheatsheet) */
.operator-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.op-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.op-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* op_context buttons - same style as query operators */
.ctx-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.ctx-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.operator-display {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.op-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.op-name {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-secondary);
    background: var(--bg-code);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.op-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.operator-display .code-block {
    margin: 0;
}

/* Architecture Box (Query vs Function) */
.architecture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Module section headings */
.module-types > h4,
.import-section > h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Comparison Table */
.comparison-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.5fr;
    gap: 0;
}

.comparison-row.comparison-header {
    background: var(--bg-secondary);
    font-weight: 600;
}

.comparison-row.comparison-header .comparison-cell {
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparison-cell {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.comparison-row:last-child .comparison-cell {
    border-bottom: none;
}

.comparison-cell.comparison-label {
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.comparison-cell code {
    font-family: var(--font-mono);
    background: var(--bg-code);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin: 0 0.25rem;
}

.comparison-cell code:first-child {
    margin-left: 0;
}

/* Code Examples Grid */
.code-examples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.code-example-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.code-example-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arch-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.arch-item.query-side {
    border-left: 3px solid #22c55e;
}

.arch-item.function-side {
    border-left: 3px solid #6366f1;
}

.arch-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.arch-icon {
    font-size: 1.5rem;
}

.arch-header h4 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.arch-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.query-side .arch-badge {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.function-side .arch-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.arch-item ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.arch-item li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.arch-item li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.arch-item li strong {
    color: var(--text-primary);
}

.arch-item li code {
    font-family: var(--font-mono);
    background: var(--bg-code);
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.arch-code {
    background: var(--bg-code);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.arch-code code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.arch-code code strong {
    color: var(--accent-secondary);
}

.arch-hint {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.arch-hint h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.arch-hint strong {
    color: var(--text-primary);
}

.arch-hint code {
    font-family: var(--font-mono);
    background: var(--bg-code);
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

/* Return Types Box */
.return-types-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.return-type-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.return-type-header {
    display: flex;
    align-items: center;
}

.return-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.return-badge.entity {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.return-badge.tuple {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.return-badge.struct {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.return-type-card .code-block {
    margin: 0;
}

.return-type-card .code-block.compact pre {
    padding: 0.625rem 0.75rem;
    font-size: 0.8rem;
}

.return-type-result {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.return-type-result code {
    font-family: var(--font-mono);
    color: var(--success);
    background: none;
    padding: 0;
}

.return-type-desc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hint-note {
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.ref-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ref-item code {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-secondary);
    font-weight: 600;
}

.ref-item span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Assertions Grid */
.assertions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.assertion-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

.assertion-item code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-secondary);
    font-weight: 500;
}

.assertion-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* GTV & GTX Section */
.gtv-comparison,
.gtv-structure,
.gtv-types,
.gtv-usage {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.gtv-comparison h4,
.gtv-structure h4,
.gtv-types h4,
.gtv-usage h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.gtv-structure .code-block pre {
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ============ PATTERN TABS ============ */
/* Patterns Showcase (uses types-tab style) */
.patterns-showcase {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.patterns-showcase .types-tabs {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.tab-content > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ EXAMPLES SECTION ============ */
.examples-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.example-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.example-tab:hover {
    border-color: var(--accent-primary);
}

.example-tab.active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.example-icon {
    font-size: 1.5rem;
}

.example-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.example-content.active {
    display: block;
}

.example-header {
    text-align: center;
    margin-bottom: 2rem;
}

.example-header h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.example-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.file-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0;
}

.file-tab {
    padding: 0.75rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.file-tab:hover {
    border-color: var(--accent-primary);
}

.file-tab.active {
    background: var(--bg-code);
    color: var(--accent-secondary);
    border-color: var(--border-color);
}

.file-content {
    display: none;
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    overflow: hidden;
    position: relative;
}

.file-content.active {
    display: block;
}

.file-content pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: hidden;
    transition: max-height 0.3s ease;
}

.file-content.expanded pre {
    max-height: none;
    overflow-y: auto;
    padding-bottom: 4rem;
}

.file-content::after {
    content: '';
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--bg-code));
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.file-content.expanded::after {
    opacity: 0;
}

.code-expand-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: var(--bg-code);
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-base);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.code-expand-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

.code-expand-btn .expand-icon {
    transition: transform 0.3s ease;
}

.file-content.expanded .code-expand-btn .expand-icon {
    transform: rotate(180deg);
}

.file-content code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ============ FOOTER ============ */
.footer {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    padding-bottom: 3rem;
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo .logo-icon {
    font-size: 1.5rem;
}

.footer-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.social-link svg {
    fill: currentColor;
}

.social-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.footer-column h4 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.footer-column a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: var(--accent-secondary);
}

/* Footer Bottom - SEO Text */
.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.footer-bottom .seo-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
    max-width: 600px;
    margin: 0.5rem auto 0;
    line-height: 1.5;
}

.footer-bottom .privacy-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-bottom .privacy-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* ============ RESPONSIVE ============ */
/* Navigation breakpoint - mobile menu */
@media (max-width: 1000px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

/* Hero and content breakpoint */
@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 100px;
    }
    
    .hero-content {
        order: 1;
    }
    
    .hero-code {
        order: 2;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .hero-subtitle {
        margin: 0 auto 2rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .concepts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reference-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        flex-direction: column;
        gap: 3rem;
    }
    
    .footer-links {
        gap: 3rem;
    }
    
    /* Architecture grid single column */
    .architecture-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        overflow: hidden;
        width: 100%;
    }
    
    .arch-item {
        padding: 1.25rem;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        overflow: hidden;
    }
    
    .arch-item .code-block {
        max-width: 100%;
        overflow: hidden;
        width: 100%;
    }
    
    .arch-item .code-block pre {
        max-width: 100%;
    }
    
    /* Comparison table responsive */
    .comparison-row {
        grid-template-columns: 0.8fr 1fr 1fr;
    }
    
    .comparison-cell {
        padding: 0.75rem 0.625rem;
        font-size: 0.8rem;
    }
    
    .comparison-row.comparison-header .comparison-cell {
        font-size: 0.85rem;
    }
    
    .code-examples-grid {
        grid-template-columns: 1fr;
        overflow: hidden;
        width: 100%;
    }
    
    .code-example-item {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        overflow: hidden;
    }
    
    .code-example-item .code-block {
        max-width: 100%;
        overflow: hidden;
    }
    
    .code-example-item .code-block pre {
        max-width: 100%;
    }
    
    /* Return types responsive */
    .return-types-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .return-type-card {
        padding: 1rem;
    }
    
    /* Operator selector wrap */
    .operator-selector {
        flex-wrap: wrap;
    }
    
    /* Syntax variants stack */
    .syntax-variant-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 120px 1.25rem 60px;
        min-height: auto;
    }
    
    .nav-container {
        padding: 0 1.25rem;
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.6;
        opacity: 0.9;
    }
    
    .hero-badge {
        font-size: 0.7rem;
        padding: 0.35rem 0.7rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-code {
        max-width: 100%;
        overflow: hidden;
    }
    
    .code-window {
        border-radius: var(--radius-md);
    }
    
    .code-window pre {
        padding: 1rem;
        font-size: 0.75rem;
    }
    
    .code-window code {
        font-size: 0.75rem;
        white-space: pre;
    }
    
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: center;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
    }
    
    .btn {
        flex: 1 1 auto;
        max-width: 200px;
        justify-content: center;
        padding: 0.75rem 1.25rem;
        min-height: 44px;
        font-size: 0.875rem;
    }
    
    .concepts-grid {
        gap: 1rem;
        mask-image: none;
        -webkit-mask-image: none;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .concepts-grid::before {
        display: none;
    }
    
    .concept-card {
        flex: 0 0 calc(100vw - 2rem);
        min-width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        scroll-snap-align: center;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .types-category {
        grid-template-columns: 1fr;
    }
    
    .syntax-variants {
        grid-template-columns: 1fr;
    }

    /* Section headers */
    .section-header h2 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    /* Tabs - horizontal scroll with gradient fade indicators */
    .patterns-showcase,
    .types-showcase {
        position: relative;
        --scroll-left-opacity: 0;
        --scroll-right-opacity: 0;
    }
    
    /* Left gradient - fades in as you scroll right */
    .patterns-showcase::before,
    .types-showcase::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 60px;
        width: 90px;
        background: linear-gradient(to left, transparent, var(--bg-primary));
        pointer-events: none;
        z-index: 3;
        opacity: var(--scroll-left-opacity);
    }
    
    /* Right gradient - fades out as you approach the end */
    .patterns-showcase::after,
    .types-showcase::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        height: 60px;
        width: 90px;
        background: linear-gradient(to right, transparent, var(--bg-primary));
        pointer-events: none;
        z-index: 3;
        opacity: var(--scroll-right-opacity);
    }
    
    .types-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        padding-right: 50px; /* Space so last tab isn't under gradient */
    }
    
    .types-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .types-tab {
        flex-shrink: 0;
        white-space: nowrap;
        min-height: 44px; /* Touch target */
    }
    
    /* Operator buttons */
    .op-btn, .ctx-btn {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }
    
    /* Code blocks - tighter padding */
    .code-block {
        font-size: 0.75rem;
        border-radius: var(--radius-sm);
    }
    
    .code-block pre {
        padding: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Code blocks break out of container padding */
    .mainnet-box .code-block,
    .config-box .code-block,
    .step-card .code-block {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    
    /* Examples section - buttons with scroll gradient indicators */
    .examples-showcase {
        position: relative;
        --scroll-left-opacity: 0;
        --scroll-right-opacity: 0;
    }
    
    .examples-showcase::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 80px;
        width: 90px;
        background: linear-gradient(to left, transparent, var(--bg-secondary));
        pointer-events: none;
        z-index: 3;
        opacity: var(--scroll-left-opacity);
    }
    
    .examples-showcase::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        height: 80px;
        width: 90px;
        background: linear-gradient(to right, transparent, var(--bg-secondary));
        pointer-events: none;
        z-index: 3;
        opacity: var(--scroll-right-opacity);
    }
    
    .examples-tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
        padding-left: 0;
        padding-right: 0;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 1rem;
    }
    
    .examples-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .example-tab {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.75rem 1.25rem;
        scroll-snap-align: start;
    }
    
    .example-tab:last-child {
        margin-right: 1rem;
    }
    
    /* Disable hover effect on touch devices - only show border on active/click */
    .example-tab:hover {
        border-color: var(--border-color);
    }
    
    .example-tab.active {
        border-color: var(--accent-primary);
    }
    
    .example-icon {
        font-size: 1.25rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 2rem;
    }
    
    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .footer-social {
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2rem;
        justify-content: center;
        text-align: center;
    }
    
    .section {
        padding: 48px 1.25rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
        letter-spacing: -0.01em;
    }
    
    .config-box,
    .reference-box {
        padding: 1.5rem;
        border-radius: var(--radius-md);
    }
    
    .config-box > .code-block,
    .reference-box > .code-block {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    /* Code blocks inside nested containers should not have negative margins */
    .arch-item .code-block,
    .code-example-item .code-block {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Section dividers compact */
    .section-divider {
        margin: 2rem 0 1.5rem;
    }
    
    .section-divider::before,
    .section-divider::after {
        display: none;
    }
    
    .divider-content h2 {
        font-size: 1.2rem;
    }
    
    .divider-content p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 40px 1rem;
    }
    
    /* Hide hero code window on narrow portrait screens */
    .hero-code {
        display: none;
    }
    
    .hero {
        min-height: auto;
        padding: 130px 1rem 80px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .hero-badge {
        margin-top: 0.5rem;
        font-size: 0.65rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .config-box,
    .reference-box,
    .types-content,
    .step-card,
    .concept-card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }
    
    /* Control cards compact but readable */
    .control-card,
    .type-card {
        padding: 0.875rem;
        overflow: hidden;
    }
    
    .type-card .type-example {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .type-card .type-example code {
        white-space: nowrap;
        display: block;
    }
    
    .control-card .code-block,
    .type-card .code-block {
        margin-left: 0;
        margin-right: 0;
        border-radius: var(--radius-sm);
    }
    
    .control-header {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .control-header code {
        font-size: 0.85rem;
    }
    
    .control-usage {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .control-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.35rem;
    }
    
    .control-card > p {
        font-size: 0.75rem;
        margin-bottom: 0.625rem;
        line-height: 1.5;
    }
    
    /* Control insight same size as description */
    .control-insight {
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }
    
    .control-insight code {
        font-size: 0.7rem;
    }
    
    /* Code blocks readable on mobile */
    .control-card .code-block.compact pre {
        font-size: 0.7rem;
        padding: 0.625rem 0.75rem;
    }
    
    .concept-card {
        flex: 0 0 calc(100vw - 2rem);
        min-width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
    }
    
    .concept-card .code-block pre {
        font-size: 0.7rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* All code blocks readable */
    .code-block pre {
        font-size: 0.7rem;
        padding: 0.75rem;
    }
    
    .code-block code {
        font-size: 0.7rem;
    }
    
    /* Complete Examples code blocks - same size as other code blocks */
    .file-content pre {
        font-size: 0.7rem;
        padding: 0.75rem;
    }
    
    .file-content code {
        font-size: 0.7rem;
    }
    
    /* Concept card text compact */
    .concept-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .concept-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.35rem;
    }
    
    .concept-card > p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        line-height: 1.5;
    }
    
    .concept-tips {
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .concept-tips .tip {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }
    
    .concept-tips .tip code {
        font-size: 0.75rem;
    }
    
    .card-hint {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        margin-top: 0.75rem;
    }
    
    .card-hint code {
        font-size: 0.75rem;
    }
    
    /* Deploy notes same as card-hint on mobile */
    .deploy-note {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .deploy-note li {
        font-size: 0.75rem;
    }
    
    .deploy-note ul {
        margin: 6px 0 0 14px !important;
    }
    
    .deploy-note code {
        font-size: 0.7rem;
    }
    
    .code-block pre,
    .code-window pre {
        padding: 0.75rem;
    }
    
    .hero h1 {
        font-size: 1.625rem;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
        line-height: 1.6;
        opacity: 0.9;
    }
    
    .hero-actions {
        flex-direction: row;
        gap: 0.625rem;
        width: 100%;
    }
    
    .btn {
        flex: 1;
        width: auto;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
        min-height: 48px;
    }
    
    .file-tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .file-tab {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
    
    .reference-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .reference-card {
        padding: 1rem;
    }
    
    /* Hide elements on mobile */
    .hide-mobile {
        display: none !important;
    }
    
    /* Assertions grid mobile */
    .assertions-grid {
        gap: 0.375rem;
    }
    
    .assertion-item {
        padding: 0.375rem 0.5rem;
        gap: 0.375rem;
    }
    
    .assertion-item code {
        font-size: 0.7rem;
    }
    
    .assertion-item span {
        font-size: 0.65rem;
    }
    
    .hint-note {
        font-size: 0.75rem;
        line-height: 1.5;
    }
    
    /* Reference items (assert_equals, etc.) */
    .ref-item code {
        font-size: 0.8rem;
    }
    
    .ref-item span {
        font-size: 0.75rem;
    }
    
    .reference-grid {
        gap: 0.625rem;
    }
    
    /* Section header smaller */
    .section-header h2 {
        font-size: 1.375rem;
        letter-spacing: -0.01em;
    }
    
    .section-header p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* Types showcase mobile */
    .types-tabs {
        gap: 0.375rem;
        padding: 0.625rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--bg-tertiary);
        border-radius: var(--radius-md);
    }
    
    .types-tab {
        font-size: 0.8rem;
        padding: 0.625rem 0.875rem;
        min-height: 42px;
        flex: 0 0 auto;
        white-space: nowrap;
        text-align: center;
        justify-content: center;
    }
    
    .types-tab .tab-icon {
        display: none;
    }
    
    /* Example buttons with scroll gradients */
    .examples-showcase {
        position: relative;
        --scroll-left-opacity: 0;
        --scroll-right-opacity: 0;
    }
    
    .examples-showcase::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 60px;
        width: 70px;
        background: linear-gradient(to left, transparent, var(--bg-secondary));
        pointer-events: none;
        z-index: 3;
        opacity: var(--scroll-left-opacity);
    }
    
    .examples-showcase::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        height: 60px;
        width: 70px;
        background: linear-gradient(to right, transparent, var(--bg-secondary));
        pointer-events: none;
        z-index: 3;
        opacity: var(--scroll-right-opacity);
    }
    
    .examples-tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
        padding-left: 0;
        padding-right: 0;
        justify-content: flex-start;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 1rem;
    }
    
    .examples-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .example-tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        gap: 0.4rem;
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
    }
    
    .example-tab:last-child {
        margin-right: 1rem;
    }
    
    .example-icon {
        font-size: 1rem;
    }
    
    .example-header h3 {
        font-size: 1.1rem;
    }
    
    .example-header p {
        font-size: 0.75rem;
    }
    
    .type-card {
        padding: 0.875rem;
    }
    
    .type-card h4 {
        font-size: 0.85rem;
    }
    
    .type-card > p {
        font-size: 0.75rem;
    }
    
    /* Operator selector compact */
    .operator-selector {
        padding: 0.625rem;
        gap: 0.375rem;
        background: var(--bg-tertiary);
        border-radius: var(--radius-md);
    }
    
    .op-btn, .ctx-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        min-height: 42px;
    }
    
    /* Operator display compact */
    .operator-display {
        padding: 1rem;
    }
    
    .op-name {
        font-size: 1rem;
        padding: 0.25rem 0.625rem;
    }
    
    .op-desc {
        font-size: 0.8rem;
    }
    
    .op-info {
        gap: 0.625rem;
        margin-bottom: 1rem;
    }
    
    /* Comparison table mobile */
    .comparison-table {
        font-size: 0.75rem;
    }
    
    .comparison-row {
        grid-template-columns: 0.6fr 1fr 1fr;
    }
    
    .comparison-cell {
        padding: 0.5rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .comparison-row.comparison-header .comparison-cell {
        font-size: 0.75rem;
        gap: 0.25rem;
    }
    
    .comparison-row.comparison-header .arch-icon {
        font-size: 0.9rem;
    }
    
    .comparison-cell.comparison-label {
        font-size: 0.65rem;
    }
    
    .comparison-cell code {
        font-size: 0.65rem;
        padding: 0.1rem 0.25rem;
    }
    
    /* Code example labels - no uppercase on mobile */
    .code-example-label {
        text-transform: none;
    }
    
    /* Architecture items compact (Define in Module, Configure in YAML, etc.) */
    .arch-item {
        padding: 1rem;
    }
    
    .arch-header {
        gap: 0.625rem;
        margin-bottom: 0.875rem;
    }
    
    .arch-icon {
        font-size: 1.25rem;
    }
    
    .arch-header h4 {
        font-size: 0.9rem;
    }
    
    .arch-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .arch-item li {
        font-size: 0.8rem;
        padding: 0.375rem 0;
        padding-left: 1.125rem;
    }
    
    .arch-item li code {
        font-size: 0.75rem;
        padding: 0.125rem 0.375rem;
    }
    
    /* Deploy steps compact */
    .deploy-step {
        padding: 0.875rem !important;
        gap: 0.75rem;
    }
    
    .deploy-step-number {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }
    
    .deploy-step-content h3 {
        font-size: 1rem !important;
    }
    
    .deploy-step-content > p {
        font-size: 0.8rem;
        margin-bottom: 0.875rem;
        line-height: 1.5;
    }
    
    /* Deploy list compact */
    .deploy-list {
        padding-left: 1.25rem;
        line-height: 1.6;
        font-size: 0.8rem;
    }
    
    .deploy-list li {
        margin-bottom: 0.5rem;
    }
    
    .deploy-list code {
        font-size: 0.7rem;
        padding: 0.15rem 0.375rem;
    }
    
    /* Mainnet box compact */
    .mainnet-box {
        padding: 0.875rem !important;
    }
    
    .mainnet-box .code-block,
    .config-box .code-block {
        margin-left: 0;
        margin-right: 0;
        border-radius: var(--radius-sm);
    }
    
    .mainnet-box h3 {
        font-size: 1.1rem !important;
    }
    
    .mainnet-box > p {
        font-size: 0.75rem !important;
        margin-bottom: 1rem;
    }
    
    /* Mainnet differences grid */
    .mainnet-differences {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .diff-label {
        font-size: 0.7rem !important;
    }
    
    .diff-item span:last-child {
        font-size: 0.7rem !important;
    }
    
    .diff-item span:last-child a {
        font-size: 0.7rem !important;
    }
    
    .diff-item code {
        font-size: 0.65rem !important;
        padding: 0.1rem 0.3rem;
    }
    
    /* Deploy link buttons */
    .deploy-link {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Section divider */
    .divider-content {
        padding: 0 1rem;
    }
    
    /* ICMF box */
    .icmf-box {
        padding: 0.75rem;
    }
    
    .chain-label {
        font-size: 0.7rem;
    }
    
    .icmf-arrow {
        font-size: 1.5rem;
        padding-top: 1.5rem;
    }
    
    /* Syntax variants */
    .syntax-variant h5 {
        font-size: 0.8rem;
    }
    
    .syntax-variant p {
        font-size: 0.8rem;
    }
    
    /* GTV section */
    .gtv-comparison h4,
    .gtv-structure h4,
    .gtv-types h4,
    .gtv-usage h4 {
        font-size: 0.9rem;
    }
    
    .gtv-grid {
        gap: 0.625rem;
    }
    
    .gtv-item h5 {
        font-size: 0.85rem;
    }
    
    .gtv-item p {
        font-size: 0.75rem;
    }
    
    /* Footer compact */
    .footer {
        padding: 2.5rem 1rem 1.5rem;
    }
    
    .footer-tagline {
        font-size: 0.8rem;
    }
    
    .footer-column h4 {
        font-size: 0.9rem;
    }
    
    .footer-column a {
        font-size: 0.85rem;
        padding: 0.375rem 0;
    }
    
    /* Step cards compact */
    .step-header h3 {
        font-size: 1.05rem;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    /* Scroll dots larger for touch */
    .scroll-dots {
        gap: 0.875rem;
        padding: 1rem 0;
    }
    
    .scroll-dot {
        width: 10px;
        height: 10px;
    }
}

/* Extra small devices (320px and below) */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    .types-tab {
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
    }
    
    .types-tab .tab-icon {
        display: none;
    }
    
    .op-btn, .ctx-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }
    
    .code-block pre,
    .code-window pre {
        font-size: 0.6rem;
        padding: 0.5rem;
    }
    
    .concept-card h3 {
        font-size: 1rem;
    }
    
    .step-header h3 {
        font-size: 0.9rem;
    }
    
    .divider-content h2 {
        font-size: 1rem;
    }
}

/* Landscape mobile optimization - minimal to prevent scroll jump */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 70px 1rem 40px;
    }
    
    .hero-actions {
        flex-direction: row;
        gap: 1rem;
    }
    
    .hero-actions .btn {
        width: auto;
        flex: 0 0 auto;
    }
    
    .section {
        padding: 40px 1rem;
    }
    
    .types-category {
        grid-template-columns: 1fr;
    }
    
    .examples-tabs {
        justify-content: center;
    }
}

/* ============ DEPLOY SECTION ============ */
.deploy-flow {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.deploy-step {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.deploy-step:hover {
    border-color: var(--accent-primary);
}

.deploy-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent-primary);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.deploy-step-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.deploy-step-content > p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.deploy-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.deploy-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.2s;
}

.deploy-link:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.deploy-note {
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-left: 2px solid var(--accent-primary);
}

.deploy-note.warning {
    background: rgba(239, 68, 68, 0.08);
    border-left: 2px solid #ef4444;
}

.deploy-note.warning ul {
    color: var(--text-secondary);
}

.deploy-note.warning li {
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.deploy-note.success {
    background: rgba(34, 197, 94, 0.08);
    border-left: 2px solid #22c55e;
}

.deploy-note.success ul {
    color: var(--text-secondary);
}

.deploy-note.success li {
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.deploy-note strong {
    color: var(--text-primary);
}

.deploy-list {
    list-style: decimal;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.deploy-list li {
    margin-bottom: 0.5rem;
}

.deploy-list a {
    color: var(--accent-secondary);
}

.deploy-list code {
    font-family: var(--font-mono);
    background: var(--bg-code);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

/* Mainnet Box */
.mainnet-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.mainnet-box h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.mainnet-box > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.mainnet-differences {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.diff-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.diff-label {
    font-weight: 600;
    color: var(--success);
    font-size: 0.85rem;
}

.diff-item span:last-child {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.diff-item code {
    font-family: var(--font-mono);
    background: var(--bg-code);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

/* ============ ACCOUNT MANAGEMENT SECTION ============ */
.account-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.account-mgmt-id-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
}

.account-mgmt-approaches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.account-mgmt-approaches .code-block pre {
    padding: 1rem 1.25rem;
}

.account-mgmt-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.account-mgmt-big-picture {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-mgmt-big-picture-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

/* Responsive Account Management */
@media (max-width: 768px) {
    .account-mgmt-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .account-mgmt-id-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .account-mgmt-id-grid > div:nth-child(2) {
        display: none; /* Hide the "Both use .hash()" center element */
    }
    
    .account-mgmt-approaches {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .account-mgmt-stats {
        display: flex;
        flex-wrap: wrap;
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .account-mgmt-big-picture {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .account-mgmt-big-picture-icon {
        font-size: 2rem;
    }
    
    #account-management h3 {
        font-size: 1.25rem;
    }
    
    #account-management .ref-subtitle {
        font-size: 0.85rem;
    }
    
    /* Account ID Generation mobile fixes */
    .account-id-gen-box {
        padding: 1rem !important;
    }
    
    .account-id-gen-box h4 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem !important;
    }
    
    .account-mgmt-id-grid > div {
        padding: 0.75rem !important;
    }
    
    .account-mgmt-id-grid strong {
        font-size: 0.85rem;
    }
    
    .id-gen-details {
        font-size: 0.75rem !important;
    }
    
    .id-gen-result {
        padding: 0.5rem !important;
        font-size: 0.8rem;
    }
    
    .id-gen-result code {
        font-size: 0.75rem !important;
    }
}

/* Responsive Deploy */
@media (max-width: 768px) {
    .mainnet-differences {
        grid-template-columns: 1fr;
    }
    
    .deploy-links {
        flex-direction: column;
    }
    
    .file-content.expanded pre {
        padding-bottom: 4rem;
    }
}

/* ============ SYNTAX HIGHLIGHTING OVERRIDES ============ */
.hljs {
    background: transparent !important;
}
