/* ============================================================
   COGNITIO NEXUS — "Nexus / Singularity" design system
   Additive layer. Loaded AFTER styles.css on in-scope pages only
   (index, projects, thank-you, privacy-policy, 404, 403).
   NEVER edit styles.css / main.js — those are shared with the
   out-of-scope /landing pages and pdf-viewer.html.

   Fonts are loaded via the <link> in each page's <head>:
   Fraunces (display), JetBrains Mono (instrument), Inter (body).
   ============================================================ */

:root {
    /* — Void — */
    --void-pure: #000000;
    --void-950:  #04060d;   /* page background */
    --void-900:  #080b14;   /* raised / alternating sections */
    --void-850:  #0c1019;   /* card / surface base */
    --void-800:  #12161f;   /* elevated card / inputs */
    --void-700:  #1b202c;

    --line:        rgba(255, 255, 255, 0.06);
    --line-strong: rgba(255, 255, 255, 0.11);

    /* — Light spectrum (the soul: cyan → periwinkle → violet) — */
    --cyan:        #22e8f5;
    --cyan-deep:   #0fb9c9;
    --azure:       #4fb8ff;
    --peri:        #7c8bf5;
    --violet:      #a06bff;
    --violet-deep: #7b3fe4;

    --glow-cyan:   rgba(34, 232, 245, 0.28);
    --glow-violet: rgba(160, 107, 255, 0.26);
    --glow-soft:   rgba(124, 139, 245, 0.16);

    /* — Text — */
    --text-bright: #f4f7fb;
    --text-body:   #c2cad6;
    --text-muted:  #79828f;
    --text-faint:  #4a515c;

    /* — Semantic (functional, not brand) — */
    --signal-green: #34d399;
    --signal-red:   #f87171;
    --focus:        #22e8f5;

    /* — Type — */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;

    /* — Motion — */
    --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quint:   cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out-soft: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring:      cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-micro:  180ms;
    --dur-base:   420ms;
    --dur-reveal: 700ms;
    --dur-decode: 1100ms;

    /* — Shape — */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-pill: 999px;

    /* — Canonical gradients — */
    --grad-text: linear-gradient(105deg, var(--cyan) 0%, var(--peri) 55%, var(--violet) 100%);
    --grad-line: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
}

/* ============================================================
   BASE — additive. Tailwind preflight (CDN) handles reset on
   index/projects; these rules also make the self-contained
   pages (thank-you/privacy/404/403) work with Tailwind + nexus.
   ============================================================ */
html { scroll-behavior: smooth; }

body.nx {
    background-color: var(--void-950);
    color: var(--text-body);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Atmospheric base wash — a single, very faint periwinkle bloom
   sitting behind everything so the void has depth, never flat black. */
body.nx::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(124, 139, 245, 0.10), transparent 60%),
        radial-gradient(90% 60% at 85% 110%, rgba(160, 107, 255, 0.07), transparent 55%);
}
/* Content sits at the default stacking level; the ambient wash (above) and
   the constellation backdrop (below) live behind it via negative z-index, so
   sticky header / skip link / overlays keep their own positioning + z-index. */

::selection { background: rgba(34, 232, 245, 0.22); color: var(--text-bright); }

/* Quiet custom scrollbar */
.nx ::-webkit-scrollbar { width: 10px; height: 10px; }
.nx ::-webkit-scrollbar-track { background: var(--void-950); }
.nx ::-webkit-scrollbar-thumb { background: var(--void-700); border-radius: 999px; border: 2px solid var(--void-950); }
.nx ::-webkit-scrollbar-thumb:hover { background: #2a3242; }

/* Skip link — viewport-fixed, visible only on focus */
.nx-skip {
    position: fixed;
    left: 50%;
    top: -120%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 0.6rem 1.1rem;
    background: var(--void-800);
    border: 1px solid var(--cyan);
    border-radius: var(--r-pill);
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: top var(--dur-base) var(--ease-out-expo);
}
.nx-skip:focus { top: 1rem; }

/* Global focus-visible — must read on both void and bright fills */
.nx :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}
.nx :focus:not(:focus-visible) { outline: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.nx-eyebrow {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--cyan);
    display: inline-block;
}
.nx-eyebrow--muted { color: var(--text-muted); }
.nx-eyebrow .nx-eyebrow__index { color: var(--text-faint); margin-right: 0.65em; }

.nx-display {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--text-bright);
    line-height: 1.05;
    letter-spacing: -0.01em;
    font-optical-sizing: auto;
}

.nx-h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.04;
    letter-spacing: -0.015em;
    color: var(--text-bright);
    font-optical-sizing: auto;
}

.nx-lead {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    line-height: 1.6;
    color: var(--text-body);
    max-width: 56ch;
}

.nx-mono {
    font-family: var(--font-mono);
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.nx-gradient {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.nx-container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 768px) { .nx-container { padding-inline: 2rem; } }

/* Sections below the hero/descent are OPAQUE so they occlude the
   fixed constellation backdrop as they scroll over it. */
.nx-section { position: relative; padding-block: clamp(5rem, 12vw, 8rem); background: var(--void-950); }
.nx-section--raised { background: var(--void-900); }
.nx-hairline { height: 1px; border: 0; background: var(--line); margin: 0; }

/* ============================================================
   HEADER / NAV — override the shared #page-header structure.
   (IDs/classes kept so main.js mobile-nav keeps working.)
   ============================================================ */
.nx #page-header {
    background: rgba(4, 6, 13, 0.55);
    border-bottom: 1px solid var(--line);
}
.nx .header-blur { -webkit-backdrop-filter: blur(16px) saturate(120%); backdrop-filter: blur(16px) saturate(120%); }

.nx .nav-link {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.5rem 0.85rem;
    position: relative;
    transition: color var(--dur-base) var(--ease-out-expo);
}
.nx .nav-link::after {
    content: "";
    position: absolute;
    left: 50%; right: 50%;
    bottom: 0.2rem;
    height: 1px;
    background: var(--cyan);
    transition: left var(--dur-base) var(--ease-out-expo), right var(--dur-base) var(--ease-out-expo);
}
.nx .nav-link:hover { color: var(--text-bright); }
.nx .nav-link:hover::after { left: 0.85rem; right: 0.85rem; }

/* Brand lockup: isolated nexus mark + wordmark in the site's own mono,
   so the logo speaks the same type language as the rest of the site. */
.nx .nav-logo { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.nx .nav-logo__mark {
    height: 28px;
    width: auto;
    transition: filter var(--dur-base) var(--ease-out-expo);
}
.nx .nav-logo__word {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-bright);
    white-space: nowrap;
    padding-left: 0.16em; /* optical balance for tracking */
    transition: color var(--dur-base) var(--ease-out-expo);
}
.nx .nav-logo:hover .nav-logo__mark,
.nx .nav-logo:focus-visible .nav-logo__mark { filter: drop-shadow(0 0 10px var(--glow-cyan)); }
.nx .nav-logo:hover .nav-logo__word { color: var(--cyan); }
@media (max-width: 600px) { .nx .nav-logo__word { display: none; } }

/* Centered lockup variant for the simple (thank-you/legal/error) pages */
.nx-simple-header .nav-logo { gap: 0.7rem; }
.nx-simple-header .nav-logo__mark { height: 32px; }

/* ============================================================
   THE SINGLE MAGNETIC CTA — "contained light", not a candy button
   ============================================================ */
.nx-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.75rem;
    border-radius: var(--r-pill);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    color: var(--cyan);
    background: rgba(34, 232, 245, 0.04);
    border: 1px solid transparent;
    background-image:
        linear-gradient(var(--void-900), var(--void-900)),
        linear-gradient(105deg, rgba(34, 232, 245, 0.5), rgba(160, 107, 255, 0.5));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 24px -6px var(--glow-cyan), inset 0 0 18px -10px var(--glow-cyan);
    cursor: pointer;
    transition: transform var(--dur-base) var(--ease-spring),
                box-shadow var(--dur-base) var(--ease-out-expo),
                color var(--dur-base) var(--ease-out-expo);
    will-change: transform;
    text-decoration: none;
    overflow: hidden;
}
.nx-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(34, 232, 245, 0.18), rgba(160, 107, 255, 0.18));
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out-expo);
}
.nx-cta > * { position: relative; z-index: 1; }
.nx-cta:hover {
    color: var(--text-bright);
    box-shadow: 0 0 42px -6px var(--glow-cyan), 0 0 64px -10px var(--glow-violet);
}
.nx-cta:hover::before { opacity: 1; }
.nx-cta:active { transform: scale(0.98); }

.nx-cta__dot {
    width: 6px; height: 6px;
    border-radius: 999px;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
}

/* compact header variant */
.nx .nav-cta {
    padding: 0.55rem 1.1rem;
    font-size: 0.82rem;
    border-radius: var(--r-pill);
    color: var(--cyan);
    background-image:
        linear-gradient(rgba(4, 6, 13, 0.6), rgba(4, 6, 13, 0.6)),
        linear-gradient(105deg, rgba(34, 232, 245, 0.5), rgba(160, 107, 255, 0.5));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 1px solid transparent;
    box-shadow: 0 0 18px -8px var(--glow-cyan);
    transition: color var(--dur-base) var(--ease-out-expo), box-shadow var(--dur-base) var(--ease-out-expo);
}
.nx .nav-cta:hover { color: var(--text-bright); box-shadow: 0 0 30px -6px var(--glow-cyan); }

/* Ghost / text link with travelling arrow */
.nx-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--cyan);
    text-decoration: none;
    transition: color var(--dur-base) var(--ease-out-expo);
}
.nx-link .nx-link__arrow { transition: transform var(--dur-base) var(--ease-out-expo); }
.nx-link:hover { color: var(--text-bright); }
.nx-link:hover .nx-link__arrow { transform: translateX(5px); }

/* ============================================================
   CONSTELLATION BACKDROP — a fixed, full-viewport layer behind the
   hero + descent. The poster and WebGL canvas live here so the
   constellation stays visible through the scroll choreography, then
   is occluded by the opaque sections below. nexus.js fades + pauses
   it once the descent is scrolled past.
   ============================================================ */
#nexus-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.6s var(--ease-out-expo);
}

/* ============================================================
   HERO — full viewport void (transparent → backdrop shows through)
   ============================================================ */
.nx-hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
}
.hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s var(--ease-out-expo);
}
[data-webgl="on"] .hero-canvas { opacity: 1; }
.hero-canvas canvas { display: block; width: 100% !important; height: 100% !important; }

#nexus-poster {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: opacity 0.8s var(--ease-out-expo);
}
#nexus-poster svg { width: 100%; height: 100%; display: block; }
[data-webgl="on"] #nexus-poster { opacity: 0; }

/* Vignette to keep focus center-screen behind the copy */
.nx-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(70% 70% at 50% 45%, transparent 40%, rgba(4, 6, 13, 0.55) 100%);
}

.nx-hero__inner {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    max-width: 60rem;
}

.nx-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2.25rem;
}
.nx-status__dot {
    width: 7px; height: 7px;
    border-radius: 999px;
    background: var(--signal-green);
    box-shadow: 0 0 10px var(--signal-green);
    animation: nx-pulse 2.8s var(--ease-in-out-soft) infinite;
}

.nx-wordmark {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(0.85rem, 2.2vw, 1.15rem);
    letter-spacing: 0.55em;
    text-transform: uppercase;
    color: var(--text-bright);
    margin-bottom: 1.75rem;
    padding-left: 0.55em; /* optical balance for tracking */
}

.nx-hero__line {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 7vw, 5.25rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: var(--text-bright);
    margin: 0 auto 2.75rem;
    max-width: 18ch;
    font-optical-sizing: auto;
}
.nx-hero__line em {
    font-style: italic;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* scroll cue */
.nx-scrollcue {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.nx-scrollcue__line {
    width: 1px; height: 38px;
    background: linear-gradient(var(--cyan), transparent);
    animation: nx-scrolldrop 2.6s var(--ease-in-out-soft) infinite;
}

/* ============================================================
   DECODE — per-character glyph cycling resolving to final text
   ============================================================ */
.nx-decode { white-space: pre-wrap; }
.nx-decode .nx-char { display: inline-block; }
.nx-decode .nx-char--scramble { color: var(--cyan); opacity: 0.85; }

/* ============================================================
   THE DESCENT — sticky capability lines, one visible at a time.
   BASELINE (no JS / reduced motion): a safe static vertical stack,
   fully visible. ENHANCED (.nx-js, full motion): sticky overlap
   where only the active line shows. Reduced-motion reverts below.
   ============================================================ */
.nx-descent { position: relative; }
.nx-descent__viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    text-align: center;
    padding: clamp(4rem, 10vw, 7rem) 1.5rem;
}
.nx-descent__line {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 5vw, 3.6rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: var(--text-bright);
    max-width: 20ch;
    margin-inline: auto;
}
.nx-descent__line .nx-key {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-style: italic;
}
.nx-descent__progress { display: none; }

/* Enhanced sticky-scroll choreography (only when JS is present) */
.nx-js .nx-descent { height: 320vh; }
.nx-js .nx-descent__viewport {
    position: sticky;
    top: 0;
    min-height: 100svh;
    display: grid;
    place-items: center;
    gap: 0;
    padding: 2rem 1.5rem;
}
.nx-js .nx-descent__line {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(18px);
    filter: blur(8px);
    transition: opacity var(--dur-reveal) var(--ease-out-expo),
                transform var(--dur-reveal) var(--ease-out-expo),
                filter var(--dur-reveal) var(--ease-out-expo);
}
.nx-js .nx-descent__line.is-active { opacity: 1; transform: none; filter: none; }
.nx-js .nx-descent__progress {
    position: absolute;
    left: 50%;
    bottom: 8vh;
    transform: translateX(-50%);
    display: flex;
    gap: 0.55rem;
    z-index: 3;
}
.nx-descent__tick {
    width: 28px; height: 2px;
    background: var(--line-strong);
    transition: background var(--dur-base) var(--ease-out-expo);
}
.nx-descent__tick.is-active { background: var(--cyan); box-shadow: 0 0 8px var(--glow-cyan); }

/* ============================================================
   PROOF WHISPER — sparse hard numbers
   ============================================================ */
.nx-proof__grid { display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .nx-proof__grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
.nx-proof__item { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.nx-proof__stat {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    line-height: 1;
    letter-spacing: -0.02em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.75rem;
}
.nx-proof__label {
    font-family: var(--font-body);
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--text-body);
    max-width: 30ch;
}

/* ============================================================
   PROJECT CARDS (homepage teasers + projects.html)
   ============================================================ */
.nx-card {
    position: relative;
    display: block;
    background: linear-gradient(160deg, var(--void-850), var(--void-900));
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.85rem;
    text-decoration: none;
    overflow: hidden;
    transition: transform var(--dur-base) var(--ease-out-quint),
                border-color var(--dur-base) var(--ease-out-expo),
                box-shadow var(--dur-base) var(--ease-out-expo);
}
.nx-card::before { /* top-edge spectrum line */
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: var(--grad-line);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-reveal) var(--ease-out-expo);
}
.nx-card::after { /* corner wash */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 0% 0%, rgba(34, 232, 245, 0.07), transparent 55%);
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out-expo);
}
.nx-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 232, 245, 0.3);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5), 0 0 24px -8px var(--glow-cyan);
}
.nx-card:hover::before { transform: scaleX(1); }
.nx-card:hover::after { opacity: 1; }
.nx-card > * { position: relative; z-index: 1; }

.nx-card__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.3rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-bright);
    transition: color var(--dur-base) var(--ease-out-expo);
}
.nx-card:hover .nx-card__title { color: var(--cyan); }
.nx-card__body { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }

.nx-tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(34, 232, 245, 0.08);
    border: 1px solid rgba(34, 232, 245, 0.16);
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-pill);
    white-space: nowrap;
}
.nx-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--void-800);
    border: 1px solid var(--line);
    padding: 0.28rem 0.62rem;
    border-radius: var(--r-sm);
    white-space: nowrap;
}

/* ============================================================
   CONTACT — override the shared form classes (after styles.css)
   Keep .form-input/.form-textarea/.form-submit/.form-status names
   (main.js + structure depend on them).
   ============================================================ */
.nx-contact-card {
    background: linear-gradient(160deg, rgba(12, 16, 25, 0.7), rgba(8, 11, 20, 0.7));
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.nx .contact-form { display: flex; flex-direction: column; gap: 1rem; }
.nx .form-group { margin: 0; }
.nx .form-input,
.nx .form-textarea {
    width: 100%;
    background: var(--void-800);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.95rem 1.1rem;
    color: var(--text-bright);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--dur-base) var(--ease-out-expo),
                box-shadow var(--dur-base) var(--ease-out-expo);
}
.nx .form-input::placeholder,
.nx .form-textarea::placeholder { color: var(--text-faint); }
.nx .form-textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.nx .form-input:focus,
.nx .form-textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 232, 245, 0.16);
}
.nx .form-submit {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
    cursor: pointer;
    /* visual: add class="form-submit nx-cta" on the button in markup */
}
.nx .form-status {
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    min-height: 1.2em;
    color: var(--text-muted);
}
.nx .form-status-success { color: var(--signal-green); }
.nx .form-status-error { color: var(--signal-red); }

/* Honeypot hide — re-declared so it works even where styles.css is absent */
.nx .hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.nx-consent {
    margin-top: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.nx-consent a { color: var(--text-body); text-decoration: underline; text-underline-offset: 2px; }
.nx-consent a:hover { color: var(--cyan); }

/* ============================================================
   FOOTER — quiet exhale. Override shared .footer after styles.css
   ============================================================ */
.nx .footer,
.nx-footer {
    background: var(--void-900);
    border-top: 1px solid var(--line);
    padding-block: 2.5rem;
}
.nx-footer__meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.nx-footer__meta a { color: var(--text-muted); text-decoration: none; transition: color var(--dur-base) var(--ease-out-expo); }
.nx-footer__meta a:hover { color: var(--cyan); }
.nx-footer__wordmark {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--text-bright);
}

/* ============================================================
   PAGE LOADER — restyle the shared #page-loader content into a
   single breathing point of cyan light (markup/IDs unchanged).
   The body opacity gate + .loaded handshake live in styles.css.
   ============================================================ */
.nx #page-loader { background: var(--void-950); }
.nx #page-loader > div { gap: 0 !important; }
.nx #page-loader .relative,            /* old spinner ring wrapper */
.nx #page-loader span { display: none !important; }
.nx #page-loader::after {
    content: "";
    width: 10px; height: 10px;
    border-radius: 999px;
    background: var(--cyan);
    box-shadow: 0 0 24px 4px var(--glow-cyan);
    animation: nx-breathe 1.6s var(--ease-in-out-soft) infinite;
}

/* ============================================================
   REVEAL PRIMITIVE — override shared scroll-animation classes
   (main.js toggles .is-visible). Everything resolves into focus.
   Hidden initial state is gated on .nx-js so no-JS users see all
   content; with JS the elements animate in on scroll.
   ============================================================ */
.nx-js .nx .fade-in-up,
.nx-js .nx .fade-in,
.nx-js .nx .nx-reveal,
.nx-js .nx .slide-in-left,
.nx-js .nx .slide-in-right,
.nx-js .nx .scale-in {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
    transition: opacity var(--dur-reveal) var(--ease-out-expo),
                transform var(--dur-reveal) var(--ease-out-expo),
                filter var(--dur-reveal) var(--ease-out-expo);
}
.nx .fade-in-up.is-visible,
.nx .fade-in.is-visible,
.nx .nx-reveal.is-visible,
.nx .slide-in-left.is-visible,
.nx .slide-in-right.is-visible,
.nx .scale-in.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
}
.nx .stagger-1 { transition-delay: 0.08s; }
.nx .stagger-2 { transition-delay: 0.16s; }
.nx .stagger-3 { transition-delay: 0.24s; }
.nx .stagger-4 { transition-delay: 0.32s; }
.nx .stagger-5 { transition-delay: 0.40s; }

/* ============================================================
   AMBIENT KEYFRAMES
   ============================================================ */
@keyframes nx-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.82); }
}
@keyframes nx-breathe {
    0%, 100% { transform: scale(0.7); opacity: 0.5; }
    50%      { transform: scale(1.15); opacity: 1; }
}
@keyframes nx-scrolldrop {
    0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
    40%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
    60%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ============================================================
   ERROR / LEGAL / SIMPLE PAGE helpers (thank-you, 404, 403, privacy)
   ============================================================ */
.nx-errcode {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(5rem, 18vw, 11rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.nx-legal { max-width: 55rem; margin-inline: auto; }
.nx-legal h1 { font-family: var(--font-display); font-weight: 400; color: var(--text-bright); font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.nx-legal h2 { font-family: var(--font-display); font-weight: 400; color: var(--text-bright); margin-top: 2.5rem; margin-bottom: 0.85rem; font-size: 1.4rem; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
.nx-legal p { color: var(--text-body); line-height: 1.75; margin-bottom: 1rem; }
.nx-legal ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.nx-legal li { color: var(--text-body); line-height: 1.7; margin-bottom: 0.5rem; }
.nx-legal li::marker { color: var(--cyan); }
.nx-legal strong { color: var(--cyan); font-weight: 600; }
.nx-legal a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.nx-legal a:hover { color: var(--text-bright); }

/* ============================================================
   PROJECTS / DOSSIER — override shared case-study classes.
   (Only loaded on in-scope pages → out-of-scope pdf-viewer.html,
   which reuses .case-study-article, is unaffected.)
   ============================================================ */
.nx .case-study-article {
    background: linear-gradient(160deg, var(--void-850), var(--void-900));
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: clamp(1.5rem, 4vw, 2.5rem);
}
.nx .case-study-article h2 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.015em;
    color: var(--text-bright);
}
.nx .section-marker {
    font-family: var(--font-mono);
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.72rem;
}
.nx .code-tag {
    font-family: var(--font-mono);
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}
.nx .tech-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--void-800);
    border: 1px solid var(--line);
    padding: 0.28rem 0.62rem;
    border-radius: var(--r-sm);
}
.nx .project-tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
    background: rgba(34, 232, 245, 0.08);
    border: 1px solid rgba(34, 232, 245, 0.16);
    padding: 0.3rem 0.65rem;
    border-radius: var(--r-pill);
}
.nx .stat-value {
    font-family: var(--font-display);
    font-weight: 400;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.nx .stat-label {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.4rem;
}
.nx .impact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

/* ============================================================
   REDUCED MOTION — belt + suspenders (JS guard in nexus.js too)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-canvas { display: none !important; }     /* always show static poster */
    [data-webgl="on"] #nexus-poster { opacity: 1 !important; }
    .nx-scrollcue__line,
    .nx-status__dot,
    .nx #page-loader::after { animation: none !important; }

    .nx .fade-in-up,
    .nx .fade-in,
    .nx .nx-reveal,
    .nx .slide-in-left,
    .nx .slide-in-right,
    .nx .scale-in,
    .nx-descent__line {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: opacity 160ms linear !important;
    }
    .nx-cta, .nx-card, .nav-link::after { transition: none !important; }
    .nx-cta { will-change: auto; }

    /* Revert the enhanced sticky descent to the safe static stack */
    .nx-js .nx-descent { height: auto !important; }
    .nx-js .nx-descent__viewport {
        position: static !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column;
        gap: 3rem;
        padding: clamp(4rem, 10vw, 7rem) 1.5rem;
    }
    .nx-js .nx-descent__line { grid-area: auto !important; }
    .nx-js .nx-descent__progress { display: none !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
    .nx-hero__inner { padding-top: 5rem; }
    .nx-descent__viewport { min-height: 100svh; }

    /* On-brand full-screen mobile menu (overrides styles.css overlay) */
    .nx #main-nav.is-active {
        background:
            radial-gradient(80% 55% at 50% 36%, rgba(34, 232, 245, 0.07), transparent 70%),
            var(--void-950) !important;
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
    .nx #main-nav.is-active ul { gap: 2.25rem !important; }
    .nx #main-nav.is-active ul li a {
        font-family: var(--font-display);
        font-size: 1.9rem;
        font-weight: 400;
        letter-spacing: -0.01em;
        text-transform: none;
        color: var(--text-bright);
    }
    .nx #main-nav.is-active ul li a.nav-cta {
        font-family: var(--font-body);
        font-size: 1rem;
        font-weight: 600;
        color: var(--cyan);
    }
    .nx #main-nav.is-active ul li a.nav-link:hover { color: var(--cyan); }
}
