/* ===========================================
   VS CODE MODERN THEME — SLIDE DECK
   Colors sourced from VS Code Dark+ palette.
   System font stack for body, Source Code Pro
   for code/mono, Codicons for iconography.
   =========================================== */

:root {
    /* Core palette — VS Code Dark+ */
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d2d;
    --bg-input: #3c3c3c;
    --surface: #333333;
    --border: #3c3c3c;
    --border-subtle: #2d2d2d;

    /* Text hierarchy */
    --text-bright: #e8e8e8;
    --text-primary: #cccccc;
    --text-secondary: #9d9d9d;
    --text-muted: #858585;
    --text-faint: #5a5a5a;

    /* Accent colors — VS Code token palette */
    --blue: #007acc;
    --blue-light: #3794ff;
    --blue-bright: #75beff;
    --green: #4ec9b0;
    --green-bright: #73d0c2;
    --yellow: #dcdcaa;
    --orange: #ce9178;
    --purple: #c586c0;
    --red: #f44747;
    --cyan: #9cdcfe;

    /* Semantic */
    --accent: var(--blue-light);
    --accent-glow: rgba(55, 148, 255, 0.15);
    --success: var(--green);
    --warning: var(--yellow);
    --danger: var(--red);

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Ubuntu, sans-serif;
    --font-mono: 'Source Code Pro', 'Cascadia Code', 'Fira Code', Consolas, monospace;

    /* Spacing */
    --slide-padding: clamp(2rem, 4vw, 3.5rem);

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --duration-fast: 0.35s;
    --duration-normal: 0.55s;
    --duration-slow: 0.8s;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================================
   PROGRESS BAR
   Thin accent line at the top of the viewport
   =========================================== */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    width: 0%;
    z-index: 100;
    transition: width 0.3s var(--ease-out-quart);
}

/* ===========================================
   NAVIGATION DOTS
   Right-aligned slide position indicators
   =========================================== */
.nav-dots {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 90;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-faint);
    border: none;
    cursor: pointer;
    transition: background 0.25s, transform 0.25s var(--ease-out-expo);
    padding: 0;
}

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

.nav-dot.active {
    background: var(--accent);
    transform: scale(1.3);
}

/* ===========================================
   SLIDE COUNTER
   Bottom-left slide number display
   =========================================== */
.slide-counter {
    position: fixed;
    bottom: 24px;
    left: 32px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    z-index: 90;
    letter-spacing: 0.04em;
}

.slide-counter .current {
    color: var(--text-muted);
}

/* ===========================================
   SLIDE CONTAINER
   Each <section class="slide"> is a full-viewport slide
   =========================================== */
.slide {
    min-height: 100vh;
    padding: var(--slide-padding);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.slide-content {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* ===========================================
   TYPOGRAPHY
   =========================================== */
h1 {
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 600;
    color: var(--text-bright);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 600;
    color: var(--text-bright);
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin-bottom: 24px;
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 600;
    color: var(--text-bright);
    line-height: 1.3;
    margin-bottom: 8px;
}

p {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.6;
    color: var(--text-primary);
}

.text-large {
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    line-height: 1.5;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-purple { color: var(--purple); }
.text-orange { color: var(--orange); }

.highlight {
    color: var(--blue-light);
}

.mono {
    font-family: var(--font-mono);
}

/* ===========================================
   BADGES & LABELS
   =========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 5px 14px;
    font-size: 12px;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.badge .codicon {
    font-size: 14px;
}

.badge-green { color: var(--green); border-color: rgba(78, 201, 176, 0.2); }
.badge-blue { color: var(--blue-light); border-color: rgba(55, 148, 255, 0.2); }
.badge-yellow { color: var(--yellow); border-color: rgba(220, 220, 170, 0.2); }
.badge-purple { color: var(--purple); border-color: rgba(197, 134, 192, 0.2); }
.badge-orange { color: var(--orange); border-color: rgba(206, 145, 120, 0.2); }

/* ===========================================
   CARDS
   Elevated surface containers
   =========================================== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 20px;
    transition: border-color 0.2s, transform 0.2s var(--ease-out-expo);
}

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

.card-accent-top {
    border-top: 2px solid var(--accent);
}

.card-accent-green { border-top-color: var(--green); }
.card-accent-yellow { border-top-color: var(--yellow); }
.card-accent-purple { border-top-color: var(--purple); }

/* ===========================================
   GRIDS & LAYOUT
   =========================================== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.flex-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 20px; }
.gap-xl { gap: 32px; }

.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 20px; }
.mt-lg { margin-top: 32px; }
.mt-xl { margin-top: 48px; }

/* ===========================================
   CODE BLOCKS
   Inline code and block-level code display
   =========================================== */
code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 2px 6px;
    color: var(--orange);
}

.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 20px 24px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    color: var(--text-primary);
}

.code-block .keyword { color: var(--purple); }
.code-block .string { color: var(--orange); }
.code-block .type { color: var(--green); }
.code-block .function { color: var(--yellow); }
.code-block .comment { color: var(--text-faint); font-style: italic; }
.code-block .number { color: var(--green-bright); }
.code-block .property { color: var(--cyan); }

/* ===========================================
   ICON FEATURES
   Codicon-based feature lists
   =========================================== */
.icon-feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.icon-feature .codicon {
    font-size: 18px;
    margin-top: 3px;
    flex-shrink: 0;
}

.icon-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===========================================
   FLOW DIAGRAMS
   Horizontal flow with arrows between items
   =========================================== */
.flow-row {
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: center;
}

.flow-node {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 22px;
    text-align: center;
    font-size: 14px;
    color: var(--text-primary);
}

.flow-arrow {
    color: var(--text-faint);
    font-size: 20px;
    padding: 0 12px;
    flex-shrink: 0;
}

.flow-node.active {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--text-bright);
}

/* ===========================================
   COMPARISON LAYOUTS
   Side-by-side before/after or comparison
   =========================================== */
.compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.compare-col {
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.compare-header {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

/* ===========================================
   QUOTE CALLOUT
   Large pull-quote styling
   =========================================== */
.quote {
    font-size: clamp(1.3rem, 2.8vw, 2rem);
    font-weight: 400;
    color: var(--text-bright);
    line-height: 1.4;
    border-left: 3px solid var(--accent);
    padding-left: 24px;
    font-style: italic;
}

.quote-attribution {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
    font-style: normal;
}

/* ===========================================
   ANIMATIONS
   Scroll-triggered via IntersectionObserver
   =========================================== */
.reveal {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity var(--duration-normal) var(--ease-out-expo),
                transform var(--duration-normal) var(--ease-out-expo);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity var(--duration-normal) var(--ease-out-expo),
                transform var(--duration-normal) var(--ease-out-expo);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity var(--duration-normal) var(--ease-out-expo),
                transform var(--duration-normal) var(--ease-out-expo);
}

.slide.visible .reveal,
.slide.visible .reveal-left,
.slide.visible .reveal-scale {
    opacity: 1;
    transform: none;
}

/* Stagger children within visible slides */
.slide.visible .reveal:nth-child(1),
.slide.visible .reveal-left:nth-child(1) { transition-delay: 0.05s; }
.slide.visible .reveal:nth-child(2),
.slide.visible .reveal-left:nth-child(2) { transition-delay: 0.12s; }
.slide.visible .reveal:nth-child(3),
.slide.visible .reveal-left:nth-child(3) { transition-delay: 0.19s; }
.slide.visible .reveal:nth-child(4),
.slide.visible .reveal-left:nth-child(4) { transition-delay: 0.26s; }
.slide.visible .reveal:nth-child(5),
.slide.visible .reveal-left:nth-child(5) { transition-delay: 0.33s; }
.slide.visible .reveal:nth-child(6),
.slide.visible .reveal-left:nth-child(6) { transition-delay: 0.40s; }

/* Explicit delay classes for non-sequential staggering */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }

/* ===========================================
   SUBTLE BACKGROUND TEXTURE
   Faint dot grid for depth
   =========================================== */
.bg-dots {
    background-image: radial-gradient(circle, var(--border-subtle) 1px, transparent 1px);
    background-size: 32px 32px;
}

.bg-gradient-subtle {
    background: radial-gradient(ellipse at 30% 50%, rgba(55, 148, 255, 0.04) 0%, transparent 60%),
                var(--bg-primary);
}

/* ===========================================
   STATE BADGES
   For task state machine diagram
   =========================================== */
.state-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
}

.state-working {
    background: rgba(55, 148, 255, 0.12);
    color: var(--blue-light);
    border: 1px solid rgba(55, 148, 255, 0.25);
}

.state-input {
    background: rgba(220, 220, 170, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(220, 220, 170, 0.2);
}

.state-complete {
    background: rgba(78, 201, 176, 0.1);
    color: var(--green);
    border: 1px solid rgba(78, 201, 176, 0.2);
}

.state-failed {
    background: rgba(244, 71, 71, 0.1);
    color: var(--red);
    border: 1px solid rgba(244, 71, 71, 0.2);
}

/* ===========================================
   TIP / CALLOUT BOXES
   =========================================== */
.tip-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    padding: 16px 20px;
}

.tip-box .tip-number {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

/* ===========================================
   BLINK CURSOR
   =========================================== */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 0.85em;
    background: var(--text-bright);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

/* ===========================================
   REDUCED MOTION
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal, .reveal-left, .reveal-scale {
        transition: opacity 0.25s ease;
        transform: none;
    }
}

/* ===========================================
   RESPONSIVE
   =========================================== */
/* ===========================================
   TALKTRACK OVERLAY
   Presenter notes panel — hidden by default,
   toggled with T key, closed with Esc.
   z-index 95: above nav (90), below progress (100).
   =========================================== */
.talktrack {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 340px;
    max-height: 45vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    z-index: 95;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
    animation: talktrack-in 0.3s var(--ease-out-quart);
}

@keyframes talktrack-in {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.talktrack[hidden] {
    display: none;
}

.talktrack-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 6px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.talktrack-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.talktrack-badge[hidden] { display: none; }

.talktrack-close {
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    font-size: 16px;
}

.talktrack-close:hover {
    color: var(--text-secondary);
}

.talktrack-title {
    padding: 12px 14px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
    flex-shrink: 0;
}

.talktrack-notes {
    padding: 8px 14px 12px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary);
    overflow-y: auto;
    flex: 1;
}

.talktrack-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.talktrack-slide-ref {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-faint);
}

.talktrack-hint {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-faint);
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .nav-dots { display: none; }
    .slide-counter { display: none; }
    .talktrack { display: none !important; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .compare { grid-template-columns: 1fr; }
    .flow-row { flex-wrap: wrap; justify-content: center; }
    .slide { padding: clamp(2rem, 4vw, 3rem); }
}
