/* ================================
   HERO — Antonio Richaud
   Minimalismo científico con alma de observatorio mexicano
================================ */

.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;

    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;

    display: flex;
    align-items: center;
    color: var(--text-primary, #f5f7fb);
    background:
        radial-gradient(circle at 76% 28%, rgba(79, 38, 140, 0.2), transparent 27rem),
        radial-gradient(circle at 18% 84%, rgba(47, 21, 76, 0.22), transparent 32rem),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.025), transparent 42rem),
        linear-gradient(135deg, #020203 0%, #050407 42%, #100817 100%);
    padding: clamp(5.5rem, 9vw, 8.5rem) clamp(1.25rem, 5vw, 5rem);
}

.hero__background {
    position: absolute;
    inset: 0;
    z-index: -3;
    pointer-events: none;
}

.hero__grid {
    position: absolute;
    inset: 0;
    opacity: 0.055;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 84px 84px;
    mask-image: radial-gradient(circle at 42% 44%, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle at 42% 44%, black 0%, transparent 70%);
}

.hero__horizon {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 16%;
    height: 1px;
    opacity: 0.26;
    background: linear-gradient(90deg,
            transparent,
            rgba(196, 174, 255, 0.32),
            transparent);
}

.hero__horizon::before,
.hero__horizon::after {
    content: "";
    position: absolute;
    left: 50%;
    width: min(72vw, 820px);
    height: min(72vw, 820px);
    border: 1px solid rgba(196, 174, 255, 0.045);
    border-radius: 50%;
    transform: translateX(-50%);
}

.hero__horizon::before {
    bottom: -380px;
}

.hero__horizon::after {
    bottom: -450px;
    width: min(86vw, 980px);
    height: min(86vw, 980px);
}

.hero__ambient {
    position: absolute;
    width: clamp(14rem, 28vw, 28rem);
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(52px);
    opacity: 0.24;
}

.hero__ambient--one {
    top: 8%;
    right: 5%;
    background: rgba(97, 49, 173, 0.26);
}

.hero__ambient--two {
    left: 3%;
    bottom: 3%;
    background: rgba(79, 35, 128, 0.18);
}

/* ================================
   ORION / FOGÓN CÓSMICO MAYA
   Solo modo oscuro
================================ */

.hero__constellation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.66;
    mix-blend-mode: screen;
    transition:
        opacity 260ms ease,
        filter 260ms ease;
}

.hero__constellation-group {
    --orion-x: 180px;
    --orion-y: 0px;
    --orion-scale: 1;

    transform-box: fill-box;
    transform-origin: center;
    transform:
        translate(var(--orion-x), var(--orion-y)) scale(var(--orion-scale));
    animation: hero-constellation-breathe 10s ease-in-out infinite;
}

.hero__constellation-line {
    fill: none;
    stroke: rgba(221, 211, 255, 0.22);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    transition:
        stroke 260ms ease,
        stroke-width 260ms ease,
        opacity 260ms ease;
}

.hero__constellation-line--hearth {
    stroke: rgba(221, 211, 255, 0.25);
}

.hero__constellation-line--belt {
    stroke: rgba(221, 211, 255, 0.14);
    stroke-dasharray: 5 8;
}

.hero__star {
    fill: rgba(245, 247, 251, 0.82);
    transition:
        fill 260ms ease,
        opacity 260ms ease,
        filter 260ms ease;
}

.hero__star--major {
    filter: drop-shadow(0 0 8px rgba(196, 174, 255, 0.32));
}

.hero__star--rigel {
    fill: rgba(255, 255, 255, 0.9);
}

.hero__star--belt {
    fill: rgba(225, 216, 255, 0.68);
    filter: drop-shadow(0 0 5px rgba(196, 174, 255, 0.22));
}

.hero__nebula {
    fill: rgba(128, 83, 210, 0.2);
    filter: drop-shadow(0 0 16px rgba(128, 83, 210, 0.42));
    animation: hero-nebula-pulse 7s ease-in-out infinite;
    transition:
        fill 260ms ease,
        filter 260ms ease,
        opacity 260ms ease;
}

.hero__nebula-core {
    fill: rgba(245, 247, 251, 0.62);
    filter: drop-shadow(0 0 10px rgba(196, 174, 255, 0.5));
    transition:
        fill 260ms ease,
        filter 260ms ease;
}

.hero.is-info-open .hero__constellation {
    opacity: 0.98;
    filter: drop-shadow(0 0 12px rgba(150, 104, 255, 0.18));
}

.hero.is-info-open .hero__constellation-line--hearth {
    stroke: rgba(236, 229, 255, 0.46);
    stroke-width: 1.2;
}

.hero.is-info-open .hero__constellation-line--belt {
    stroke: rgba(236, 229, 255, 0.28);
}

.hero.is-info-open .hero__star {
    fill: rgba(255, 255, 255, 0.96);
    filter: drop-shadow(0 0 10px rgba(196, 174, 255, 0.45));
}

.hero.is-info-open .hero__nebula {
    fill: rgba(146, 92, 235, 0.34);
    filter: drop-shadow(0 0 24px rgba(146, 92, 235, 0.6));
}

.hero.is-info-open .hero__nebula-core {
    fill: rgba(255, 255, 255, 0.86);
    filter: drop-shadow(0 0 14px rgba(221, 211, 255, 0.68));
}

/* ================================
   INFO CONSTELLATION
================================ */

.hero__info {
    position: absolute;
    top: clamp(5.25rem, 8vw, 6.5rem);
    right: clamp(1rem, 4vw, 3.5rem);
    z-index: 3;
}

.hero__info-button {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid rgba(245, 247, 251, 0.18);
    border-radius: 999px;
    color: rgba(245, 247, 251, 0.82);
    background: rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(14px);
    cursor: pointer;
    transition:
        transform 220ms ease,
        color 220ms ease,
        border-color 220ms ease,
        background-color 220ms ease,
        box-shadow 220ms ease;
}

.hero__info-button span {
    font-size: 0.92rem;
    font-weight: 700;
    font-family: Georgia, serif;
    line-height: 1;
}

.hero__info-button:hover,
.hero__info-button[aria-expanded="true"] {
    transform: translateY(-1px);
    color: #070a12;
    background: rgba(245, 247, 251, 0.92);
    border-color: rgba(245, 247, 251, 0.92);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.hero__info-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 5px;
}

.hero__info-card {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(32rem, calc(100vw - 2rem));
    padding: 0.95rem 1rem;
    border: 1px solid rgba(245, 247, 251, 0.12);
    border-radius: 1.1rem;
    color: rgba(245, 247, 251, 0.78);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
        rgba(8, 6, 12, 0.88);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(20px);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.35rem) scale(0.98);
    transform-origin: top right;
    transition:
        opacity 220ms ease,
        visibility 220ms ease,
        transform 220ms ease;
}

.hero__info-card.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.hero__info-kicker {
    margin: 0 0 0.42rem;
    color: rgba(196, 174, 255, 0.74);
    font-size: 0.66rem;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero__info-title {
    margin: 0;
    color: rgba(245, 247, 251, 0.96);
    font-size: 1rem;
    line-height: 1.22;
    letter-spacing: -0.02em;
}

.hero__info-text {
    margin: 0.58rem 0 0;
    color: rgba(245, 247, 251, 0.68);
    font-size: 0.84rem;
    line-height: 1.55;
}

/* ================================
   CONTENT
================================ */

.hero__inner {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.hero__content {
    max-width: 920px;
    animation: hero-content-in 780ms ease both;
}

/* ================================
   TITLE
   Silueta lineal limpia sin text-stroke
================================ */

.hero__title {
    margin: 0;
    color: var(--text-primary, #f5f7fb);
    font-size: clamp(3.35rem, 9vw, 8.2rem);
    line-height: 1;
    letter-spacing: -0.028em;
    text-wrap: balance;
}

.hero__title-line {
    --hero-title-fill: var(--text-primary, #f5f7fb);
    --hero-title-line: rgba(245, 247, 251, 0.82);
    --hero-title-bg: #030305;

    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    padding-right: 0.18em;
    padding-bottom: 0.18em;
    overflow: visible;

    color: var(--hero-title-bg);
    -webkit-text-fill-color: var(--hero-title-bg);

    text-shadow:
        0.8px 0 0 var(--hero-title-line),
        -0.8px 0 0 var(--hero-title-line),
        0 0.8px 0 var(--hero-title-line),
        0 -0.8px 0 var(--hero-title-line),
        0.56px 0.56px 0 var(--hero-title-line),
        -0.56px 0.56px 0 var(--hero-title-line),
        0.56px -0.56px 0 var(--hero-title-line),
        -0.56px -0.56px 0 var(--hero-title-line);

    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

.hero__title-line::before {
    content: attr(data-text);
    position: absolute;
    inset: 0 auto -0.2em 0;
    width: 116%;

    color: var(--hero-title-fill);
    -webkit-text-fill-color: var(--hero-title-fill);
    text-shadow: none;

    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;

    clip-path: inset(0 100% -0.3em 0);

    animation: hero-title-fill-loop 5.6s cubic-bezier(0.77, 0, 0.18, 1) infinite;
}

.hero__title-line--name::before {
    animation-delay: 0.28s;
}

/* ================================
   TEXT / ACTIONS
================================ */

.hero__subtitle {
    max-width: 720px;
    margin: clamp(1.5rem, 3vw, 2.15rem) 0 0;
    color: var(--text-secondary, rgba(245, 247, 251, 0.72));
    font-size: clamp(1rem, 1.55vw, 1.22rem);
    line-height: 1.75;
    text-wrap: pretty;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: clamp(2rem, 4vw, 2.85rem);
}

.hero__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.15rem;
    padding: 0.9rem 1.35rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--text-primary, #f5f7fb);
    background: transparent;
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition:
        transform 220ms ease,
        background-color 220ms ease,
        color 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.hero__button:hover {
    transform: translateY(-2px);
    color: #070a12;
    background: var(--text-primary, #f5f7fb);
    border-color: var(--text-primary, #f5f7fb);
    box-shadow: 0 18px 48px rgba(255, 255, 255, 0.12);
}

.hero__button:focus-visible,
.hero__social-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 5px;
}

.hero__social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.hero__social-link {
    display: inline-grid;
    place-items: center;
    width: 2.85rem;
    height: 2.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: var(--text-primary, #f5f7fb);
    background: transparent;
    text-decoration: none;
    transition:
        transform 220ms ease,
        background-color 220ms ease,
        color 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.hero__social-link:hover {
    transform: translateY(-2px);
    color: #070a12;
    background: var(--text-primary, #f5f7fb);
    border-color: var(--text-primary, #f5f7fb);
    box-shadow: 0 18px 48px rgba(255, 255, 255, 0.1);
}

.hero__social-icon {
    width: 1.18rem;
    height: 1.18rem;
    fill: currentColor;
}

/* ================================
   LIGHT MODE
   La constelación y su info existen solo en modo oscuro.
================================ */

html[data-theme="light"] .hero,
body[data-theme="light"] .hero,
body.light .hero,
body.light-mode .hero {
    color: var(--text-primary, #151515);
    background:
        radial-gradient(circle at 78% 22%, rgba(235, 178, 72, 0.14), transparent 30rem),
        radial-gradient(circle at 15% 88%, rgba(84, 90, 98, 0.08), transparent 34rem),
        linear-gradient(135deg, #fffaf1 0%, #f8f5ec 46%, #ffffff 100%);
}

html[data-theme="light"] .hero__constellation,
body[data-theme="light"] .hero__constellation,
body.light .hero__constellation,
body.light-mode .hero__constellation,
html[data-theme="light"] .hero__info,
body[data-theme="light"] .hero__info,
body.light .hero__info,
body.light-mode .hero__info {
    display: none;
}

html[data-theme="light"] .hero__grid,
body[data-theme="light"] .hero__grid,
body.light .hero__grid,
body.light-mode .hero__grid {
    opacity: 0.24;
    background-image:
        linear-gradient(rgba(20, 20, 20, 0.075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 20, 20, 0.075) 1px, transparent 1px);
}

html[data-theme="light"] .hero__horizon,
body[data-theme="light"] .hero__horizon,
body.light .hero__horizon,
body.light-mode .hero__horizon {
    background: linear-gradient(90deg,
            transparent,
            rgba(21, 21, 21, 0.28),
            transparent);
}

html[data-theme="light"] .hero__horizon::before,
body[data-theme="light"] .hero__horizon::before,
body.light .hero__horizon::before,
body.light-mode .hero__horizon::before,
html[data-theme="light"] .hero__horizon::after,
body[data-theme="light"] .hero__horizon::after,
body.light .hero__horizon::after,
body.light-mode .hero__horizon::after {
    border-color: rgba(21, 21, 21, 0.06);
}

html[data-theme="light"] .hero__title-line,
body[data-theme="light"] .hero__title-line,
body.light .hero__title-line,
body.light-mode .hero__title-line {
    --hero-title-fill: var(--text-primary, #151515);
    --hero-title-line: rgba(21, 21, 21, 0.74);
    --hero-title-bg: #fbf7ee;
}

html[data-theme="light"] .hero__subtitle,
body[data-theme="light"] .hero__subtitle,
body.light .hero__subtitle,
body.light-mode .hero__subtitle {
    color: var(--text-secondary, rgba(21, 21, 21, 0.68));
}

html[data-theme="light"] .hero__button,
body[data-theme="light"] .hero__button,
body.light .hero__button,
body.light-mode .hero__button {
    color: var(--text-primary, #151515);
}

html[data-theme="light"] .hero__button:hover,
body[data-theme="light"] .hero__button:hover,
body.light .hero__button:hover,
body.light-mode .hero__button:hover {
    color: #fffaf1;
    background: var(--text-primary, #151515);
    border-color: var(--text-primary, #151515);
    box-shadow: 0 18px 48px rgba(21, 21, 21, 0.12);
}

html[data-theme="light"] .hero__social-link,
body[data-theme="light"] .hero__social-link,
body.light .hero__social-link,
body.light-mode .hero__social-link {
    color: var(--text-primary, #151515);
    border-color: rgba(21, 21, 21, 0.18);
}

html[data-theme="light"] .hero__social-link:hover,
body[data-theme="light"] .hero__social-link:hover,
body.light .hero__social-link:hover,
body.light-mode .hero__social-link:hover {
    color: #fffaf1;
    background: var(--text-primary, #151515);
    border-color: var(--text-primary, #151515);
    box-shadow: 0 18px 48px rgba(21, 21, 21, 0.1);
}

/* ================================
   Cambio de idioma
================================ */

.hero.is-changing-language .hero__title,
.hero.is-changing-language .hero__subtitle,
.hero.is-changing-language .hero__actions,
.hero.is-changing-language .hero__social,
.hero.is-changing-language .hero__info-card {
    opacity: 0;
    transform: translateY(8px);
}

.hero__title,
.hero__subtitle,
.hero__actions,
.hero__social,
.hero__info-card {
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 180ms ease;
}

/* ================================
   Animaciones
================================ */

@keyframes hero-content-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-title-fill-loop {
    0% {
        clip-path: inset(0 100% -0.3em 0);
    }

    30% {
        clip-path: inset(0 0 -0.3em 0);
    }

    58% {
        clip-path: inset(0 0 -0.3em 0);
    }

    88% {
        clip-path: inset(0 100% -0.3em 0);
    }

    100% {
        clip-path: inset(0 100% -0.3em 0);
    }
}

@keyframes hero-constellation-breathe {

    0%,
    100% {
        opacity: 0.82;
        filter: drop-shadow(0 0 0 rgba(150, 104, 255, 0));
    }

    50% {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(150, 104, 255, 0.12));
    }
}

@keyframes hero-nebula-pulse {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.9;
    }
}

/* ================================
   Responsive
================================ */

@media (max-width: 920px) {
    .hero {
        min-height: 100vh;
        min-height: 100svh;
        min-height: 100dvh;
        align-items: center;
        padding-top: clamp(4.5rem, 12vw, 6rem);
        padding-bottom: clamp(4.5rem, 12vw, 6.5rem);
    }

    .hero__content {
        max-width: 100%;
    }

    .hero__title {
        max-width: 100%;
        font-size: clamp(3rem, 13vw, 6rem);
        letter-spacing: -0.024em;
    }

    .hero__constellation {
        opacity: 0.4;
    }

    .hero__constellation-group {
        --orion-x: 90px;
        --orion-y: -6px;
        --orion-scale: 0.94;
    }

    .hero__info-card {
        width: min(25rem, calc(100vw - 2rem));
    }
}

@media (max-width: 680px) {
    .hero {
        padding-inline: 1rem;
    }

    .hero__info {
        display: none;
    }

    .hero__title {
        font-size: clamp(2.75rem, 15.4vw, 4.55rem);
        letter-spacing: -0.02em;
        line-height: 0.94;
    }

    .hero__title-line {
        white-space: normal;
        padding-right: 0.12em;
        padding-bottom: 0.16em;
    }

    .hero__title-line--name {
        margin-top: -0.18em;
    }

    .hero__title-line::before {
        white-space: normal;
        inset: 0 auto -0.18em 0;
    }

    .hero__subtitle {
        max-width: 100%;
        font-size: 1rem;
        line-height: 1.68;
    }

    .hero__actions {
        width: 100%;
    }

    .hero__button {
        flex: 1 1 100%;
    }

    .hero__social {
        gap: 0.65rem;
        margin-top: 1.75rem;
    }

    .hero__social-link {
        width: 2.75rem;
        height: 2.75rem;
    }

    .hero__constellation {
        opacity: 0.22;
    }

    .hero__constellation-group {
        --orion-x: 0px;
        --orion-y: -22px;
        --orion-scale: 0.88;
    }
}

/* ================================
   Laptop height adjustment
================================ */

@media (min-width: 900px) and (max-height: 860px) {
    .hero {
        padding-top: clamp(4.75rem, 7vh, 6rem);
        padding-bottom: clamp(3.5rem, 6vh, 5rem);
    }

    .hero__inner {
        transform: translateY(-2rem);
    }

    .hero__social {
        margin-top: 1.65rem;
    }

    .hero__info {
        top: 4.85rem;
    }

    .hero__info-card {
        width: min(30rem, calc(100vw - 2rem));
        padding: 0.82rem 0.9rem;
    }

    .hero__info-text {
        font-size: 0.8rem;
        line-height: 1.45;
    }
}

/* ================================
   Reduced Motion
================================ */

@media (prefers-reduced-motion: reduce) {

    .hero__content,
    .hero__title-line::before,
    .hero__constellation-group,
    .hero__nebula {
        animation: none;
    }

    .hero__title-line::before {
        clip-path: inset(0 0 -0.3em 0);
    }

    .hero__button,
    .hero__social-link,
    .hero__title,
    .hero__subtitle,
    .hero__actions,
    .hero__social,
    .hero__info-button,
    .hero__info-card,
    .hero__constellation,
    .hero__constellation-line,
    .hero__star,
    .hero__nebula,
    .hero__nebula-core {
        transition: none;
    }

    .hero__button:hover,
    .hero__social-link:hover,
    .hero__info-button:hover {
        transform: none;
    }
}

/* ================================
   Continuidad visual Hero → Qué hago
================================ */

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    z-index: -1;
    height: clamp(8rem, 18vw, 16rem);
    pointer-events: none;
    background:
        linear-gradient(180deg,
            rgba(16, 8, 23, 0) 0%,
            rgba(16, 8, 23, 0.42) 42%,
            rgba(16, 8, 23, 0.86) 72%,
            #100817 100%);
}

html[data-theme="light"] .hero::after,
body[data-theme="light"] .hero::after,
body.light .hero::after,
body.light-mode .hero::after {
    background:
        linear-gradient(180deg,
            rgba(255, 250, 241, 0) 0%,
            rgba(255, 250, 241, 0.48) 42%,
            rgba(248, 245, 236, 0.88) 72%,
            #f8f5ec 100%);
}