/* ========================================
   TEDx Demo — Dark Theme Premium
   ======================================== */

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a2e;
    --surface: #16161f;
    --border: #2a2a3a;
    --text: #e0e0e8;
    --text-dim: #8888a0;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --red: #ff3355;
    --red-dim: #cc2244;
    --orange: #ff8833;
    --blue: #3388ff;
    --yellow: #ffcc00;
    --green: #00ff88;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --radius: 12px;
    --glow-accent: 0 0 30px rgba(0, 255, 136, 0.15);
    --glow-red: 0 0 30px rgba(255, 51, 85, 0.15);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 60px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.accent { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s;
}

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

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    animation: pulse-dot 2s infinite;
}

.status-dot.connected {
    background: var(--accent);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ---- Sections ---- */
.section {
    min-height: 100vh;
    padding: 120px 60px 80px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

.section:nth-child(even) {
    background: rgba(18, 18, 26, 0.5);
}

.section-header {
    margin-bottom: 60px;
    position: relative;
    padding-bottom: 24px;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 2px;
}

.section-num {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text);
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 600px;
}

/* ---- Hero ---- */
.hero {
    align-items: center;
    text-align: center;
    padding-top: 0;
    position: relative;
    overflow: hidden;
}

.bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 8px 24px;
    border: 1px solid var(--accent);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 32px;
    animation: badge-glow 3s ease-in-out infinite;
}

@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(0, 255, 136, 0); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.15); }
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.05;
    min-height: 180px;
    max-width: 800px;
    margin: 0 auto 24px;
}

.hero-title .cursor {
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background: var(--accent);
    margin-left: 4px;
    animation: blink-cursor 0.8s infinite;
    vertical-align: text-bottom;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-sub {
    font-size: 1.3rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 48px;
    min-height: 2em;
}

.hero-counter {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 48px;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.counter-num {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
}

.counter-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-cta {
    display: inline-block;
    padding: 16px 40px;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 2px;
    border-radius: var(--radius);
    transition: all 0.3s;
}

.hero-cta:hover {
    background: var(--accent);
    color: var(--bg);
    box-shadow: var(--glow-accent);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 3px;
    animation: float-down 2s infinite;
}

@keyframes float-down {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

.scroll-arrow {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, var(--text-dim), transparent);
}

/* ---- isTrusted Demo ---- */
.istrusted-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
}

.istrusted-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.istrusted-col h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.istrusted-input-wrap {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.demo-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
}

.demo-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.demo-btn:active { transform: scale(0.97); }

.btn-red { background: var(--red); color: white; }
.btn-red:hover { background: var(--red-dim); box-shadow: var(--glow-red); }
.btn-green { background: var(--accent); color: var(--bg); }
.btn-green:hover { background: var(--accent-dim); box-shadow: var(--glow-accent); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--blue)); color: var(--bg); }
.btn-accent:hover { box-shadow: 0 0 40px rgba(0, 255, 136, 0.3); }
.btn-accent:disabled { opacity: 0.4; cursor: not-allowed; }

.istrusted-result {
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.istrusted-result code {
    display: block;
    margin-bottom: 12px;
}

.red { color: var(--red); }
.green { color: var(--accent); }

.detection-bar {
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 1px;
    opacity: 0;
    transform: scaleX(0.8);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.detection-bar.active {
    opacity: 1;
    transform: scaleX(1);
}

.red-bar { background: rgba(255, 51, 85, 0.15); border: 1px solid var(--red); color: var(--red); }
.green-bar { background: rgba(0, 255, 136, 0.1); border: 1px solid var(--accent); color: var(--accent); }

.code-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    overflow-x: auto;
    line-height: 1.8;
}

.istrusted-explain {
    margin-top: 40px;
    max-width: 800px;
}

.istrusted-explain p {
    margin-bottom: 12px;
    color: var(--text-dim);
}

.istrusted-explain code {
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
}

.istrusted-explain strong {
    color: var(--text);
}

/* ---- Keystroke ---- */
.keystroke-demo {
    max-width: 1200px;
}

.keystroke-input-area {
    margin-bottom: 40px;
}

.demo-input-lg {
    width: 100%;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    outline: none;
    transition: border-color 0.3s;
}

.demo-input-lg:focus {
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
}

.keystroke-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

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

.canvas-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.canvas-panel h3 {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-dim);
}

.canvas-panel canvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: var(--surface);
}

.canvas-verdict {
    margin-top: 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    background: var(--surface);
}

.keystroke-code {
    margin-top: 40px;
}

/* ---- Bézier ---- */
.bezier-demo {
    max-width: 1100px;
}

#canvas-bezier {
    width: 100%;
    height: 400px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.bezier-controls {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.bezier-info {
    display: flex;
    gap: 40px;
    margin-top: 24px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.bezier-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
}

/* ---- Waterfall ---- */
.waterfall-demo {
    max-width: 900px;
}

.waterfall-timeline {
    position: relative;
    padding: 20px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.waterfall-timeline .timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.wf-event {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.wf-event.active {
    opacity: 1;
    transform: translateX(0);
}

.wf-bar {
    min-width: 80px;
    height: 44px;
    border-radius: 8px;
    position: relative;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.wf-event.active .wf-bar {
    transform: scaleX(1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.wf-keydown { background: linear-gradient(90deg, #ff3355, #ff6644); min-width: 120px; }
.wf-mouseup { background: linear-gradient(90deg, #ff5566, #ff8877); min-width: 100px; }
.wf-click { background: linear-gradient(90deg, #ff7744, #ff9955); min-width: 110px; }
.wf-focus { background: linear-gradient(90deg, #44aaff, #66ccff); min-width: 90px; }
.wf-keypress { background: linear-gradient(90deg, #ff8833, #ffaa44); min-width: 100px; }
.wf-input { background: linear-gradient(90deg, #3388ff, #55aaff); min-width: 90px; }
.wf-keyup { background: linear-gradient(90deg, #8855ff, #aa77ff); min-width: 80px; }
.wf-change { background: linear-gradient(90deg, #00ff88, #44ffaa); min-width: 70px; }

.wf-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 70px;
    color: #e0e0f0;
}

.wf-event .wf-bar::after {
    content: attr(data-time);
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.7);
}

.wf-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}

.waterfall-controls {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.waterfall-code {
    margin-top: 32px;
}

.typing-code {
    min-height: 120px;
    font-size: 0.8rem;
}

/* ---- Spatial ---- */
.spatial-demo {
    max-width: 1100px;
}

#canvas-spatial {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.spatial-formula {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
}

.formula-box {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px 24px;
    text-align: center;
    box-shadow: var(--glow-accent);
}

.formula-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.formula-box code {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
}

.formula-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0.4;
    transition: all 0.5s;
}

.formula-step.active {
    opacity: 1;
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.formula-step span:last-child {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

#spatial-play {
    margin-top: 24px;
}

/* ---- Nuclear ---- */
.nuclear-demo {
    max-width: 1200px;
}

.nuclear-pipeline {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.nuke-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 140px;
    opacity: 0.3;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.nuke-step.active {
    opacity: 1;
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
    transform: scale(1.05);
}

.nuke-step.burn {
    border-color: var(--red);
    box-shadow: var(--glow-red);
}

.nuke-icon {
    font-size: 2rem;
}

.nuke-red { color: var(--red); }
.nuke-orange { color: var(--orange); }
.nuke-blue { color: var(--blue); }
.nuke-yellow { color: var(--yellow); }
.nuke-green { color: var(--green); }

.nuke-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.nuke-detail {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
}

.nuke-count {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--red);
}

.nuke-arrow {
    font-size: 1.5rem;
    color: var(--text-dim);
}

#nuke-play {
    margin-top: 32px;
    align-self: center;
}

/* ---- Dashboard ---- */
.dashboard {
    min-height: auto;
    padding-bottom: 120px;
}

.dash-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

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

.dash-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dash-stat-card.green-card { border-color: var(--accent); }
.dash-stat-card.red-card { border-color: var(--red); }

.dash-stat-num {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
}

.green-card .dash-stat-num { color: var(--accent); }
.red-card .dash-stat-num { color: var(--red); }

.dash-stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.container-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s;
}

.container-card:hover {
    border-color: rgba(0, 255, 136, 0.3);
    background: var(--bg-card-hover);
}

.container-card.running { border-color: var(--yellow); }
.container-card.done { border-color: var(--accent); }
.container-card.error { border-color: var(--red); }

.container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.container-name {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
}

.container-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.container-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.container-status .dot.pending { background: var(--text-dim); }
.container-status .dot.running { background: var(--yellow); animation: pulse-dot 1s infinite; }
.container-status .dot.ok { background: var(--accent); }
.container-status .dot.fail { background: var(--red); }

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border-top: 1px solid rgba(42, 42, 58, 0.5);
}

.account-email {
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.account-status {
    font-weight: 600;
}

.account-status.pending { color: var(--text-dim); }
.account-status.running { color: var(--yellow); }
.account-status.ok { color: var(--accent); }
.account-status.fail { color: var(--red); }

.dash-log {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 32px;
    overflow: hidden;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-small {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
}

.log-body {
    padding: 16px 20px;
    max-height: 250px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.8;
}

.log-line {
    color: var(--text-dim);
}

.log-line .timestamp { color: var(--text-dim); }
.log-line .info { color: var(--blue); }
.log-line .success { color: var(--accent); }
.log-line .error { color: var(--red); }
.log-line .warn { color: var(--yellow); }

/* Proxies */
.dash-proxies h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

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

.proxy-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    transition: all 0.3s;
}

.proxy-item.active {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Footer ---- */
.footer {
    padding: 40px 60px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ---- Reveal Animation ---- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

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

/* ---- Hydration Section ---- */
.hydration-demo {
    max-width: 900px;
}

.hydration-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.hydro-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.hydro-row.danger-zone,
.hydro-row.hydro-danger-zone {
    background: rgba(255, 51, 85, 0.05);
    border: 1px dashed var(--red);
}

.hydro-row.safe-zone {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid var(--accent);
}

.hydro-marker {
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hydro-time {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
}

.hydro-label {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.hydro-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hydro-bar {
    height: 8px;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.hydro-bar-visual {
    background: var(--accent);
    width: 30%;
}

.hydro-bar-inject {
    background: var(--red);
    width: 5%;
}

.hydro-bar-ready {
    background: var(--blue);
    width: 100%;
}

.red-bar-anim {
    animation: pulse-bar 1.5s ease-in-out infinite;
}

@keyframes pulse-bar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hydro-detail {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
}

.hydration-solution, .hydration-clock {
    margin-top: 24px;
}

.hydration-solution h3, .hydration-clock h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--accent);
}

.hydration-solution p, .hydration-clock p {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 8px;
}

.formula-inline {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 12px 24px;
    margin-top: 12px;
}

.formula-inline code {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
}

.hydro-controls {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

/* ---- Network Section ---- */
.network-demo {
    max-width: 1100px;
}

.network-topology {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.topo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.topo-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.topo-bad { border-color: var(--red); }
.topo-good { border-color: var(--accent); }

.topo-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.topo-node {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

.topo-dc {
    background: rgba(255, 51, 85, 0.1);
    border: 1px solid var(--red);
    color: var(--red);
}

.topo-baremetal {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.topo-proxy {
    background: rgba(255, 136, 51, 0.1);
    border: 1px solid var(--orange);
    color: var(--orange);
}

.topo-target {
    background: rgba(51, 136, 255, 0.1);
    border: 1px solid var(--blue);
    color: var(--blue);
}

.topo-arrow {
    font-size: 1.2rem;
}

.topo-arrow.bad { color: var(--red); }
.topo-arrow.good { color: var(--accent); }

.topo-verdict {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 10px;
    border-radius: 6px;
}

.topo-verdict.red {
    color: var(--red);
    background: rgba(255, 51, 85, 0.08);
}

.topo-verdict.green {
    color: var(--accent);
    background: rgba(0, 255, 136, 0.08);
}

.network-proxies {
    margin-top: 32px;
}

.network-proxies h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.network-code {
    margin-top: 32px;
}

/* ---- Waterfall enhancements ---- */
.wf-mouseup { background: linear-gradient(90deg, #ff6644, #ff8855); width: 110px; }
.wf-click { background: linear-gradient(90deg, #ffaa44, #ffbb55); width: 105px; }
.wf-focus { background: linear-gradient(90deg, #aa55ff, #cc77ff); width: 85px; }

.waterfall-note {
    margin-top: 24px;
    max-width: 800px;
}

.waterfall-note p {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.waterfall-note code {
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
}

.nuclear-note {
    margin-top: 24px;
    max-width: 800px;
}

.nuclear-note p {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.nuclear-note em {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

/* ---- Proxy API Flow ---- */
.proxy-api-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.flow-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    min-width: 200px;
    transition: all 0.3s;
}

.flow-step:hover {
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
}

.flow-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.flow-step h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.flow-step p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.flow-step a {
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    word-break: break-all;
}

.flow-step a:hover {
    text-decoration: underline;
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--text-dim);
}

.proxy-api-detail {
    max-width: 800px;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .keystroke-canvases {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 900px) {
    .section {
        padding: 100px 30px 60px;
    }
    .istrusted-demo {
        grid-template-columns: 1fr;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .hero-counter {
        flex-wrap: wrap;
        gap: 30px;
    }
    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav-links {
        display: none;
    }
    .spatial-formula {
        grid-template-columns: 1fr;
    }
    .nuclear-pipeline {
        flex-direction: column;
    }
    .nuke-arrow {
        transform: rotate(90deg);
    }
}
