/* ============================================================
   DRISHTI LABS — style.css (V2)
   ============================================================
   Steel blue + charcoal cinematic aesthetic.
   All animations re-triggerable on viewport re-entry.

   TABLE OF CONTENTS
   -----------------
   1.  CSS Custom Properties
   2.  Reset & Base
   3.  Typography
   4.  Loading Screen
   5.  Navigation Bar
   6.  Hero Section
   7.  Problem Section
   8.  Sensor Node Section
   9.  Product Section
   10. Projects — Anchor
   11. Projects — Vyuh (Swarm)
   12. About Section
   13. Contact Section
   14. Scroll Reveal (re-triggerable)
   15. Utility Classes
   16. Responsive / Mobile
   ============================================================ */


/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
    /* --- Charcoal backgrounds --- */
    --color-bg: #0b0d11;
    --color-bg-surface: #14171e;
    --color-bg-elevated: #1a1e28;

    /* --- Text --- */
    --color-text-primary: #dce1e8;
    --color-text-secondary: #8a919e;
    --color-text-tertiary: #4e5564;

    /* --- Steel blue accent --- */
    --color-accent: #6b8cae;
    --color-accent-dim: #4a6a8a;
    --color-accent-glow: rgba(107, 140, 174, 0.15);

    /* --- Sensor colors --- */
    --color-rgb: #9c28a9;
    --color-thermal: #c4866e;
    --color-gpr: #3d784b;

    /* --- Grid --- */
    --color-grid: rgba(107, 140, 174, 0.05);

    /* --- Typography --- */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --fs-hero: clamp(2.4rem, 5vw, 4rem);
    --fs-heading: clamp(1.5rem, 3vw, 2.4rem);
    --fs-subhead: clamp(1.05rem, 2vw, 1.4rem);
    --fs-body: clamp(0.9rem, 1.2vw, 1.05rem);
    --fs-small: clamp(0.72rem, 0.9vw, 0.82rem);

    /* --- Spacing --- */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* --- Layout --- */
    --nav-height: 76px;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}


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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    font-size: var(--fs-body);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--fs-hero);
}

h2 {
    font-size: var(--fs-heading);
}

h3 {
    font-size: var(--fs-subhead);
}

p {
    color: var(--color-text-secondary);
    max-width: 620px;
}

.label-mono {
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
}

.accent-line {
    width: 50px;
    height: 2px;
    background: var(--color-accent-dim);
    margin: var(--space-sm) auto var(--space-md);
}


/* ============================================================
   4. LOADING SCREEN
   ============================================================ */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.loader--hidden {
    opacity: 0;
    pointer-events: none;
}

.loader__animation {
    position: relative;
    width: 180px;
    height: 180px;
}

/* Sweep bars */
.scan-bar {
    position: absolute;
    left: 10%;
    width: 80%;
    height: 2px;
    background: var(--color-accent);
    opacity: 0;
    animation: scanSweep 2.8s ease-in-out infinite;
}

.scan-bar:nth-child(1) {
    top: 15%;
    animation-delay: 0s;
}

.scan-bar:nth-child(2) {
    top: 35%;
    animation-delay: 0.4s;
}

.scan-bar:nth-child(3) {
    top: 55%;
    animation-delay: 0.8s;
}

.scan-bar:nth-child(4) {
    top: 75%;
    animation-delay: 1.2s;
}

@keyframes scanSweep {
    0% {
        opacity: 0;
        transform: translateY(-10px) scaleX(0.3);
    }

    15% {
        opacity: 0.7;
        transform: translateY(0) scaleX(1);
    }

    50% {
        opacity: 0.2;
        transform: translateY(15px) scaleX(0.7);
    }

    85% {
        opacity: 0.7;
        transform: translateY(30px) scaleX(1);
    }

    100% {
        opacity: 0;
        transform: translateY(40px) scaleX(0.3);
    }
}

/* Corner brackets */
.scan-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: var(--color-accent-dim);
    border-style: solid;
    border-width: 0;
    opacity: 0;
    animation: cornerPulse 2.8s ease-in-out infinite;
}

.scan-corner--tl {
    top: 0;
    left: 0;
    border-top-width: 2px;
    border-left-width: 2px;
}

.scan-corner--tr {
    top: 0;
    right: 0;
    border-top-width: 2px;
    border-right-width: 2px;
}

.scan-corner--bl {
    bottom: 0;
    left: 0;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.scan-corner--br {
    bottom: 0;
    right: 0;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

@keyframes cornerPulse {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.8;
    }
}

/* Crosshair */
.scan-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
}

.scan-crosshair::before,
.scan-crosshair::after {
    content: '';
    position: absolute;
    background: var(--color-accent);
    opacity: 0.5;
}

.scan-crosshair::before {
    top: 50%;
    left: -8px;
    width: 28px;
    height: 1px;
    transform: translateY(-50%);
}

.scan-crosshair::after {
    left: 50%;
    top: -8px;
    width: 1px;
    height: 28px;
    transform: translateX(-50%);
}

/* Rotating ring */
.scan-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    border: 1px solid var(--color-accent-dim);
    border-radius: 50%;
    border-top-color: var(--color-accent);
    animation: ringRotate 3s linear infinite;
    opacity: 0.4;
}

@keyframes ringRotate {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Loader text */
.loader__text {
    margin-top: var(--space-lg);
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    color: var(--color-accent-dim);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Progress bar */
.loader__progress {
    margin-top: var(--space-md);
    width: 120px;
    height: 1px;
    background: var(--color-text-tertiary);
    position: relative;
    overflow: hidden;
}

.loader__progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--color-accent);
    transition: width 0.3s ease-out;
}


/* ============================================================
   5. NAVIGATION BAR
   ------------------------------------------------------------
   WHY: Sticky transparent → frosted on scroll.
        Logo (56px) + "DRISHTI LABS" text on left, tabs on right.
   ============================================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    background: transparent;
    transition: background var(--transition),
        box-shadow var(--transition);
}

.nav--scrolled {
    background: rgba(11, 13, 17, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Brand container: logo + text side by side */
.nav__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Logo — 68px height on desktop */
.nav__logo {
    height: 68px;
    width: auto;
    filter: invert(1);
    transition: filter var(--transition);
}

/* "DRISHTI LABS" text beside logo */
.nav__brand-text {
    font-family: var(--font-primary);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    white-space: nowrap;
}

/* Nav links */
.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav__link {
    font-size: var(--fs-small);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    transition: color var(--transition);
    cursor: pointer;
    position: relative;
    padding: var(--space-xs) 0;
}

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

.nav__link--active {
    color: var(--color-accent);
}

.nav__link--active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
}

/* Mobile hamburger */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 20px;
    position: relative;
    z-index: 1001;
}

.nav__toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: absolute;
    left: 0;
}

.nav__toggle span:nth-child(1) {
    top: 0;
}

.nav__toggle span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.nav__toggle span:nth-child(3) {
    bottom: 0;
}

.nav__toggle--open span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.nav__toggle--open span:nth-child(2) {
    opacity: 0;
}

.nav__toggle--open span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}


/* ============================================================
   6. HERO SECTION
   ------------------------------------------------------------
   Full-screen bridge_down_view.png with overlay + vignette.
   Text: "DRISHTI LABS" → "Beyond the Surface" → subheading.
   ============================================================ */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: -20% 0;
    background: url('images/bridge_down_view.png') center center / cover no-repeat;
    will-change: transform;
    z-index: 1;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 13, 17, 0.70);
    z-index: 2;
}

.hero__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
            transparent 40%,
            rgba(11, 13, 17, 0.6) 100%);
    z-index: 3;
}

.hero__content {
    position: relative;
    z-index: 4;
    text-align: center;
    max-width: 800px;
    padding: 0 var(--space-md);
}

/* "DRISHTI LABS" — large hero heading */
.hero__title {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

/* "Beyond the Surface" — tagline */
.hero__tagline {
    font-size: var(--fs-heading);
    font-weight: 300;
    color: var(--color-accent);
    letter-spacing: 0.06em;
    margin-bottom: var(--space-sm);
}

.hero__content .accent-line {
    margin: var(--space-sm) auto var(--space-md);
}

.hero__content p {
    margin: 0 auto;
    color: var(--color-text-secondary);
    font-size: var(--fs-subhead);
    max-width: 560px;
}


/* ============================================================
   7. PROBLEM SECTION
   ------------------------------------------------------------
   Single block with crack_wall_01.png blurred + desaturated.
   ============================================================ */
.problem-section {
    position: relative;
    background: var(--color-bg);
}

.problem-block {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.problem-block__bg {
    position: absolute;
    inset: -5%;
    background-size: cover;
    background-position: center;
    filter: blur(10px) saturate(0.6);
    z-index: 1;
}

.problem-block__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(11, 13, 17, 0.60) 0%,
            rgba(11, 13, 17, 0.65) 60%,
            rgba(12, 15, 20, 0.92) 100%);
    z-index: 2;
}

.problem-block__content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 700px;
    padding: var(--space-lg) var(--space-md);
}

.problem-block__content h2 {
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.problem-block__content p {
    margin: 0 auto;
    margin-bottom: var(--space-md);
}


/* ============================================================
   8. SENSOR NODE SECTION
   ------------------------------------------------------------
   Background: sensor_bg_image.png with overlay.
   Layout: Main node LEFT, 3 branches stacked RIGHT.
   SVG lines connect them. Branches slide in from right.
   ============================================================ */
.sensor-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--space-xl) var(--space-md);
}

/* Background — pure CSS dark gradient + faint geometry lines */
.sensor-section__bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, var(--color-bg) 0%, #0e1118 30%, #111520 60%, var(--color-bg-surface) 100%);
    z-index: 1;
}

/* Faint diagonal structural geometry lines */
.sensor-section__bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(45deg, rgba(107, 140, 174, 0.015) 0px, rgba(107, 140, 174, 0.015) 1px, transparent 1px, transparent 120px),
        repeating-linear-gradient(-45deg, rgba(107, 140, 174, 0.01) 0px, rgba(107, 140, 174, 0.01) 1px, transparent 1px, transparent 160px);
    pointer-events: none;
}

.sensor-section__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(12, 15, 20, 0.90) 0%,
            rgba(11, 13, 17, 0.72) 15%,
            rgba(11, 13, 17, 0.72) 85%,
            rgba(11, 13, 17, 0.92) 100%);
    z-index: 2;
}

/* Subtle grid texture on top */
.sensor-section__grid {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, var(--color-grid) 0px, var(--color-grid) 1px, transparent 1px, transparent 80px),
        repeating-linear-gradient(0deg, var(--color-grid) 0px, var(--color-grid) 1px, transparent 1px, transparent 80px);
    pointer-events: none;
    z-index: 3;
}

/* Wrapper for heading + diagram */
.sensor-wrapper {
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 900px;
}

.sensor-wrapper .section-heading {
    text-align: center;
    margin-bottom: var(--space-lg);
}

/* Node diagram */
.sensor-diagram {
    position: relative;
    width: 100%;
    height: 520px;
}

/* --- Main node (CENTER) --- */
.sensor-node--main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
}

.sensor-node--main .node-label {
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    color: var(--color-accent);
    letter-spacing: 0.1em;
    line-height: 1.5;
    padding: var(--space-sm);
}

/* Pulse glow */
.sensor-node--main::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid var(--color-accent-dim);
    opacity: 0;
    animation: centerPulse 3s ease-in-out infinite;
}

@keyframes centerPulse {

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

    50% {
        opacity: 0.4;
        transform: scale(1.08);
    }
}

/* --- Branch nodes (surrounding center) --- */
.sensor-node--branch {
    position: absolute;
    width: 160px;
    padding: var(--space-sm) var(--space-xs);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-text-tertiary);
    border-radius: 8px;
    text-align: center;
    z-index: 10;
    /* Start hidden — JS toggles node--visible */
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.sensor-node--branch .node-title {
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    font-weight: 600;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.sensor-node--branch .node-subtitle {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
}

/* RGB — top center, enters from above */
.node-rgb {
    top: 2%;
    left: 50%;
    transform: translate(-50%, -40px);
    border-color: var(--color-rgb);
}

.node-rgb .node-title {
    color: var(--color-rgb);
}

.node-rgb.node--visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Thermal — left of center, enters from left */
.node-thermal {
    top: 50%;
    left: 5%;
    transform: translate(-60px, -50%);
    border-color: var(--color-thermal);
}

.node-thermal .node-title {
    color: var(--color-thermal);
}

.node-thermal.node--visible {
    opacity: 1;
    transform: translate(0, -50%);
}

/* GPR — right of center, enters from right */
.node-gpr {
    top: 50%;
    right: 5%;
    transform: translate(60px, -50%);
    border-color: var(--color-gpr);
}

.node-gpr .node-title {
    color: var(--color-gpr);
}

.node-gpr.node--visible {
    opacity: 1;
    transform: translate(0, -50%);
}

/* --- SVG connecting lines --- */
.sensor-lines {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.sensor-lines line {
    stroke-width: 1;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.2s ease-out;
}

.sensor-lines.lines--visible line {
    stroke-dashoffset: 0;
}

/* Reset lines when not visible (re-trigger) */
.sensor-lines.lines--hidden line {
    stroke-dashoffset: 500;
}

.sensor-lines .line-rgb {
    stroke: var(--color-rgb);
    opacity: 0.4;
}

.sensor-lines .line-thermal {
    stroke: var(--color-thermal);
    opacity: 0.4;
}

.sensor-lines .line-gpr {
    stroke: var(--color-gpr);
    opacity: 0.4;
}


/* ============================================================
   9. PRODUCT SECTION
   ============================================================ */
.product-section {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--color-bg);
    padding: var(--space-xl) var(--space-md);
}

/* Smooth top blend from sensor section */
.product-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to bottom, #0c0f14, transparent);
    z-index: 0;
    pointer-events: none;
}

.product-section h2 {
    margin-bottom: var(--space-sm);
}

.product-section p {
    margin: 0 auto;
    color: var(--color-text-tertiary);
    font-size: var(--fs-subhead);
}


/* ============================================================
   9b. SERVICES SECTION — 3D VIEWER
   ------------------------------------------------------------
   Three.js GLB viewer with orbit controls.
   Lazy loads models when section enters viewport.
   Controls overlay top-right: Show Mesh + Dark Mode toggles.
   ============================================================ */
.services-section {
    position: relative;
    background: var(--color-bg-surface);
    padding: var(--space-lg) var(--space-md) var(--space-xl);
    overflow: hidden;
}

/* Top blend from product section */
.services-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to bottom, var(--color-bg), transparent);
    z-index: 1;
    pointer-events: none;
}

/* Bottom blend into projects */
.services-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to top, var(--color-bg), transparent);
    z-index: 1;
    pointer-events: none;
}

/* Info text block above viewer */
.services-info {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-lg);
    position: relative;
    z-index: 2;
}

.services-info h2 {
    margin-bottom: var(--space-sm);
}

.services-info p {
    margin: 0 auto;
}

/* Viewer container */
.services-viewer {
    position: relative;
    width: 100%;
    max-width: 1100px;
    height: 70vh;
    min-height: 400px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(107, 140, 174, 0.1);
    background: #0c0f14;
    z-index: 2;
}

.services-viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Controls overlay — top right */
.viewer-controls {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: rgba(20, 23, 30, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(107, 140, 174, 0.1);
    border-radius: 8px;
}

.viewer-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    color: var(--color-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: color 0.2s ease;
}

.viewer-controls label:hover {
    color: var(--color-text-primary);
}

.viewer-controls input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--color-text-tertiary);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.viewer-controls input[type="checkbox"]:checked {
    border-color: var(--color-accent);
    background: var(--color-accent-dim);
}

.viewer-controls input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: var(--color-text-primary);
    line-height: 1;
}

/* Loading overlay */
.viewer-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(12, 15, 20, 0.85);
    transition: opacity 0.5s ease;
}

.viewer-loading--hidden {
    opacity: 0;
    pointer-events: none;
}

.viewer-loading__spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-text-tertiary);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: viewerSpin 1s linear infinite;
    margin-bottom: var(--space-sm);
}

@keyframes viewerSpin {
    to {
        transform: rotate(360deg);
    }
}

.viewer-loading__text {
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    color: var(--color-text-secondary);
    letter-spacing: 0.08em;
}


/* ============================================================
   10. PROJECTS — ANCHOR
   ============================================================ */
.project-anchor {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-surface);
    padding: var(--space-xl) var(--space-md);
    overflow: hidden;
}

/* Top blend from product/services */
.project-anchor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to bottom, var(--color-bg), transparent);
    z-index: 0;
    pointer-events: none;
}

/* Bottom blend into Vyuh */
.project-anchor::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to top, var(--color-bg), transparent);
    z-index: 0;
    pointer-events: none;
}

.project-anchor__layout {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    max-width: 1100px;
    width: 100%;
}

/* Robot image */
.project-anchor__image {
    flex: 1;
    max-width: 480px;
}

.project-anchor__image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    animation: subtleFloat 5s ease-in-out infinite;
    transition: transform 0.3s ease;
}

/* Hover: lift + slight scale + subtle shadow */
.project-anchor__image img:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 40px rgba(107, 140, 174, 0.2);
}

@keyframes subtleFloat {

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

    50% {
        transform: translateY(-2px);
    }
}

/* Text */
.project-anchor__text {
    flex: 1;
    max-width: 500px;
}

.project-anchor__text h2 {
    font-size: var(--fs-hero);
    margin-bottom: var(--space-xs);
}

.project-anchor__text h3 {
    color: var(--color-text-secondary);
    font-weight: 400;
    margin-bottom: var(--space-md);
}

.project-anchor__text p {
    line-height: 1.8;
}


/* ============================================================
   11. PROJECTS — VYUH (Swarm)
   ------------------------------------------------------------
   Dark gradient bg with a <canvas> overlay for swarm dots.
   Text overlaid on top of canvas.
   ============================================================ */
.project-vyuh {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg,
            var(--color-bg) 0%,
            var(--color-bg-surface) 40%,
            var(--color-bg-elevated) 100%);
    overflow: hidden;
    padding: var(--space-xl) var(--space-md);
}

/* Top blend from Anchor */
.project-vyuh::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to bottom, #0c0f14, transparent);
    z-index: 3;
    pointer-events: none;
}

/* Bottom blend into About */
.project-vyuh::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to top, #0c0f14, transparent);
    z-index: 3;
    pointer-events: none;
}

/* Canvas for swarm animation (JS draws here) */
.project-vyuh__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Text content above canvas */
.project-vyuh__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 650px;
}

.project-vyuh__content h2 {
    font-size: var(--fs-hero);
    margin-bottom: var(--space-xs);
}

.project-vyuh__content h3 {
    color: var(--color-text-secondary);
    font-weight: 400;
    margin-bottom: var(--space-md);
}

.project-vyuh__content p {
    margin: 0 auto;
    line-height: 1.8;
}


/* ============================================================
   12. ABOUT SECTION
   ------------------------------------------------------------
   Background: bridge_image_1.png with dark overlay + parallax.
   ============================================================ */
.about-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--space-xl) var(--space-md);
}

/* Background image — JS applies parallax */
.about-section__bg {
    position: absolute;
    inset: -20% 0;
    background: url('images/bridge_image_1.png') center center / cover no-repeat;
    will-change: transform;
    z-index: 1;
}

.about-section__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(12, 15, 20, 0.88) 0%,
            rgba(11, 13, 17, 0.65) 12%,
            rgba(11, 13, 17, 0.65) 85%,
            rgba(12, 15, 20, 0.90) 100%);
    z-index: 2;
}

/* Parallax decorative layers */
.about-section__parallax-layer {
    position: absolute;
    pointer-events: none;
    will-change: transform;
    z-index: 3;
}

.about-content {
    position: relative;
    z-index: 4;
    max-width: 900px;
    text-align: center;
}

.about-content h2 {
    margin-bottom: var(--space-sm);
}

.about-content p {
    margin: 0 auto var(--space-lg);
    line-height: 1.8;
}

/* Core Team Section */
.core-team {
    margin-top: var(--space-xl);
    width: 100%;
    max-width: 1000px;
}

.core-team__heading {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.core-team__title {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0;
}

/* Advisors variant — centered 2-col with colinear content */
/* .core-team__grid--advisors {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-width: 500px;
    margin: 0 auto;
    align-items: start;
} */

/* Advisors variant — centered 2-col with colinear content */
.core-team__grid--advisors {
    display: flex;
    /* Changed from grid to flex */
    flex-direction: row;
    /* Force horizontal alignment */
    flex-wrap: nowrap;
    /* Prevent stacking */
    justify-content: center;
    /* Center the pair on the page */
    max-width: 800px;
    /* Increased from 500px to allow space */
    margin: 0 auto;
    gap: var(--space-lg);
    /* Adds proper spacing between the two */
}

/* Force advisor card names to a fixed height so role/affiliation align */
.core-team__grid--advisors .team-card__name {
    min-height: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Linked team cards (anchor-based) */
a.team-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Responsive flex layout — centers incomplete rows */
.core-team__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}

/* Glass card */
.team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(26, 30, 40, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(107, 140, 174, 0.08);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Circular photo — grayscale → color on hover */
.team-card__photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-text-tertiary);
    transition: border-color 0.3s ease;
}

.team-card:hover .team-card__photo {
    border-color: var(--color-accent-dim);
}

.team-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.7);
    transition: filter 0.4s ease;
}

.team-card:hover .team-card__photo img {
    filter: grayscale(0);
}

.team-card__name {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: center;
}

.team-card__role {
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
}

.team-card__affiliation {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 1.5;
}


/* ============================================================
   13. CONTACT SECTION
   ------------------------------------------------------------
   Background: bridge_image_2.png (night) with 75% overlay.
   ============================================================ */
.contact-section {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: var(--space-xl) var(--space-md);
}

.contact-section__bg {
    position: absolute;
    inset: 0;
    background: url('images/bridge_image_2.png') center center / cover no-repeat;
    z-index: 1;
}

.contact-section__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(12, 15, 20, 0.90) 0%,
            rgba(11, 13, 17, 0.72) 15%,
            rgba(11, 13, 17, 0.75) 100%);
    z-index: 2;
}

.contact-content {
    position: relative;
    z-index: 3;
}

.contact-content h2 {
    margin-bottom: var(--space-sm);
}

.contact-content .accent-line {
    margin: var(--space-sm) auto var(--space-md);
}

.contact-links {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    margin-top: var(--space-md);
}

.contact-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text-secondary);
    transition: color var(--transition);
}

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

.contact-link svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.contact-link span {
    font-size: var(--fs-small);
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
}


/* ============================================================
   14. SCROLL REVEAL (RE-TRIGGERABLE)
   ------------------------------------------------------------
   WHY: Elements fade-up on enter, fade-out on exit,
        and re-animate on re-entry.
   HOW: JS toggles "revealed" class on/off. No unobserve.
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow),
        transform var(--transition-slow);
}

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

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.25s;
}

.reveal-delay-3 {
    transition-delay: 0.4s;
}


/* ============================================================
   15. UTILITY CLASSES
   ============================================================ */
.no-scroll {
    overflow: hidden;
}


/* ============================================================
   16. RESPONSIVE / MOBILE
   ============================================================ */

/* --- Tablet (≤ 900px) --- */
@media (max-width: 900px) {
    .nav {
        padding: 0 var(--space-md);
    }

    .nav__logo {
        height: 48px;
    }

    .nav__brand-text {
        font-size: 0.9rem;
        letter-spacing: 0.1em;
    }

    .nav__links {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: rgba(11, 13, 17, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        justify-content: center;
        gap: var(--space-lg);
        padding: var(--space-xl) var(--space-lg);
        transform: translateX(100%);
        transition: transform 0.4s ease;
    }

    .nav__links--open {
        transform: translateX(0);
    }

    .nav__toggle {
        display: block;
    }

    .nav__link {
        font-size: var(--fs-body);
    }

    /* Projects stack vertically */
    .project-anchor__layout {
        flex-direction: column;
        text-align: center;
    }

    .project-anchor__text {
        text-align: center;
    }

    .project-anchor__text p {
        margin: 0 auto;
    }

    /* Sensor diagram scale */
    .sensor-diagram {
        height: 380px;
    }

    .sensor-node--main {
        width: 150px;
        height: 150px;
    }

    .sensor-node--branch {
        width: 120px;
    }

    /* Team grid single column on tablet */
    .core-team__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Phone (≤ 600px) --- */
@media (max-width: 600px) {
    .nav__links {
        width: 100%;
    }

    .nav__brand-text {
        display: none;
    }

    .sensor-diagram {
        height: 340px;
    }

    .sensor-node--main {
        width: 120px;
        height: 120px;
    }

    .sensor-node--main .node-label {
        font-size: 0.6rem;
    }

    .sensor-node--branch {
        width: 95px;
        padding: var(--space-xs);
    }

    .sensor-node--branch .node-title {
        font-size: 0.6rem;
    }

    .sensor-node--branch .node-subtitle {
        font-size: 0.55rem;
    }

    /* Team grid single column on phone */
    .core-team__grid {
        grid-template-columns: 1fr;
    }

    .hero__title {
        font-size: clamp(1.8rem, 7vw, 3rem);
    }

    .contact-links {
        flex-direction: column;
        gap: var(--space-md);
    }
}