/* --- CSS Variables for Theming --- */
:root {
    /* Light Theme (Default) */
    --bg-body: #ffffff;
    --bg-grad-start: #f3f4f6;
    --bg-grad-end: #ffffff;
    --text-main: #111827;
    --text-muted: #4b5563;
    --text-ghost: rgba(0,0,0,0.03);
    --grid-line: rgba(0, 0, 0, 0.05);
    --drill-rail: rgba(0, 0, 0, 0.1);
    --drill-head: #000000;
    --drill-shadow: rgba(0,0,0,0.2);
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.1);
    --outline-stroke: rgba(0,0,0,0.3);
    --outline-ghost: rgba(0,0,0,0.1);
    --nav-text: rgba(0,0,0,0.7);
    --nav-text-hover: #000000;
    --dust-color: rgba(0,0,0,0.4);

    /* UI Elements */
    --btn-primary-bg: #000000;
    --btn-primary-text: #ffffff;
    --btn-secondary-border: rgba(0,0,0,0.2);
    --btn-secondary-hover: rgba(0,0,0,0.05);

    /* Math Specific */
    --math-bg: #f9fafb;
    --math-border: #e5e7eb;
    --variable-highlight: #4f46e5;

    /* Tutorial Specific */
    --sidebar-bg: #f9fafb;
    --step-active-bg: #000000;
    --step-active-text: #ffffff;
    --step-completed-bg: rgba(0,0,0,0.05);
    --code-bg: #111827;
    --success-border: #22c55e;
    --success-bg: #f0fdf4;
}

/* Dark Theme (Commented Out) */
/*
body.dark-mode {
    --bg-body: #1a1a1a;
    --bg-grad-start: #2a2a2a;
    --bg-grad-end: #1a1a1a;
    --text-main: #e5e5e5;
    --text-muted: #9ca3af;
    --text-ghost: rgba(255,255,255,0.02);
    --grid-line: rgba(255, 255, 255, 0.03);
    --drill-rail: rgba(255, 255, 255, 0.1);
    --drill-head: #ffffff;
    --drill-shadow: rgba(255,255,255,0.4);
    --card-bg: #111;
    --card-border: rgba(255, 255, 255, 0.1);
    --outline-stroke: rgba(255,255,255,0.3);
    --outline-ghost: rgba(255,255,255,0.1);
    --nav-text: rgba(255,255,255,0.8);
    --nav-text-hover: #ffffff;
    --dust-color: rgba(255,255,255,0.2);

    --btn-primary-bg: #ffffff;
    --btn-primary-text: #000000;
    --btn-secondary-border: rgba(255,255,255,0.3);
    --btn-secondary-hover: rgba(255,255,255,0.05);

    --math-bg: rgba(0,0,0,0.3);
    --math-border: rgba(255,255,255,0.05);
    --variable-highlight: #a5b4fc;

    --sidebar-bg: #151515;
    --step-active-bg: #ffffff;
    --step-active-text: #000000;
    --step-completed-bg: rgba(255,255,255,0.1);
    --code-bg: #000000;
    --success-border: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
}
*/

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* --- Monochromatic Gradient World --- */
.depth-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to bottom,
        var(--bg-grad-start) 0%,
        var(--bg-grad-end) 100%
    );
    z-index: -2;
    transition: background 0.5s ease;
}

/* --- Parallax Layers --- */
.parallax-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120vh;
    pointer-events: none;
    z-index: -1;
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

/* Infinite Grid Styles */
.infinite-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    opacity: 1;
    will-change: background-position;
    transition: background-image 0.5s ease;
}

/* Binary Dust */
.binary-dust {
    position: absolute;
    font-size: 10px;
    font-family: monospace;
    color: var(--dust-color);
}

/* --- 3D Card Effect --- */
.tilt-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

.tilt-inner {
    transform: translateZ(20px);
}

/* Card Styles with Variables */
.card-styled {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
}

/* --- Typography Effects --- */
.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.9;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
    color: var(--text-main);
}

.outline-text {
    color: transparent;
    -webkit-text-stroke: 2px var(--outline-stroke);
    position: relative;
    display: inline-block;
}

.outline-ghost {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-text-stroke: 1px var(--outline-ghost);
    pointer-events: none;
    z-index: -1;
}

.text-muted {
    color: var(--text-muted);
}

/* --- Drill Rail --- */
.drill-rail {
    position: fixed;
    left: 80px;
    top: 0;
    height: 100%;
    width: 1px;
    background: var(--drill-rail);
    z-index: 50;
    transition: background 0.5s ease;
}

.drill-head {
    position: absolute;
    left: -6px;
    top: 0;
    width: 13px;
    height: 40px;
    background: var(--drill-head);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    box-shadow: 0 0 15px var(--drill-shadow);
    z-index: 51;
    transition: background 0.5s ease, box-shadow 0.5s ease;
    will-change: transform;
}

.depth-counter {
    position: fixed;
    left: 100px;
    top: 0;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 50;
    will-change: transform;
}

.section-number-lg {
    position: absolute;
    left: -4rem;
    top: -2rem;
    font-size: 12rem;
    font-weight: 800;
    font-family: 'Syne', sans-serif;
    color: var(--text-ghost);
    line-height: 1;
    z-index: -1;
    pointer-events: none;
    transition: color 0.5s ease;
}

/* --- Buttons --- */
.btn-main {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn-sec {
    border: 1px solid var(--btn-secondary-border);
    color: var(--text-main);
}

.btn-sec:hover {
    background-color: var(--btn-secondary-hover);
}

.nav-link {
    color: var(--nav-text);
    transition: color 0.3s;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--nav-text-hover);
}

/* --- Tutorial Cards --- */
.tutorial-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    border-color: var(--text-main);
    transform: translateY(-2px);
}
