/* ==========================================================================
   KROTAR — Hero Section
   Content sits directly on the hero background (WebGL shader + ambient
   glow orbs). No card/panel wrapper — a soft radial scrim behind the text
   provides contrast without ever reading as a boxed container.

   Timing: the ambient glow orbs are visible on the very first frame (no
   animation-delay) and their keyframe ranges start close to their "settled"
   look, not from a dim/weak state, so the very first paint already reads
   as the finished composition — the loop is a subtle variation on top of
   an already-strong frame, not a ramp-up. Content entrance settles in
   well under 1s.
   ========================================================================== */

.krotar-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.25rem 1.5rem 1.25rem;
    box-sizing: border-box;
    overflow: hidden;
    background: transparent;
    scroll-margin-top: 0;
}

/* Portada redesign: KROTAR + descriptor + the two area cards are one first-
   screen composition on desktop (no scroll needed to see all of it) — the
   stack distributes them vertically within the hero's own 100dvh instead of
   the cards living in a separate section below the fold. Tablet/mobile fall
   back to generous, non-cramped spacing further down (scroll is fine there,
   per spec — only desktop has the fits-in-one-viewport requirement). */
.krotar-hero-stack {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 2vh, 1.5rem);
}

/* Immediate Ambient Light & Depth Atmosphere Orbs — electric blue / cyan only */
.hero-light-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 1;
}

.hero-glow-center {
    top: 50%;
    left: 50%;
    width: 680px;
    height: 460px;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle, rgba(0, 102, 255, 0.4) 0%, rgba(0, 91, 255, 0.22) 38%, rgba(0, 174, 239, 0.1) 65%, transparent 100%);
    animation: heroGlowBreathing 9s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}

.hero-glow-top-right {
    top: 5%;
    right: 5%;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(10, 61, 255, 0.32) 0%, rgba(0, 174, 239, 0.16) 50%, transparent 78%);
    animation: heroGlowDrift 13s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}

.hero-glow-bottom-left {
    bottom: 2%;
    left: 2%;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.28) 0%, rgba(0, 102, 255, 0.14) 50%, transparent 78%);
    animation: heroGlowDrift 16s ease-in-out infinite alternate-reverse;
    mix-blend-mode: screen;
}

@keyframes heroGlowBreathing {
    0% {
        transform: translate(-50%, -55%) scale(1);
        opacity: 0.94;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 1;
    }
}

@keyframes heroGlowDrift {
    0% {
        transform: translate(0, 0) scale(1.04);
    }

    100% {
        transform: translate(20px, -18px) scale(1.12);
    }
}

.krotar-hero-container {
    position: relative;
    z-index: 2;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    perspective: 1400px;
}

/* ==========================================================================
   3D depth: KROTAR floats forward, the claim sits back and beneath it.
   --hero-tilt-x/-y are set by script.js on mousemove (desktop with a fine
   pointer only) and eased back to 0 on mouseleave; the transition below
   supplies the smooth return. Static translateZ still applies with no JS
   at all, so the depth read holds on touch devices and under
   prefers-reduced-motion — only the live tracking is skipped there.
   ========================================================================== */
.hero-3d-title-wrap {
    transform-style: preserve-3d;
    transform: translateZ(38px) rotateX(var(--hero-tilt-y, 0deg)) rotateY(var(--hero-tilt-x, 0deg));
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.hero-3d-claim-wrap {
    transform-style: preserve-3d;
    transform: translateZ(-16px) rotateX(calc(var(--hero-tilt-y, 0deg) * 0.4)) rotateY(calc(var(--hero-tilt-x, 0deg) * 0.4));
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* Soft radial dark falloff behind the text block — contrast without a box:
   no border, no fill edge, no radius, no shadow. Sized to the text, not
   the viewport, so it never reads as a panel. */
.hero-content-scrim {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 130%;
    height: 150%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse 55% 55% at 50% 50%, rgba(2, 3, 8, 0.55) 0%, rgba(2, 3, 8, 0.28) 45%, transparent 75%);
    z-index: -1;
    pointer-events: none;
}

/* Monolithic Brand Name — Space Grotesk display face (loaded once, used only
   here; the rest of the site stays on Manrope). Cool metallic gradient with
   an electric-blue rim light for depth, without tipping into neon/game UI. */
.krotar-hero-title {
    position: relative;
    font-family: 'Space Grotesk', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(4.55rem, 10vw, 8.65rem);
    font-weight: 700;
    line-height: 0.94;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0;
    padding-left: 0.06em;
    /* visually offsets tracking */

    /* Cool metallic surface — translucent, not a solid plate. Alpha < 1 on
       every stop is what lets the waves behind read faintly through the
       glyphs (smoked-glass / acrylic feel) instead of an opaque wordmark. */
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.94) 0%,
            rgba(234, 242, 255, 0.88) 32%,
            rgba(185, 203, 232, 0.78) 68%,
            rgba(124, 147, 184, 0.68) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    /* Thin stacked extrusion (a few small-offset dark layers) reads as a
       solid edge beneath the glyphs, not a flat cutout — kept subtle. */
    text-shadow:
        0 1px 0 rgba(4, 10, 24, 0.5),
        0 2px 0 rgba(4, 10, 24, 0.36),
        0 3px 1px rgba(4, 10, 24, 0.22);

    /* Depth shadow + contained electric-blue rim glow (front-edge definition) */
    filter:
        drop-shadow(0 22px 44px rgba(0, 0, 0, 0.9))
        drop-shadow(0 0 30px rgba(0, 145, 255, 0.2))
        drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
    user-select: none;

    animation: krotarTitleHeroEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Moving blue sheen — a second copy of the glyphs (via attr(), not a real
   DOM duplicate) clipped the same way, carrying only an animated diagonal
   light band blended with screen so it reads as a reflection sliding over
   the glass, never as a fixed tint. Outside the letter shapes it is fully
   transparent, so it can never wash the scene behind it. */
.krotar-hero-title::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    padding-left: 0.06em;
    background: linear-gradient(115deg,
            transparent 26%,
            rgba(0, 145, 255, 0.65) 45%,
            rgba(0, 217, 255, 0.82) 50%,
            rgba(0, 145, 255, 0.65) 55%,
            transparent 74%);
    background-size: 220% 220%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    mix-blend-mode: screen;
    pointer-events: none;
    animation: krotarSheenSweep 10s ease-in-out infinite;
}

@keyframes krotarSheenSweep {

    0%,
    100% {
        background-position: 0% 30%;
    }

    50% {
        background-position: 100% 70%;
    }
}

@keyframes krotarTitleHeroEntrance {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
        filter: blur(6px) drop-shadow(0 0 0 transparent);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter:
            blur(0px)
            drop-shadow(0 22px 44px rgba(0, 0, 0, 0.92))
            drop-shadow(0 0 30px rgba(0, 145, 255, 0.22))
            drop-shadow(0 0 2px rgba(255, 255, 255, 0.25));
    }
}

/* Descriptor — portada redesign: the entire hero message is KROTAR + this
   one line ("Crecimiento digital · Control operativo"); the two area cards
   right below carry the rest. Same glass/sheen material language as the
   title, scaled down, so it reads as part of the same surface. */
.hero-descriptor {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65em;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(1.05rem, 1.58vw, 1.3rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.9);
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 145, 255, 0.1);
    margin: 0;
    animation: krotarTaglineEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    opacity: 0;
}

.hero-descriptor span[data-text] {
    position: relative;
}

.hero-descriptor span[data-text]::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
            transparent 32%,
            rgba(0, 145, 255, 0.28) 47%,
            rgba(0, 217, 255, 0.36) 50%,
            rgba(0, 145, 255, 0.28) 53%,
            transparent 68%);
    background-size: 260% 260%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    mix-blend-mode: screen;
    pointer-events: none;
    animation: krotarSheenSweep 12s ease-in-out infinite;
}

.hero-descriptor span[data-text]:last-of-type::after {
    animation-delay: -6s;
}

.hero-descriptor-dot {
    width: 5px;
    height: 5px;
    flex: none;
    border-radius: 50%;
    background: var(--color-cyan);
    box-shadow: 0 0 10px rgba(0, 174, 239, 0.7);
}

@keyframes krotarTaglineEntrance {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet/mobile: the fits-in-one-viewport requirement is desktop-only —
   here KROTAR and the descriptor go back to a more generous, standalone
   hero read, and the area cards (in .krotar-hero-stack, see sections.css)
   are free to take the height they need below the fold. */
@media (max-width: 1023px) {
    .krotar-hero {
        min-height: 0;
        padding: 6.5rem 1.5rem 3rem;
    }

    .krotar-hero-title {
        font-size: clamp(2.75rem, 9.5vw, 6.5rem);
        margin-bottom: 1.2rem;
    }

    .hero-descriptor {
        font-size: clamp(1rem, 2.6vw, 1.2rem);
        margin-bottom: 0.5rem;
    }

    .krotar-hero-stack {
        gap: clamp(2.5rem, 6vw, 3.5rem);
    }
}

@media (max-width: 560px) {
    .krotar-hero {
        padding: 6rem 1.25rem 3rem;
    }

    .hero-descriptor {
        font-size: 0.92rem;
        gap: 0.5em;
        white-space: normal;
    }

    /* Lighter reflection on small screens: no cursor tracking exists here
       anyway (script.js gates that to hover:hover + pointer:fine), so this
       only trims the animated sheen's own intensity for a calmer, cheaper
       static-feeling depth read while keeping legibility maximal. */
    .krotar-hero-title::after {
        opacity: 0.7;
        animation-duration: 13s;
    }

    .hero-descriptor span[data-text]::after {
        opacity: 0.6;
    }
}
