/* ─────────────────────────────────────────────────────────
   main.css  —  NEXUS futuristic site
   ───────────────────────────────────────────────────────── */

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

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

body {
    background: #050508;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* ── Custom Cursor ──────────────────────────────────────── */
.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 6px; height: 6px;
    background: #00FFB2;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: width 0.15s, height 0.15s, background 0.15s, opacity 0.15s;
}

.cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 36px; height: 36px;
    border: 1px solid rgba(0, 255, 178, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: width  0.3s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s ease;
}

body[data-cursor="hover"] .cursor-dot  { width: 8px;  height: 8px; }
body[data-cursor="hover"] .cursor-ring { width: 56px; height: 56px; border-color: rgba(0,255,178,0.8); }
body[data-cursor="click"] .cursor-dot  { width: 4px;  height: 4px; background: #fff; }
body[data-cursor="click"] .cursor-ring { width: 22px; height: 22px; border-color: rgba(255,255,255,0.8); }

/* Hide cursors on touch devices */
@media (hover: none) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* ── Page Loader ────────────────────────────────────────── */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #050508;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* No opacity transition here — GSAP handles animation via yPercent */
}

.loader-text {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    /* GSAP animates these */
}

#loader-bar {
    height: 100%;
    width: 0%;
    background: #00FFB2;
    transition: none; /* GSAP controls this */
}

/* ── Navbar ─────────────────────────────────────────────── */
#navbar {
    /* Mix-blend-difference removed — causes text to vanish on light bg sections */
    transition: background 0.4s ease,
                padding    0.4s ease,
                border     0.4s ease,
                transform  0.4s ease;
}

#navbar.scrolled {
    background: rgba(5, 5, 8, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Nav underline animation */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px; left: 0;
    width: 0; height: 1px;
    background: #00FFB2;
    transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* ── Hero Section ───────────────────────────────────────── */
#hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.65;
}

/* Grid overlay — cross-browser mask */
.hero-grid-overlay {
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 80px 80px;
    /* Standard + webkit for Safari */
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
    mask-image:         radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* Hero content wrapper — full width, proper padding for nav clearance */
.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 80rem;   /* 7xl = 1280px */
    margin: 0 auto;
    padding: 9rem 2rem 6rem;
}

@media (min-width: 768px) {
    .hero-content { padding: 9rem 3rem 6rem; }
}

/* Hero text — GSAP controls opacity/transform; remove conflicting Tailwind states */
.hero-eyebrow { opacity: 0; }           /* GSAP animates to opacity:1 */
.hero-line    { opacity: 0; }           /* GSAP animates — no translate-y-full */
.hero-sub     { opacity: 0; }
.hero-cta     { opacity: 0; }
.hero-scroll  { opacity: 0; }
.hero-badge   { opacity: 0; }

/* Scroll indicator */
.scroll-line {
    animation: scrollDown 2s ease-in-out infinite;
}
@keyframes scrollDown {
    0%   { transform: translateY(-100%); opacity: 1; }
    60%  { transform: translateY(0%);    opacity: 1; }
    100% { transform: translateY(200%);  opacity: 0; }
}

/* Stat cards — left accent border on hover */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 2px; height: 0;
    background: #00FFB2;
    transition: height 0.35s ease;
}
.stat-card:hover::before { height: 100%; }

/* ── Services Grid ──────────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: rgba(255,255,255,0.06);
}
@media (min-width: 768px)  { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }

.service-card {
    background: #0D0D14;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
    /* Ensure full height in grid */
    display: flex;
    flex-direction: column;
}
.service-card:hover { background: #1A1A2E; }

/* ── Marquee ────────────────────────────────────────────── */
.marquee-strip {
    overflow: hidden;
    white-space: nowrap;
    border-top:    1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 1rem 0;
    background: #050508;
}

.marquee-track {
    display: inline-flex;
    align-items: center;
    gap: 3rem;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.marquee-strip:hover .marquee-track {
    animation-play-state: paused;
}

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

/* ── Section headings ───────────────────────────────────── */
.section-label {
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.section-title {
    overflow: hidden; /* clip GSAP character slides */
    line-height: 1.05;
}

/* GSAP char split helper */
.split-char {
    display: inline-block;
    will-change: transform, opacity;
    line-height: inherit;
}

/* ── Page transition curtain ────────────────────────────── */
#page-curtain {
    position: fixed;
    inset: 0;
    background: #050508;
    z-index: 8888;
    transform: scaleY(0);
    transform-origin: bottom;
    /* pointer-events managed by JS */
}

/* ── Mobile menu ────────────────────────────────────────── */
#mobile-menu {
    transition: opacity 0.4s ease;
}

.menu-bar {
    display: block;
    height: 1px;
    background: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

/* ── Careers filter buttons ─────────────────────────────── */
.filter-btn {
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.filter-btn.active {
    border-color: #00FFB2;
    color: #00FFB2;
}

/* ── Case study rows ────────────────────────────────────── */
.case-row {
    transition: background 0.3s ease, padding 0.3s ease;
}

/* ── Footer ─────────────────────────────────────────────── */
footer a {
    transition: color 0.2s ease;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar              { width: 4px; }
::-webkit-scrollbar-track        { background: #050508; }
::-webkit-scrollbar-thumb        { background: #00FFB2; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(255,255,255,0.6); }

/* ── Utility: visually hide but keep accessible ─────────── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ════════════════════════════════════════════════════
   Page-specific styles added in refinement pass
   ════════════════════════════════════════════════════ */

/* ── Page hero section spacing ──────────────────────── */
.page-hero {
    background: #050508;
}

/* ── Services page ──────────────────────────────────── */
.service-row {
    /* Isolate transitions — no layout jump */
}

.service-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-item {
    /* padding-left animated by GSAP — set baseline */
    padding-left: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: border-color 0.25s ease;
}
.service-item:last-child { border-bottom: none; }
.service-item:hover { border-color: rgba(0,255,178,0.2); }

/* ── About page ─────────────────────────────────────── */
.team-card {
    transition: background 0.3s ease;
    /* perspective for 3D tilt GSAP effect */
    transform-style: preserve-3d;
}
.team-card:hover { background: #1A1A2E; }

.value-card {
    transition: background 0.3s ease;
}
.value-card:hover { background: #1A1A2E; }

/* Number display inside about stats */
.about-stat p:first-child {
    font-variant-numeric: tabular-nums;
}

/* ── Case studies ────────────────────────────────────── */
.case-row {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.case-row:last-child { border-bottom: none; }

/* Ghost number — avoid bright flash on load */
.case-num {
    color: rgba(255,255,255,0.06);
    line-height: 1;
    user-select: none;
    will-change: color;
}

/* ── Careers ─────────────────────────────────────────── */
.job-card {
    /* JS renders inline styles for reliability — this backs it up */
    transition: background 0.25s ease, border-color 0.25s ease;
    will-change: opacity, transform;
}

/* ── Utilities ───────────────────────────────────────── */

/* Force list-none inside nav to avoid browser default bullets */
#navbar ul,
#mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Ensure sections don't create unwanted overflow on mobile */
section, .max-w-7xl {
    max-width: 100%;
}

/* Fix grid gap-px on some browsers needing explicit colour */
.grid.gap-px {
    background: rgba(255,255,255,0.05);
}
.grid.gap-px > * {
    background: #0D0D14;
}

/* Divide-y utility fallback */
.divide-y > * + * {
    border-top: 1px solid rgba(255,255,255,0.05);
}
.divide-white\/5 > * + * {
    border-color: rgba(255,255,255,0.05);
}

/* border-white/8 — Tailwind CDN may not generate this opacity value */
.border-white\/8 { border-color: rgba(255,255,255,0.08) !important; }

/* Prevent enormous Bebas Neue numbers from clipping on small screens */
@media (max-width: 640px) {
    .case-num  { font-size: 3rem !important; }
    .about-stat p:first-child { font-size: 2.5rem !important; }
}
