/* theme */
:root {
    --bg: #faf9f7;
    --surface: #fff;
    --text: #2c2c2c;
    --muted: #6b6b6b;
    --accent: #6b8f71;
    --accent-hover: #7da383;
    --border: #e2ddd5;
    --tag-bg: #f0ece6;
    --tag-text: #5a5347;
    --heading-font: 'EB Garamond', Georgia, serif;
    --body-font: 'Source Sans 3', 'Segoe UI', sans-serif;
    --mono-font: 'IBM Plex Mono', 'Consolas', monospace;
    --max-w: 960px;
    --neon: #39ff14;
}

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

body {
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    padding-bottom: 48px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}


/* nav */

nav {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.nav-row {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-name {
    font-family: var(--heading-font);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.nav-name:hover { text-decoration: none; }

nav ul { list-style: none; display: flex; gap: 1.8rem; }

nav ul a {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
}
nav ul a:hover { color: var(--accent); }


/* two-column layout */

.two-col {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    padding-top: 2.5rem;
}


/* sidebar */

.sidebar {
    position: sticky;
    top: 4rem;
    align-self: start;
}

.headshot-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--heading-font);
    font-size: 3rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.headshot {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.my-name {
    font-family: var(--heading-font);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.my-title {
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 0.2rem;
    line-height: 1.5;
}

.sidebar-links {
    list-style: none;
    margin-top: 1.2rem;
    font-size: 0.9rem;
    line-height: 2.2;
}
.sidebar-links a { font-weight: 500; }


/* content */

.content section {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
.content section:last-child { border-bottom: none; margin-bottom: 0; }

section[id] {
    scroll-margin-top: 70px;
}

.section-title {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
    display: inline;
    padding-bottom: 1px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.content p { margin-bottom: 0.8rem; }
.content p:last-child { margin-bottom: 0; }

.accent { color: var(--accent); font-weight: 500; }
.meta { font-size: 0.9rem; color: var(--muted); margin-top: 0.1rem; }
.interests { font-size: 0.95rem; margin-top: 0.5rem; }


/* education */

.edu-item { margin-bottom: 1.2rem; }
.edu-item:last-child { margin-bottom: 0; }

.edu-item h3 {
    font-family: var(--heading-font);
    font-size: 1.1rem;
    font-weight: 600;
}


/* project cards */

.project-card {
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: box-shadow 0.2s;
}
.project-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.project-card:last-child { margin-bottom: 0; }

.project-card h3 {
    font-family: var(--heading-font);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.project-card h3 a { color: var(--text); }
.project-card h3 a:hover { color: var(--accent); text-decoration: none; }

.project-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.tag {
    padding: 0.12rem 0.55rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.78rem;
    border-radius: 3px;
    font-weight: 500;
}


/* volunteer */

.volunteer-item { margin-bottom: 1.2rem; }
.volunteer-item:last-child { margin-bottom: 0; }

.volunteer-item h3 {
    font-family: var(--heading-font);
    font-size: 1.05rem;
    font-weight: 600;
}
.volunteer-item p { font-size: 0.95rem; margin-top: 0.3rem; }


/* cv button */

.cv-btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.45rem 1.3rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 3px;
    transition: background 0.2s;
}
.cv-btn:hover { background: var(--accent-hover); text-decoration: none; }


/* footer */

footer {
    padding: 2rem 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}


/* ================================================================
   TERMINAL
   ================================================================ */

#terminal-tooltip {
    position: fixed;
    bottom: 52px;
    left: 1rem;
    background: #0a0a0a;
    color: var(--neon);
    font-family: var(--mono-font);
    font-size: 0.82rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--neon);
    border-radius: 4px;
    z-index: 250;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 0 6px rgba(57,255,20,0.3), 0 0 20px rgba(57,255,20,0.1);
    animation: tooltipFadeIn 0.4s ease;
}

#terminal-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 24px;
    width: 10px;
    height: 10px;
    background: #0a0a0a;
    border-right: 1px solid var(--neon);
    border-bottom: 1px solid var(--neon);
    transform: rotate(45deg);
}

#terminal-tooltip.tooltip-hidden { display: none; }

#tooltip-close {
    background: none;
    border: none;
    color: var(--neon);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}
#tooltip-close:hover { opacity: 1; }

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

#terminal-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #1e1e1e;
    color: #a0a0a0;
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    gap: 0.8rem;
    font-family: var(--mono-font);
    font-size: 0.82rem;
    cursor: pointer;
    z-index: 200;
}
#terminal-bar:hover { background: #252525; }
#terminal-bar .terminal-prompt { color: var(--accent); }
#terminal-bar .terminal-hint { color: #666; }

#terminal-window {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 320px;
    background: #1a1a1a;
    color: #d4d4d4;
    font-family: var(--mono-font);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    z-index: 300;
    border-top: 2px solid var(--accent);
    transition: transform 0.25s ease;
    cursor: text;
}
#terminal-window.hidden {
    transform: translateY(100%);
    pointer-events: none;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 1rem;
    background: #252525;
    font-size: 0.78rem;
    color: #888;
}

.terminal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
}
.terminal-close:hover { color: #fff; }

#terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem 1rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.8rem;
    gap: 0.5rem;
    position: relative;
}
.terminal-input-row .terminal-prompt { color: var(--accent); white-space: nowrap; }

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #d4d4d4;
    font-family: var(--mono-font);
    font-size: 0.85rem;
    caret-color: transparent;
}

/* block cursor */
#terminal-cursor {
    display: inline-block;
    width: 0.52em;
    height: 1.15em;
    background: var(--accent);
    vertical-align: text-bottom;
    animation: cursorBlink 1s step-end infinite;
    pointer-events: none;
    position: absolute;
    left: 0;
    bottom: 0.85rem;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}


/* ================================================================
   EASTER EGG EFFECTS
   ================================================================ */

/* 1. glitch overlay */

#glitch-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    background: #000;
}

#glitch-overlay.active {
    animation: glitchFlash 2.5s steps(1) forwards;
}

@keyframes glitchFlash {
    0%   { opacity: 0; }
    5%   { opacity: 0.8; background: #ff0000; }
    8%   { opacity: 0; }
    12%  { opacity: 0.6; background: #00ff00; }
    14%  { opacity: 0; }
    20%  { opacity: 0.9; background: #000; }
    25%  { opacity: 0.3; background: #ff00ff; }
    28%  { opacity: 0; }
    35%  { opacity: 0.7; background: #0000ff; }
    38%  { opacity: 0; }
    45%  { opacity: 1; background: #000; }
    55%  { opacity: 1; background: #000; }
    60%  { opacity: 0.5; background: #ff0000; }
    62%  { opacity: 0; }
    70%  { opacity: 0.3; background: #00ffff; }
    72%  { opacity: 0; }
    80%  { opacity: 0.6; background: #000; }
    90%  { opacity: 0.2; }
    100% { opacity: 0; }
}

.glitch-text {
    animation: glitchShake 0.15s steps(2) 2.5s;
}

@keyframes glitchShake {
    0%   { transform: translate(2px, -1px) skewX(1deg); }
    25%  { transform: translate(-3px, 2px) skewX(-2deg); }
    50%  { transform: translate(1px, -2px) skewX(0.5deg); }
    75%  { transform: translate(-2px, 1px) skewX(-1deg); }
    100% { transform: translate(0, 0) skewX(0); }
}


/* 1b. data tampering popup */

#tampering-popup {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#tampering-popup.active {
    opacity: 1;
    pointer-events: auto;
}

.tampering-inner {
    text-align: center;
    color: #ff4444;
    font-family: var(--mono-font);
}

.tampering-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: tamperPulse 0.5s ease infinite alternate;
}

.tampering-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tampering-sub {
    font-size: 0.9rem;
    color: #aa3333;
    margin-top: 0.5rem;
}

@keyframes tamperPulse {
    from { transform: scale(1); opacity: 0.8; }
    to   { transform: scale(1.1); opacity: 1; }
}


/* 2. konami code */

#konami-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 9997;
    background: #111;
    color: #ffd700;
    font-family: var(--mono-font);
    font-size: 1.4rem;
    text-align: center;
    padding: 2rem 3rem;
    border: 3px solid #ffd700;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s, transform 0.4s;
    line-height: 1.8;
    box-shadow: 0 0 30px rgba(255,215,0,0.3);
}

#konami-message span {
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    opacity: 0.6;
}

#konami-message.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}


/* 4. matrix mode */

#matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.matrix-mode { background: #000 !important; color: var(--neon) !important; }
.matrix-mode nav { background: rgba(0,0,0,0.9) !important; border-color: #1a3a1a !important; }
.matrix-mode nav a, .matrix-mode .nav-name { color: var(--neon) !important; }
.matrix-mode .sidebar, .matrix-mode .content { position: relative; z-index: 2; }
.matrix-mode .my-name, .matrix-mode .section-title { color: var(--neon) !important; }
.matrix-mode .my-title, .matrix-mode .meta, .matrix-mode .sidebar-links { color: #2aaa2a !important; }
.matrix-mode .accent, .matrix-mode .sidebar-links a { color: #5f5 !important; }
.matrix-mode .project-card { background: rgba(0,0,0,0.7) !important; border-color: #1a3a1a !important; }
.matrix-mode .project-card h3 a { color: var(--neon) !important; }
.matrix-mode .tag { background: #0a1f0a !important; color: var(--neon) !important; }
.matrix-mode .headshot-placeholder { background: #0a2a0a !important; color: var(--neon) !important; }
.matrix-mode .content section { border-color: #1a3a1a !important; }
.matrix-mode footer { color: #2aaa2a !important; border-color: #1a3a1a !important; }
.matrix-mode .cv-btn { background: #1a3a1a !important; color: var(--neon) !important; }
.matrix-mode #terminal-bar { background: #0a0a0a !important; }
.matrix-mode #terminal-window { border-color: var(--neon) !important; }


/* 5. greek mode */

.greek-mode {
    font-family: 'Times New Roman', serif !important;
    letter-spacing: 0.02em;
}

#qed-badge {
    position: fixed;
    bottom: 52px;
    right: 1.5rem;
    font-size: 1.8rem;
    color: var(--accent);
    z-index: 150;
    cursor: default;
    opacity: 0;
    animation: qedFadeIn 1s ease forwards;
}

@keyframes qedFadeIn {
    to { opacity: 1; }
}


/* 6. shutdown blackout + corrigibility banner */

#blackout-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#blackout-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#corrigibility-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: #1a1a1a;
    color: #e0e0e0;
    font-family: var(--mono-font);
    font-size: 1rem;
    text-align: center;
    z-index: 9996;
    transform: translateY(-100%);
    transition: transform 0.6s ease;
    border-bottom: 2px solid var(--accent);
    letter-spacing: 0.03em;
}

#corrigibility-banner.active {
    transform: translateY(0);
}


/* 7. doom clock */

#doom-clock {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 1rem;
    vertical-align: middle;
}

.doom-face {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    position: relative;
    border: 2px solid #555;
}

.doom-inner {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono-font);
    font-size: 0.55rem;
    font-weight: 700;
    color: #c0392b;
}

.doom-label {
    font-family: var(--mono-font);
    font-size: 0.72rem;
    color: #888;
}


/* 8. superposition badge */

#superposition-badge {
    position: fixed;
    bottom: 52px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1a1a1a;
    color: var(--neon);
    font-family: var(--mono-font);
    font-size: 0.85rem;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--neon);
    border-radius: 4px;
    z-index: 150;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    box-shadow: 0 0 10px rgba(57,255,20,0.2);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

#superposition-badge.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.badge-close {
    background: none;
    border: none;
    color: var(--neon);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}
.badge-close:hover { opacity: 1; }


/* ================================================================
   BEND PHYSICS — accordion ridge effect
   ================================================================ */

#bend-ceiling {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    pointer-events: none;
    overflow: hidden;
    background: var(--bg);
}

.bend-strip {
    position: absolute;
    left: 0;
    right: 0;
    overflow: hidden;
    background: var(--bg);
    transition: transform 1.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 1.5s ease;
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.bend-strip:nth-child(odd)  { transform-origin: center bottom; }
.bend-strip:nth-child(even) { transform-origin: center top; }

#bend-ceiling.folded .bend-strip:nth-child(odd) {
    transform: perspective(600px) rotateX(14deg) translateZ(10px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

#bend-ceiling.folded .bend-strip:nth-child(even) {
    transform: perspective(600px) rotateX(-14deg) translateZ(10px);
    box-shadow: 0 -6px 20px rgba(0,0,0,0.18);
}

.bend-strip:nth-child(odd) {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.bend-strip:nth-child(even) {
    border-top: 1px solid rgba(0,0,0,0.08);
}

.bend-strip::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.bend-strip:nth-child(odd)::after {
    background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.07));
}

.bend-strip:nth-child(even)::after {
    background: linear-gradient(to top, transparent 30%, rgba(0,0,0,0.07));
}

#bend-ceiling.folded .bend-strip::after { opacity: 1; }

.bend-strip-inner {
    position: absolute;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.bend-strip-inner nav,
.bend-strip-inner .sidebar {
    position: static !important;
}

#bend-ceiling.unfolding .bend-strip {
    transform: perspective(600px) rotateX(0deg) translateZ(0px) !important;
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 0 rgba(0,0,0,0) !important;
}

#bend-ceiling.unfolding .bend-strip::after {
    opacity: 0 !important;
}


/* ================================================================
   ATTENTION — semantic word connections
   ================================================================ */

body.attention-active {
    background: #111 !important;
}

body.attention-active nav,
body.attention-active footer {
    background: #111 !important;
    border-color: #333 !important;
}

body.attention-active nav a,
body.attention-active .nav-name,
body.attention-active .content,
body.attention-active .sidebar,
body.attention-active footer {
    color: #555 !important;
}

body.attention-active .section-title {
    color: #666 !important;
    border-color: #444 !important;
}

body.attention-active .project-card {
    background: #1a1a1a !important;
    border-color: #333 !important;
}

body.attention-active .tag {
    background: #222 !important;
    color: #555 !important;
}

body.attention-active .headshot-placeholder {
    background: #333 !important;
    color: #555 !important;
}

body.attention-active .cv-btn {
    background: #333 !important;
    color: #555 !important;
}

body.attention-active .meta,
body.attention-active .my-title,
body.attention-active .sidebar-links,
body.attention-active .accent {
    color: #444 !important;
}

body.attention-active .content section {
    border-color: #333 !important;
}

#attention-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    pointer-events: none;
}

.attn-word {
    cursor: crosshair;
    border-radius: 2px;
    padding: 0 1px;
}

.attn-source {
    color: #fff !important;
    text-shadow: 0 0 12px rgba(255,255,255,0.9), 0 0 30px rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1) !important;
    border-radius: 3px;
}

.attn-highlight {
    border-radius: 3px;
}


/* ================================================================
   BLACK HOLE — Schwarzschild singularity
   ================================================================ */

@keyframes blackholeJolt {
    0%   { transform: translate(0, 0) scale(1); }
    30%  { transform: translate(0, 0) scale(0.995); }
    50%  { transform: translate(0, 0) scale(0.99); filter: brightness(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.blackhole-jolt nav,
.blackhole-jolt main,
.blackhole-jolt .sidebar,
.blackhole-jolt footer {
    animation: blackholeJolt 0.4s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
    transform-origin: center center;
}

.blackhole-hide-content nav,
.blackhole-hide-content main,
.blackhole-hide-content footer {
    opacity: 0 !important;
}

@keyframes spaghettify {
    0% {
        transform: translate(0, 0) scale(1, 1) rotate(0deg);
        opacity: 1;
        filter: blur(0px);
    }
    20% {
        transform: translate(0, -10vh) scale(0.8, 1.3) rotate(5deg);
        opacity: 0.9;
    }
    50% {
        transform: translate(calc(50vw - 50%), -30vh) scale(0.3, 3) rotate(180deg);
        opacity: 0.7;
        filter: blur(1px);
    }
    75% {
        transform: translate(calc(50vw - 50%), -45vh) scale(0.05, 8) rotate(540deg);
        opacity: 0.4;
        filter: blur(3px);
    }
    100% {
        transform: translate(calc(50vw - 50%), -50vh) scale(0.0, 15) rotate(720deg);
        opacity: 0;
        filter: blur(6px);
    }
}

#terminal-window.blackhole-spaghetti {
    animation: spaghettify 3s cubic-bezier(0.55, 0, 1, 0.45) forwards !important;
    z-index: 10000;
    border-color: #ff6600 !important;
    box-shadow: 0 0 30px rgba(255, 100, 0, 0.5);
}

#terminal-window.blackhole-spaghetti * {
    color: var(--neon) !important;
    text-shadow: 0 0 10px var(--neon);
}


/* ================================================================
   AUTOMATA — Game of Life overlay
   ================================================================ */

#automata-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 140;
    pointer-events: none;
    background: var(--bg);
}

.automata-mode nav,
.automata-mode main,
.automata-mode footer,
.automata-mode .sidebar {
    transition: opacity 2s ease;
    opacity: 0;
}


/* ================================================================
   NAVIER-STOKES — GPU fluid simulation
   ================================================================ */

#navier-stokes-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 200;
    cursor: crosshair;
}

/* hide page content behind the fluid canvas */
body.navier-stokes-active nav,
body.navier-stokes-active main,
body.navier-stokes-active footer {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* keep terminal above the fluid canvas */
body.navier-stokes-active #terminal-window,
body.navier-stokes-active #terminal-bar,
body.navier-stokes-active #terminal-tooltip {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 301;
}


/* ================================================================
   MOBILE
   ================================================================ */

@media (max-width: 700px) {
    .two-col { grid-template-columns: 1fr; gap: 2rem; }
    .sidebar { position: static; text-align: center; }
    .headshot-placeholder, .headshot { margin: 0 auto 1rem; }
    .sidebar-links { text-align: left; }
    nav ul { gap: 1rem; flex-wrap: wrap; }
    .nav-row { flex-wrap: wrap; gap: 0.8rem; }

    #terminal-input {
        font-size: 16px;
    }
    .terminal-input-row .terminal-prompt {
        font-size: 14px;
    }
    #terminal-output {
        font-size: 14px;
    }
    #terminal-window {
        height: 50vh;
    }
}

/* ================================================================
   HISTORY COMMAND — fullscreen ASCII animation
   ================================================================ */

/* Terminal expands to fill viewport */
#terminal-window.history-fullscreen {
    height: 100vh !important;
    top: 0;
    bottom: 0;
    transition: height 0.4s ease, top 0.4s ease;
}

/* Container fills all space below terminal header */
#history-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ASCII canvas — fills container, monospace, no wrapping */
#history-canvas {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 8px;
    font-family: var(--mono-font);
    font-size: 14px;
    line-height: 1.2;
    color: #ffffff;
    background: transparent;
    white-space: pre;
    overflow: hidden;
    z-index: 1;
}

/* Timestamp — bottom left */
#history-timestamp {
    position: absolute;
    bottom: 48px;
    left: 16px;
    font-family: var(--mono-font);
    font-size: 13px;
    color: #555;
    z-index: 3;
    pointer-events: none;
}

/* Subtitle — bottom center, over everything */
#history-subtitle {
    position: absolute;
    bottom: 12px;
    left: 10%;
    right: 10%;
    text-align: center;
    font-family: var(--mono-font);
    font-size: 13px;
    line-height: 1.5;
    color: #aaa;
    z-index: 3;
    pointer-events: none;
    /* subtle text shadow for readability over ASCII */
    text-shadow: 0 0 8px #000, 0 0 16px #000;
}

/* 
Mandlebrot
*/

.mandelbrot-active {
    overflow: hidden;
}
.mandelbrot-active .sidebar,
.mandelbrot-active .content,
.mandelbrot-active nav,
.mandelbrot-active footer {
    visibility: hidden;
}

/* 
three-body
*/

.three-body-active {
    overflow: hidden;
}
.three-body-active .sidebar,
.three-body-active .content,
.three-body-active nav,
.three-body-active footer {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* ================================================================
   SSH — Live City Camera Overlay
   ================================================================ */

#ssh-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#ssh-overlay.ssh-visible {
    opacity: 1;
}

#ssh-overlay.ssh-closing {
    opacity: 0;
    transition: opacity 0.25s ease;
}

#ssh-window {
    width: min(900px, 85vw);
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.97);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

#ssh-overlay.ssh-visible #ssh-window {
    transform: scale(1);
    opacity: 1;
}

#ssh-overlay.ssh-closing #ssh-window {
    transform: scale(0.97);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Header bar */
#ssh-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: #252525;
    border-bottom: 1px solid #333;
    font-family: var(--mono-font);
    font-size: 0.82rem;
    color: #a0a0a0;
    min-height: 44px;
}

/* Live indicator */
.ssh-live-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #e74c3c;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.ssh-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: sshPulseDot 1.5s ease-in-out infinite;
}

@keyframes sshPulseDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.6); }
    50%      { opacity: 0.6; box-shadow: 0 0 0 4px rgba(231, 76, 60, 0); }
}

/* Title area */
.ssh-title-area {
    flex: 1;
    min-width: 0;
    text-align: center;
}

#ssh-stream-title {
    color: #d4d4d4;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

#ssh-local-time {
    color: #666;
    font-size: 0.72rem;
    line-height: 1.3;
}

/* Controls */
.ssh-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.ssh-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ssh-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ssh-next-btn {
    font-size: 1.1rem;
}

/* Iframe container */
#ssh-iframe-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

#ssh-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-family: var(--mono-font);
    font-size: 0.88rem;
    animation: sshPulseText 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes sshPulseText {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

#ssh-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 6px 6px;
    transition: opacity 0.4s ease;
    z-index: 2;
}

/* Shield — blocks all YouTube UI interaction */
#ssh-shield {
    position: absolute;
    inset: 0;
    z-index: 3;
    cursor: default;
}

/* Cover — hides YouTube branding on load */
#ssh-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

#ssh-cover.ssh-cover-fade {
    opacity: 0;
}

.ssh-cover-text {
    color: #555;
    font-family: var(--mono-font);
    font-size: 0.88rem;
    animation: sshPulseText 2s ease-in-out infinite;
}

/* ================================================================
   SSH — Mobile responsive
   ================================================================ */

@media (max-width: 768px) {
    #ssh-window {
        width: calc(100vw - 16px);
        border-radius: 4px;
    }

    #ssh-header {
        padding: 0.5rem 0.7rem;
        gap: 0.5rem;
    }

    #ssh-stream-title {
        font-size: 0.75rem;
    }

    .ssh-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.1rem;
    }

    #ssh-iframe {
        border-radius: 0 0 4px 4px;
    }
}
/* ================================================================
   DOUBLE PENDULUM
   ================================================================ */

/* Hide page content behind the pendulum canvas */
.double-pendulum-active nav,
.double-pendulum-active .content,
.double-pendulum-active footer {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Hide sidebar text but keep the headshot photo */
.double-pendulum-active .sidebar * {
    visibility: hidden !important;
}
.double-pendulum-active .sidebar .headshot {
    visibility: visible !important;
    position: relative;
    z-index: 55;
}

/* Keep terminal above the canvas */
.double-pendulum-active #terminal-window,
.double-pendulum-active #terminal-bar,
.double-pendulum-active #terminal-tooltip {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 301;
}
.double-pendulum-active .sidebar {
    z-index: 55;
}