/**
 * Hero Block — matches ALKEMIA-Genesis reference
 *
 * @package AloraAlkemia
 */

/* ── Section ────────────────────────────────────────────────────────────── */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: 88px;  /* fixed header height */
    padding-bottom: 1.5rem;

    /* Dark section atmosphere — matches section-dark from reference */
    background-color: oklch(0.13 0.04 260);
    background-image:
        radial-gradient(1200px 700px at 80% 10%, color-mix(in oklab, var(--color-red) 18%, transparent), transparent 55%),
        radial-gradient(900px 600px at 0% 90%, color-mix(in oklab, #092D4D 30%, transparent), transparent 60%),
        radial-gradient(1400px 900px at 50% -20%, oklch(0.28 0.07 258) 0%, transparent 55%),
        linear-gradient(180deg, oklch(0.14 0.045 260) 0%, oklch(0.11 0.04 260) 50%, oklch(0.16 0.05 260) 100%);
}

/* ── Atmosphere decorations ─────────────────────────────────────────────── */
.hero-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.hero-atmosphere .grid-pattern {
    position: absolute;
    inset: 0;
    color: white;
    opacity: 0.08;
    background-image:
        linear-gradient(to right, color-mix(in oklab, currentColor 10%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in oklab, currentColor 10%, transparent) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 40%, transparent 100%);
}

.hero-orb-1 {
    position: absolute;
    top: -12rem;
    right: -10rem;
    width: 44rem;
    height: 44rem;
    border-radius: 9999px;
    background: radial-gradient(circle, color-mix(in oklab, var(--color-red) 55%, transparent), transparent 70%);
    filter: blur(80px);
    opacity: 0.55;
    animation: heroPulse 6s ease-in-out infinite;
}

.hero-orb-2 {
    position: absolute;
    bottom: -14rem;
    left: -10rem;
    width: 46rem;
    height: 46rem;
    border-radius: 9999px;
    background: radial-gradient(circle, color-mix(in oklab, #092D4D 80%, transparent), transparent 70%);
    filter: blur(80px);
    opacity: 0.55;
}

.hero-horizon-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--color-red) 30%, transparent), transparent);
}

.grain-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

@keyframes heroPulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.04); }
}

/* ── Background image (optional) ────────────────────────────────────────── */
.hero-bg-image-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 12, 21, var(--hero-overlay-opacity, 0.7));
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.hero-section .container {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-top: 0;
    padding-bottom: 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 48px;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.hero-section--left .hero-content  { align-items: flex-start; margin: 0; }
.hero-section--right .hero-content { align-items: flex-end; margin: 0 0 0 auto; }

/* Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.hero-badge-bar {
    display: block;
    width: 3px;
    height: 16px;
    background: var(--color-red);
    flex-shrink: 0;
}

.hero-badge-text {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--color-red);
    line-height: 1;
}

/* Title */
.hero-title {
    font-family: var(--font-display, 'Montserrat', sans-serif);
    font-size: clamp(2.5rem, 5vw, 4.25rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-white);
    margin: 0 0 1.25rem;
}

.hero-title .text-vermilion {
    color: var(--color-red);
}

/* Description */
.hero-description {
    font-size: var(--text-lg);
    line-height: 1.625;
    color: rgba(255, 255, 255, 0.7);
    max-width: 576px;
    margin: 0 0 1.75rem;
}

/* CTA row */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.btn--hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-red);
    color: #fff;
    padding: 14px 28px;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: 2px;
    border: none;
    text-decoration: none;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
    cursor: pointer;
}

.btn--hero:hover {
    box-shadow:
        0 0 0 1px color-mix(in oklab, var(--color-red) 40%, transparent),
        0 12px 40px -12px color-mix(in oklab, var(--color-red) 60%, transparent);
    transform: translateY(-1px);
}

.btn--hero-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text-white);
    padding: 14px 28px;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.btn--hero-outline:hover {
    border-color: var(--color-red);
    color: var(--color-red);
}

/* ── Stats column ────────────────────────────────────────────────────────── */
.hero-stats-col {
    position: relative;
}

/* Sigil — decorative SVG behind the stats box */
.hero-sigil {
    position: absolute;
    inset: -1rem;
    z-index: -1;
    opacity: 0.4;
    overflow: hidden;
    color: rgba(255,255,255,.6);
}

.hero-sigil .grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, color-mix(in oklab, currentColor 10%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in oklab, currentColor 10%, transparent) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 40%, transparent 100%);
}

.hero-sigil-svg {
    width: 100%;
    height: 100%;
    color: rgba(255,255,255,.6);
}

/* Stats box — surface-glass */
.hero-stats-box {
    position: relative;
    z-index: 1;
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;           /* gap-px: 1px lines between cells */
    overflow: hidden;
    border-radius: 10px;
    background: color-mix(in oklab, white 8%, transparent); /* the 1px gaps show this */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid color-mix(in oklab, white 8%, transparent);
    box-shadow:
        inset 0 1px 0 color-mix(in oklab, white 8%, transparent),
        0 30px 60px -30px rgba(0,0,0,.6);
}

/* Each stat cell */
.hero-stat-item {
    background: rgba(0, 28, 89, 0.6); /* bg-navy/60 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 28px;
}

.hero-stat-number {
    font-family: var(--font-display, 'Montserrat', sans-serif);
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    font-weight: 500;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
    display: block;
}

.hero-stat-label {
    display: block;
    margin-top: 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

/* Red hairline — below label, per reference */
.hero-stat-line {
    margin-top: 16px;
    height: 1px;
    width: 32px;
    background: var(--color-red);
}

/* ── Entry animations (CSS, no IO dependency) ───────────────────────────── */
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-animate {
    animation: heroFadeIn 0.7s ease-out both;
}

.hero-animate--delay {
    animation-delay: 0.2s;
    animation-duration: 1s;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .hero-stat-item {
        padding: 20px;
    }
}

@media (max-width: 767px) {
    .hero-section {
        min-height: 100svh;
        padding-top: 96px;  /* mobile header: 10px + 72px inner + 14px gap */
        padding-bottom: 3rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero-sigil {
        display: none;
    }

    .hero-title {
        font-size: clamp(2rem, 9vw, 2.75rem);
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn--hero,
    .btn--hero-outline {
        justify-content: center;
        width: 100%;
    }

    .hero-stat-item {
        padding: 16px;
    }

    .hero-stat-number {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-stats-box {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Short viewports (≤ 800px height, landscape laptops, DevTools 750px) ── */
/*    Mantiene min-height: 100vh — solo comprime el contenido interior.      */
@media (max-height: 800px) and (min-width: 768px) {
    .hero-section {
        padding-top: 104px;   /* un poco más de clearance sobre el header fijo */
        padding-bottom: 1.5rem;
    }

    .hero-badge {
        margin-bottom: 0.625rem;
    }

    .hero-title {
        font-size: clamp(1.75rem, 3.5vw, 3rem);
        margin-bottom: 0.75rem;
    }

    .hero-description {
        font-size: 0.9375rem;
        line-height: 1.5;
        margin-bottom: 1.125rem;
    }

    .hero-stats-box {
        padding: 20px;
    }

    .hero-stat-item {
        padding: 18px;
    }

    .hero-stat-number {
        font-size: clamp(1.5rem, 2.25vw, 1.875rem);
    }
}

/* ── Very short viewports (≤ 680px height) — further compression ─────────── */
@media (max-height: 680px) and (min-width: 768px) {
    .hero-section {
        padding-top: 96px;
        padding-bottom: 1rem;
    }

    .hero-title {
        font-size: clamp(1.5rem, 3vw, 2.5rem);
        margin-bottom: 0.5rem;
    }

    .hero-badge {
        margin-bottom: 0.375rem;
    }

    .hero-description {
        margin-bottom: 0.875rem;
    }

    .hero-actions {
        gap: 0.625rem;
    }

    .btn--hero,
    .btn--hero-outline {
        padding: 11px 22px;
    }

    .hero-stats-box {
        padding: 14px;
    }

    .hero-stat-item {
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-orb-1 { animation: none; }
    .hero-animate,
    .hero-animate--delay { animation: none; }
}
