:root {
    --bg-color: #050505;
    --text-primary: #F0F0F0;
    --text-secondary: #888888;
    --accent: #E0E0E0;
    --highlight: #FFFFFF;
    --void: #000000;
    --titanium: #2A2A2A;

    --font-mono: 'Space Mono', monospace;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor everywhere */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- CODE BACKGROUND (TORCH EFFECT) --- */
#code-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.2;
    /* EXPERIMENTAL: INTENSITY BOOST */
    color: rgba(0, 255, 136, 0.3);
    /* Adjusted to 30% */
    text-shadow: 0 0 2px rgba(0, 255, 136, 0.3);
    /* Added glow */
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    opacity: 1;

    /* Grid Layout for Full Coverage */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    align-content: start;
    gap: 10px;
    padding: 20px;

    mask-image: radial-gradient(circle 350px at var(--cursor-x, 50%) var(--cursor-y, 50%),
            black 0%,
            transparent 100%);
    -webkit-mask-image: radial-gradient(circle 350px at var(--cursor-x, 50%) var(--cursor-y, 50%),
            black 0%,
            transparent 100%);
    transition: opacity 0.3s;
}

/* --- CUSTOM CURSOR --- */
.cursor-dot {
    width: 6px;
    height: 6px;
    background: white;
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: 9998;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
}

/* Hover state for cursor */
body:has(a:hover) .cursor-outline,
body:has(div[data-tilt]:hover) .cursor-outline {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    border-color: transparent;
}

/* --- NAVIGATION --- */
nav.nav-bar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    mix-blend-mode: exclusion;
}

.nav-brand {
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: -0.05em;
    font-size: 1.2rem;
}

.blink {
    animation: blink 1s infinite step-end;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 1;
}

.nav-btn {
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: white;
    color: black;
}

/* --- HERO SECTION --- */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* Putting subject ON TOP */
    mix-blend-mode: lighten;
    /* Makes black background transparent */
    pointer-events: none;
    /* Let clicks pass through if needed */
}

canvas#hero-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.2) brightness(1.1);
    /* CRITICAL: Boosts white/black separation for blend mode */
}

.hero-content {
    position: relative;
    z-index: 1;
    /* Putting text BEHIND */
    text-align: center;
    /* mix-blend-mode removed so it's solid behind the lighten layer */
    pointer-events: none;
}

.hero-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    margin-bottom: 20px;
    opacity: 0.5;
    /* Lower opacity for background feel */
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 8rem);
    line-height: 0.9;
    font-weight: 400;
    /* Editorial look */
    margin-bottom: 30px;
    color: #444;
    /* Even darker to prevent bleed-through on subject shadows */
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    /* Subtle glow to lift it from black bg */
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.line-x {
    width: 60px;
    height: 1px;
    background: currentColor;
}

.highlight {
    color: var(--highlight);
    font-weight: 700;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: white;
    animation: scrollGrow 2s infinite ease-out;
    transform-origin: top;
}

@keyframes scrollGrow {
    0% {
        transform: scaleY(0);
    }

    50% {
        transform: scaleY(1);
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* --- ORIGIN SECTION (Split Layout) --- */
.origin-section {
    position: relative;
    padding: 100px 0;
    /* background: var(--bg-color); */
    background: transparent;
    /* Updated for Torch */
}

.split-container {
    display: flex;
    min-height: 200vh;
    /* For scrolling effect */
}

.split-left {
    width: 50%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.split-right {
    width: 50%;
    padding: 100px 60px;
}

/* Sticky Pinning handled by GSAP */
/* .pin-target style removed as it is handled by JS */

.rock-model {
    width: 300px;
    height: 300px;
    background: #111;
    border-radius: 50% 40% 60% 30% / 40% 50% 60% 50%;
    /* Organic shape */
    position: relative;
    /* Placeholder for potential 3D or image */
    background: radial-gradient(circle at 30% 30%, #333, #000);
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.05);
    transition: all 0.5s ease;
}

.visual-label {
    position: absolute;
    bottom: -40px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.narrative-block {
    height: 80vh;
    /* Spacing for scroll */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
    border-left: 2px solid var(--text-primary);
    padding-left: 15px;
}

.narrative-text {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    line-height: 1.3;
}

/* --- RESUME SECTION --- */
.resume-section {
    padding: 100px 0;
    /* background: var(--bg-color); */
    background: transparent;
    /* Updated for Torch */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.resume-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

.resume-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 60px;
}

.resume-line {
    flex-grow: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.resume-text {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 40px;
    font-weight: 300;
}

.resume-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.resume-quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.resume-sign {
    font-family: var(--font-mono);
    text-align: right;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

/* --- SYSTEM STATUS (Nav) --- */
.nav-status {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(0, 255, 136, 0.05);
}

.status-led {
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 5px #00ff88;
    animation: pulseStatus 2s infinite;
}

.status-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #00ff88;
    letter-spacing: 0.05em;
    font-weight: 700;
}

@keyframes pulseStatus {
    0% {
        opacity: 1;
        box-shadow: 0 0 5px #00ff88;
    }

    50% {
        opacity: 0.4;
        box-shadow: 0 0 0 #00ff88;
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 5px #00ff88;
    }
}

/* --- DOSSIER DOWNLOAD BUTTON --- */
.dossier-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    transition: all 0.3s;
    white-space: nowrap;
}

.dossier-btn:hover {
    background: white;
    color: black;
    border-color: white;
}

/* --- MISSION PARAMETERS (Services) --- */
.mission-section {
    padding: 100px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mission-header {
    margin-bottom: 80px;
}

.mission-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.mission-title {
    font-family: var(--font-sans);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 60px;
    row-gap: 80px;
}

.mission-item {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.mission-icon {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.1);
    /* Ghost numbers */
    line-height: 1;
}

.mission-content h3 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--highlight);
}

.mission-content p {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 400px;
}

/* --- ARSENAL SECTION (3D Cards) --- */
.arsenal-section {
    padding: 150px 0;
    /* background: #080808; */
    background: transparent;
    /* Updated for Torch */
    perspective: 1000px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.huge-title {
    font-size: 5rem;
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: -0.05em;
    color: rgba(255, 255, 255, 0.15);
    /* Increased from 0.05 */
    /* Ghost text */
    margin-bottom: 20px;
}

.section-line {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 80px;
}

.carousel-3d {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.arsenal-card {
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.arsenal-card:hover .card-inner {
    transform: rotateY(180deg);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.05);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.card-back {
    transform: rotateY(180deg);
    background: var(--titanium);
    color: black;
    /* Contrast for back */
}

/* Styling for back content */
.card-back .code-snippet {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: #fff;
    /* White text on dark grey back */
    line-height: 2;
    text-align: left;
    width: 100%;
}

.card-back {
    background: #111;
    /* Keep it dark theme */
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 30px;
}

.custom-icon-img {
    height: 60px;
    filter: grayscale(1) invert(1);
}

.arsenal-card h3 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- ARTIFACTS (Dossier) --- */
.artifacts-section {
    padding: 100px 0;
}

.dossier-container {
    max-width: 1200px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Folder look */
}

.folder-tab {
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
    padding: 15px 30px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.folder-content {
    padding: 60px;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
}

.project-info h3 {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: 20px;
}

.tags span {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 15px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    border-radius: 20px;
    margin-right: 10px;
    margin-bottom: 20px;
}

.description {
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 40px;
    max-width: 400px;
}

.project-link {
    color: var(--highlight);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.project-link:hover {
    border-color: var(--highlight);
    letter-spacing: 1px;
}

.video-placeholder {
    width: 100%;
    height: 400px;
    background: #111;
    position: relative;
    overflow: hidden;
    border: 1px solid #333;
}

.scanlines {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent 0px,
            rgba(0, 0, 0, 0.5) 1px,
            transparent 2px);
    pointer-events: none;
    opacity: 0.5;
}

/* --- LAB SECTION --- */
.lab-section {
    padding: 100px 0;
    overflow: hidden;
}

.marquee-wrapper {
    width: 100%;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #fff;
    padding: 20px 0;
    margin-bottom: 50px;
    background: white;
    color: black;
}

.marquee {
    display: flex;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
}

.marquee span {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    margin-right: 50px;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.lab-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 400px;
}

.lab-item {
    border-right: 1px solid #222;
    position: relative;
    transition: all 0.3s;
    background-size: cover;
    background-position: center;
}

/* Placeholders specifically */
/* Placeholders specifically */
.item-1 {
    background-image: url('lab_glitch.png');
}

.item-2 {
    background-image: url('lab_fluid.png');
}

.item-3 {
    background-image: url('lab_neural.png');
}

.item-4 {
    background: #0a0a0a;
    /* Keep as filler or generate audio one later */
}

/* New Image Styles */
.rock-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50% 40% 60% 30% / 40% 50% 60% 50%;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    /* Soft edge */
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.5s;
}

.video-placeholder:hover .project-img {
    opacity: 1;
}

.lab-item:hover {
    flex-grow: 2;
    /* Expansion effect */
}

.overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.lab-item:hover .overlay {
    opacity: 1;
    transform: translateY(0);
}

/* --- UPLINK (Footer) --- */
.uplink-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* background: radial-gradient(circle at center, #111 0%, #000 70%); */
    background: radial-gradient(circle at center, rgba(17, 17, 17, 0.8) 0%, rgba(0, 0, 0, 0.95) 70%);
    /* Transparency for Torch */
}

.status-monitor {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #333;
    padding: 10px 20px;
    border-radius: 30px;
    margin-bottom: 40px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #4cd964;
    /* Terminal Green */
}

.led {
    width: 8px;
    height: 8px;
    background: #4cd964;
    border-radius: 50%;
    box-shadow: 0 0 10px #4cd964;
}

.cta-title {
    font-family: var(--font-sans);
    font-size: clamp(2rem, 6vw, 6rem);
    line-height: 1;
    font-weight: 800;
    margin-bottom: 30px;
}

.outline {
    color: transparent;
    -webkit-text-stroke: 1px white;
    opacity: 0.3;
}

/* --- PREMIUM BUTTON STYLES (Glass + Torch Green) --- */
.launch-btn {
    display: inline-block;
    margin-top: 60px;
    padding: 25px 60px;
    background: rgba(10, 10, 10, 0.6);
    /* Glass */
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    letter-spacing: 0.1em;
}

/* Hover State */
.launch-btn:hover {
    border-color: #00ff88;
    /* Torch Green */
    color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
    /* Subtle tint */
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

/* Scanner Beam */
.launch-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.4), transparent);
    /* Green Beam */
    transition: 0.5s;
}

.launch-btn:hover::after {
    left: 100%;
    transition: 0.5s;
}

/* Glitch/Decode Target */
.btn-text {
    z-index: 2;
    position: relative;
}

/* Remove old glitch layers */
.btn-glitch {
    display: none;
}

/* --- RESTORED FOOTER STYLES --- */
.footer-signals {
    display: flex;
    flex-direction: row;
    /* Force side-by-side */
    gap: 60px;
    /* Wider gap */
    justify-content: center;
    align-items: center;
    margin-top: 30vh;
    /* Push to bottom of view */
    margin-bottom: 40px;
}

.signal {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: var(--font-mono);
    text-align: left;
}

.signal a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.1em;
    transition: color 0.3s;
    text-transform: uppercase;
}

.signal a:hover {
    color: var(--highlight);
    text-shadow: 0 0 10px white;
}

.copyright {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.4;
    margin-top: 20px;
    letter-spacing: 0.05em;
}