/* ===== VARIABLES ===== */
:root {
    --bg: #08080e;
    --bg-alt: #0d0d16;
    --card: #12121e;
    --card-border: rgba(255,255,255,0.07);
    --text: #d0d0d8;
    --text-dim: #888899;
    --text-bright: #f0f0f4;
    --cyan: #00e5ff;
    --purple: #b44dff;
    --orange: #ff9f1a;
    --red: #ff4466;
    --green: #44ffaa;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== HERO ===== */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    padding: 0 2rem;
}
/* Hero Logo */
.hero-logo-wrap {
    margin-bottom: 1.5rem;
    animation: logoFloat 5s ease-in-out infinite;
}
.hero-logo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: contain;
    padding: 10px;
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(180,77,255,0.25);
    box-shadow:
        0 0 20px rgba(180,77,255,0.15),
        0 0 40px rgba(0,229,255,0.08);
    animation: logoGlow 4s ease-in-out infinite;
}
@keyframes logoGlow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(180,77,255,0.15),
            0 0 40px rgba(0,229,255,0.08);
        border-color: rgba(180,77,255,0.25);
    }
    50% {
        box-shadow:
            0 0 28px rgba(0,229,255,0.25),
            0 0 50px rgba(180,77,255,0.12);
        border-color: rgba(0,229,255,0.3);
    }
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero-label {
    font-size: 0.85rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.hero-content h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--cyan), var(--purple), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}
.hero-acronym {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}
.hero-sub {
    font-size: 1.15rem;
    color: var(--text);
    max-width: 500px;
    margin: 0 auto 2rem;
}
.hero-author {
    font-size: 0.95rem;
    color: var(--orange);
    font-weight: 500;
    margin-bottom: 3rem;
}
.scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    animation: bobHint 2s ease-in-out infinite;
}
@keyframes bobHint {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ===== NAVIGATION ===== */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(8,8,14,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}
#nav.visible { transform: translateY(0); }
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--cyan);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
    border: 1.5px solid rgba(180,77,255,0.25);
    box-shadow: 0 0 8px rgba(180,77,255,0.1);
    background: rgba(255,255,255,0.04);
    padding: 2px;
}
.nav-links {
    display: flex;
    gap: 1.5rem;
}
.nav-links a {
    font-size: 0.82rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-bright); }

/* ===== SECTIONS ===== */
.section {
    padding: 6rem 2rem;
}
.section-alt {
    background: var(--bg-alt);
}
.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}
.section-number {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--cyan);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.75rem;
}
.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1rem;
}
.section-lead {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 700px;
    margin: 0 auto;
}

/* ===== TWO-COLUMN LAYOUT ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.col h3 {
    font-size: 1.3rem;
    color: var(--text-bright);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}
.col h3:first-child { margin-top: 0; }
.col p {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 1rem;
}
.col em { color: var(--orange); font-style: italic; }

/* ===== MATH & EQUATIONS ===== */
.math {
    font-family: var(--mono);
    font-size: 0.9em;
    color: var(--cyan);
}
.equation {
    font-family: var(--mono);
    font-size: 0.85rem;
    background: rgba(0,229,255,0.05);
    border: 1px solid rgba(0,229,255,0.15);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0 1rem;
    color: var(--text-bright);
    line-height: 1.9;
    overflow-x: auto;
}

/* ===== VIS CARDS ===== */
.vis-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}
.vis-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}
.vis-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}
.vis-button {
    margin-top: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.vis-button:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Canvas / SVG responsive sizing */
.vis-card canvas,
.vis-card svg {
    max-width: 100%;
    height: auto;
}

/* ===== PROBLEM SECTION ===== */
.problem-diagram {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}
.problem-bar {
    position: relative;
    height: 36px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
}
.problem-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 6px;
    opacity: 0.25;
    transition: width 1s ease;
}
.fast-fill { width: 90%; background: var(--cyan); }
.mid-fill { width: 12%; background: var(--red); }
.slow-fill { width: 8%; background: var(--orange); }
.frozen-fill { width: 5%; background: var(--purple); }
.problem-bar-label {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    color: var(--text);
}
.problem-bar-status {
    position: relative;
    z-index: 1;
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
}
.problem-bar-status.strong { color: var(--green); }
.problem-bar-status.weak { color: var(--red); }
.diagram-caption {
    font-size: 0.8rem !important;
    color: var(--text-dim) !important;
    text-align: center;
    margin-top: 0.5rem;
}

/* ===== BLOCKQUOTE ===== */
.thesis-quote {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    border-left: 3px solid var(--purple);
    background: rgba(180,77,255,0.05);
    border-radius: 0 8px 8px 0;
}
.thesis-quote p {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}
.thesis-quote cite {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-style: normal;
}

/* ===== DETAIL CARDS ===== */
.detail-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}
.detail-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}
.detail-icon {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.detail-card h4 {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}
.detail-card p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ===== FEATURE LIST ===== */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1rem;
}
.feature-list li {
    font-size: 0.9rem;
    color: var(--text);
    padding: 0.5rem 0;
    padding-left: 1.25rem;
    position: relative;
}
.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 6px;
    height: 6px;
    background: var(--cyan);
    border-radius: 50%;
}

/* ===== TITANS VARIANTS ===== */
.arch-variant {
    padding: 1rem 0;
    border-bottom: 1px solid var(--card-border);
}
.arch-variant:last-child { border-bottom: none; }
.arch-variant h4 {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.arch-variant p {
    font-size: 0.85rem;
    color: var(--text-dim);
}
.tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
}
.tag-mac { background: rgba(0,229,255,0.15); color: var(--cyan); }
.tag-mag { background: rgba(180,77,255,0.15); color: var(--purple); }
.tag-mal { background: rgba(255,159,26,0.15); color: var(--orange); }

/* ===== FREQUENCY TABLE ===== */
.freq-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--card);
    border-radius: 8px;
    border: 1px solid var(--card-border);
}
.freq-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.freq-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.freq-label {
    color: var(--text-bright);
    font-weight: 500;
    min-width: 180px;
}
.freq-rate {
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.8rem;
}

/* ===== DREAMER COMPONENTS ===== */
.component-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}
.component {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--card);
    border-radius: 6px;
    border: 1px solid var(--card-border);
    align-items: center;
}
.comp-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--orange);
}
.comp-desc {
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* ===== CONVERGENCE ===== */
.convergence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.conv-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--card-border);
    transition: transform 0.3s, border-color 0.3s;
}
.conv-card:hover { transform: translateY(-3px); }
.conv-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}
.conv-role {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}
.conv-card p:last-child {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}
.conv-dogma { border-color: rgba(68,255,170,0.3); }
.conv-dogma h4 { color: var(--green); }
.conv-dogma .conv-role { color: var(--green); }
.conv-dreamer { border-color: rgba(255,159,26,0.3); }
.conv-dreamer h4 { color: var(--orange); }
.conv-dreamer .conv-role { color: var(--orange); }
.conv-titans { border-color: rgba(255,68,102,0.3); }
.conv-titans h4 { color: var(--red); }
.conv-titans .conv-role { color: var(--red); }
.conv-hope { border-color: rgba(180,77,255,0.3); }
.conv-hope h4 { color: var(--purple); }
.conv-hope .conv-role { color: var(--purple); }

/* ===== THESIS CLAIMS ===== */
.thesis-claims {
    margin-top: 2rem;
}
.thesis-claims h3 {
    font-size: 1.4rem;
    color: var(--text-bright);
    text-align: center;
    margin-bottom: 2rem;
}
.claim {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}
.claim-num {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--cyan);
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0,229,255,0.3);
    border-radius: 12px;
}
.claim h4 {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.4rem;
}
.claim p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ===== MELINOE ROLES ===== */
.melinoe-roles {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1rem 0;
}
.role {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.role-icon {
    width: 40px;
    height: 40px;
    border: 2px solid;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
}
.role h4 {
    font-size: 0.95rem;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}
.role p {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 0;
}

/* ===== LIFECYCLE ===== */
.timeline-section {
    margin-top: 3rem;
}
.timeline-section h3 {
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-bright);
    margin-bottom: 2rem;
}
.lifecycle {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
}
.lifecycle-phase {
    flex: 1;
    max-width: 280px;
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}
.phase-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin: 0 auto 0.75rem;
}
.wake-dot { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.sleep-dot { background: var(--orange); box-shadow: 0 0 12px var(--orange); }
.transfer-dot { background: var(--green); box-shadow: 0 0 12px var(--green); }
.lifecycle-phase h4 {
    font-size: 0.95rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}
.lifecycle-phase p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
}
.lifecycle-arrow {
    font-size: 1.5rem;
    color: var(--text-dim);
    padding-top: 2.5rem;
    flex-shrink: 0;
}

/* ===== TRANSFORMER VIS ===== */
#attn-tokens {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    padding: 0 0.5rem;
}
#attn-svg {
    margin-top: -2px;
}
.attn-token {
    padding: 0.3rem 0.6rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.attn-token:hover, .attn-token.active {
    background: rgba(0,229,255,0.15);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 10px rgba(0,229,255,0.2);
}
#attn-matrix-container {
    margin-top: 0.5rem;
    text-align: center;
}
#attn-matrix {
    border-radius: 4px;
    image-rendering: pixelated;
}

/* ===== PROOF OF CONCEPT ===== */
.adapter-components {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0 1rem;
}
.adapter-comp {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--card);
    border-radius: 6px;
    border: 1px solid var(--card-border);
    align-items: start;
}
.adapter-comp-name {
    font-size: 0.82rem;
    font-weight: 600;
}
.adapter-comp-desc {
    font-size: 0.78rem;
    color: var(--text-dim);
}
.eval-methods {
    margin-top: 3rem;
}
.eval-methods h3 {
    font-size: 1.3rem;
    color: var(--text-bright);
    text-align: center;
    margin-bottom: 2rem;
}
.eval-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
}
.eval-card h4 {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.eval-icon {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
}
.eval-card p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.eval-card p:last-child { margin-bottom: 0; }

/* ===== RESULTS ===== */
.results-block {
    margin-bottom: 4rem;
}
.results-block:last-child { margin-bottom: 0; }
.results-block h3 {
    font-size: 1.3rem;
    color: var(--text-bright);
    margin-bottom: 1rem;
}
.results-block > p {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    max-width: 800px;
}
.result-findings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.finding {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}
.finding-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.finding-label.good {
    background: rgba(68,255,170,0.12);
    color: var(--green);
}
.finding-label.neutral {
    background: rgba(255,159,26,0.12);
    color: var(--orange);
}
.finding p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0;
}
.improvements-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}
.improvement-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    align-items: flex-start;
}
.improvement-card.improvement-primary {
    border-color: rgba(0,229,255,0.3);
    background: rgba(0,229,255,0.03);
}
.imp-num {
    font-family: var(--mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cyan);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(0,229,255,0.3);
    border-radius: 8px;
}
.improvement-card h4 {
    font-size: 0.95rem;
    color: var(--text-bright);
    margin-bottom: 0.35rem;
}
.improvement-card p {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0;
}
.expectations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.expectation-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--card-border);
}
.expectation-card.constraint {
    border-color: rgba(255,68,102,0.2);
}
.expectation-card.expected {
    border-color: rgba(68,255,170,0.2);
}
.expectation-card h4 {
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.75rem;
}
.expectation-card.constraint h4 { color: var(--red); }
.expectation-card.expected h4 { color: var(--green); }
.results-closing {
    font-size: 1rem;
    color: var(--text);
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    font-style: italic;
}

/* ===== FOOTER ===== */
footer {
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--card-border);
    background: var(--bg);
}
.footer-title {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}
.footer-sub {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}
.footer-author {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ===== ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================
   PRESENTATION MODE
   ========================================================== */

/* Toggle button (always visible) */
.pres-toggle-btn {
    position: fixed;
    top: 0.5rem;
    right: 1rem;
    z-index: 150;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(8,8,14,0.8);
    backdrop-filter: blur(8px);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.pres-toggle-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0,229,255,0.08);
}

/* Controls bar (hidden until presentation mode) */
.pres-controls {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    background: rgba(8,8,14,0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    align-items: center;
    gap: 1rem;
}
.pres-btn {
    padding: 0.4rem 1rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.pres-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--cyan);
    color: var(--cyan);
}
.pres-counter {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    min-width: 50px;
    text-align: center;
}
.pres-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    opacity: 0.6;
    margin-left: 0.5rem;
}

/* Progress bar */
.pres-progress {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 300;
    background: rgba(255,255,255,0.05);
}
.pres-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    transition: width 0.4s ease;
    width: 0%;
}

/* === Active presentation mode === */
body.presentation-mode {
    overflow: hidden;
}
body.presentation-mode #nav {
    display: none !important;
}
body.presentation-mode footer {
    display: none !important;
}
body.presentation-mode .scroll-hint {
    display: none !important;
}
body.presentation-mode .pres-controls {
    display: flex;
}
body.presentation-mode .pres-progress {
    display: block;
}
body.presentation-mode .pres-toggle-btn {
    background: rgba(0,229,255,0.15);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* All slides hidden by default in pres mode */
body.presentation-mode #hero,
body.presentation-mode .section {
    display: none;
}

/* Active slide */
body.presentation-mode .pres-slide-active {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 200;
    overflow-y: auto;
    background: var(--bg);
    animation: presSlideIn 0.35s ease;
}
body.presentation-mode .section-alt.pres-slide-active {
    background: var(--bg-alt);
}
body.presentation-mode #hero.pres-slide-active {
    display: flex !important;
}

/* Ensure section content has padding at bottom for controls */
body.presentation-mode .pres-slide-active .section-inner {
    padding-bottom: 5rem;
}
body.presentation-mode .pres-slide-active:focus {
    outline: none;
}

/* In pres mode, make fade-in elements visible immediately */
body.presentation-mode .fade-in {
    opacity: 1;
    transform: none;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .convergence-grid { grid-template-columns: 1fr; }
    .detail-cards { grid-template-columns: 1fr; }
    .lifecycle { flex-direction: column; align-items: center; }
    .lifecycle-arrow { transform: rotate(90deg); padding: 0; }
    .nav-links { display: none; }
    .freq-label { min-width: auto; }
    .pres-hint { display: none; }
    .expectations-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .section { padding: 3rem 1rem; }
    .hero-content h1 { font-size: 2.5rem; }
    .pres-controls { padding: 0.5rem 0.75rem; gap: 0.5rem; }
}
