/* ============================================
   NORTHSTAR — Styles
   ============================================ */

:root {
    --bg: #0e1117;
    --bg-elevated: #141a24;
    --bg-card: #1a2030;
    --bg-card-hover: #212838;
    --border: #252d3f;
    --border-light: #333d52;
    --primary: #7c6fca;
    --primary-bright: #9d92e8;
    --primary-dim: #4a3f8a;
    --primary-glow: rgba(124, 111, 202, 0.18);
    --accent: #a78bfa;
    --text: #f0f1f5;
    --text-secondary: #a0a8bc;
    --text-dim: #6b748a;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(124, 111, 202, 0.06) 0%, transparent 60%);
    background-attachment: fixed;
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 2rem;
    transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition);
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background: rgba(14, 17, 23, 0.88);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom-color: var(--border);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.nav-logo-img {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

.nav-logo-text {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color var(--transition);
}

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

.nav-cta {
    background: var(--primary);
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 500 !important;
    transition: background var(--transition), transform var(--transition) !important;
}

.nav-cta:hover {
    background: var(--primary-bright) !important;
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow), 0 4px 12px rgba(0,0,0,0.3);
}

.btn-primary:hover {
    background: var(--primary-bright);
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--primary-glow), 0 8px 24px rgba(0,0,0,0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-dim);
    background: rgba(255,255,255,0.03);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    border-radius: 12px;
}

/* ============================================
   HERO SECTION
   ============================================ */

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

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(124, 111, 202, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(100, 140, 200, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at center, transparent 0%, var(--bg) 75%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 720px;
    padding: 0 2rem;
}

.hero-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, var(--primary-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-dim), transparent);
    animation: scrollPulse 2s infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

/* ============================================
   SECTIONS (shared)
   ============================================ */

.section {
    padding: 8rem 2rem;
    position: relative;
}

.section-dark {
    background: var(--bg-elevated);
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary-bright);
    margin-bottom: 1.25rem;
    position: relative;
    padding-left: 1.5rem;
}

.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 640px;
    margin-bottom: 3.5rem;
}

/* ============================================
   FEATURES GRID (About)
   ============================================ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 20px var(--primary-glow);
}

.feature-accent {
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ============================================
   VIDEO SHOWCASE
   ============================================ */

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.video-grid .video-item-featured .video-frame {
    aspect-ratio: 16 / 9;
}

.video-grid .video-item:not(.video-item-featured) {
    display: inline;
}

.video-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@supports (grid-template-columns: 1fr) {
    .video-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .video-item-featured {
        grid-column: 1 / -1;
    }
}

.video-frame {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #0a0e14;
    box-shadow: 0 16px 60px rgba(0,0,0,0.3), 0 0 30px var(--primary-glow);
    aspect-ratio: 16 / 9;
}

.showcase-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-caption {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.video-dot-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--primary-glow); }
    50% { opacity: 0.5; box-shadow: 0 0 16px var(--primary-glow); }
}

/* ============================================
   ENVIRONMENTS — MARQUEE
   ============================================ */

.env-section {
    padding: 6rem 0 5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    overflow: hidden;
}

.env-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3.5rem;
    padding: 0 2rem;
}

.env-header .section-desc {
    margin-bottom: 0;
}

.marquee-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.marquee {
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    will-change: transform;
}

.marquee-left .marquee-track {
    animation: marqueeLeft 35s linear infinite;
}

.marquee-right .marquee-track {
    animation: marqueeRight 40s linear infinite;
}

@keyframes marqueeLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marqueeRight {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.marquee-tag {
    flex-shrink: 0;
    padding: 0.6rem 1.5rem;
    border-radius: 100px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 450;
    white-space: nowrap;
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.marquee-tag:hover {
    border-color: var(--primary);
    color: var(--text);
    background: var(--primary-glow);
}

@media (max-width: 768px) {
    .env-section {
        padding: 4rem 0 3.5rem;
    }

    .env-header {
        margin-bottom: 2.5rem;
    }

    .marquee-tag {
        padding: 0.5rem 1.1rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta-section {
    padding: 6rem 2rem 8rem;
}

.cta-box {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 4rem 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124, 111, 202, 0.05) 100%);
    box-shadow: 0 0 60px var(--primary-glow);
}

.cta-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.cta-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.cta-email {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.cta-email a {
    color: var(--primary-bright);
    text-decoration: none;
    transition: color var(--transition);
}

.cta-email a:hover {
    color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
}

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

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-img {
    height: 20px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.5;
}

.footer-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .env-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(14, 17, 23, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        gap: 1.5rem;
        transition: right var(--transition);
        border-left: 1px solid var(--border);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        font-size: 1.1rem;
    }

    .nav-cta {
        margin-top: 1rem;
        text-align: center;
        width: 100%;
        justify-content: center;
    }

    .section {
        padding: 5rem 1.5rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .env-grid {
        grid-template-columns: 1fr;
    }

    .cta-box {
        padding: 2.5rem 1.5rem;
    }

    .video-grid {
        grid-template-columns: 1fr !important;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.75rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
        letter-spacing: 0.08em;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* ============================================
   NOISE TEXTURE OVERLAY
   ============================================ */

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
}
