:root {
    --bg-color: #ffffff;
    --text-main: #000000;
    --text-mono: #000000;
    --border-color: #000000;
    --font-mono: "JetBrains Mono", "Courier New", "Courier", monospace;
    --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    background-image: radial-gradient(#000 1px, transparent 1px);
    background-size: 20px 20px;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 3rem;
    background: #fff;
    border-left: 1px solid #000;
    border-right: 1px solid #000;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 4rem;
    height: fit-content;
}

.sidebar h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5rem;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-link {
    display: block;
    font-family: var(--font-mono);
    color: #444;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid transparent;
    padding: 0.25rem 0.5rem;
    transition: all 0.1s;
}

.toc-link:hover,
.toc-link.active {
    color: #000;
    border: 1px solid #000;
    background: #eee;
}

/* Main Content */
.main-content {
    min-width: 0;
}

header {
    margin-bottom: 5rem;
    border: 2px solid #000;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

header h1 {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

header .subtitle {
    font-size: 1rem;
    border-top: 1px solid #000;
    padding-top: 0.5rem;
}

/* CRITICAL HEADER ALERT - NAKED EYE 3D */
.alert-header-critical {
    margin-top: 2rem;
    border: 2px solid #000;
    /* Stable Black Background - No Flashing */
    background: #000;
    color: #fff;
    padding: 2.5rem 1.5rem;
    /* More space for 3D */
    text-align: center;
    position: relative;
    overflow: visible;
    /* Allow 3D pop-out */
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.2);
    /* Subtle breathing, NO color flash */
    animation: floatingContainer 4s ease-in-out infinite;
}

/* Scrolling Stripe Background */
.alert-header-critical::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
            #111,
            #111 10px,
            #000 10px,
            #000 20px);
    opacity: 0.5;
    z-index: 0;
}

/* Scanline Overlay */
.alert-header-critical::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom,
            transparent 45%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 55%);
    background-size: 100% 5px;
    /* Thin scanlines */
    z-index: 1;
    pointer-events: none;
}

.alert-header-critical strong,
.alert-header-critical span {
    position: relative;
    z-index: 2;
    /* Above background */
}

/* CRITICAL HEADER ALERT - CYBERPUNK GLITCH */
.alert-header-critical strong {
    display: block;
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-family: "Black Ops One", var(--font-mono);
    font-weight: 900;

    /* Hard Edge Styling */
    color: #fff;
    -webkit-text-stroke: 0;
    /* Let layers handle details */

    /* Hard Block Shadow */
    text-shadow: 4px 4px 0 #333;

    position: relative;
    /* No Pulse, just pure glitch stability */
}

/* Glitch Layers */
.alert-header-critical strong::before,
.alert-header-critical strong::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    /* Match bg to hide underlying text */
    color: #fff;
    /* White Text */
    -webkit-text-stroke: 1px #000;
    /* Definition */
}

.alert-header-critical strong::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    /* Magenta Hue */
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.alert-header-critical strong::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    /* Cyan Hue */
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.alert-header-critical span {
    display: block;
    position: relative;
    z-index: 100;
    font-weight: 700;
}

/* Animations */
@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
        transform: translate(-2px, 0);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
        transform: translate(2px, 0);
    }

    40% {
        clip-path: inset(10% 0 50% 0);
        transform: translate(-2px, 0);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(2px, 0);
    }

    80% {
        clip-path: inset(30% 0 40% 0);
        transform: translate(-2px, 0);
    }

    100% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(2px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(2px, 0);
    }

    20% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(-2px, 0);
    }

    40% {
        clip-path: inset(40% 0 30% 0);
        transform: translate(2px, 0);
    }

    60% {
        clip-path: inset(15% 0 70% 0);
        transform: translate(-2px, 0);
    }

    80% {
        clip-path: inset(55% 0 10% 0);
        transform: translate(2px, 0);
    }

    100% {
        clip-path: inset(25% 0 50% 0);
        transform: translate(-2px, 0);
    }
}

@keyframes floatingContainer {

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

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

/* Remove old Flash animations */
@keyframes scanlineScroll {
    0% {
        background-position: 0 0;
    }

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

/* Steps */
.step {
    margin-bottom: 5rem;
    border-top: 4px solid #000;
    padding-top: 1rem;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 3rem;
}

.step-content {
    display: flex;
    flex-direction: column;
}

.step-header {
    margin-bottom: 1.5rem;
}

.step-number {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid #000;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    margin-bottom: 1rem;
    background: #000;
    color: #fff;
}

.step-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.step p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.step-visual {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-visual img {
    width: 100%;
    border: 1px solid #000;
    padding: 5px;
    background: #fff;
    box-shadow: 8px 8px 0 #000;
    cursor: zoom-in;
    transition: transform 0.1s;
}

.step-visual img:hover {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0 #000;
}

.btn-download {
    display: inline-block;
    font-family: var(--font-mono);
    background: #fff;
    color: #000;
    border: 2px solid #000;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 4px 4px 0 #000;
}

.btn-download:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
    background: #000;
    color: #fff;
}

.alert {
    padding: 1rem;
    border: 2px solid #000;
    margin: 1.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: #fff;
}

.alert-warning {
    border-left-width: 8px;
}

.alert-danger {
    border-left-width: 8px;
    background-image: linear-gradient(45deg, #000 25%, transparent 25%, transparent 50%, #000 50%, #000 75%, transparent 75%, transparent);
    background-size: 10px 10px;
    background-color: #fff;
}

.alert-danger p {
    background: #fff;
    padding: 0.5rem;
    font-weight: 800;
    display: inline-block;
}

/* FAB */
.fab-container {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    z-index: 100;
}

.fab-toggle {
    width: 4rem;
    height: 4rem;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-mono);
    font-weight: 700;
    box-shadow: 6px 6px 0 #000;
}

.fab-menu {
    position: absolute;
    bottom: 5rem;
    right: 0;
    background: #fff;
    border: 2px solid #000;
    width: 220px;
    display: none;
    box-shadow: 6px 6px 0 #000;
}

.fab-menu.active {
    display: block;
}

.fab-item {
    display: block;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: #000;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border-bottom: 1px solid #000;
}

.fab-item:hover {
    background: #000;
    color: #fff;
}

footer {
    padding: 2rem 0;
    border-top: 4px solid #000;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* LIGHTBOX FIX */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    background-image: radial-gradient(#000 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border: 4px solid #000;
    box-shadow: 20px 20px 0 #000;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        padding: 2rem;
        border: none;
    }

    .sidebar {
        display: none;
    }

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