/* =============================================================
   HOMEPAGE STYLES — bartzcon.com
   ============================================================= */

/* === CSS Variables === */
:root {
    --bg: #0A0A0C;
    --surface: #111114;
    --surface-hover: #18181C;
    --border: #1E1E24;
    --text-primary: #E8E8ED;
    --text-secondary: #D0D0D8;
    --accent: #4AEDC4;
    --accent-dim: rgba(74, 237, 196, 0.08);
    --accent-glow: rgba(74, 237, 196, 0.15);
    --serif: 'DM Serif Display', Georgia, serif;
    --sans: 'DM Sans', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

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

/* === Base === */
html {
    scroll-behavior: smooth;
    background: var(--bg);
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* === Three.js Background === */
#three-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#three-bg canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw;
    max-height: 100vh;
}

/* Film grain overlay for premium texture */
#three-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    opacity: 0.12;
    pointer-events: none;
    z-index: 1;
}

/* === NAV === */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 24px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
    border-bottom: 1px solid transparent;
}

nav.scrolled {
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-logo {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-logo span { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--accent);
    letter-spacing: 1.5px;
}

.nav-links a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* === HERO === */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 48px 96px;
    position: relative;
    z-index: 1;
}

/* Dark vignette so text reads clearly over the 3D background */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 70% 60% at 50% 50%,
        rgba(10, 10, 12, 0.75) 0%,
        rgba(10, 10, 12, 0.3) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: -1;
}

.hero-headline {
    font-family: var(--serif);
    font-size: clamp(36px, 5.5vw, 72px);
    font-weight: 400;
    line-height: 1.1;
    max-width: 800px;
    color: var(--text-primary);
    text-shadow: 0 2px 20px rgba(10, 10, 12, 0.8);
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.3s;
}

.hero-headline em {
    font-style: normal;
    color: var(--accent);
    text-shadow: 0 0 30px rgba(74, 237, 196, 0.3);
}

.hero-sub {
    margin-top: 28px;
    font-size: 18px;
    font-weight: 300;
    color: var(--text-primary);
    text-shadow: 0 1px 12px rgba(10, 10, 12, 0.9);
    max-width: 560px;
    line-height: 1.7;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 36px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.9s;
}

.hero-tag {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent);
    padding: 6px 16px;
    border: 1px solid rgba(74, 237, 196, 0.2);
    border-radius: 20px;
    background: rgba(10, 10, 12, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.scroll-indicator {
    position: absolute;
    bottom: 32px;
    right: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 1.2s;
}

.scroll-indicator span {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-primary);
    writing-mode: vertical-rl;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* === CONTENT WRAPPER === */
.content-layer {
    position: relative;
    z-index: 1;
    background: rgba(10, 10, 12, 0.88);
    overflow-x: hidden;
}

.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 48px;
}

/* =============================================================
   JOURNEY LINE — Vertical scroll progress with pulsing nodes
   ============================================================= */
/* =============================================================
   JOURNEY LINE — 3D orb nodes with smooth animations
   ============================================================= */
.journey-line {
    position: fixed;
    left: 32px;
    top: 0;
    bottom: 0;
    width: 48px;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.journey-line.active {
    opacity: 1;
}

/* Faint vertical track */
.journey-track {
    position: absolute;
    left: 50%;
    top: 80px;
    bottom: 80px;
    width: 1px;
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(-50%);
}

/* Filled progress — soft gradient line */
.journey-progress {
    position: absolute;
    left: 50%;
    top: 80px;
    width: 1px;
    height: 0;
    background: linear-gradient(to bottom, rgba(74, 237, 196, 0.4), rgba(74, 237, 196, 0.15));
    transform: translateX(-50%);
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Travelling dot — small, smooth */
.journey-dot {
    position: absolute;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(74, 237, 196, 0.5);
    transition: top 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    top: 80px;
}

/* Section nodes — pulsing orbs that mirror the mesh aesthetic */
.journey-node {
    position: absolute;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);

    /* Dormant — faint wireframe-like outline */
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

/* Reached — orb comes alive, pulses like the mesh */
.journey-node.reached {
    width: 12px;
    height: 12px;
    border-color: rgba(74, 237, 196, 0.5);
    background:
        radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.25), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(74, 237, 196, 0.5), rgba(74, 237, 196, 0.1));
    box-shadow:
        0 0 6px rgba(74, 237, 196, 0.4),
        0 0 16px rgba(74, 237, 196, 0.15),
        inset 0 -1px 3px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    animation: orbBreathe 3s ease-in-out infinite;
}

/* Organic breathing pulse — smooth scale + glow shift like the mesh surface */
@keyframes orbBreathe {
    0%   {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 6px rgba(74, 237, 196, 0.4),
            0 0 16px rgba(74, 237, 196, 0.15),
            inset 0 -1px 3px rgba(0, 0, 0, 0.3),
            inset 0 1px 2px rgba(255, 255, 255, 0.1);
    }
    50%  {
        transform: translate(-50%, -50%) scale(1.25);
        box-shadow:
            0 0 10px rgba(74, 237, 196, 0.5),
            0 0 24px rgba(74, 237, 196, 0.2),
            inset 0 -1px 3px rgba(0, 0, 0, 0.3),
            inset 0 1px 2px rgba(255, 255, 255, 0.15);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 6px rgba(74, 237, 196, 0.4),
            0 0 16px rgba(74, 237, 196, 0.15),
            inset 0 -1px 3px rgba(0, 0, 0, 0.3),
            inset 0 1px 2px rgba(255, 255, 255, 0.1);
    }
}

/* Soft ambient glow halo behind reached orbs */
.journey-node.reached::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 237, 196, 0.08), transparent 70%);
    transform: translate(-50%, -50%);
    animation: haloBreath 3s ease-in-out infinite;
    animation-delay: 1.5s;
}

@keyframes haloBreath {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 0.7; transform: translate(-50%, -50%) scale(1.3); }
}

/* Node label */
.journey-node-label {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

.journey-node.reached .journey-node-label {
    color: rgba(74, 237, 196, 0.6);
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* === SECTION === */
.section {
    padding: 120px 0;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(32px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-label::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--accent);
}

.section h2 {
    font-family: var(--serif);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.section p {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.85;
    margin-bottom: 20px;
    font-weight: 300;
}

.section p:last-child { margin-bottom: 0; }

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

/* === ABOUT === */
.about-layout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.about-layout h2 {
    text-align: left;
}

.about-text {
    max-width: 720px;
    text-align: justify;
}

.about-pullquote {
    font-family: var(--serif);
    font-size: 24px;
    color: var(--accent);
    line-height: 1.4;
    margin: 36px 0;
    padding-left: 24px;
    border-left: 2px solid var(--accent);
    font-weight: 400;
}

/* =============================================================
   DATA FLOW VISUALIZATION — animated pipeline
   ============================================================= */
.data-flow {
    margin-top: 56px;
    padding: 16px 0;
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: flex-start;
    gap: 0;
    position: relative;
}

/* --- Stages --- */
.flow-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: relative;
}

.flow-stage.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Icons (each stage unique) --- */
.flow-icon {
    width: 72px;
    height: 72px;
    position: relative;
    margin-bottom: 16px;
}

/* Stage 1: Scattered dots — chaos, no structure */
.flow-icon-scatter {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
}

.flow-icon-scatter span {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.6s ease;
}

/* Scatter animation — brighter grey dots, strong contrast */
.flow-stage.visible .flow-icon-scatter span:nth-child(1) { transform: translate(-3px, 4px); background: rgba(255, 255, 255, 0.40); }
.flow-stage.visible .flow-icon-scatter span:nth-child(2) { transform: translate(5px, -2px); background: rgba(255, 255, 255, 0.22); }
.flow-stage.visible .flow-icon-scatter span:nth-child(3) { transform: translate(-1px, 6px); background: rgba(255, 255, 255, 0.48); }
.flow-stage.visible .flow-icon-scatter span:nth-child(4) { transform: translate(4px, 3px); background: rgba(255, 255, 255, 0.18); }
.flow-stage.visible .flow-icon-scatter span:nth-child(5) { transform: translate(-6px, -1px); background: rgba(255, 255, 255, 0.30); }
.flow-stage.visible .flow-icon-scatter span:nth-child(6) { transform: translate(2px, -5px); background: rgba(255, 255, 255, 0.42); }
.flow-stage.visible .flow-icon-scatter span:nth-child(7) { transform: translate(3px, -3px); background: rgba(255, 255, 255, 0.25); }
.flow-stage.visible .flow-icon-scatter span:nth-child(8) { transform: translate(-4px, 2px); background: rgba(255, 255, 255, 0.35); }
.flow-stage.visible .flow-icon-scatter span:nth-child(9) { transform: translate(1px, 5px); background: rgba(255, 255, 255, 0.20); }

.flow-icon-scatter span { animation: scatterFloat 3s ease-in-out infinite alternate; }
.flow-icon-scatter span:nth-child(2) { animation-delay: -0.5s; }
.flow-icon-scatter span:nth-child(3) { animation-delay: -1s; }
.flow-icon-scatter span:nth-child(4) { animation-delay: -1.5s; }
.flow-icon-scatter span:nth-child(5) { animation-delay: -2s; }
.flow-icon-scatter span:nth-child(6) { animation-delay: -0.3s; }
.flow-icon-scatter span:nth-child(7) { animation-delay: -0.8s; }
.flow-icon-scatter span:nth-child(8) { animation-delay: -1.2s; }
.flow-icon-scatter span:nth-child(9) { animation-delay: -1.8s; }

@keyframes scatterFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(var(--dx, 3px), var(--dy, -3px)); }
}

.flow-icon-scatter span:nth-child(1) { --dx: -3px; --dy: 4px; }
.flow-icon-scatter span:nth-child(2) { --dx: 5px; --dy: -2px; }
.flow-icon-scatter span:nth-child(3) { --dx: -1px; --dy: 6px; }
.flow-icon-scatter span:nth-child(4) { --dx: 4px; --dy: 3px; }
.flow-icon-scatter span:nth-child(5) { --dx: -6px; --dy: -1px; }
.flow-icon-scatter span:nth-child(6) { --dx: 2px; --dy: -5px; }
.flow-icon-scatter span:nth-child(7) { --dx: 3px; --dy: -3px; }
.flow-icon-scatter span:nth-child(8) { --dx: -4px; --dy: 2px; }
.flow-icon-scatter span:nth-child(9) { --dx: 1px; --dy: 5px; }

/* Stage 2: Aligned grid — order from chaos */
.flow-icon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
}

.flow-icon-grid span {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    background: rgba(100, 160, 240, 0.08);
    border: 1px solid rgba(100, 160, 240, 0.12);
    transition: all 0.4s ease;
    transform: scale(0);
}

.flow-stage.visible .flow-icon-grid span {
    transform: scale(1);
    background: rgba(100, 160, 240, 0.25);
    border-color: rgba(100, 160, 240, 0.40);
}

.flow-stage.visible .flow-icon-grid span:nth-child(1) { transition-delay: 0ms; }
.flow-stage.visible .flow-icon-grid span:nth-child(2) { transition-delay: 50ms; }
.flow-stage.visible .flow-icon-grid span:nth-child(3) { transition-delay: 100ms; }
.flow-stage.visible .flow-icon-grid span:nth-child(4) { transition-delay: 150ms; }
.flow-stage.visible .flow-icon-grid span:nth-child(5) { transition-delay: 200ms; background: rgba(100, 160, 240, 0.45); border-color: rgba(100, 160, 240, 0.60); }
.flow-stage.visible .flow-icon-grid span:nth-child(6) { transition-delay: 250ms; }
.flow-stage.visible .flow-icon-grid span:nth-child(7) { transition-delay: 300ms; }
.flow-stage.visible .flow-icon-grid span:nth-child(8) { transition-delay: 350ms; }
.flow-stage.visible .flow-icon-grid span:nth-child(9) { transition-delay: 400ms; }

/* Stage 3: Magnifying lens — finding patterns */
.flow-icon-lens {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lens-ring {
    width: 60%;
    height: 60%;
    border: 2px solid rgba(240, 180, 60, 0.15);
    border-radius: 50%;
    position: absolute;
    top: 8%;
    left: 14%;
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.flow-stage.visible .lens-ring {
    border-color: rgba(240, 180, 60, 0.7);
    box-shadow: 0 0 20px rgba(240, 180, 60, 0.2), inset 0 0 16px rgba(240, 180, 60, 0.08);
}

.lens-handle {
    width: 2px;
    height: 25%;
    background: rgba(240, 180, 60, 0.25);
    position: absolute;
    bottom: 6%;
    right: 20%;
    transform: rotate(-45deg);
    transform-origin: top center;
    transition: background 0.6s ease;
}

.flow-stage.visible .lens-handle {
    background: rgba(240, 180, 60, 0.6);
}

.lens-flare {
    width: 12%;
    height: 12%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 180, 60, 0.5), transparent);
    position: absolute;
    top: 20%;
    left: 26%;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.flow-stage.visible .lens-flare {
    opacity: 1;
    animation: lensShimmer 2.5s ease-in-out infinite;
}

@keyframes lensShimmer {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.4); }
}

/* Stage 4: Target — precision, decision */
.flow-icon-target {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Ensure pulse rings don't affect layout */
.target-pulse,
.target-ring,
.target-center {
    pointer-events: none;
}

/* Fix alignment: center all target elements via transform */
.target-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(74, 237, 196, 0.15);
    transition: all 0.6s ease;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.target-ring-outer { width: 88%; height: 88%; }
.target-ring-mid { width: 60%; height: 60%; }
.target-ring-inner { width: 33%; height: 33%; }

.flow-stage.visible .target-ring-outer { border-color: rgba(74, 237, 196, 0.45); }
.flow-stage.visible .target-ring-mid { border-color: rgba(74, 237, 196, 0.6); }
.flow-stage.visible .target-ring-inner { border-color: rgba(74, 237, 196, 0.8); }

.target-center {
    width: 11%;
    height: 11%;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    box-shadow: 0 0 16px rgba(74, 237, 196, 0.8);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.flow-stage.visible .target-center {
    transform: translate(-50%, -50%) scale(1);
}

.target-pulse {
    width: 88%;
    height: 88%;
    border-radius: 50%;
    border: 1px solid var(--accent);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.flow-stage.visible .target-pulse {
    animation: targetPulse 3s ease-out infinite;
}

.flow-stage.visible .target-pulse-2 {
    animation: targetPulse 3s ease-out infinite 1.5s;
}

@keyframes targetPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.35; }
    100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

/* --- Connectors between stages --- */
.flow-connector {
    width: 48px;
    height: 2px;
    position: relative;
    flex-shrink: 0;
    overflow: visible;
    margin-top: 36px; /* vertically center with 72px icons */
    align-self: flex-start;
}

.flow-connector-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.flow-connector.visible .flow-connector-line {
    transform: scaleX(1);
}

/* Connector line color progression: grey → blue → amber → teal */
.flow-connector[data-conn="0"] .flow-connector-line { background: rgba(255, 255, 255, 0.12); }
.flow-connector[data-conn="1"] .flow-connector-line { background: rgba(100, 160, 240, 0.25); }
.flow-connector[data-conn="2"] .flow-connector-line { background: rgba(240, 180, 60, 0.25); }

/* --- Stage text --- */
.flow-stage-text {
    max-width: 140px;
}

.flow-stage-title {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    transition: color 0.6s ease;
}

/* Title color progression: grey → blue → amber → teal */
.flow-stage[data-stage="0"] .flow-stage-title { color: rgba(255, 255, 255, 0.55); }
.flow-stage[data-stage="1"] .flow-stage-title { color: rgb(100, 160, 240); }
.flow-stage[data-stage="2"] .flow-stage-title { color: rgb(240, 180, 60); }
.flow-stage[data-stage="3"] .flow-stage-title { color: var(--accent); text-shadow: 0 0 16px rgba(74, 237, 196, 0.4); }

.flow-stage-desc {
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 300;
}
/* === SERVICES CARDS === */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.service-card {
    position: relative;
    padding: 36px 28px 28px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 4px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(24px);
    overflow: hidden;
    box-shadow:
        0 12px 40px rgba(0, 240, 255, 0.05),
        inset 0 0 20px rgba(0, 240, 255, 0.02);
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: scaleX(1);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0, 240, 255, 0.08),
        inset 0 0 24px rgba(0, 240, 255, 0.03);
}

.service-number {
    position: absolute;
    top: 16px;
    right: 20px;
    font-family: var(--serif);
    font-size: 48px;
    line-height: 1;
    color: rgba(74, 237, 196, 0.20);
    pointer-events: none;
    transition: color 0.4s ease;
}

.service-card h3 {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 12px;
    position: relative;
}

.service-card p {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 400;
    margin-bottom: 16px;
    position: relative;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
}

.service-tag {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-primary);
    padding: 4px 12px;
    border: 1px solid rgba(74, 237, 196, 0.12);
    border-radius: 2px;
    background: rgba(74, 237, 196, 0.06);
}

/* =============================================================
   CASE STUDY CARDS — Modern with preview
   ============================================================= */
.case-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 48px;
}

.case-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 4px;
    text-decoration: none;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 12px 40px rgba(0, 240, 255, 0.05),
        inset 0 0 20px rgba(0, 240, 255, 0.02);
}

.case-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: scaleX(1);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

.case-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0, 240, 255, 0.08),
        inset 0 0 24px rgba(0, 240, 255, 0.03);
}

/* Image thumbnail preview area */
.case-preview {
    position: relative;
    padding: 16px;
    overflow: hidden;
    width: 35%;
    min-height: 160px;
    max-height: 280px;
    flex-shrink: 0;
}

.case-preview-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: #030303;
    border-radius: 6px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.5s ease;
}

.case-card:hover .case-preview-inner {
    border-color: rgba(0, 240, 255, 0.2);
}

.case-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.1);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-card:hover .case-thumb-img {
    transform: scale(1.05);
}

/* Subtle cyan glow overlay on hover */
.case-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.05), transparent 70%);
    opacity: 1;
    pointer-events: none;
    z-index: 20;
}

/* Card text content */
.case-card-body {
    padding: 20px 24px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.case-card-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.case-card h3 {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 10px;
}

.case-card p {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 16px;
    flex: 1;
}

.case-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.case-meta-tag {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-primary);
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.02);
}

.case-card-arrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent);
    opacity: 1;
    transition: transform 0.3s ease;
}

.case-card:hover .case-card-arrow {
    transform: translateX(4px);
}

/* Ghost / Next case study card */
.case-card-ghost {
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 100px;
    background: rgba(255, 255, 255, 0.01);
}

.ghost-text {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.ghost-dots {
    display: flex;
    gap: 6px;
}

.ghost-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    animation: ghostPulse 1.5s ease-in-out infinite;
}

.ghost-dot:nth-child(2) { animation-delay: 0.3s; }
.ghost-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes ghostPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.6; }
}

/* === CONTACT === */
.contact-section {
    text-align: center;
    padding: 120px 0;
    background: linear-gradient(to bottom, transparent, rgba(74, 237, 196, 0.03) 40%, rgba(74, 237, 196, 0.05) 100%);
}

.contact-headline {
    font-family: var(--serif);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.contact-cta {
    display: inline-block;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
    padding: 16px 40px;
    border: 1px solid var(--accent);
    border-radius: 2px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.contact-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

.contact-cta:hover {
    color: var(--bg);
}

.contact-cta:hover::before {
    transform: scaleX(1);
}

.contact-links {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.contact-links a {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.contact-links a:hover {
    color: var(--accent);
}

/* === FOOTER === */
footer {
    padding: 64px 48px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-text {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
    .journey-line { display: none; }
}

@media (max-width: 768px) {
    nav { padding: 16px 24px; }
    .nav-logo { font-size: 11px; letter-spacing: 2px; flex-shrink: 0; }
    .nav-links { gap: 14px; }
    .nav-links a { font-size: 11px; white-space: nowrap; }
    .hero { padding: 100px 24px 64px; }
    .hero-sub { font-size: 16px; }
    .content { padding: 0 24px; }
    .section { padding: 80px 0; }
    .services-grid { grid-template-columns: 1fr; }
    .case-grid { grid-template-columns: 1fr; }
    .case-card { flex-direction: column; }
    .case-preview { width: 100%; min-height: 0; max-height: 220px; }
    .case-thumb-img { object-fit: cover; object-position: center center; }
    .scroll-indicator { display: none; }
    .about-pullquote { font-size: 20px; }
    .data-flow { flex-direction: column; gap: 0; max-width: 100%; margin-left: auto; margin-right: auto; align-items: stretch; }
    .flow-connector { width: 2px; height: 20px; margin-top: 0; margin-left: 28px; align-self: flex-start; }
    .flow-connector-line { transform: scaleY(0); transform-origin: top; }
    .flow-connector.visible .flow-connector-line { transform: scaleY(1); }
    .flow-stage { flex-direction: row; text-align: left; gap: 12px; }
    .flow-stage-text { max-width: none; }
    .flow-icon { flex-shrink: 0; width: 48px; height: 48px; margin-bottom: 0; }
    footer { padding: 48px 24px; }
}

@media (max-width: 480px) {
    nav { padding: 12px 16px; }
    .nav-links { gap: 10px; }
    .nav-links a { font-size: 10px; white-space: nowrap; }
    .nav-logo { font-size: 10px; letter-spacing: 1.5px; }
    .hero { padding: 80px 16px 48px; }
    .hero-headline { font-size: clamp(28px, 8vw, 48px); }
    .hero-sub { font-size: 15px; }
    .content { padding: 0 16px; }
    .section { padding: 64px 0; }
    .hero-tags { gap: 8px; }
    .hero-tag { font-size: 10px; padding: 5px 12px; }
    footer { padding: 36px 16px; }
    .case-preview { min-height: 0; max-height: 180px; }
    .flow-icon { width: 40px; height: 40px; }
    .flow-stage-desc { font-size: 12px; }
    .flow-connector { margin-left: 20px; height: 16px; }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .section, .service-card,
    .hero-headline, .hero-sub, .hero-tags, .scroll-indicator {
        opacity: 1;
        transform: none;
    }
    .flow-stage { opacity: 1; transform: none; }
    .flow-connector-line { transform: scaleX(1); }
    .flow-icon-grid span { transform: scale(1); }
    .target-center { transform: translate(-50%, -50%) scale(1); }
    .journey-node.reached {
        animation: none;
    }
    .journey-node.reached::after {
        animation: none;
    }
}
