:root {
    /* Light Theme (Default) */
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.7);
    --text-main: #09090B;
    --text-muted: #71717A;
    --border: #E4E4E7;
    --border-hover: #D4D4D8;

    --btn-bg: #18181B;
    --btn-text: #FFFFFF;
    --btn-hover: #27272A;

    --brand-glow: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    --brand-text: linear-gradient(135deg, #0284C7, #4F46E5);
    --icon-bg: #F4F4F5;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.15);

    --accent: #0284C7;
    --accent-bg: rgba(2, 132, 199, 0.1);

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg: #09090B;
    --surface: #121214;
    --surface-glass: rgba(18, 18, 20, 0.7);
    --text-main: #FAFAFA;
    --text-muted: #A1A1AA;
    --border: #27272A;
    --border-hover: #3F3F46;

    --btn-bg: #FAFAFA;
    --btn-text: #09090B;
    --btn-hover: #E4E4E7;

    --brand-glow: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    --brand-text: linear-gradient(135deg, #38BDF8, #818CF8);
    --icon-bg: #18181B;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 40px -12px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 32px rgba(59, 130, 246, 0.2);

    --accent: #38BDF8;
    --accent-bg: rgba(56, 189, 248, 0.1);
}

/* --- BASE STYLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.container {
    width: 1200px;
    max-width: 90%;
    margin: auto;
}

/* --- BACKGROUND MESH --- */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 800px;
    background: var(--brand-glow);
    filter: blur(100px);
    z-index: -1;
    opacity: 0.8;
    pointer-events: none;
    transition: background 0.4s ease;
}

/* --- HERO --- */
.hero {
    padding: 120px 0 64px;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.hero h1 {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 24px;
}

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

.hero p {
    color: var(--text-muted);
    font-size: 20px;
    max-width: 650px;
    margin: 0 auto;
}

/* --- COC LAYOUT --- */
.layout-container {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 64px;
    margin-bottom: 100px;
}

/* --- SIDEBAR --- */
.sidebar-wrapper {
    position: relative;
}

.sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    padding-left: 16px;
}

.side-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.side-link:hover {
    color: var(--text-main);
    background: var(--surface-glass);
}

.side-link.active {
    color: var(--text-main);
    font-weight: 600;
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

/* --- POLICY CARDS (Matching Bento Items) --- */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.policy-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.policy-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.icon-box {
    width: 48px;
    height: 48px;
    background: var(--icon-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 24px;
}

.policy-card h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.policy-card p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 16px;
}

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

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

/* --- BEHAVIOR LISTS --- */
.behavior-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 32px;
}

.behavior-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--surface-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    align-items: flex-start;
}

.behavior-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.b-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.b-icon-wrap.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.b-icon-wrap.warning {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.behavior-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

.behavior-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

/* --- EXPANDABLE BLOCK --- */
.expand-block {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
}

.expand-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.expand-trigger:hover {
    background: var(--surface-glass);
}

.expand-trigger i {
    transition: transform 0.3s ease;
}

.expand-trigger[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.expand-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.expand-trigger[aria-expanded="true"]+.expand-content {
    grid-template-rows: 1fr;
}

.expand-inner {
    overflow: hidden;
    padding: 0 20px;
}

.expand-inner>div {
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

/* --- TERMINAL (Reusing Landing Page Style) --- */
.terminal {
    background: #09090B;
    border-radius: var(--radius-md);
    border: 1px solid #27272A;
    overflow: hidden;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
    margin-top: 32px;
}

.terminal-header {
    background: #18181B;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #27272A;
    align-items: center;
}

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

.mac-close {
    background: #FF5F56;
}

.mac-min {
    background: #FFBD2E;
}

.mac-max {
    background: #27C93F;
}

.terminal-title {
    margin-left: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #A1A1AA;
}

.terminal-body {
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.terminal-text h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #FAFAFA;
    letter-spacing: -0.5px;
}

.terminal-text p {
    font-size: 15px;
    color: #A1A1AA;
    max-width: 400px;
    margin: 0;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #18181B;
    border: 1px solid #27272A;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    color: #FAFAFA;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-copy:hover {
    background: #27272A;
    border-color: #3F3F46;
}

.btn-copy i {
    color: #38BDF8;
}

.copy-success {
    position: absolute;
    inset: 0;
    background: #10B981;
    color: #09090B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.btn-copy.copied .copy-success {
    transform: translateY(0);
}

/* --- TIMELINE / LADDER --- */
.timeline {
    margin-top: 40px;
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    border-radius: 2px;
}

.timeline-step {
    position: relative;
    padding-bottom: 40px;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -24px;
    top: 0;
    width: 24px;
    height: 24px;
    transform: translateX(-50%);
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.timeline-step:hover .timeline-marker {
    border-color: #0284C7;
    color: #0284C7;
}

.timeline-step:nth-child(4):hover .timeline-marker {
    border-color: #EF4444;
    color: #EF4444;
}

.timeline-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 16px;
    font-size: 14px;
    background: var(--surface-glass);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.timeline-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    margin-top: 4px;
}

.timeline-desc {
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- ATTRIBUTION --- */
.attribution-card {
    background: transparent;
    border: 1px dashed var(--border);
    padding: 32px;
    text-align: center;
}

.attribution-card p {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.attribution-card a {
    color: var(--text-main);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 4px;
    transition: all 0.2s;
}

.attribution-card a:hover {
    text-decoration-color: #0284C7;
    color: #0284C7;
}

/* --- ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE --- */

/* Tablet & Smaller Desktop */
@media (max-width: 1024px) {
    .layout-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .sidebar-wrapper {
        display: none;
    }

    .hero h1 {
        font-size: 48px;
    }

    .policy-card {
        padding: 32px;
    }

    .terminal-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .timeline-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .timeline-label {
        margin-top: 12px;
    }

    .timeline-label:first-child {
        margin-top: 0;
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 768px) {
    .hero {
        padding: 80px 0 40px;
    }

    .hero h1 {
        font-size: 40px;
        letter-spacing: -1px;
    }

    .hero p {
        font-size: 18px;
    }

    .policy-card {
        padding: 24px;
    }

    .policy-card h2 {
        font-size: 24px;
    }

    /* Stack behavior items vertically if things get too cramped */
    .behavior-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Mobile Portrait (Phones) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 32px;
        margin-bottom: 16px;
    }

    .hero p {
        font-size: 16px;
    }

    .logo {
        font-size: 16px;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
    }

    .policy-card {
        padding: 20px;
    }

    .icon-box {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-bottom: 16px;
    }

    .terminal-body {
        padding: 20px;
    }

    .terminal-text h3 {
        font-size: 18px;
    }

    /* Make the copy button full width on tiny screens */
    .btn-copy {
        width: 100%;
        justify-content: center;
        font-size: 11px;
    }

    /* Adjust timeline connecting lines and markers for tight spaces */
    .timeline {
        padding-left: 20px;
        margin-top: 24px;
    }

    .timeline-marker {
        left: -20px;
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .timeline-grid {
        padding: 16px;
        font-size: 13px;
    }

    .expand-trigger {
        padding: 12px 16px;
        font-size: 14px;
    }

    .expand-inner {
        padding: 0 16px;
    }
}