/*
 * 4What Digital - Cinematic Brutalism Design System
 * Based on inspo.html style guide
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Brand Colors */
    --brand-red: #be1e2d;
    --brand-red-light: rgba(190, 30, 45, 0.1);
    --brand-red-glow: rgba(190, 30, 45, 0.5);

    /* Background Colors */
    --dark-bg: #050505;
    --dark-bg-secondary: #0a0a0a;

    /* Glass Effect */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 15, 15, 0.7);
    --glass-bg-hover: rgba(255, 255, 255, 0.05);

    /* Grid */
    --grid-color: rgba(190, 30, 45, 0.05);

    /* Text Colors */
    --text-primary: #e5e5e5;
    --text-secondary: #b0b8c4;
    --text-muted: #8791a0;

    /* Accent Colors for Services */
    --accent-orange: #f97316;
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    --transition-slow: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.8;
    cursor: auto;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Hide default cursor only after JS has loaded (fallback if JS fails) */
body.loaded {
    cursor: none;
}

::selection {
    background: var(--brand-red);
    color: white;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.font-display {
    font-family: 'Syncopate', sans-serif;
    letter-spacing: -0.05em;
}

.font-mono {
    font-family: 'IBM Plex Mono', monospace;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Syncopate', sans-serif;
    letter-spacing: -0.05em;
    line-height: 1.1;
}

h1 { font-size: clamp(2.5rem, 8vw, 6rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h4 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    pointer-events: none;
}

.pulse-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(190, 30, 45, 0.03), transparent 60%);
    z-index: -1;
    animation: breathe 8s infinite ease-in-out;
    pointer-events: none;
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.noise-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ============================================
   CUSTOM CURSOR (Circular - from inspo.html)
   ============================================ */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--brand-red);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, border-color 0.2s, background-color 0.2s;
}

/* Hover State for Cursor */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    border-color: var(--brand-red);
    background-color: rgba(190, 30, 45, 0.1);
    mix-blend-mode: screen;
}

/* Touch / coarse-pointer devices: hide custom cursor.
   Targets all touch-primary devices regardless of viewport width
   (including tablets, foldables, touchscreen laptops in tablet mode).
   Falls back to width-based rule for browsers that don't support hover/pointer queries. */
@media (hover: none), (pointer: coarse), (max-width: 768px) {
    body { cursor: auto; }
    .cursor-dot,
    .cursor-outline { display: none; }
}

/* ============================================
   GLASS PANELS
   ============================================ */
/* ============================================
   3D SPACE SYSTEM
   The website is a 3D environment on a 2D plane.
   UI elements exist at different Z-depths.
   ============================================ */

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    transition:
        background var(--transition-medium),
        border-color var(--transition-medium),
        transform 0.4s cubic-bezier(0.19, 1, 0.22, 1),
        box-shadow 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    /* Depth: panels float above the background */
    transform: perspective(1200px) translateZ(0px);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 1px rgba(255, 255, 255, 0.05);
}

.glass-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-red);
    opacity: 0;
    transform: translateY(-100%);
    transition: all var(--transition-slow);
    box-shadow: 0 0 10px var(--brand-red);
}

.glass-panel:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.glass-panel:hover {
    background: var(--glass-bg-hover);
    border-color: var(--brand-red);
    /* Lift toward viewer on hover */
    transform: perspective(1200px) translateZ(12px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 1px rgba(190, 30, 45, 0.2),
        0 0 40px rgba(190, 30, 45, 0.04);
}

/* Depth layers — elements at different Z-positions */
.depth-1 { transform: perspective(1200px) translateZ(4px); }
.depth-2 { transform: perspective(1200px) translateZ(8px); }
.depth-3 { transform: perspective(1200px) translateZ(16px); }

.depth-1:hover { transform: perspective(1200px) translateZ(16px); }
.depth-2:hover { transform: perspective(1200px) translateZ(20px); }
.depth-3:hover { transform: perspective(1200px) translateZ(28px); }

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.nav.scrolled {
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo-dot {
    width: 0.75rem;
    height: 0.75rem;
    background: var(--brand-red);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.nav-logo-text {
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.nav-logo-text span {
    color: var(--brand-red);
}

.nav-links {
    display: none;
    gap: 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .nav-links { display: flex; }
}

.nav-link {
    position: relative;
    transition: color var(--transition-fast);
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--brand-red);
    transition: width var(--transition-medium);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    padding: 0.5rem 1.25rem;
    border: 1px solid rgba(190, 30, 45, 0.5);
    color: var(--brand-red);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: transparent;
    cursor: none;
    transition: all var(--transition-fast);
}

.nav-cta:hover {
    background: var(--brand-red);
    color: black;
    border-color: var(--brand-red);
}

/* Mobile Menu */
.nav-mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

@media (min-width: 768px) {
    .nav-mobile-toggle { display: none; }
}

@media (max-width: 767px) {
    .nav-cta { display: none; }
}

.nav-mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* Hamburger → X animation */
.nav-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.nav-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile Menu Open State */
@media (max-width: 767px) {
    .nav-mobile-toggle {
        z-index: 101;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 5, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 99;
        font-size: 0.875rem;
    }

    .nav-links.active .nav-link {
        font-size: 1rem;
        color: var(--text-secondary);
    }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: none;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
    /* Buttons are tactile — they sit forward and press down on click */
    transform: perspective(800px) translateZ(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    transform: perspective(800px) translateZ(8px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: perspective(800px) translateZ(0px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: var(--brand-red);
    color: white;
    border: none;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    transform: translateX(-100%);
    transition: transform var(--transition-medium);
    mix-blend-mode: overlay;
}

.btn-primary:hover::before {
    transform: translateX(0);
}

.btn-primary:hover {
    letter-spacing: 0.2em;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    border-color: var(--brand-red);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--brand-red);
    border: 1px solid var(--brand-red);
    padding: 0.75rem 1.5rem;
}

.btn-ghost:hover {
    background: var(--brand-red);
    color: black;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0;
}

/* ============================================
   SCENE SYSTEM (Full-viewport scroll-snap)
   ============================================ */
.scene {
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 0;
}

.scene > .container {
    position: relative;
    z-index: 10;
}

/* Vignette overlay on each scene for depth */
.scene::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(5, 5, 5, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Scenes that contain free-flowing content (not snapped) */
.scene-group {
    scroll-snap-align: start;
    position: relative;
}

.scene-group > .section {
    scroll-snap-align: none;
}

/* ============================================
   SCENE NAVIGATION — Tech Module Panel
   ============================================ */
.scene-nav {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    display: none;
}

@media (min-width: 768px) {
    .scene-nav { display: block; }
}

/* --- Panel container --- */
.scene-nav-panel {
    width: 44px;
    padding: 14px 12px;
    transition: width 0.5s cubic-bezier(0.19, 1, 0.22, 1),
                padding 0.5s cubic-bezier(0.19, 1, 0.22, 1),
                background 0.4s ease,
                box-shadow 0.5s ease,
                transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden;
    position: relative;
    background: transparent;
    border-left: 1px solid transparent;
    transform: perspective(800px) translateZ(0px);
    transform-style: preserve-3d;
}

.scene-nav:hover .scene-nav-panel {
    width: 300px;
    padding: 24px 24px 20px;
    background: rgba(5, 5, 5, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid rgba(190, 30, 45, 0.4);
    transform: perspective(800px) translateZ(20px);
    box-shadow:
        0 0 40px rgba(190, 30, 45, 0.08),
        0 0 80px rgba(190, 30, 45, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Holographic scan-line overlay */
.scene-nav-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(190, 30, 45, 0.015) 3px,
        rgba(190, 30, 45, 0.015) 4px
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
}

.scene-nav:hover .scene-nav-panel::before {
    opacity: 1;
}

/* Outer glow halo (renders behind the panel for depth) */
.scene-nav-panel::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px solid rgba(190, 30, 45, 0.0);
    transition: all 0.5s ease 0.1s;
    pointer-events: none;
    z-index: -1;
}

.scene-nav:hover .scene-nav-panel::after {
    inset: -6px;
    border-color: rgba(190, 30, 45, 0.12);
    box-shadow: 0 0 30px rgba(190, 30, 45, 0.06);
}

/* --- HUD Frame corners --- */
.scene-nav-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease 0.1s;
}

.scene-nav:hover .scene-nav-frame {
    opacity: 1;
}

.scene-nav-frame-corner {
    position: absolute;
    width: 12px;
    height: 12px;
}

.scene-nav-frame-corner::before,
.scene-nav-frame-corner::after {
    content: '';
    position: absolute;
    background: var(--brand-red);
}

/* Top-left */
.scene-nav-frame-tl { top: 0; left: 0; }
.scene-nav-frame-tl::before { top: 0; left: 0; width: 12px; height: 1px; }
.scene-nav-frame-tl::after { top: 0; left: 0; width: 1px; height: 12px; }

/* Top-right */
.scene-nav-frame-tr { top: 0; right: 0; }
.scene-nav-frame-tr::before { top: 0; right: 0; width: 12px; height: 1px; }
.scene-nav-frame-tr::after { top: 0; right: 0; width: 1px; height: 12px; }

/* Bottom-left */
.scene-nav-frame-bl { bottom: 0; left: 0; }
.scene-nav-frame-bl::before { bottom: 0; left: 0; width: 12px; height: 1px; }
.scene-nav-frame-bl::after { bottom: 0; left: 0; width: 1px; height: 12px; }

/* Bottom-right */
.scene-nav-frame-br { bottom: 0; right: 0; }
.scene-nav-frame-br::before { bottom: 0; right: 0; width: 12px; height: 1px; }
.scene-nav-frame-br::after { bottom: 0; right: 0; width: 1px; height: 12px; }

/* --- Header --- */
.scene-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(190, 30, 45, 0.15);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s ease 0.15s, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1) 0.15s;
}

.scene-nav:hover .scene-nav-header {
    opacity: 1;
    transform: translateX(0);
}

.scene-nav-header-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    color: var(--brand-red);
}

.scene-nav-header-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.scene-nav-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

/* --- Track (module list) --- */
.scene-nav-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

/* --- Individual module --- */
.scene-nav-module {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
}

.scene-nav-module:hover {
    background: rgba(190, 30, 45, 0.05);
}

/* The dot */
.scene-nav-module-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: var(--dark-bg);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.scene-nav-module.active .scene-nav-module-dot {
    border-color: var(--brand-red);
    background: var(--brand-red);
    box-shadow: 0 0 10px var(--brand-red-glow);
}

.scene-nav-module:hover .scene-nav-module-dot {
    border-color: var(--brand-red);
    transform: scale(1.3);
}

/* Connector line between dots */
.scene-nav-module-connector {
    position: absolute;
    left: 10px;
    top: 50%;
    width: 1px;
    height: calc(100% + 0px);
    background: rgba(255, 255, 255, 0.06);
    z-index: 1;
}

.scene-nav-module:last-child .scene-nav-module-connector {
    display: none;
}

.scene-nav-module.active .scene-nav-module-connector {
    background: linear-gradient(to bottom, var(--brand-red), rgba(190, 30, 45, 0.1));
}

/* Data pulse on active connector */
.scene-nav-module.active .scene-nav-module-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-red);
    box-shadow: 0 0 8px var(--brand-red-glow);
    animation: dataPulseDown 2s ease-in-out infinite;
}

@keyframes dataPulseDown {
    0% { top: 0; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Module info (collapsed → expanded) */
.scene-nav-module-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    width: 0;
    transform: translateX(8px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s cubic-bezier(0.19, 1, 0.22, 1) 0.1s, width 0.4s ease;
    overflow: hidden;
    white-space: nowrap;
}

.scene-nav:hover .scene-nav-module-info {
    opacity: 1;
    width: 220px;
    transform: translateX(0);
}

/* Stagger the module info reveals */
.scene-nav:hover .scene-nav-module:nth-child(1) .scene-nav-module-info { transition-delay: 0.08s; }
.scene-nav:hover .scene-nav-module:nth-child(2) .scene-nav-module-info { transition-delay: 0.12s; }
.scene-nav:hover .scene-nav-module:nth-child(3) .scene-nav-module-info { transition-delay: 0.16s; }
.scene-nav:hover .scene-nav-module:nth-child(4) .scene-nav-module-info { transition-delay: 0.20s; }
.scene-nav:hover .scene-nav-module:nth-child(5) .scene-nav-module-info { transition-delay: 0.24s; }
.scene-nav:hover .scene-nav-module:nth-child(6) .scene-nav-module-info { transition-delay: 0.28s; }
.scene-nav:hover .scene-nav-module:nth-child(7) .scene-nav-module-info { transition-delay: 0.32s; }

.scene-nav-module-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    color: rgba(190, 30, 45, 0.5);
    letter-spacing: 0.1em;
}

.scene-nav-module.active .scene-nav-module-id {
    color: var(--brand-red);
}

.scene-nav-module-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.scene-nav-module.active .scene-nav-module-name {
    color: var(--text-primary);
}

.scene-nav-module:hover .scene-nav-module-name {
    color: var(--text-primary);
}

.scene-nav-module-desc {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 1px;
}

.scene-nav-module.active .scene-nav-module-desc {
    opacity: 1;
    color: var(--text-secondary);
}

/* --- Secondary nav branch --- */
.scene-nav-branch {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s ease 0.35s, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1) 0.35s;
    position: relative;
}

.scene-nav:hover .scene-nav-branch {
    opacity: 1;
    transform: translateX(0);
}

/* Branch connector — visual fork from the main track */
.scene-nav-branch::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 10px;
    width: 1px;
    height: calc(100% - 12px);
    background: rgba(255, 255, 255, 0.04);
}

.scene-nav-branch-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.5625rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 8px;
    margin-left: 26px;
}

.scene-nav-branch-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 26px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    position: relative;
}

.scene-nav-branch-link:hover {
    color: var(--text-primary);
    padding-left: 30px;
}

.scene-nav-branch-icon {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.15);
    transition: color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.scene-nav-branch-link:hover .scene-nav-branch-icon {
    color: var(--brand-red);
    transform: translateX(2px);
}

/* Dashboard link gets brand accent */
.scene-nav-branch-link--accent {
    color: rgba(190, 30, 45, 0.5);
}

.scene-nav-branch-link--accent:hover {
    color: var(--brand-red);
}

.scene-nav-branch-link--accent .scene-nav-branch-icon {
    color: rgba(190, 30, 45, 0.3);
}

/* --- Footer data readout --- */
.scene-nav-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(190, 30, 45, 0.15);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s ease 0.3s, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1) 0.3s;
}

.scene-nav:hover .scene-nav-footer {
    opacity: 1;
    transform: translateX(0);
}

.scene-nav-footer-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.5625rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    opacity: 0.5;
    display: block;
    margin-bottom: 8px;
}

.scene-nav-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.scene-nav-progress-fill {
    height: 100%;
    width: var(--scene-progress, 0%);
    background: var(--brand-red);
    box-shadow: 0 0 8px var(--brand-red-glow);
    transition: width 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Scan line effect on the progress bar */
.scene-nav-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(190, 30, 45, 0.6), transparent);
    animation: scanLine 3s ease-in-out infinite;
}

@keyframes scanLine {
    0% { transform: translateX(-30px); }
    100% { transform: translateX(240px); }
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* Headers sit slightly forward — first thing you read */
    transform: perspective(1200px) translateZ(6px);
}

.section-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--brand-red);
    margin-bottom: 1rem;
    /* Tags feel like HUD labels floating close to camera */
    text-shadow: 0 0 12px rgba(190, 30, 45, 0.3);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    padding-top: 6rem;
    position: relative;
    overflow: hidden;
}

/* --- 3D Logo Canvas (full viewport, scene-driven) --- */
#hero-3d-canvas {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    opacity: 0.6;
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform, opacity;
    pointer-events: none;
}

@media (max-width: 768px) {
    #hero-3d-canvas {
        opacity: 0.3;
    }
}

/* --- Animated Background Glow --- */
.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.03) 40%, transparent 70%);
    animation: glowPulse 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

.hero .container {
    position: relative;
    z-index: 10;
}

/* --- Hero Animations --- */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.hero-animate {
    opacity: 0;
    animation: heroFadeIn 0.7s ease-out forwards;
}

.hero-animate:nth-child(1) { animation-delay: 0s; }
.hero-animate:nth-child(2) { animation-delay: 0.2s; }
.hero-animate:nth-child(3) { animation-delay: 0.5s; }
.hero-animate:nth-child(4) { animation-delay: 0.8s; }
.hero-animate:nth-child(5) { animation-delay: 1.1s; }

/* --- Status Indicator --- */
.hero-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.hero-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
}

.hero-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--brand-red);
}

/* --- Title --- */
.hero-title {
    text-transform: uppercase;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    max-width: 60rem;
    text-wrap: balance;
    font-size: clamp(1.5rem, 3.2vw, 2.3rem);
}

.hero-title-accent {
    color: var(--brand-red);
}

.hero-title-gradient {
    background: linear-gradient(to right, white, #9ca3af, #4b5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Typewriter Line --- */
.hero-typewriter-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 2.75rem;
    max-width: 50rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1rem, 2.4vw, 1.45rem);
    min-height: 2.5em;
}

.hero-prompt {
    color: var(--brand-red);
    font-weight: 500;
    flex-shrink: 0;
}

.typewriter .txt {
    color: var(--text-primary);
}

.hero-cursor {
    color: var(--brand-red);
    font-weight: 300;
    animation: blink 1s step-end infinite;
}

/* --- Description --- */
.hero-description {
    max-width: 40rem;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-muted);
}

/* --- CTAs --- */
.hero-cta {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Mobile Hero --- */
@media (max-width: 768px) {
    .hero-glow {
        width: 500px;
        height: 500px;
    }

    .hero-typewriter-line {
        font-size: 0.95rem;
    }

    .hero-description br {
        display: none;
    }
}

/* ============================================
   SERVICE CARDS
   ============================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    padding: 2rem;
    transition: all var(--transition-slow);
    transform: perspective(1200px) translateZ(4px);
}

.service-card:hover {
    background: var(--glass-bg-hover);
    transform: perspective(1200px) translateZ(24px);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.5),
        0 0 2px rgba(190, 30, 45, 0.2);
}

.service-card-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.service-card-tag.orange { color: var(--accent-orange); }
.service-card-tag.red { color: var(--brand-red); }
.service-card-tag.green { color: var(--accent-green); }

.service-card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: color var(--transition-fast);
}

.service-card:hover .service-card-title.orange { color: var(--accent-orange); }
.service-card:hover .service-card-title.red { color: var(--brand-red); }
.service-card:hover .service-card-title.green { color: var(--accent-green); }

.service-card-description {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.service-card-divider {
    height: 1px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: background var(--transition-fast);
}

.service-card:hover .service-card-divider.orange { background: rgba(249, 115, 22, 0.5); }
.service-card:hover .service-card-divider.red { background: rgba(190, 30, 45, 0.5); }
.service-card:hover .service-card-divider.green { background: rgba(34, 197, 94, 0.5); }

.service-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.service-card-link:hover {
    color: var(--brand-red);
}

.service-card-link svg {
    width: 1rem;
    height: 1rem;
    transition: transform var(--transition-fast);
}

.service-card-link:hover svg {
    transform: translateX(4px);
}

/* ============================================
   PHILOSOPHY / PROBLEM SECTION
   ============================================ */
.philosophy {
    position: relative;
}

.philosophy-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .philosophy-content {
        grid-template-columns: 1fr 1fr;
    }
}

.philosophy-highlight {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-red);
    margin: 2rem 0;
}

/* ============================================
   PIPELINE VISUALIZATION
   ============================================ */
.pipeline-viz {
    padding: 2.5rem;
}

.pipeline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.pipeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.5s ease;
}

.pipeline-node.active {
    opacity: 1;
    transform: translateY(0);
}

.pipeline-node-icon {
    width: 56px;
    height: 56px;
    border: 1px solid rgba(190, 30, 45, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    transition: border-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}

.pipeline-node.active .pipeline-node-icon {
    border-color: var(--brand-red);
    color: var(--brand-red);
    box-shadow: 0 0 24px rgba(190, 30, 45, 0.3), inset 0 0 12px rgba(190, 30, 45, 0.1);
}

.pipeline-node-label {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    transition: color 0.5s ease;
}

.pipeline-node.active .pipeline-node-label {
    color: var(--text-primary);
}

.pipeline-node-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 220px;
    transition: color 0.5s ease;
}

.pipeline-node.active .pipeline-node-detail {
    color: var(--text-secondary);
}

/* Connector line + pulse */
.pipeline-connector {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pipeline-connector.active {
    opacity: 1;
}

.pipeline-line {
    width: 1px;
    height: 100%;
    background: rgba(190, 30, 45, 0.2);
}

.pipeline-connector.active .pipeline-line {
    background: linear-gradient(to bottom, var(--brand-red), rgba(190, 30, 45, 0.2));
}

.pipeline-pulse {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-red);
    box-shadow: 0 0 12px var(--brand-red-glow);
    opacity: 0;
}

.pipeline-connector.active .pipeline-pulse {
    animation: pipelinePulseVertical 1.5s ease-in-out infinite;
}

@keyframes pipelinePulseVertical {
    0% { top: 0; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: calc(100% - 8px); opacity: 0; }
}

/* Result block */
.pipeline-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(190, 30, 45, 0.08);
    border-left: 3px solid var(--brand-red);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pipeline-result.active {
    opacity: 1;
    transform: translateY(0);
}

.pipeline-result-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--brand-red);
    margin-bottom: 0.5rem;
}

.pipeline-result-value {
    font-family: 'Syncopate', sans-serif;
    font-size: 2rem;
    font-weight: 700;
}

/* Desktop: horizontal pipeline */
@media (min-width: 768px) {
    .pipeline {
        flex-direction: row;
        align-items: flex-start;
    }

    .pipeline-node {
        flex: 1;
    }

    .pipeline-connector {
        width: 60px;
        height: auto;
        min-height: 56px;
        align-self: flex-start;
        margin-top: 14px;
        flex-shrink: 0;
    }

    .pipeline-line {
        width: 100%;
        height: 1px;
    }

    .pipeline-connector.active .pipeline-line {
        background: linear-gradient(to right, var(--brand-red), rgba(190, 30, 45, 0.2));
    }

    .pipeline-connector.active .pipeline-pulse {
        animation: pipelinePulseHorizontal 1.5s ease-in-out infinite;
    }

    @keyframes pipelinePulseHorizontal {
        0% { left: 0; opacity: 0; }
        20% { opacity: 1; }
        80% { opacity: 1; }
        100% { left: calc(100% - 8px); opacity: 0; }
    }
}

/* ============================================
   STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    padding: 1.5rem;
}

.stat-value {
    font-family: 'Syncopate', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brand-red);
}

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* ============================================
   AGENCY VS. SYSTEM COMPARISON
   ============================================ */
.comparison-grid {
    max-width: 800px;
    margin: 2rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comparison-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.comparison-col-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

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

.comparison-col-label--green {
    color: var(--accent-green);
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    transition: border-color var(--transition-medium),
                transform 0.3s cubic-bezier(0.19, 1, 0.22, 1),
                box-shadow 0.3s ease;
    transform: perspective(1200px) translateZ(0px);
}

.comparison-row:hover {
    transform: perspective(1200px) translateZ(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.comparison-row:hover {
    border-color: rgba(34, 197, 94, 0.15);
}

.comparison-cell {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.comparison-cell--old {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.1);
}

.comparison-cell--new {
    color: var(--text-primary);
    position: relative;
    padding-left: 1rem;
}

.comparison-cell--new::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 2px;
    background: var(--accent-green);
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

@media (max-width: 640px) {
    .comparison-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .comparison-header {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .comparison-cell--new {
        padding-left: 0.75rem;
    }
}

/* ============================================
   ACTIVITY FEED (ALWAYS ON)
   ============================================ */
.activity-feed {
    max-width: 700px;
    margin: 2rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.activity-feed::before {
    content: '';
    position: absolute;
    left: 3.5rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        rgba(34, 197, 94, 0.3),
        rgba(34, 197, 94, 0.05)
    );
}

.activity-item {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    padding: 0.75rem 1rem;
    transition: border-color var(--transition-medium);
}

.activity-item:hover {
    border-color: rgba(34, 197, 94, 0.15);
}

.activity-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-green);
    flex-shrink: 0;
    min-width: 2.5rem;
}

.activity-desc {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 640px) {
    .activity-feed::before {
        display: none;
    }

    .activity-item {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
    position: relative;
    padding: 6rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(190, 30, 45, 0.3);
    border-bottom: 1px solid rgba(190, 30, 45, 0.3);
    overflow: hidden;
    justify-content: center;
    flex-direction: column;
}

/* CTA content needs to sit above the 3D logo */
.cta-section > * {
    position: relative;
    z-index: 10;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--brand-red);
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.cta-section:hover::before {
    opacity: 0.05;
}

.cta-tag {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--brand-red);
    border: 1px solid var(--brand-red);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
}

.cta-title {
    font-size: clamp(1.6rem, 3.4vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    max-width: 36rem;
    margin: 0 auto 1.5rem;
    text-wrap: balance;
}

.cta-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    border-bottom: 1px solid transparent;
    padding-bottom: 0.25rem;
    transition: all var(--transition-fast);
}

.cta-link:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* ============================================
   LOGO GRID
   ============================================ */
.logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 2rem 0;
    opacity: 1;
}

.logo-grid img {
    height: 2rem;
    width: auto;
    filter: grayscale(100%) brightness(200%);
    transition: all var(--transition-fast);
}

.logo-grid img:hover {
    filter: grayscale(0%) brightness(100%);
    opacity: 1;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 0;
    scroll-snap-align: end;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    color: var(--text-muted);
}

.footer-tag {
    opacity: 0.5;
}

/* ============================================
   METHODOLOGY SECTION
   ============================================ */
.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.methodology-item {
    padding: 2rem;
}

.methodology-number {
    font-family: 'Syncopate', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--brand-red);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.methodology-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.methodology-description {
    font-size: 0.875rem;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--brand-red);
    background: rgba(190, 30, 45, 0.05);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-glow {
    text-shadow: 0 0 20px var(--brand-red-glow);
}

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

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.hidden { display: none; }

@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:flex { display: flex; }
    .md\:grid { display: grid; }
}

/* ============================================
   BENTO GRID SYSTEM
   (extracted from index.html inline styles)
   ============================================ */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(150px, auto);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .bento-grid { grid-template-columns: 1fr; }
}

.bento-item { position: relative; overflow: hidden; }
.bento-span-2 { grid-column: span 2; }
.bento-span-3 { grid-column: span 3; }
.bento-row-2 { grid-row: span 2; }

@media (max-width: 640px) {
    .bento-span-2, .bento-span-3 { grid-column: span 1; }
    .bento-row-2 { grid-row: span 1; }
}

/* Image Reveal Card */
.img-reveal-card { position: relative; overflow: hidden; }

.img-reveal-card img {
    width: 100%; height: 100%; object-fit: cover;
    filter: grayscale(50%);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    transform: scale(1);
}

.img-reveal-card:hover img { filter: grayscale(0%); transform: scale(1.1); }

.img-reveal-card::after {
    content: ''; position: absolute; inset: 0;
    background: var(--brand-red);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0.2;
}

.img-reveal-card:hover::after { transform: translateY(0); }

.img-reveal-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    z-index: 10;
}

/* Stat Block */
.stat-block { display: flex; flex-direction: column; justify-content: center; padding: 2rem; }

.stat-block-value {
    font-family: 'Syncopate', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700;
    background: linear-gradient(to bottom, white, #4b5563);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; line-height: 1;
}

.stat-block-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.5rem;
}

/* Action Block */
.action-block {
    display: flex; align-items: center; justify-content: space-between;
    padding: 2rem; background: var(--brand-red); color: white;
    transition: background 0.3s;
}

.action-block:hover { background: #a11a26; }
.action-block h4 { font-family: 'Syncopate', sans-serif; font-size: 1.5rem; }
.action-block p { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; opacity: 0.8; margin-top: 0.25rem; }
.action-block svg { width: 2rem; height: 2rem; transform: rotate(-45deg); transition: transform 0.3s; }
.action-block:hover svg { transform: rotate(0deg); }

/* Featured Tag */
.featured-tag {
    position: absolute; top: 1rem; right: 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem; color: var(--brand-red);
    border: 1px solid var(--brand-red);
    padding: 0.25rem 0.75rem; border-radius: 9999px; z-index: 20;
}

/* Status Indicator */
.status-indicator {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem; color: var(--text-muted);
}

.status-dot {
    width: 0.5rem; height: 0.5rem; border-radius: 50%;
    background: #22c55e; animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* Icon Button */
.icon-btn {
    width: 3rem; height: 3rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}

.icon-btn:hover { background: var(--brand-red); }

/* Tags */
.tag-list { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tag {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem; color: var(--text-muted);
}

/* Hover Gradient */
.hover-gradient::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(190, 30, 45, 0.1), transparent);
    opacity: 0; transition: opacity 0.5s;
}

.hover-gradient:hover::before { opacity: 1; }

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   PROBLEM SECTION
   ============================================ */
.problem-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.problem-card {
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    /* Staggered Z-depth — cards feel like floating layers */
    transform: perspective(1200px) translateZ(0px);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1),
                box-shadow 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.problem-card:nth-child(1) { transform: perspective(1200px) translateZ(2px); }
.problem-card:nth-child(2) { transform: perspective(1200px) translateZ(6px); }
.problem-card:nth-child(3) { transform: perspective(1200px) translateZ(4px); }
.problem-card:nth-child(4) { transform: perspective(1200px) translateZ(8px); }

.problem-card:hover {
    transform: perspective(1200px) translateZ(20px) !important;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.5),
        0 0 1px rgba(190, 30, 45, 0.3);
}

.problem-card-icon {
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(190, 30, 45, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-red);
    margin-bottom: 1rem;
}

.problem-card h4 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.problem-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 1024px) {
    .problem-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .problem-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SOLUTION SECTION
   ============================================ */
.solution-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.solution-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.solution-modules {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.solution-module {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

.solution-module .module-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* ============================================
   SOCIAL PROOF METRIC
   ============================================ */
.logo-grid .client-metric {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--brand-red);
    margin-top: 0.25rem;
}

/* ============================================
   ACCESSIBILITY: REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .hero-animate { animation: none; opacity: 1; }
    .animate-on-scroll { opacity: 1; transform: none; }
    .pipeline-node { opacity: 1; transform: none; }
    .pipeline-connector { opacity: 1; }
    .pipeline-result { opacity: 1; transform: none; }
}

/* ============================================
   MOBILE RESPONSIVE FIXES
   ============================================ */
@media (max-width: 640px) {
    /* Hero — tighter on small screens */
    .hero-title {
        font-size: clamp(1.4rem, 4.5vw, 2rem);
        line-height: 1.0;
    }

    .hero-typewriter-line {
        font-size: clamp(0.9rem, 2.5vw, 1.2rem);
        min-height: 2em;
    }

    .hero-description {
        font-size: 0.875rem;
    }

    .hero { padding: 6rem 0 3rem; }

    /* Service cards — smaller min-width so they stack cleanly */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .service-card-title {
        font-size: 1.2rem;
    }

    .service-card-description {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    /* Sections — reduce vertical padding */
    .section {
        padding: 3rem 0;
    }

    /* Scene sections — don't force full viewport on mobile */
    .scene {
        min-height: auto;
        padding: 4rem 0;
    }

    /* Container padding */
    .container {
        padding: 0 1rem;
    }

    /* Section headers */
    .section-header h2 {
        font-size: clamp(1.1rem, 4vw, 1.5rem);
    }
}
