@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --bg-color: #000000;
    --card-bg: #000000;
    --accent-color: #68c222;
    /* Authentic Atari 2600 NTSC Green */
    --accent-red: #d13d3d;
    /* Authentic Atari 2600 NTSC Red/Pink */
    --accent-orange: #d17c3d;
    /* Authentic Atari 2600 NTSC Orange (Shields) */
    --accent-blue: #3d58d1;
    /* Authentic Atari 2600 NTSC Blue */
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
}

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

body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 2;
    overflow: hidden;
    /* Main window does not scroll */
    cursor: crosshair;
    /* Retro 8-bit pointer */
    /* Soft white bloom on standard text */
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Scrollable Content Container (Inside TV Glass) */
.scroll-container {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    /* Under bezel */
    border-radius: 40px;
    /* Match inner glass corner curve */
    scroll-behavior: smooth;
}

/* Video/Canvas Background Styles */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: #0c1014;
    /* True dark phosphor tube color instead of pure void black */
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3 {
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
}

h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #fff;
    /* Hard offset + intense red bloom */
    text-shadow: 4px 4px 0px var(--accent-red), 0 0 20px rgba(255, 0, 0, 0.8);
}

h2 {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
    border-bottom: 4px solid var(--accent-color);
    padding-bottom: 1rem;
    display: inline-block;
    /* Green text bloom and bottom border glow */
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
    box-shadow: 0 6px 10px -4px rgba(57, 255, 20, 0.5);
}

p {
    font-size: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* Typewriter effect */
.typewriter-text {
    color: var(--accent-color);
    font-size: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 3rem;
    min-height: 1.5em;
    line-height: 1.5;
}

.typewriter-text.typing::after {
    content: '_';
    animation: blink 0.7s infinite steps(2);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Main Content Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
    transition: transform 0.1s ease-out;
    /* Smooth parallax tracking */
}

header {
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 10vh;
    position: relative;
}

/* Scroll Down Indicator */
.scroll-indicator {
    position: relative;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--accent-color);
    font-size: 0.6rem;
    animation: bounce 1s infinite steps(2);
    z-index: 5;
}

.scroll-indicator .arrow {
    width: 15px;
    height: 15px;
    border-right: 4px solid var(--accent-color);
    border-bottom: 4px solid var(--accent-color);
    transform: rotate(45deg);
    margin-top: 10px;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Authors Section */
.authors-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: nowrap;
    width: 100%;
}

.author-card {
    text-align: center;
    background: #111;
    border-radius: 12px 12px 2px 2px;
    border: 4px solid #333;
    border-bottom: 15px solid #222;
    padding: 0;
    min-width: 240px;
    flex: 1;
    position: relative;
    transition: transform 0.1s;
    /* Snappy */
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.8), inset 0 2px 5px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.author-card:hover {
    box-shadow: 15px 15px 0px rgba(0, 0, 0, 0.9), inset 0 2px 5px rgba(255, 255, 255, 0.1);
    transform: translate(-5px, -5px);
}

.cartridge-ribs {
    width: 100%;
    height: 35px;
    background: repeating-linear-gradient(90deg, #111, #111 10px, #222 10px, #222 20px);
    border-bottom: 2px solid #000;
}

.cartridge-sticker {
    background: #050505;
    /* near black */
    margin: 15px;
    border: 2px solid #444;
    border-top: 15px solid #ff0000;
    /* Atari red band */
    padding: 1.5rem 0.5rem 1rem 0.5rem;
    position: relative;
}

.cartridge-sticker::before {
    content: "ATARI";
    position: absolute;
    top: -14px;
    left: 5px;
    color: #fff;
    font-size: 0.4rem;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
}

.author-card img {
    width: 120px;
    height: 120px;
    border: 2px solid #555;
    image-rendering: pixelated;
    /* Retro chunky pixels */
    object-fit: cover;
    margin-bottom: 1rem;
    /* mix-blend-mode removed so photos look natural on the sticker */
}

/* Middle Card */
.author-card:nth-child(2) {
    min-width: 280px;
}

.author-card:nth-child(2) .cartridge-sticker {
    border-top: 15px solid var(--accent-color);
    /* Middle card gets a green band */
    margin: 25px 15px 15px 15px;
}

.author-card:nth-child(2) img {
    width: 150px;
    height: 150px;
}

.author-name {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

.author-card:nth-child(2) .author-name {
    font-size: 0.9rem;
}

.author-role {
    color: var(--text-muted);
    font-size: 0.65rem;
}

/* --- Retro TV Frame Styling for Sections --- */
section {
    position: relative;
    /* The TV Casing (Dark grey/brown plastic) */
    background-color: #2a2a2a;
    border: 8px solid #1a1a1a;
    border-radius: 40px;
    /* Highly rounded corners for 80s TV */
    padding: 4rem;
    margin-bottom: 5rem;
    box-shadow:
        15px 15px 0px rgba(0, 0, 0, 0.8),
        /* Heavy drop shadow */
        inset -10px -10px 20px rgba(0, 0, 0, 0.6),
        /* Plastic casing shading */
        inset 10px 10px 20px rgba(255, 255, 255, 0.05);
    /* Plastic casing highlight */
    z-index: 1;
}

section.no-box {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}
section.no-box::before, section.no-box::after {
    display: none !important;
}

/* The Curved CRT Glass Screen Background */
section::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    background: #020502;
    /* Very dark phosphor off-green */
    border-radius: 30px;
    /* Curved screen edges */
    border: 15px solid #0a0a0a;
    /* Thick inner bezel */
    box-shadow:
        inset 0 0 60px rgba(0, 0, 0, 1),
        /* Deep corner shadows for curvature */
        0 0 15px rgba(255, 255, 255, 0.1);
    /* Glare on the bezel edge */
    z-index: -2;
}

/* Section Screen Scanlines removed per user request */
section::after {
    display: none !important;
}

/* Make text inside the TV glow slightly */
section h2,
section p,
section ul,
section h3 {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

section:hover {
    /* Slight screen brightness bump on hover */
    box-shadow:
        15px 15px 0px rgba(0, 0, 0, 0.8),
        inset -10px -10px 20px rgba(0, 0, 0, 0.6),
        inset 10px 10px 20px rgba(255, 255, 255, 0.05),
        0 0 30px rgba(104, 194, 34, 0.2);
}

/* --- Atari Hardware Section --- */
.hardware-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
}

.hardware-text {
    flex: 1;
    min-width: 300px;
}

.hardware-specs {
    list-style: none;
    margin-top: 1.5rem;
    padding: 0;
}

.hardware-specs li {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--accent-color);
}

.hardware-specs strong {
    color: #fff;
}

.hardware-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 300px;
}

/* --- Atari Setup --- */
.atari-setup {
    display: flex;
    align-items: flex-end;
    gap: 25px;
}

/* Joystick */
.atari-joystick {
    position: relative;
    width: 80px;
    height: 90px;
    transition: transform 0.2s;
    z-index: 20;
}

.atari-joystick:hover {
    transform: scale(1.05);
}

.joystick-base {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 70px;
    background: #111;
    border: 4px solid #fff;
    border-radius: 4px;
    box-shadow: 10px 10px 0px rgba(57, 255, 20, 0.3);
    z-index: 5;
}

.joystick-button {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 18px;
    height: 18px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid #555;
    transition: transform 0.1s;
}

.joystick-ring {
    position: absolute;
    top: 20px;
    left: 35px;
    width: 30px;
    height: 30px;
    background: transparent;
    border-radius: 50%;
    border: 4px solid #222;
}

.joystick-stick {
    position: absolute;
    bottom: 40px;
    left: 45px;
    width: 10px;
    height: 50px;
    background: #444;
    border-left: 2px solid #777;
    z-index: 10;
    transform: rotate(10deg);
    transform-origin: bottom center;
    transition: transform 0.1s ease-out;
}

.joystick-ball {
    position: absolute;
    top: -15px;
    left: -10px;
    width: 25px;
    height: 25px;
    background: #111;
    border: 3px solid #fff;
    border-radius: 50%;
}

/* Pure CSS Atari 2600 Console */
.atari-css-art {
    width: 280px;
    height: 90px;
    background: #111;
    border: 4px solid #fff;
    position: relative;
    border-radius: 4px;
    box-shadow: 10px 10px 0px rgba(57, 255, 20, 0.3);
    overflow: visible;
    /* Show inserted cartridge */
    transition: transform 0.2s;
    z-index: 1;
    /* Keep stacking context stable so cartridge stays behind the black plastic */
}

.atari-css-art:hover {
    transform: scale(1.05);
    box-shadow: 10px 10px 0px rgba(57, 255, 20, 0.6), 0 0 15px rgba(57, 255, 20, 0.5);
}

.atari-css-art:hover .atari-cartridge {
    bottom: 75px;
    /* Slide up when hovered! */
}

.atari-top {
    width: 100%;
    height: 40px;
    background: #050505;
    border-bottom: 4px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
}

.atari-slot {
    width: 140px;
    height: 12px;
    background: #000;
    border: 2px solid #222;
}

.atari-wood {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30px;
    background: #8b5a2b;
    /* Wood paneling color */
    border-top: 4px solid #6b4226;
}

.atari-switches {
    position: absolute;
    top: 50px;
    left: 20px;
    width: 240px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.switch {
    width: 16px;
    height: 8px;
    background: silver;
    border: 2px solid #fff;
    box-shadow: 0 4px 0 #666;
}

/* Space Invaders Cartridge */
.atari-cartridge {
    position: absolute;
    bottom: 5px;
    /* Fully hidden inside the vertical bounds of the 90px console */
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 80px;
    background: #1a1a1a;
    border: 4px solid #333;
    border-radius: 8px 8px 0 0;
    z-index: -1;
    /* Goes behind the console */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15px;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy eject animation */
}

.cartridge-label {
    width: 90px;
    height: 55px;
    background: linear-gradient(180deg, #222 20%, var(--accent-red) 100%);
    border: 2px solid #555;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cartridge-alien {
    /* 8-bit space invader */
    width: 3px;
    height: 3px;
    background: transparent;
    box-shadow:
        /* Row 1: x   x */
        6px 0 #fff, 24px 0 #fff,
        /* Row 2:  x x  */
        9px 3px #fff, 21px 3px #fff,
        /* Row 3: xxxxxxx */
        6px 6px #fff, 9px 6px #fff, 12px 6px #fff, 15px 6px #fff, 18px 6px #fff, 21px 6px #fff, 24px 6px #fff,
        /* Row 4: xx xxx xx */
        0 9px #fff, 3px 9px #fff, 9px 9px #fff, 12px 9px #fff, 15px 9px #fff, 21px 9px #fff, 24px 9px #fff, 27px 9px #fff,
        /* Row 5: xxxxxxxxxxx */
        0 12px #fff, 3px 12px #fff, 6px 12px #fff, 9px 12px #fff, 12px 12px #fff, 15px 12px #fff, 18px 12px #fff, 21px 12px #fff, 24px 12px #fff, 27px 12px #fff, 30px 12px #fff,
        /* Row 6: x x   x x */
        0 15px #fff, 6px 15px #fff, 24px 15px #fff, 30px 15px #fff,
        /* Row 7:  x     x */
        9px 18px #fff, 21px 18px #fff,
        /* Row 8:  x     x */
        12px 21px #fff, 18px 21px #fff;
    transform: translateX(-15px) translateY(-10px);
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-box {
    background: rgba(0, 0, 0, 0.85);
    padding: 2rem;
    text-align: center;
    border: 4px solid var(--accent-color);
    transition: background 0.1s;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3), inset 0 0 15px rgba(57, 255, 20, 0.2);
}

.stat-box:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 10px 10px 0px #fff, 0 0 30px rgba(57, 255, 20, 1);
    transform: translate(-5px, -5px);
}

.stat-box:hover .stat-number,
.stat-box:hover .stat-label {
    color: #000;
}

.stat-number {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: block;
}

.stat-label {
    font-size: 0.6rem;
}

/* Button */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: #000;
    background-color: var(--accent-color);
    border: 4px solid #fff;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 2rem;
    transition: background 0.1s;
}

.btn:hover {
    background-color: #fff;
    color: #000;
    border-color: var(--accent-color);
    box-shadow: 8px 8px 0px var(--accent-red);
    transform: translate(-4px, -4px);
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
}

.reveal.show {
    opacity: 1;
    /* Snappy blocky reveal */
    animation: 0.2s steps(4) 0s 1 slideUp;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Placeholder for chart */
.chart-placeholder {
    width: 100%;
    height: 300px;
    background: #000;
    border: 4px dashed var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 0.8rem;
    margin-top: 2rem;
}

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

/* CRT Curved Glass Bezel & Glare */
.crt-bezel {
    position: fixed;
    top: 20px;
    bottom: 20px;
    left: 20px;
    right: 20px;
    pointer-events: none;
    z-index: 9999;

    /* The curve of the inner glass */
    border-radius: 60px;

    /* Infinite outer shadow to draw the dark plastic casing */
    box-shadow: 0 0 0 100vmax #1a1a1a;
}

.crt-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Glare removed per user request */
    background: transparent;
    border-radius: inherit;
    /* Match 60px curve */
}

/* Crisp, visible CRT Glass Scanlines */
.crt-bezel::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Scanlines */
    background: repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0px,
            rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0.25) 3px,
            rgba(0, 0, 0, 0.25) 4px);

    /* Must match the parent exactly so they don't stick out! */
    border-radius: inherit;

    /* Place the deep black vignette ON TOP of the scanline background, hiding them in the corners! */
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.15),
        inset 0 0 250px rgba(0, 0, 0, 1),
        inset 0 0 80px rgba(0, 0, 0, 0.9);

    pointer-events: none;
    opacity: 0.75;
    /* Bring the scanlines to life! */
    animation:
        scanline-drift 1.5s linear infinite,
        crt-flicker 6s infinite;
}

/* --- CRT Animations --- */
@keyframes scanline-drift {
    0% {
        background-position: 0 0px;
    }

    100% {
        background-position: 0 40px;
    }

    /* Must be a multiple of the 4px pattern */
}

@keyframes crt-flicker {
    0% {
        opacity: 1;
    }

    3% {
        opacity: 0.8;
    }

    /* Quick dip in power */
    6% {
        opacity: 1;
    }

    45% {
        opacity: 0.95;
    }

    48% {
        opacity: 0.85;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}

/* Methodology Grid */
.methodology-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.method-card {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--accent-red);
    padding: 20px;
    border-radius: 4px;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow-wrap: break-word;
    word-break: break-word;
}

.method-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 0, 85, 0.3);
}

.method-card h3 {
    color: var(--accent-red);
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.method-card .icon {
    font-size: 1.5rem;
}

.pixel-art-icon {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    vertical-align: middle;
    margin-right: 10px;
    display: inline-block;
}

/* Neon Scroll Progress Bar (Moved to Left) */
#scroll-progress {
    position: fixed;
    top: 20px;
    bottom: 20px;
    left: 20px;
    width: 6px;
    background: var(--accent-color);
    height: 0%;
    z-index: 9998;
    box-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color);
    transition: height 0.1s;
    pointer-events: none;
}

a,
button,
.btn {
    cursor: pointer;
}

/* --- 8-Bit Research Charts --- */
#research-results {
    margin-top: 6rem;
    margin-bottom: 2rem;
}

#research-results h2 {
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 2rem;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.8);
}

.chart-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chart-bar-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chart-label {
    width: 140px;
    text-align: right;
    font-size: 0.8rem;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #000;
}

.pixel-bar-wrapper {
    flex: 1;
    height: 35px;
    background: #111;
    border: 4px solid #333;
    border-right-color: #555;
    border-bottom-color: #555;
    position: relative;
    display: flex;
    align-items: center;
}

.pixel-bar {
    height: 100%;
    /* Pixel art block pattern - slices the bar into segments */
    background-image: linear-gradient(90deg, transparent 80%, rgba(0, 0, 0, 0.8) 80%);
    background-size: 25px 100%;
    transition: width 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy grow */
    width: 0;
    /* Starts at 0 for animation */
}

/* Animate widths when the section gets the .show class from the scroll observer */
.show .pixel-bar.low-clutter {
    width: 25%;
    background-color: var(--accent-color);
    box-shadow: inset 0 5px rgba(255, 255, 255, 0.4), 0 0 15px var(--accent-color);
}

.show .pixel-bar.medium-clutter {
    width: 50%;
    background-color: var(--accent-orange);
    box-shadow: inset 0 5px rgba(255, 255, 255, 0.4), 0 0 15px var(--accent-orange);
}

.show .pixel-bar.high-clutter {
    width: 90%;
    background-color: var(--accent-red);
    box-shadow: inset 0 5px rgba(255, 255, 255, 0.4), 0 0 15px var(--accent-red);
}

.chart-value {
    position: absolute;
    right: -70px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

/* --- Retro Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    /* Thinner so it doesn't ruin the right TV border */
    background: #000;
    border-left: 2px solid #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border: 2px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-orange);
}

/* Playable Game Mode Styles */
.fade-out {
    opacity: 0;
    pointer-events: none;
}

.scroll-container {
    transition: opacity 0.5s ease;
}

#esc-overlay {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    text-shadow: 2px 2px 0px var(--accent-red), 0 0 10px rgba(104, 194, 34, 0.8);
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.3s ease;
    animation: blink 1s step-end infinite;
}

.esc-hidden {
    opacity: 0;
    animation: none !important;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* VHS Synthwave Tracking Sweep */
.author-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 255, 255, 0.15) 45%,
        rgba(255, 0, 255, 0.25) 50%,
        rgba(0, 255, 255, 0.15) 55%,
        transparent 100%
    );
    background-size: 100% 200%;
    background-position: 0 -100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
    mix-blend-mode: screen;
}

.author-card:hover::after {
    opacity: 1;
    animation: vhsSweep 2s linear infinite;
}

@keyframes vhsSweep {
    0% { background-position: 0 -100%; }
    100% { background-position: 0 200%; }
}

/* Static Scanline Overlay for Image */
.cartridge-sticker::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.author-card:hover .cartridge-sticker::after {
    opacity: 1;
}

/* Interactive 8-Bit Chart Tooltips */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
    cursor: help;
}

.pixel-tooltip {
    position: absolute;
    bottom: 105%; /* Show above the image */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 280px;
    background: #111;
    border: 4px solid var(--accent-color);
    box-shadow: 8px 8px 0px rgba(0,0,0,0.8), inset 0 0 10px rgba(104, 194, 34, 0.2);
    padding: 15px;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 50;
    /* image-rendering: pixelated; */
}

/* Arrow at the bottom of the tooltip */
.pixel-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px;
    border-style: solid;
    border-color: var(--accent-color) transparent transparent transparent;
}

.tooltip-wrapper:hover .pixel-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tooltip-title {
    display: block;
    color: var(--accent-orange);
    margin-bottom: 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px #000;
}

/* Base Presentation Bullets & Layout Helpers */
.presentation-bullets {
    font-size: 1.1rem;
    line-height: 1.8rem;
    list-style-type: square;
    margin-left: 1.5rem;
    text-align: left;
}

.presentation-bullets li {
    margin-bottom: 1rem;
    color: #fff;
    word-break: break-word;
    overflow-wrap: break-word;
}

.presentation-bullets li strong {
    color: #00ffff;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    word-break: break-word;
}

.btn-wrapper {
    text-align: center;
    margin-top: 2rem;
}

.chart-img {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    border: 4px solid #00ffff;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    display: block;
}

.download-section {
    text-align: center;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    margin-top: 4rem;
}

.cta-text {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsiveness
   ========================================================================== */

/* --- Tablet / Medium Screens (max-width: 992px) --- */
@media screen and (max-width: 992px) {
    .container {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1rem;
    }

    .authors-container {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .author-card {
        width: 160px;
    }

    .presentation-bullets {
        font-size: 1rem;
        line-height: 1.6rem;
        margin-left: 1.2rem;
    }

    .methodology-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- Mobile / Small Screens (max-width: 768px) --- */
@media screen and (max-width: 768px) {
    html, body {
        width: 100% !important;
        overflow-x: hidden !important;
    }

    body {
        font-size: 11px !important;
        line-height: 1.5 !important;
    }

    /* Force reveal elements to be fully visible immediately */
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /* Section TV Box Padding Override */
    section {
        padding: 1.5rem 0.8rem !important;
        margin-bottom: 2rem !important;
        border-width: 4px !important;
        border-radius: 16px !important;
        box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.8) !important;
    }

    section::before,
    section::after {
        top: 0.4rem !important;
        left: 0.4rem !important;
        right: 0.4rem !important;
        bottom: 0.4rem !important;
        border-width: 4px !important;
        border-radius: 12px !important;
    }

    /* Use full phone screen without fixed inset margins */
    .scroll-container {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important;
    }

    .crt-bezel {
        display: none !important; /* Hide heavy TV frame on mobile to maximize touch area */
    }

    .container {
        padding: 1rem 0.6rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    header {
        min-height: auto !important;
        padding-top: 1.5rem !important;
        padding-bottom: 2rem !important;
    }

    h1 {
        font-size: 1rem !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        text-shadow: 2px 2px 0px var(--accent-red), 0 0 10px rgba(255, 0, 0, 0.8) !important;
    }

    h2 {
        font-size: 0.85rem !important;
        margin-bottom: 1rem !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .typewriter-text {
        font-size: 0.55rem !important;
        margin-bottom: 1.5rem !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        line-height: 1.4 !important;
    }

    .authors-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.2rem !important;
        margin-top: 1.5rem !important;
        width: 100% !important;
    }

    .author-card,
    .author-card:nth-child(2) {
        width: 100% !important;
        max-width: 260px !important;
        min-width: 0 !important;
        padding: 0 !important;
        transform: none !important;
        box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.8) !important;
    }

    .cartridge-sticker,
    .author-card:nth-child(2) .cartridge-sticker {
        margin: 10px !important;
        padding: 1rem 0.5rem 0.8rem 0.5rem !important;
    }

    .author-card img,
    .author-card:nth-child(2) img {
        width: 110px !important;
        height: 110px !important;
        border-radius: 4px !important;
        object-fit: cover !important;
        margin: 0 auto 0.8rem auto !important;
        display: block !important;
    }

    .author-name,
    .author-card:nth-child(2) .author-name {
        font-size: 0.65rem !important;
        margin-bottom: 0.3rem !important;
    }

    .author-role {
        font-size: 0.55rem !important;
    }

    .hardware-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }

    .hardware-text {
        width: 100% !important;
        min-width: 0 !important;
    }

    .hardware-visual {
        width: 100% !important;
        min-width: 0 !important;
        transform: scale(0.7) !important;
        margin: 0 auto !important;
        transform-origin: top center !important;
    }

    .methodology-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .method-card {
        width: 100% !important;
        padding: 0.8rem !important;
        box-sizing: border-box !important;
    }

    .method-card h3 {
        font-size: 0.9rem !important;
    }

    .presentation-bullets {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-left: 0.6rem !important;
        list-style-position: inside !important;
    }

    .presentation-bullets li {
        margin-bottom: 0.6rem !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .stats-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .stat-box {
        width: 100% !important;
        min-width: 0 !important;
        padding: 0.8rem !important;
        box-sizing: border-box !important;
    }

    .stat-number {
        font-size: 1.5rem !important;
    }

    .stat-label {
        font-size: 0.55rem !important;
    }

    #scroll-progress {
        display: none !important;
    }

    .chart-container {
        width: 100% !important;
    }

    .tooltip-wrapper {
        width: 100% !important;
    }

    .pixel-tooltip {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-top: 10px !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        font-size: 0.55rem !important;
        line-height: 1.4 !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
    }

    .pixel-tooltip::after {
        display: none !important;
    }

    .cta-text {
        font-size: 0.85rem !important;
    }

    .btn {
        font-size: 0.7rem !important;
        padding: 8px 14px !important;
    }

    #download,
    .download-section {
        display: none !important;
    }
}

/* --- Ultra Small Mobile (max-width: 480px) --- */
@media screen and (max-width: 480px) {
    .container {
        padding: 0.8rem 0.4rem !important;
    }

    h1 {
        font-size: 0.85rem !important;
    }

    h2 {
        font-size: 0.75rem !important;
    }

    .typewriter-text {
        font-size: 0.5rem !important;
    }

    .author-card,
    .author-card:nth-child(2) {
        max-width: 190px !important;
    }

    .cartridge-sticker img {
        height: 95px !important;
    }

    .presentation-bullets {
        font-size: 0.75rem !important;
        line-height: 1.35 !important;
        margin-left: 0.4rem !important;
    }

    .hardware-visual {
        transform: scale(0.6) !important;
    }
}