 :root {
    --brand: #ff7b00;
    --primary-orange: #ff7b00;
    --gradient: linear-gradient(135deg, #ff9100 0%, #ff5e00 100%);

    /* Dark Theme */
    --bg-color: #050505;
    --bg-primary: #050505;
    --bg-secondary: #111116;
    --intro-bg: #0a0805;
    --nav-bg: rgba(10, 8, 12, 0.94);
    --text-main: #ffffff;
    --text-primary: #ffffff;
    --text-muted: #888888;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.07);

    /* ── Hero Canvas Animation – Dark Mode ── */
    --hbg-grid:        rgba(255, 123, 0, 0.06);
    --hbg-path:        rgba(255, 123, 0, 0.18);
    --hbg-pulse:       rgba(255, 160, 50, 0.90);
    --hbg-pulse-trail: rgba(255, 123, 0, 0.45);
    --hbg-node:        rgba(255, 140, 30, 0.60);
    --hbg-cloud:       rgba(255, 255, 255, 0.18);
    --hbg-glyph:       rgba(255, 123, 0, 0.07);
}

[data-theme="light"] {
    --brand: #ff7b00;
    --primary-orange: #ff7b00;
    --bg-color: #f5f5f7;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --intro-bg: #fffaf5;
    --nav-bg: rgba(255, 255, 255, 0.94);
    --text-main: #1d1d1f;
    --text-primary: #1d1d1f;
    --text-muted: #6e6e73;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(0, 0, 0, 0.03);
    --card-border: rgba(0, 0, 0, 0.08);

    /* ── Hero Canvas Animation – Light Mode ── */
    --hbg-grid:        rgba(200, 100, 0, 0.05);
    --hbg-path:        rgba(220, 100, 0, 0.12);
    --hbg-pulse:       rgba(255, 110, 0, 0.75);
    --hbg-pulse-trail: rgba(255, 110, 0, 0.30);
    --hbg-node:        rgba(220, 100, 0, 0.40);
    --hbg-cloud:       rgba(0, 0, 0, 0.12);
    --hbg-glyph:       rgba(180, 80, 0, 0.06);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
    transition: background-color 0.4s ease, color 0.4s ease; 
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* --- THEME TOGGLE BUTTON --- */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    cursor: pointer;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    font-size: 1.2rem;
}

/* --- INTRO OVERLAY --- */
#intro-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: var(--intro-bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out;
}

/* Flying logo during intro animation */
.moving-logo {
    width: min(340px, 75vw);
    height: min(340px, 75vw);
    background-image: url("../images/bk.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 24px;
    display: flex; 
    justify-content: center; 
    align-items: center;
    box-shadow: 0 0 40px rgba(255, 123, 0, 0.3);
    z-index: 10002;  /* above thunder canvas (10001) and intro-overlay (9999) */
    position: fixed;
    will-change: left, top, width, height, border-radius, transform;
}

/* Keyframe: gentle glow pulse during thunder phase */
@keyframes bk-thunder-pulse {
    from {
        box-shadow:
            0 0 40px rgba(255, 123, 0, 0.35),
            0 0 80px rgba(255, 100, 0, 0.15);
    }
    to {
        box-shadow:
            0 0 70px rgba(255, 160, 0, 0.70),
            0 0 130px rgba(255, 100, 0, 0.35),
            0 0 200px rgba(255, 60, 0, 0.12);
    }
}

/* Permanently docked logo inside navbar */
.moving-logo.docked {
    position: absolute !important;
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    z-index: 1 !important;
    will-change: auto !important;
}

/* --- HEADER & NAV --- */
header {
    position: fixed;
    top: 0; 
    width: 100%;
    padding: 18px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--card-border);
    transition: padding 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-shrink: 1;
}

/* Anchor box where the logo lives in navbar */
.logo-placeholder {
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-weight: 800;
    font-size: clamp(0.95rem, 3.8vw, 1.25rem);
    opacity: 0;
    transform: translateX(-10px);
    transition: 0.8s ease-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-name.visible { 
    opacity: 1; 
    transform: translateX(0); 
}

/* --- DESKTOP NAV LINKS --- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    opacity: 0;
    transition: opacity 1s ease;
}
.nav-links.show { 
    opacity: 1; 
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}
.nav-links a:hover { 
    color: var(--text-main); 
}
.nav-links a.active {
    color: var(--primary-orange);
    font-weight: 600;
}

/* Portal Button in Desktop Nav */
.nav-links .btn-portal {
    padding: 8px 20px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--primary-orange);
    color: var(--primary-orange) !important;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}
.nav-links .btn-portal:hover {
    background: var(--gradient);
    color: white !important;
    box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
    border-color: transparent;
}

/* --- HAMBURGER BUTTON --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    cursor: pointer;
    z-index: 1100;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.4s ease, border-color 0.2s, background-color 0.2s;
}
.hamburger.show { 
    opacity: 1; 
}
.hamburger:hover { 
    border-color: var(--primary-orange); 
    background: rgba(255, 123, 0, 0.08);
}

.hamburger span,
.hamburger div {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.25s ease, 
                background-color 0.2s ease;
    pointer-events: none;
}

/* Animate to × when open */
.hamburger.open span:nth-child(1),
.hamburger.open div:nth-child(1) { 
    transform: translateY(7px) rotate(45deg); 
}
.hamburger.open span:nth-child(2),
.hamburger.open div:nth-child(2) { 
    opacity: 0; 
    transform: scaleX(0); 
}
.hamburger.open span:nth-child(3),
.hamburger.open div:nth-child(3) { 
    transform: translateY(-7px) rotate(-45deg); 
}

/* --- MOBILE SLIDE-DOWN MENU --- */
.mobile-menu {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--card-border);
    padding: 85px 6% 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.mobile-menu.open {
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 15px 0;
    border-bottom: 1px solid var(--card-border);
    transition: color 0.2s, padding-left 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-menu a:hover {
    color: var(--primary-orange);
    padding-left: 6px;
}
.mobile-menu a.active {
    color: var(--primary-orange);
    font-weight: 700;
}
.mobile-menu a:last-child { 
    border-bottom: none; 
    margin-top: 10px;
    padding: 14px 20px;
    background: var(--gradient);
    color: white !important;
    border-radius: 12px;
    justify-content: center;
    font-weight: 600;
    text-align: center;
}
.mobile-menu a:last-child:hover {
    padding-left: 20px;
    box-shadow: 0 8px 20px rgba(255, 123, 0, 0.3);
}

/* --- MAIN CONTENT --- */
#main-content { 
    opacity: 0; 
    transition: 1.5s ease; 
}
#main-content.visible { 
    opacity: 1; 
}

.hero {
    position: relative;         /* stacking context for canvas */
    height: 100vh;
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center;
    background: radial-gradient(circle at center, rgba(255, 123, 0, 0.08) 0%, transparent 70%);
    padding: 0 20px;
    overflow: hidden;
}

/* ── Hero animated background canvas ── */
#hero-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    /* Soft vignette: edges fade out so animation never hard-cuts */
    -webkit-mask-image:
        radial-gradient(ellipse 85% 80% at 50% 50%, black 30%, transparent 100%);
    mask-image:
        radial-gradient(ellipse 85% 80% at 50% 50%, black 30%, transparent 100%);
}

/* Keep hero text + button above the canvas */
.hero h1,
.hero p,
.hero .hero-subtext,
.hero .btn,
.hero .hero-eyebrow-badge { 
    position: relative; 
    z-index: 1; 
}

.hero-eyebrow-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    margin-bottom: 22px;
    border-radius: 999px;
    background: rgba(255, 123, 0, 0.08);
    border: 1px solid rgba(255, 123, 0, 0.28);
    color: var(--primary-orange);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(255, 123, 0, 0.12);
}

.hero-eyebrow-badge .badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-orange);
    box-shadow: 0 0 8px var(--primary-orange);
    display: inline-block;
}

.hero h1 { 
    font-size: clamp(2.4rem, 5.5vw, 4.4rem); 
    line-height: 1.15; 
    margin-bottom: 22px; 
    max-width: 950px;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero .hero-subtext {
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 680px;
    font-size: 1.15rem;
    line-height: 1.7;
}

.btn {
    padding: 16px 40px;
    border-radius: 100px;
    text-decoration: none;
    background: var(--gradient);
    color: white;
    font-weight: 600;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* Tablet & Mobile: switch to mobile menu */
@media (max-width: 880px) {
    .nav-links { display: none !important; }
    .hamburger { display: flex; }
    header { padding: 15px 5%; }
}

@media (max-width: 480px) {
    header { padding: 12px 4%; }
    .logo-placeholder { width: 36px; height: 36px; }
    .brand-container { gap: 10px; }
    .hamburger { width: 38px; height: 38px; }
}