@import url('typography.css');
@import url('sections.css');

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

:root {
    --primary: #3A2A5E;
    --accent: #F0E7D8;
    --surface-dark: #0A0A0F;
    --surface-mid: #12131A;
    --text-primary: #F5F0E8;
    --text-secondary: #D4CFC7; /* original secondary */
    --text-tertiary: #B0ABA3; /* original tertiary */
    --glow: rgba(240, 231, 216, 0.15); /* original glow */
    --neural: #FF9B9B; /* Warm coral */
    --neural-200: #FFC3C3;
    --neural-300: #FFAAAA;
    --neural-700: #E06F6F;
    --digital: #00D9FF; /* Cyan */
    --digital-200: #7FEFFF;
    --digital-300: #3BE3FF;
    --digital-700: #00A6C4;
    /* Neutral ramp */
    --ink-900: #0A0A0F;
    --ink-800: #0F1016;
    --ink-700: #171822;
    --ink-600: #232533;
    --ink-500: #2D3040;
    /* Align loader accents to brand accents */
    --dna-1: var(--digital);
    --dna-2: var(--neural);
    /* Transitions */
    --transition-speed: 320ms;
}

body {
    font-family: var(--font-body, 'Elegant Lux Pro'), -apple-system, sans-serif;
    background: var(--ink-900);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Custom Cursor */
.cursor {
    width: 24px;
    height: 24px;
    position: fixed;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--accent);
    border-radius: 50%;
    animation: cursorPulse 2s infinite;
}

@keyframes cursorPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

/* Three.js Canvas */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* HUD Display */
.hud {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 50;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.5;
    pointer-events: none;
}

.hud-item {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    gap: 3rem;
}

.hud-label {
    color: var(--text-secondary);
}

.hud-value {
    color: var(--accent);
    font-family: monospace;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface-dark);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
}

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

.loader-helix {
    width: 60px;
    height: 100px;
    position: relative;
    margin-bottom: 2rem;
}

.helix-strand {
    position: absolute;
    width: 100%;
    height: 100%;
}

.helix-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: helixRotate 2s linear infinite;
}

.helix-dot:nth-child(odd) {
    background: var(--dna-1);
}

.helix-dot:nth-child(even) {
    background: var(--dna-2);
}

@keyframes helixRotate {
    0% { transform: rotateY(0deg) translateZ(20px); }
    100% { transform: rotateY(360deg) translateZ(20px); }
}

.loader-text {
    font-size: 0.75rem;
    font-weight: 200;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Content */
.content-layer {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* Page Transition Overlay */
.page-transition {
    position: fixed;
    inset: 0;
    z-index: 12000;
    pointer-events: none;
    display: grid;
    place-items: center;
    background: radial-gradient(ellipse at center, rgba(10,10,15,0.85) 0%, rgba(10,10,15,0.92) 40%, rgba(10,10,15,0.98) 100%);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}
.page-transition.active { opacity: 1; pointer-events: auto; }

.page-transition .pt-mark {
    width: 48px;
    height: 48px;
    position: relative;
}
.page-transition .pt-dot {
    position: absolute;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 24px var(--glow);
    animation: orbit var(--transition-speed) linear infinite;
}
.page-transition .pt-dot:nth-child(1){ top:0; left:50%; transform-origin: -14px 14px; }
.page-transition .pt-dot:nth-child(2){ top:50%; left:0; transform-origin: 14px -14px; animation-delay: calc(var(--transition-speed)/-3); }
.page-transition .pt-dot:nth-child(3){ bottom:0; right:50%; transform-origin: 14px 14px; animation-delay: calc(var(--transition-speed)/-1.5); }

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

.content-layer > * {
    pointer-events: auto;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 5vw;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: linear-gradient(to bottom, rgba(10, 10, 15, 0.8), transparent);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1rem;
    font-weight: 100;
    letter-spacing: 0.2em;
    color: var(--accent);
    text-shadow: 0 0 12px var(--glow); /* reduce glow */
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem; /* increase legibility */
    font-weight: 400;
    letter-spacing: 0.08em; /* slightly less wide */
    text-transform: uppercase;
    padding: 0.4rem 0.25rem; /* breathing room */
    transition: all 0.3s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Nav CTA button */
.nav-cta .quote-button {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    background: rgba(240, 231, 216, 0.08);
    border: 1px solid rgba(240, 231, 216, 0.25);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    color: var(--accent);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 650;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    border-radius: var(--space-2);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-cta .quote-button:hover {
    transform: translateY(-1px);
    background: rgba(240, 231, 216, 0.12);
    border-color: rgba(240, 231, 216, 0.35);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5vw;
    position: relative;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
    position: relative; /* for mask */
}

.hero-title {
    /* Typography controlled by .display-hero to avoid collisions */
    margin-bottom: 2rem;
}

.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 1s forwards;
}

.hero-title .line:nth-child(1) { animation-delay: 0.5s; }
.hero-title .line:nth-child(2) { animation-delay: 0.6s; }
.hero-title .line:nth-child(3) { animation-delay: 0.7s; }

.accent-neural {
    color: var(--neural);
    font-weight: 700;
}

.accent-digital {
    color: var(--digital);
    font-weight: 700;
}

.hero-description {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 60ch;
    margin: 0 auto 3rem;
    opacity: 0;
    animation: fadeUp 1s 0.8s forwards;
}


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

/* Hero legibility mask: subtle gradient behind type */
.hero-content::before {
    content: '';
    position: absolute;
    inset: -10vh 0 auto 0;
    height: clamp(240px, 40vh, 520px);
    margin: 0 auto;
    left: 0; right: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(10,10,15,0.75) 0%, rgba(10,10,15,0.55) 35%, rgba(10,10,15,0.0) 70%);
    filter: blur(8px);
}

/* Info Labels */
.entity-label {
    position: fixed;
    font-size: 0.625rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.5;
    z-index: 10;
}

.entity-label.left {
    bottom: 3rem;
    left: 5vw;
    color: var(--digital);
}

.entity-label.right {
    bottom: 3rem;
    right: 5vw;
    color: var(--neural);
}

/* Mobile */
@media (max-width: 768px) {
    .cursor { display: none; }
    .hero-title { font-size: clamp(2.5rem, 12vw, 5rem); }
    .hud { display: none; }
}

/* Custom cursor opt-in for desktop only */
.has-custom-cursor * { cursor: none; }
