:root {
    --hero-bg-inner: #1a1a1a;
    --hero-bg-outer: #000000;
    --hero-text: #ffffff;
    --hero-title-size: clamp(24px, 4.2vw, 76px);
    --hero-sub-size: clamp(12px, 1.18vw, 19px);
    --hero-content-width: clamp(300px, 68vw, 1100px);
    --hero-padding-y: clamp(100px, 12.5vw, 200px);
    --hero-brand-gap: clamp(14px, 1.9vw, 32px);
}

/* Remove white page background that clashes with dark hero */
.page-bg {
    display: none !important;
}

/* Scoped styles for the Hero Section */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    /* Allow growing if content is tall */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    /* Deep radial gradient */
    background: radial-gradient(circle at center, #222222 0%, #000000 100%) !important;
    color: var(--hero-text) !important;
    padding: var(--hero-padding-y) clamp(16px, 4vw, 48px) !important;
    /* Add padding for header clearing */
}

/* Ensure the canvas sits correctly */
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

.hero-canvas.fade-in {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: var(--hero-content-width);
    padding: 0;
    pointer-events: none;
    margin-top: 0;
}

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

/* Typography */
.hero-title {
    /* Fluid typography: minimum 2rem, preferred 5vw, max 3.5rem */
    font-size: var(--hero-title-size);
    font-weight: 700;
    line-height: 1.1;
    /* Tighter line height for mobile */
    margin: 0 auto clamp(16px, 2.4vh, 28px);
    max-width: 22ch;
    text-wrap: balance;
    background: linear-gradient(180deg, #FFFFFF 0%, #AAAAAA 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #ffffff;
}

.hero-sub {
    font-size: var(--hero-sub-size);
    color: #bbbbbb !important;
    margin: 0 auto clamp(18px, 2.8vh, 32px);
    line-height: 1.5;
    max-width: 60ch;
    text-wrap: balance;
    /* Prevent edge touching */
}

.hero-brand {
    color: white !important;
    margin-bottom: var(--hero-brand-gap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hero-brand-text {
    position: relative;
    display: inline-block;
    /* Required for background-clip to work robustly */
}

/* Run animation only when active/intro */
.hero-brand-text.spark-active {
    animation: lightning-flicker 2s linear forwards;
}

@keyframes lightning-flicker {

    0%,
    19%,
    21%,
    23%,
    25%,
    54%,
    56%,
    100% {
        text-shadow:
            0 0 4px rgba(255, 255, 255, 0),
            0 0 10px rgba(255, 255, 255, 0);
        color: #ffffff;
        transform: scale(1);
        background: none;
        -webkit-text-fill-color: white;
    }

    20%,
    24%,
    55% {
        /* "Right Angle Triangle" Effect: Hard Diagonal Split */
        background: linear-gradient(135deg,
                #1a73e8 50%,
                #e9428b 50%);
        -webkit-background-clip: text !important;
        background-clip: text !important;

        /* FORCE override of parent 'white !important' */
        -webkit-text-fill-color: transparent !important;
        color: transparent !important;

        /* Glow matching the split */
        text-shadow:
            -2px -2px 10px rgba(26, 115, 232, 0.5),
            2px 2px 10px rgba(233, 66, 139, 0.5);

        transform: scale(1.05);
    }
}

.hero-actions {
    display: flex;
    gap: clamp(10px, 2vw, 16px);
    /* Smaller gap on mobile */
    justify-content: center;
    flex-wrap: wrap;
    /* Allow wrapping on very small screens */
}

/* Override to maintain consistent layout */
@media (max-width: 600px) {
    .hero {
        padding: clamp(100px, 12.5vw, 200px) clamp(20px, 2.8vw, 48px) clamp(80px, 11vw, 180px) !important;
    }

    .hero-title {
        line-height: 1.08 !important;
        max-width: none !important;
    }
}

/* Buttons - fluid scaling */
.hero .btn {
    display: inline-block;
    padding: clamp(8px, 0.7vw, 14px) clamp(14px, 1.4vw, 24px);
    border-radius: clamp(3px, 0.28vw, 5px);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: clamp(11px, 0.97vw, 16px);
}

.hero .btn.primary {
    background-color: #ffffff;
    color: #000000;
    border: none;
}

.hero .btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.hero .btn.secondary {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero .btn.secondary:hover {
    border-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* HEADER OVERRIDES for Dark Theme Compatibility */
/* HEADER OVERRIDES for Dark Theme Compatibility */
.nav {
    position: absolute !important;
    /* Scroll WITH page */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;

    background: transparent !important;
    /* No color, let hero show through */
    border-bottom: none !important;
    /* No line */
    backdrop-filter: none !important;
    /* No blur, just pure transparency */

    transform: none !important;
    /* Prevent sticky transforms */
    z-index: 100 !important;
    /* Ensure it starts on top */
}

/* ... existing nav text styles ... */

.hero-brand-text {
    position: relative;
    display: inline-block;

    /* Prepare the gradient (Hidden by default via color: white) */
    background: linear-gradient(135deg,
            #1a73e8 50%,
            #e9428b 50%);
    -webkit-background-clip: text;
    background-clip: text;
    background-size: 100% 100%;

    color: white;
    /* Default state */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0);
}

/* Run animation only when active/intro */
.hero-brand-text.spark-active {
    animation: lightning-reveal 0.15s infinite alternate;
    /* Fast flicker */
}

@keyframes lightning-reveal {
    0% {
        color: white;
        text-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
        transform: scale(1);
    }

    100% {
        color: transparent;
        /* Reveal the gradient background */
        text-shadow:
            -1px -1px 15px rgba(26, 115, 232, 0.8),
            1px 1px 15px rgba(233, 66, 139, 0.8);
        transform: scale(1.04) skewX(-2deg);
    }
}

.brand-name {
    color: #ffffff !important;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.7) !important;
}

.nav-links a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.nav-toggle span {
    background: #ffffff !important;
}

/* Override to maintain consistent layout - use fluid scaling */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(24px, 4.2vw, 76px) !important;
    }
}

/* ========== SLIDING STAR ANIMATION ========== */

.hero-brand-wrapper {
    position: relative;
    overflow: visible !important;
}

.hero-brand-text {
    overflow: visible !important;
}

/* The dotless i character styling */
.dotless-i {
    position: relative;
    display: inline-block;
    font-style: normal;
    overflow: visible !important;
}

/* Star on top of i - THE FINAL STAR THAT STAYS */
.star-dot {
    position: absolute;
    top: clamp(-8px, -0.83vw, -14px);
    left: 50%;
    transform: translateX(-50%);
    width: clamp(12px, 1.25vw, 22px);
    height: clamp(12px, 1.25vw, 22px);
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    overflow: visible !important;
}

.star-dot::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f59e0b 100%);
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 
        50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%
    );
    filter: drop-shadow(0 0 4px rgba(236, 72, 153, 1)) drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

/* The sliding star that moves along the arrow */
.sliding-star {
    position: absolute;
    /* Position on the arrow - adjusted to match arrow spacing */
    bottom: clamp(-4px, -0.35vw, -6px);
    /* Start at middle of 'S' where arrow begins */
    left: 6%;
    width: clamp(12px, 1.25vw, 22px);
    height: clamp(12px, 1.25vw, 22px);
    opacity: 0;
    z-index: 50;
    pointer-events: none;
}

.sliding-star::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f59e0b 100%);
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 
        50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%
    );
    filter: drop-shadow(0 0 6px rgba(236, 72, 153, 1)) 
            drop-shadow(0 0 10px rgba(99, 102, 241, 0.8));
}

/* Animation trigger */
.hero-brand.animate-star .sliding-star {
    animation: fastSlide 0.8s ease-out forwards;
}

.hero-brand.animate-star .star-dot {
    animation: jumpToI 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards;
}

/* SINGLE FAST PUSH from S to I along the arrow */
@keyframes fastSlide {
    0% {
        left: 6%;
        bottom: -4px;
        opacity: 1;
    }
    40% {
        left: 50%;
        bottom: -12px;
        opacity: 1;
    }
    70% {
        left: 84%;
        bottom: -4px;
        opacity: 1;
    }
    85% {
        left: 92%;
        bottom: 18px;
        opacity: 1;
    }
    100% {
        left: 94%;
        bottom: 58px;
        opacity: 0;
    }
}

/* Star jumps and lands on the i - STAYS VISIBLE */
@keyframes jumpToI {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(2) translateY(20px);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(0.8) translateY(-5px);
    }
    75% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2) translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

/* KEEP STAR VISIBLE PERMANENTLY after animation with ROTATE */
.hero-brand.star-landed .star-dot {
    opacity: 1 !important;
    transform: translateX(-50%) scale(1) !important;
}

.hero-brand.star-landed .star-dot::before {
    animation: rotateStar 3s linear infinite !important;
}

/* Continuous rotation animation for the landed star */
@keyframes rotateStar {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Ensure animation keeps final state */
.hero-brand.animate-star .star-dot {
    animation-fill-mode: forwards !important;
}