/* ===== BASE & RESET ===== */
html { scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #0f172a;
    color: #cbd5e1;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

::selection { background: #e31937; color: #fff; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { color: #f1f5f9; font-weight: 700; line-height: 1.2; }
h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
a { color: #60a5fa; text-decoration: none; transition: color 0.2s; }
a:hover { color: #93c5fd; }
code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.85em; }
p code { background: #1e293b; padding: 2px 6px; border-radius: 4px; color: #f472b6; }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
section { min-height: 100vh; padding: 6rem 0; position: relative; }
.section-dark { background: #020617; }
.section-mid { background: #0f172a; }

/* ===== NAVIGATION ===== */
nav {
    position: fixed; top: 0; width: 100%; z-index: 100;
    background: rgba(2, 6, 23, 0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid #1e293b;
}
nav .nav-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between; height: 64px;
}
nav .logo { font-size: 1.25rem; font-weight: 800; color: #fff; }
nav .logo span { color: #e31937; }
nav .nav-links { display: flex; gap: 0.25rem; align-items: center; }
nav .nav-links a {
    padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
    color: #94a3b8; transition: all 0.2s;
}
nav .nav-links a:hover { color: #fff; background: #1e293b; }
nav .nav-links a.active { color: #fff; background: #e31937; }

/* ===== PROGRESS BAR ===== */
#progress-bar {
    position: fixed; top: 64px; left: 0; height: 3px; z-index: 99;
    background: linear-gradient(90deg, #e31937, #f97316, #eab308);
    transition: width 0.1s linear; width: 0%;
}

/* ===== HERO ===== */
.hero { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 100vh; padding-top: 64px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin-bottom: 1.5rem; }
.hero .gradient-text {
    background: linear-gradient(135deg, #e31937, #f97316, #eab308);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero .subtitle { font-size: 1.25rem; color: #64748b; max-width: 600px; margin: 0 auto 2rem; }
.badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: 999px;
    border: 1px solid #334155; background: rgba(30,41,59,0.5);
    color: #94a3b8; font-size: 0.85rem; margin-bottom: 1.5rem;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #e31937; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== TRIAD CARDS ===== */
.triad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.triad-card {
    padding: 2rem; border-radius: 16px; border: 1px solid #1e293b;
    background: #0f172a; transition: transform 0.3s, box-shadow 0.3s;
}
.triad-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.triad-card .icon { font-size: 2rem; margin-bottom: 1rem; }
.triad-card h4 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.triad-card p { font-size: 0.9rem; color: #94a3b8; }
.border-red { border-left: 4px solid #e31937; }
.border-yellow { border-left: 4px solid #eab308; }
.border-blue { border-left: 4px solid #3b82f6; }

/* ===== WORKSHOP AGENDA ===== */
.agenda-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 2rem; }
.agenda-card {
    padding: 1.5rem; border-radius: 12px; background: #1e293b; border: 1px solid #334155;
    position: relative; overflow: hidden;
}
.agenda-card .time { font-size: 0.8rem; color: #e31937; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.agenda-card h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.agenda-card p { font-size: 0.85rem; color: #64748b; }

/* ===== MODE TOGGLE ===== */
.mode-toggle {
    display: flex; justify-content: center; margin-bottom: 2rem;
    background: #1e293b; border-radius: 12px; padding: 4px; display: inline-flex;
}
.mode-toggle-wrapper { display: flex; justify-content: center; margin-bottom: 2rem; }
.mode-btn {
    padding: 0.65rem 1.5rem; border-radius: 10px; border: none; cursor: pointer;
    font-size: 0.9rem; font-weight: 600; transition: all 0.25s;
    background: transparent; color: #64748b; font-family: inherit;
}
.mode-btn.active-flourish { background: #16a34a; color: #fff; box-shadow: 0 4px 12px rgba(22,163,74,0.3); }
.mode-btn.active-python { background: #2563eb; color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.mode-btn:hover:not(.active-flourish):not(.active-python) { color: #cbd5e1; }

/* ===== CONTENT PANELS ===== */
.panel { display: none; }
.panel.visible { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.workshop-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; }
@media (max-width: 900px) { .workshop-layout { grid-template-columns: 1fr; } }

/* ===== INSTRUCTION CARDS ===== */
.instruction-card {
    background: #0f172a; border: 1px solid #1e293b; border-radius: 16px;
    padding: 2rem; margin-bottom: 1.5rem;
}
.instruction-card .step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; font-size: 0.85rem; font-weight: 700;
    margin-right: 0.75rem;
}
.flourish-step .step-num { background: rgba(22,163,74,0.15); color: #4ade80; }
.python-step .step-num { background: rgba(37,99,235,0.15); color: #60a5fa; }

.step-item {
    padding: 1rem 1.25rem; background: #1e293b; border-radius: 10px;
    margin-bottom: 0.75rem; font-size: 0.95rem;
}
.step-item strong { color: #f1f5f9; }

/* ===== CODE BLOCKS ===== */
.code-block-wrapper { position: relative; margin: 1rem 0; }
.code-block-wrapper .copy-btn {
    position: absolute; top: 0.75rem; right: 0.75rem;
    background: #334155; border: none; color: #94a3b8; padding: 0.35rem 0.75rem;
    border-radius: 6px; font-size: 0.75rem; cursor: pointer; transition: all 0.2s;
    font-family: inherit;
}
.code-block-wrapper .copy-btn:hover { background: #475569; color: #fff; }
pre { background: #020617 !important; border: 1px solid #1e293b; border-radius: 12px; padding: 1.5rem; overflow-x: auto; }
pre code { font-size: 0.85rem; line-height: 1.6; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: sticky; top: 84px; align-self: start;
}
.sidebar-card {
    background: #1e293b; border-radius: 16px; padding: 1.5rem;
    border: 1px solid #334155; margin-bottom: 1rem;
}
.sidebar-card h4 { font-size: 1rem; margin-bottom: 1rem; }
.checklist-item {
    display: flex; align-items: flex-start; gap: 0.5rem;
    margin-bottom: 0.75rem; font-size: 0.85rem;
}
.checklist-item .check { color: #4ade80; margin-top: 2px; flex-shrink: 0; }
.checklist-item span strong { color: #f1f5f9; }

/* ===== IMAGE REVEAL (The Trap) ===== */
.trap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 2rem 0; }
@media (max-width: 768px) { .trap-grid { grid-template-columns: 1fr; } }
.trap-card {
    border-radius: 16px; overflow: hidden; border: 1px solid #1e293b;
    background: #0f172a; transition: all 0.3s;
}
.trap-card:hover { border-color: #334155; }
.trap-card img { width: 100%; height: auto; display: block; }
.trap-card .caption { padding: 1.5rem; }
.trap-card .caption h4 { font-size: 1.1rem; }
.trap-card .caption p { font-size: 0.9rem; color: #94a3b8; }
.trap-label {
    display: inline-block; padding: 0.25rem 0.75rem; border-radius: 6px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}
.label-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.label-success { background: rgba(34,197,94,0.15); color: #4ade80; }

/* ===== ACTIVITY BOX ===== */
.activity-box {
    background: linear-gradient(135deg, rgba(234,179,8,0.05), rgba(249,115,22,0.05));
    border: 1px solid #854d0e; border-radius: 16px; padding: 2rem; margin: 2rem 0;
}
.activity-box h4 { color: #fbbf24; }
.activity-box .activity-tag {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px;
    font-size: 0.75rem; font-weight: 600; margin-bottom: 0.5rem;
}
.tag-basic { background: rgba(22,163,74,0.15); color: #4ade80; }
.tag-advanced { background: rgba(37,99,235,0.15); color: #60a5fa; }

/* ===== SECTION HEADERS ===== */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header .section-label {
    display: inline-block; font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem;
    padding: 0.35rem 1rem; border-radius: 6px;
}
.label-scientist { background: rgba(239,68,68,0.1); color: #f87171; }
.label-artist { background: rgba(234,179,8,0.1); color: #fbbf24; }
.label-author { background: rgba(59,130,246,0.1); color: #60a5fa; }
.label-hook { background: rgba(168,85,247,0.1); color: #c084fc; }
.section-header .section-subtitle { color: #64748b; font-size: 1.1rem; max-width: 650px; margin: 0 auto; }

/* ===== TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.85rem; }
.data-table th { background: #1e293b; color: #94a3b8; text-align: left; padding: 0.75rem 1rem; font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #1e293b; }
.data-table tr:hover td { background: rgba(30,41,59,0.5); }

/* ===== GOOD VS BAD VIZ ===== */
.viz-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 2rem 0; }
@media (max-width: 768px) { .viz-comparison { grid-template-columns: 1fr; } }
.viz-card { border-radius: 16px; padding: 2rem; border: 2px solid; }
.viz-bad { border-color: #991b1b; background: rgba(153,27,27,0.05); }
.viz-good { border-color: #166534; background: rgba(22,101,52,0.05); }
.viz-card h4 { margin-bottom: 1rem; }
.viz-card ul { list-style: none; padding: 0; }
.viz-card ul li { padding: 0.35rem 0; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }

/* ===== STORY CARDS (Author section) ===== */
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.story-card {
    padding: 2rem; border-radius: 16px; background: #0f172a;
    border: 1px solid #1e293b; transition: transform 0.3s;
}
.story-card:hover { transform: translateY(-4px); }
.story-card .persona {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: 0.75rem;
}
.story-card .headline { font-size: 1.15rem; font-weight: 700; color: #f1f5f9; margin-bottom: 0.75rem; line-height: 1.4; }
.story-card .approach { font-size: 0.85rem; color: #94a3b8; }

/* ===== DOWNLOAD SECTION ===== */
.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.download-card {
    background: #1e293b; padding: 1.25rem; border-radius: 12px; border: 1px solid #334155;
    display: flex; align-items: center; gap: 1rem; transition: border-color 0.2s;
}
.download-card:hover { border-color: #e31937; }
.download-card .dl-icon { font-size: 1.5rem; color: #e31937; flex-shrink: 0; }
.download-card .dl-info h4 { font-size: 0.95rem; margin-bottom: 0.15rem; }
.download-card .dl-info p { font-size: 0.8rem; color: #64748b; }

/* ===== FOOTER ===== */
footer {
    background: #020617; border-top: 1px solid #1e293b;
    padding: 3rem 0; text-align: center;
}
footer p { color: #475569; font-size: 0.9rem; }
footer p + p { margin-top: 0.5rem; font-size: 0.8rem; }

/* ===== SCROLL ANIMATIONS ===== */
.scroll-reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.revealed { opacity: 1; transform: translateY(0); }

/* ===== SCREENSHOT SHOWCASE ===== */
.screenshot-showcase {
    margin: 2rem 0;
    text-align: center;
}
.screenshot-showcase .showcase-img {
    width: 100%;
    max-width: 900px;
    border-radius: 16px;
    border: 1px solid #1e293b;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}
.screenshot-showcase .showcase-img:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.screenshot-caption {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

/* ===== TOOLTIP ===== */
.tooltip { position: relative; cursor: help; border-bottom: 1px dashed #64748b; }
.tooltip:hover::after {
    content: attr(data-tip); position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%); background: #334155; color: #f1f5f9;
    padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.8rem;
    white-space: nowrap; z-index: 10;
}

/* ===== HAMBURGER MENU ===== */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: #f1f5f9;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 101;
}

/* ===== RESPONSIVE: TABLET (max-width: 900px) ===== */
@media (max-width: 900px) {
    .workshop-layout { grid-template-columns: 1fr; }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .container { padding: 0 1.5rem; }
    section { padding: 4rem 0; }
}

/* ===== RESPONSIVE: MOBILE (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Navigation */
    .nav-hamburger { display: block; }

    nav .nav-links {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(2, 6, 23, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid #1e293b;
        gap: 0.25rem;
        z-index: 100;
    }
    nav .nav-links.nav-open {
        display: flex;
    }
    nav .nav-links a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        text-align: center;
        border-radius: 8px;
    }

    /* Hero */
    .hero { min-height: auto; padding: 6rem 0 3rem; }
    .hero h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
    .hero .subtitle { font-size: 1rem; }

    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    /* Layout */
    .container { padding: 0 1rem; }
    section { padding: 3rem 0; }

    /* Grids */
    .triad-grid { grid-template-columns: 1fr; }
    .agenda-grid { grid-template-columns: 1fr; }
    .trap-grid { grid-template-columns: 1fr; }
    .viz-comparison { grid-template-columns: 1fr; }
    .story-grid { grid-template-columns: 1fr; }
    .download-grid { grid-template-columns: 1fr; }

    /* Sidebar stacks on mobile */
    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Cards */
    .triad-card, .instruction-card, .story-card, .activity-box {
        padding: 1.25rem;
    }

    /* Code blocks */
    pre { padding: 1rem; font-size: 0.75rem; }
    pre code { font-size: 0.75rem; line-height: 1.5; }
    .code-block-wrapper .copy-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Mode toggle */
    .mode-btn { padding: 0.5rem 1rem; font-size: 0.8rem; }

    /* Table */
    .data-table { font-size: 0.75rem; }
    .data-table th, .data-table td { padding: 0.5rem; }

    /* Screenshots */
    .screenshot-showcase .showcase-img {
        border-radius: 10px;
    }

    /* Footer */
    footer { padding: 2rem 0; }
    footer p { font-size: 0.8rem; }
}

/* ===== RESPONSIVE: SMALL MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
    .hero h1 { font-size: 1.5rem; }
    .badge { font-size: 0.75rem; padding: 0.35rem 0.75rem; }
    .hero .subtitle { font-size: 0.9rem; }

    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.1rem; }

    .container { padding: 0 0.75rem; }
    section { padding: 2.5rem 0; }

    .section-header { margin-bottom: 2rem; }
    .section-header .section-subtitle { font-size: 0.9rem; }

    .triad-card, .instruction-card { padding: 1rem; }
    .step-item { padding: 0.75rem; font-size: 0.85rem; }

    .mode-toggle { flex-direction: column; width: 100%; }
    .mode-btn { width: 100%; text-align: center; }

    pre { padding: 0.75rem; }
    pre code { font-size: 0.7rem; }

    .story-card .headline { font-size: 1rem; }
    .story-card .approach { font-size: 0.8rem; }

    .download-card { padding: 1rem; }
    .download-card .dl-icon { font-size: 1.25rem; }
    .download-card .dl-info h4 { font-size: 0.85rem; }

    .activity-box { padding: 1.25rem; }
}
