:root {
    --black: #08080a;
    /* Deeper midnight charcoal */
    --grey-dark: #121215;
    --grey-mid: #1c1c22;
    --grey-line: #212126;
    --grey-text: #8b8b94;
    --grey-light: #f5f5f7;
    --white: #ffffff;

    /* Cyber Coral Accent - Vibrant & Modern */
    --accent: #FF5C5C;
    --accent-dim: rgba(255, 92, 92, 0.1);

    --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', monospace;

    --grid-gap: 20px;
    --section-padding: clamp(80px, 12vw, 160px);
    --content-padding: clamp(32px, 8vw, 80px);
    --section-gap: clamp(60px, 10vw, 120px);
    --border-width: 1px;
    --border-radius: 0px;
}

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

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

html {
    font-size: 16px;
    /* Base size increase */
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    overscroll-behavior: none;
}

body {
    font-family: var(--font-sans);
    background: var(--black);
    color: var(--white);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* GRID BACKGROUND */
.grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
    background-image:
        linear-gradient(var(--grey-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grey-line) 1px, transparent 1px);
    background-size: 80px 80px;
}

.grid-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--accent-dim) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

/* CONTENT WRAPPER */
.content {
    position: relative;
    z-index: 1;
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 28px var(--content-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(8, 8, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-logo svg {
    width: 44px;
    height: 44px;
    fill: var(--accent);
}

.nav-logo svg path {
    fill: var(--white);
    stroke: none;
}

.nav-wordmark {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--white);
}

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

.nav-cta {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--grey-line);
    color: var(--white);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

/* HERO */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--content-padding);
    padding-top: 100px;
    padding-bottom: 40px;
    position: relative;
    overflow: hidden;
}

/* Hero image placeholder - replace src with your chosen image */
.hero-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
    background: linear-gradient(135deg, transparent 0%, var(--black) 100%);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: lighten;
}

/* Logo watermark in hero */
.hero-logo-watermark {
    position: absolute;
    top: 55%;
    right: -10%;
    transform: translateY(-50%);
    width: 70vw;
    height: auto;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.hero-logo-watermark path {
    fill: none;
    stroke: var(--white);
    stroke-width: 0.4px;
}

.hero-glow {
    display: none;
}

/* PARTICLE CANVAS */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Enable pointer events only in hero area for mouse tracking */
.hero {
    position: relative;
}

.hero #particle-canvas {
    pointer-events: auto;
}

/* Reduce particles on mobile for performance */
@media (max-width: 768px) {
    #particle-canvas {
        opacity: 0.5;
    }
}

.hero-meta-top {
    position: relative;
    margin-bottom: auto;
    display: flex;
    gap: 40px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--grey-text);
    z-index: 1;
}

.hero-label {
    position: relative;
    z-index: 1;
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-light);
    margin-top: 60px;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards 0.2s;
}

.hero h1 {
    position: relative;
    z-index: 1;
    font-family: var(--font-sans);
    font-size: clamp(56px, 14vw, 150px);
    font-weight: 700;
    line-height: 0.82;
    letter-spacing: -0.06em;
    text-transform: uppercase;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.4s;
}

.hero h1 span {
    display: block;
}

.hero h1 .neon {
    color: var(--accent);
}

.hero h1 .outline {
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.9);
}

.hero-sub {
    position: relative;
    z-index: 1;
    font-size: clamp(16px, 2vw, 20px);
    color: var(--grey-light);
    max-width: 480px;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards 0.6s;
}

.hero-scroll {
    position: absolute;
    z-index: 1;
    bottom: 40px;
    right: var(--content-padding);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-text);
    opacity: 0;
    animation: fadeIn 0.6s ease forwards 1s;
}

.hero-scroll::after {
    content: '↓';
    font-size: 16px;
    animation: bounce 2s ease infinite;
}

/* MARQUEE */
.marquee-container {
    border-top: 1px solid var(--grey-line);
    border-bottom: 1px solid var(--grey-line);
    padding: 32px 0;
    overflow: hidden;
    background: var(--black);
    display: flex;
}

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

.marquee-item {
    font-family: var(--font-sans);
    font-size: clamp(24px, 10vw, 80px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    padding: 0 80px;
    color: var(--white);
}

.marquee-item.dim {
    color: var(--accent);
    opacity: 1;
}

/* SECTIONS */
section {
    padding: var(--section-padding) var(--content-padding);
    border-bottom: 1px solid var(--grey-line);
}

.section-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 60px;
}

.section-num {
    font-family: var(--font-mono);
    font-size: clamp(48px, 10vw, 96px);
    font-weight: 700;
    line-height: 1;
    color: var(--grey-line);
    -webkit-text-stroke: 1px var(--grey-text);
    -webkit-text-fill-color: transparent;
}

.section-meta {
    padding-top: 8px;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--font-sans);
    font-size: clamp(28px, 6vw, 48px);
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--white);
    max-width: 800px;
    position: relative;
}

/* TECHNICAL MARKERS */
.section-header {
    position: relative;
}

.section-header::before,
.section-header::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px solid var(--grey-line);
    pointer-events: none;
}

.section-header::before {
    top: -10px;
    left: -10px;
    border-right: none;
    border-bottom: none;
}

.section-header::after {
    bottom: -10px;
    right: -10px;
    border-left: none;
    border-top: none;
}

/* GAP SECTION */
/* Capability list - simple two-column layout */
.capability-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 64px;
}

.capability-list li {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--grey-light);
    padding-left: 20px;
    position: relative;
    text-wrap: pretty;
}

.capability-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.capability-list strong {
    color: var(--white);
    font-weight: 600;
}

@media (max-width: 640px) {
    .capability-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* SERVICES */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1px;
    background: var(--grey-line);
}

.service-card {
    background: var(--black);
    padding: 48px;
    border: 1px solid var(--white);
    transition: all 0.2s ease;
    position: relative;
}

.service-card:hover {
    background: var(--grey-dark);
    border-color: var(--accent);
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.service-card:hover .service-num {
    color: var(--white);
}

.service-num {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 24px;
}

.service-title {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.service-desc {
    font-size: 18px;
    color: var(--grey-light);
    line-height: 1.6;
    margin-bottom: 24px;
}

.service-tags {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--grey-text);
    letter-spacing: 0.05em;
}

.service-link {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.service-link:hover {
    opacity: 0.7;
}

.services-bridge {
    font-family: var(--font-sans);
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: 500;
    color: var(--grey-light);
    text-align: left;
    margin-bottom: 40px;
    max-width: 600px;
}

/* WORK */
.work-stat {
    display: flex;
    align-items: baseline;
    gap: 24px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.stat-num {
    font-family: var(--font-mono);
    font-size: clamp(64px, 15vw, 120px);
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
}

.stat-text {
    font-size: 18px;
    color: var(--grey-light);
    max-width: 400px;
    line-height: 1.6;
}

.work-list {
    border-top: 1px solid var(--grey-line);
}

.work-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 32px;
    align-items: center;
    padding: 32px 0;
    border-bottom: 1px solid var(--grey-line);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.work-item:hover {
    padding-left: 24px;
    border-color: var(--accent);
}

.work-item:hover .work-title {
    color: var(--white);
    transform: translateX(8px);
}

.work-sector {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-text);
}

.work-title {
    font-size: 20px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.work-outcome {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent);
    text-align: right;
    white-space: nowrap;
}

.work-quote {
    font-family: var(--font-sans);
    font-size: 14px;
    font-style: italic;
    color: var(--grey-text);
    text-align: right;
    white-space: normal;
    max-width: 320px;
    line-height: 1.4;
}

.work-quote .quote-author {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: var(--accent);
    margin-top: 4px;
}

@media (max-width: 640px) {
    .work-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .work-outcome {
        text-align: left;
    }

    .work-quote {
        text-align: left;
        max-width: none;
    }
}

/* TESTIMONIALS */
.testimonials-carousel {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.testimonial-track {
    position: relative;
    min-height: 280px;
}

.testimonial-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    padding: 0 20px;
}

.testimonial-card.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.testimonial-quote {
    font-family: var(--font-sans);
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.7;
    color: var(--grey-light);
    margin: 0 0 40px 0;
    position: relative;
}

.testimonial-quote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-sans);
    font-size: 80px;
    font-style: normal;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.testimonial-name {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
}

.testimonial-role {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.testimonial-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.testimonial-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--grey-text);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.testimonial-dot:hover {
    border-color: var(--accent);
}

.testimonial-dot.active {
    background: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .testimonial-track {
        min-height: 400px;
    }

    .testimonial-quote::before {
        font-size: 60px;
        top: -15px;
    }
}

/* APPROACH */
.approach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1px;
    background: var(--grey-line);
}

.approach-card {
    background: var(--black);
    padding: 32px;
}

.approach-num {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 16px;
}

.approach-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.approach-desc {
    font-size: 18px;
    color: var(--grey-light);
    line-height: 1.6;
}

/* ABOUT */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 60px;
}

.about-name {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 28px;
    letter-spacing: -0.02em;
}

.about-text p {
    font-size: 18px;
    color: var(--grey-light);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 65ch;
}

.about-text strong {
    color: var(--white);
}

.about-portrait {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.about-portrait img {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid var(--white);
    filter: grayscale(100%);
    transition: filter 0.4s ease, border-color 0.3s ease;
}

.about-portrait img:hover {
    filter: grayscale(0%);
    border-color: var(--accent);
}

/* CTA SECTION */
.cta-section {
    padding: var(--section-padding) var(--content-padding);
    text-align: center;
    position: relative;
}

.cta-glow {
    display: none;
}

.cta-title {
    font-family: var(--font-mono);
    font-size: clamp(24px, 6vw, 56px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    position: relative;
}

.cta-sub {
    font-size: 20px;
    color: var(--grey-light);
    margin-bottom: 48px;
}

.cta-btn {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    padding: 24px 60px;
    background: var(--white);
    color: var(--black);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 4px solid var(--white);
}

.cta-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    transform: none;
    box-shadow: none;
}

/* FOOTER */
footer {
    padding: 60px var(--content-padding) 40px;
    border-top: 1px solid var(--grey-line);
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-logo-large {
    width: 100%;
    max-width: 240px;
    height: auto;
    opacity: 1;
}

.footer-logo-large path {
    fill: var(--white);
    stroke: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 40px;
}

.footer-col-title {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-text);
    margin-bottom: 16px;
}

.footer-col a,
.footer-col p {
    display: block;
    font-size: 16px;
    color: var(--grey-light);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--grey-line);
    flex-wrap: wrap;
    gap: 16px;
}

.footer-wordmark {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

.footer-wordmark span {
    color: var(--accent);
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--grey-text);
}

@media (max-width: 640px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-logo-large {
        max-width: 120px;
    }
}

/* ANIMATIONS */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes bounce {

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

    50% {
        transform: translateY(6px);
    }
}

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

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

/* SCROLL REVEAL */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* MOBILE TWEAKS */
@media (max-width: 768px) {
    .section-header {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-num {
        font-size: 48px;
    }

    .hero-scroll {
        display: none;
        /* Hide on mobile to prevent any text overlap */
    }

    .hero {
        padding-bottom: 80px;
        /* More breathing room at the bottom */
    }
}

@media (max-width: 480px) {
    .about-portrait {
        order: -1;
        margin-bottom: 40px;
    }

    .about-portrait img {
        max-width: 280px;
    }

    .marquee-item {
        padding: 0 16px;
    }

    .hero-logo-watermark {
        width: 140vw;
        right: -30%;
        top: 50%;
        opacity: 0.08;
    }

    .nav-wordmark {
        display: none;
    }

    .testimonial-track {
        min-height: 450px;
    }
}

/* ===========================================
   DATA FLOW ANIMATION
   Three-zone diagram: Sources → Structure → Outputs
   =========================================== */

.data-flow-section {
    padding: 40px var(--content-padding) 60px;
    border-bottom: 1px solid var(--grey-line);
    overflow: hidden;
    background: linear-gradient(180deg, var(--black) 0%, rgba(255, 92, 92, 0.02) 50%, var(--black) 100%);
}

.data-flow-label {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-align: center;
    margin: 0 0 16px;
}

.data-flow-intro {
    font-family: var(--font-sans);
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 500;
    line-height: 1.4;
    color: var(--white);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px;
    letter-spacing: -0.02em;
}

.data-flow-caption {
    font-family: var(--font-sans);
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 400;
    line-height: 1.6;
    color: var(--grey-light);
    text-align: center;
    max-width: 720px;
    margin: 0 auto 40px;
}

.data-flow-diagram {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 450px;
    background: var(--black);
}

/* Flow zone base styles */
.flow-zone {
    position: relative;
    padding: 24px 24px 32px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Zone header with label and explainer */
.zone-header {
    position: relative;
    text-align: center;
    z-index: 20;
    width: 100%;
    max-width: 240px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.zone-label {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 6px;
}

.zone-explainer {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--grey-light);
    opacity: 0.85;
}

/* ---- ZONE 1: SOURCES (Chaos) ---- */
.zone-sources {
    border-right: 1px solid var(--grey-line);
}

.source-icon {
    position: absolute;
    z-index: 10;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.8;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    will-change: transform;
}

.source-icon svg {
    width: 100%;
    height: 100%;
}

/* Individual icon positioning and drift animations */
/* Icons are positioned below the ~70px header area */
.icon-pdf {
    width: 44px;
    height: 44px;
    top: 28%;
    left: 8%;
    animation: drift1 8s infinite;
}

.icon-email {
    width: 44px;
    height: 44px;
    top: 58%;
    left: 58%;
    animation: drift2 9s infinite;
}

.icon-receipt {
    width: 40px;
    height: 40px;
    top: 72%;
    left: 12%;
    animation: drift3 7s infinite;
}

.icon-voice {
    width: 40px;
    height: 40px;
    top: 35%;
    left: 65%;
    animation: drift4 10s infinite;
}

.icon-transcript {
    width: 42px;
    height: 42px;
    top: 50%;
    left: 25%;
    animation: drift5 8.5s infinite;
}

.icon-calendar {
    width: 42px;
    height: 42px;
    top: 26%;
    left: 38%;
    animation: drift6 11s infinite;
}

.icon-review {
    width: 46px;
    height: 46px;
    top: 80%;
    left: 42%;
    animation: drift7 9.5s infinite;
}

/* Brownian motion drift keyframes */
@keyframes drift1 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(8px, -6px) rotate(2deg);
    }

    50% {
        transform: translate(-4px, 10px) rotate(-1deg);
    }

    75% {
        transform: translate(6px, 4px) rotate(1deg);
    }
}

@keyframes drift2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(-10px, 5px) rotate(-2deg);
    }

    50% {
        transform: translate(6px, -8px) rotate(1deg);
    }

    75% {
        transform: translate(-3px, 3px) rotate(-1deg);
    }
}

@keyframes drift3 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(5px, 8px) rotate(1deg);
    }

    50% {
        transform: translate(-7px, -4px) rotate(-2deg);
    }

    75% {
        transform: translate(3px, -6px) rotate(0deg);
    }
}

@keyframes drift4 {

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

    25% {
        transform: translate(-6px, -8px);
    }

    50% {
        transform: translate(4px, 6px);
    }

    75% {
        transform: translate(-8px, 2px);
    }
}

@keyframes drift5 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(7px, 5px) rotate(1deg);
    }

    50% {
        transform: translate(-5px, -7px) rotate(-1deg);
    }

    75% {
        transform: translate(-2px, 8px) rotate(0deg);
    }
}

@keyframes drift6 {

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

    25% {
        transform: translate(-4px, 3px);
    }

    50% {
        transform: translate(6px, -5px);
    }

    75% {
        transform: translate(2px, 7px);
    }
}

@keyframes drift7 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(9px, -4px) rotate(2deg);
    }

    50% {
        transform: translate(-6px, 8px) rotate(-1deg);
    }

    75% {
        transform: translate(4px, -2px) rotate(1deg);
    }
}


/* ---- ZONE 2: STRUCTURE (Order) ---- */
.zone-structure {
    border-right: 1px solid var(--grey-line);
    background: linear-gradient(180deg, transparent 0%, rgba(255, 92, 92, 0.02) 50%, transparent 100%);
    overflow: visible;
    position: relative;
}

/* Position zone-header absolutely in structure zone */
.zone-structure .zone-header {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
}

/* Mini Lattices - floating fragments being connected */
.mini-lattice {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    width: 42px;
    height: 42px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    z-index: 5;
    opacity: 0.75;
}

.mini-cell {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-cell.filled {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.mini-cell.filled.accent {
    background: rgba(255, 92, 92, 0.4);
    border-color: rgba(255, 92, 92, 0.55);
}

/* Position each mini lattice - coordinates match connect-lines SVG */
.mini-1 {
    top: 12%;
    left: 8%;
    animation: miniFloat1 6s ease-in-out infinite;
}

.mini-2 {
    top: 6%;
    right: 10%;
    animation: miniFloat2 7s ease-in-out infinite;
}

.mini-3 {
    top: 50%;
    left: 2%;
    transform: translateY(-50%);
    animation: miniFloat3 5.5s ease-in-out infinite;
}

.mini-4 {
    top: 50%;
    right: 2%;
    transform: translateY(-50%);
    animation: miniFloat4 6.5s ease-in-out infinite;
}

.mini-5 {
    bottom: 10%;
    left: 10%;
    animation: miniFloat5 7.5s ease-in-out infinite;
}

.mini-6 {
    bottom: 6%;
    right: 10%;
    animation: miniFloat6 5s ease-in-out infinite;
}

/* Floating animations - subtle drift toward center */
@keyframes miniFloat1 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.7;
    }

    50% {
        transform: translate(8px, 6px) rotate(2deg);
        opacity: 0.9;
    }
}

@keyframes miniFloat2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.6;
    }

    50% {
        transform: translate(-6px, 8px) rotate(-2deg);
        opacity: 0.85;
    }
}

@keyframes miniFloat3 {

    0%,
    100% {
        transform: translateY(-50%) translate(0, 0);
        opacity: 0.65;
    }

    50% {
        transform: translateY(-50%) translate(10px, 4px);
        opacity: 0.9;
    }
}

@keyframes miniFloat4 {

    0%,
    100% {
        transform: translateY(-50%) translate(0, 0);
        opacity: 0.7;
    }

    50% {
        transform: translateY(-50%) translate(-10px, -4px);
        opacity: 0.85;
    }
}

@keyframes miniFloat5 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.6;
    }

    50% {
        transform: translate(6px, -8px) rotate(1deg);
        opacity: 0.9;
    }
}

@keyframes miniFloat6 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.7;
    }

    50% {
        transform: translate(-8px, -6px) rotate(-1deg);
        opacity: 0.85;
    }
}

/* Connection lines from mini lattices to main */
.connect-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.connect-line {
    stroke: rgba(255, 92, 92, 0.15);
    stroke-width: 0.15;
    stroke-dasharray: 1 2;
    animation: connectPulse 3s ease-in-out infinite;
}

.line-1 {
    animation-delay: 0s;
}

.line-2 {
    animation-delay: 0.5s;
}

.line-3 {
    animation-delay: 1s;
}

.line-4 {
    animation-delay: 1.5s;
}

.line-5 {
    animation-delay: 2s;
}

.line-6 {
    animation-delay: 2.5s;
}

@keyframes connectPulse {

    0%,
    100% {
        stroke: rgba(255, 92, 92, 0.08);
        stroke-width: 0.15;
    }

    50% {
        stroke: rgba(255, 92, 92, 0.35);
        stroke-width: 0.25;
    }
}

/* Database Lattice Grid */
.lattice-grid {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 4px;
    width: 160px;
    height: 160px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

.lattice-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lattice-cell.filled {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
    animation: cellSnap 4s ease-in-out infinite;
}

.lattice-cell.filled.accent {
    background: rgba(255, 92, 92, 0.3);
    border-color: rgba(255, 92, 92, 0.5);
    animation: cellSnapAccent 4s ease-in-out infinite;
}

/* Staggered snap animation delays */
.lattice-cell[data-delay="0"] {
    animation-delay: 0s;
}

.lattice-cell[data-delay="1"] {
    animation-delay: 0.15s;
}

.lattice-cell[data-delay="2"] {
    animation-delay: 0.3s;
}

.lattice-cell[data-delay="3"] {
    animation-delay: 0.45s;
}

.lattice-cell[data-delay="4"] {
    animation-delay: 0.6s;
}

.lattice-cell[data-delay="5"] {
    animation-delay: 0.75s;
}

.lattice-cell[data-delay="6"] {
    animation-delay: 0.9s;
}

.lattice-cell[data-delay="7"] {
    animation-delay: 1.05s;
}

.lattice-cell[data-delay="8"] {
    animation-delay: 1.2s;
}

.lattice-cell[data-delay="9"] {
    animation-delay: 1.35s;
}

.lattice-cell[data-delay="10"] {
    animation-delay: 1.5s;
}

.lattice-cell[data-delay="11"] {
    animation-delay: 1.65s;
}

.lattice-cell[data-delay="12"] {
    animation-delay: 1.8s;
}

.lattice-cell[data-delay="13"] {
    animation-delay: 1.95s;
}

.lattice-cell[data-delay="14"] {
    animation-delay: 2.1s;
}

.lattice-cell[data-delay="15"] {
    animation-delay: 2.25s;
}

.lattice-cell[data-delay="16"] {
    animation-delay: 2.4s;
}

.lattice-cell[data-delay="17"] {
    animation-delay: 2.55s;
}

.lattice-cell[data-delay="18"] {
    animation-delay: 2.7s;
}

.lattice-cell[data-delay="19"] {
    animation-delay: 2.85s;
}

.lattice-cell[data-delay="20"] {
    animation-delay: 3s;
}

.lattice-cell[data-delay="21"] {
    animation-delay: 3.15s;
}

.lattice-cell[data-delay="22"] {
    animation-delay: 3.3s;
}

.lattice-cell[data-delay="23"] {
    animation-delay: 3.45s;
}

.lattice-cell[data-delay="24"] {
    animation-delay: 3.6s;
}

@keyframes cellSnap {

    0%,
    100% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.05);
    }

    5% {
        transform: scale(0.8);
        background: rgba(255, 255, 255, 0.02);
    }

    10% {
        transform: scale(1.1);
        background: rgba(255, 255, 255, 0.2);
    }

    15%,
    90% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.12);
    }
}

@keyframes cellSnapAccent {

    0%,
    100% {
        transform: scale(1);
        background: rgba(255, 92, 92, 0.15);
        box-shadow: none;
    }

    5% {
        transform: scale(0.8);
        background: rgba(255, 92, 92, 0.05);
    }

    10% {
        transform: scale(1.1);
        background: rgba(255, 92, 92, 0.5);
        box-shadow: 0 0 12px rgba(255, 92, 92, 0.4);
    }

    15%,
    90% {
        transform: scale(1);
        background: rgba(255, 92, 92, 0.3);
        box-shadow: 0 0 4px rgba(255, 92, 92, 0.2);
    }
}

/* ---- SPLINE CONNECTIONS ---- */
.flow-splines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.spline {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0.4;
}

.spline-in {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-dasharray: 4 6;
    animation: splineDash 20s linear infinite;
}

.spline-out {
    stroke: var(--accent);
    stroke-dasharray: 4 6;
    animation: splineDash 20s linear infinite reverse;
}

@keyframes splineDash {
    to {
        stroke-dashoffset: -100;
    }
}

/* Animated dots traveling along splines */
.spline-dot {
    fill: rgba(255, 255, 255, 0.8);
}

.spline-dot.dot-in {
    fill: rgba(255, 255, 255, 0.7);
}

.spline-dot.dot-out {
    fill: var(--accent);
    filter: drop-shadow(0 0 4px rgba(255, 92, 92, 0.6));
}

/* ---- ZONE 3: OUTPUTS (Value) ---- */
.zone-outputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 20px 20px;
    align-items: center;
    justify-content: flex-start;
}

.zone-outputs .zone-header {
    margin-bottom: 16px;
}

.output-card {
    position: relative;
    z-index: 10;
    background: var(--grey-dark);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 8px 12px;
    width: 100%;
    max-width: 200px;
    opacity: 0;
    transform: translateX(-20px);
    animation: outputAppear 4s ease-in-out infinite;
}

.output-card:nth-child(2) {
    animation-delay: 0s;
}

.output-card:nth-child(3) {
    animation-delay: 1s;
}

.output-card:nth-child(4) {
    animation-delay: 2s;
}

.output-card:nth-child(5) {
    animation-delay: 3s;
}

.output-card:nth-child(6) {
    animation-delay: 4s;
}

@keyframes outputAppear {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    15%,
    85% {
        opacity: 1;
        transform: translateX(0);
    }

    100% {
        opacity: 0;
        transform: translateX(20px);
    }
}

.output-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.output-header span {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.output-icon {
    width: 12px;
    height: 12px;
    fill: var(--accent);
}

.output-content {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--white);
    line-height: 1.3;
}

.output-score {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.output-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    color: var(--grey-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 1px;
}

.output-status {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--white);
}

/* Analytics output with charts */
.output-charts {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.mini-bar-chart,
.mini-line-chart {
    width: 50px;
    height: 24px;
}

.mini-bar-chart .bar {
    fill: var(--accent);
    opacity: 0.6;
    animation: barGrow 2s ease-out infinite;
}

.bar-1 {
    animation-delay: 0s;
}

.bar-2 {
    animation-delay: 0.1s;
}

.bar-3 {
    animation-delay: 0.2s;
}

.bar-4 {
    animation-delay: 0.3s;
}

.bar-5 {
    animation-delay: 0.4s;
}

@keyframes barGrow {
    0% {
        opacity: 0.3;
        transform: scaleY(0.5);
        transform-origin: bottom;
    }

    20% {
        opacity: 0.8;
        transform: scaleY(1);
    }

    80% {
        opacity: 0.8;
        transform: scaleY(1);
    }

    100% {
        opacity: 0.3;
        transform: scaleY(0.5);
    }
}

.mini-line-chart .chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: lineReveal 2.5s ease-out infinite;
}

@keyframes lineReveal {
    0% {
        stroke-dashoffset: 100;
        opacity: 0.3;
    }

    30% {
        stroke-dashoffset: 0;
        opacity: 0.8;
    }

    70% {
        stroke-dashoffset: 0;
        opacity: 0.8;
    }

    100% {
        stroke-dashoffset: -100;
        opacity: 0.3;
    }
}

.mini-line-chart .chart-dot {
    fill: var(--accent);
    opacity: 0;
    animation: dotAppear 2.5s ease-out infinite;
}

.chart-dot:nth-child(2) {
    animation-delay: 0.1s;
}

.chart-dot:nth-child(3) {
    animation-delay: 0.2s;
}

.chart-dot:nth-child(4) {
    animation-delay: 0.3s;
}

.chart-dot:nth-child(5) {
    animation-delay: 0.4s;
}

.chart-dot:nth-child(6) {
    animation-delay: 0.5s;
}

@keyframes dotAppear {

    0%,
    20% {
        opacity: 0;
        transform: scale(0);
    }

    30%,
    70% {
        opacity: 1;
        transform: scale(1);
    }

    80%,
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* ---- FLOW ARROWS (Mobile only) ---- */
.flow-arrow {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px 0;
    color: var(--accent);
}

.flow-arrow svg {
    width: 32px;
    height: 32px;
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {

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

    50% {
        opacity: 1;
        transform: translateY(4px);
    }
}

/* ---- STATIC FALLBACK (for reduced motion) ---- */
.flow-static-fallback {
    display: none;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    justify-content: space-around;
    pointer-events: none;
}

.static-arrow {
    font-size: 32px;
    color: var(--accent);
    opacity: 0.5;
}

/* ---- RESPONSIVE: TABLET ---- */
@media (max-width: 900px) {
    .data-flow-diagram {
        min-height: 280px;
    }

    .flow-zone {
        padding: 30px 16px;
        min-height: 260px;
    }

    .output-card {
        max-width: 160px;
        padding: 10px 12px;
    }

    .output-header span {
        font-size: 10px;
    }

    .output-content {
        font-size: 12px;
    }

    .output-score {
        font-size: 24px;
    }

    .lattice-grid {
        width: 140px;
        height: 140px;
    }

    .flow-splines {
        opacity: 0.6;
    }
}

/* ---- RESPONSIVE: MOBILE (Vertical layout) ---- */
@media (max-width: 640px) {
    .data-flow-section {
        padding: 32px var(--content-padding) 48px;
    }

    .data-flow-label {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .data-flow-intro {
        font-size: 20px;
        margin-bottom: 32px;
        text-align: center;
    }

    .data-flow-caption {
        font-size: 16px;
        margin-bottom: 32px;
        text-align: center;
    }

    .data-flow-diagram {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        min-height: auto;
    }

    .flow-zone {
        min-height: 220px;
        padding: 24px 20px;
        border-right: none;
        justify-content: flex-start;
        padding-top: 24px;
    }

    .zone-sources {
        border-right: none;
        border-bottom: 1px solid var(--grey-line);
        min-height: 280px;
    }

    .zone-structure {
        border-right: none;
        border-bottom: 1px solid var(--grey-line);
    }

    .zone-outputs {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        align-items: center;
    }

    .output-card {
        max-width: 150px;
        padding: 10px 12px;
    }

    .output-header span {
        font-size: 9px;
    }

    .output-content {
        font-size: 11px;
    }

    .output-score {
        font-size: 22px;
    }

    .output-label {
        font-size: 9px;
    }

    .zone-header {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin-bottom: 20px;
        max-width: none;
        width: 100%;
    }

    .zone-label {
        font-size: 14px;
    }

    .zone-explainer {
        font-size: 12px;
    }

    /* Show flow arrows on mobile */
    .flow-arrow {
        display: flex;
    }

    /* Add more space between header and icons in sources zone */
    .zone-sources .zone-header {
        margin-bottom: 24px;
    }

    /* Reposition source icons for vertical layout - constrained between header and border */
    .icon-pdf {
        top: 38%;
        left: 5%;
    }

    .icon-email {
        top: 52%;
        left: 68%;
    }

    .icon-receipt {
        top: 68%;
        left: 8%;
    }

    .icon-voice {
        top: 42%;
        left: 55%;
    }

    .icon-transcript {
        top: 56%;
        left: 25%;
    }

    .icon-calendar {
        top: 40%;
        left: 35%;
    }

    .icon-review {
        top: 70%;
        left: 45%;
    }

    /* Hide horizontal splines on mobile - they don't work with vertical layout */
    .flow-splines {
        display: none;
    }

    .lattice-grid {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
        width: 180px;
        height: 180px;
    }

    .zone-structure .zone-header {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin-bottom: 20px;
    }

    /* Hide mini lattices on mobile - too cluttered */
    .mini-lattice,
    .connect-lines {
        display: none;
    }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
    .source-icon {
        animation: none;
    }

    .lattice-cell,
    .lattice-cell.filled,
    .lattice-cell.filled.accent {
        animation: none;
    }

    .lattice-cell.filled {
        background: rgba(255, 255, 255, 0.12);
    }

    .lattice-cell.filled.accent {
        background: rgba(255, 92, 92, 0.3);
    }

    .output-card {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .spline,
    .spline-in,
    .spline-out {
        animation: none;
        stroke-dasharray: none;
    }

    .spline-dot {
        display: none;
    }

    .mini-lattice {
        animation: none;
        opacity: 0.6;
    }

    .connect-line {
        animation: none;
        stroke: rgba(255, 92, 92, 0.2);
        stroke-width: 0.2;
    }

    .mini-bar-chart .bar {
        animation: none;
        opacity: 0.6;
    }

    .mini-line-chart .chart-line {
        animation: none;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
        opacity: 0.7;
    }

    .mini-line-chart .chart-dot {
        animation: none;
        opacity: 0.8;
    }

    .flow-arrow svg {
        animation: none;
        opacity: 0.7;
    }

    .flow-static-fallback {
        display: flex;
    }
}