/* ============================================================================
   HOME — only the new landing page loads this file.
   ----------------------------------------------------------------------------
   The hero is the first screen: the global navbar is 58px, the rest is the
   measured viewport (`--app-h`, written by assets/js/hero-scene.js). The 3D
   canvas is decoration behind the copy; every state has a CSS fallback so a
   slow connection never shows an empty rectangle.
   ========================================================================= */

/* ---------- Hero shell ---------- */

.home-hero {
    position: relative;
    min-height: calc(var(--app-h, 100svh) - var(--glb-h, 58px) - var(--glb-hang, 12px));
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 3.5rem 0 5rem;
    isolation: isolate;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 56% 50% at 74% 40%, rgba(224, 161, 107, 0.10), transparent 64%),
        radial-gradient(ellipse 48% 44% at 16% 82%, rgba(111, 214, 196, 0.09), transparent 68%);
}

.hero-bg canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-veil {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(6, 7, 10, 0.96) 0%, rgba(6, 7, 10, 0.84) 38%, rgba(6, 7, 10, 0.2) 64%, rgba(6, 7, 10, 0.4) 100%),
        linear-gradient(180deg, rgba(6, 7, 10, 0.42) 0%, transparent 30%, rgba(6, 7, 10, 0.82) 100%);
}

.hero-inner {
    position: relative;
    width: min(100% - 2rem, var(--max-width));
    margin-inline: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.hero-copy {
    max-width: 46rem;
}

.home-title {
    margin: 1.1rem 0 0;
    font-size: clamp(3rem, 8.6vw, 6.2rem);
    line-height: 0.94;
    letter-spacing: -0.025em;
    color: var(--fg-1);
}

.home-title span {
    display: block;
}

/* The accent line is a metal gradient rather than a glowing flat cyan: same
   emphasis, none of the neon spill. */
.home-title span.accent {
    background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 58%, var(--accent-lo) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.home-hero .hero-subtitle {
    max-width: 44ch;
    margin-top: 1.5rem;
    color: var(--fg-2);
    font-size: 1rem;
    line-height: 1.72;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 2rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.5rem;
    margin-top: 2.6rem;
    color: var(--fg-3);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.hero-meta span::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.8;
}

.scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.4rem;
    color: var(--fg-3);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: color 160ms var(--ease);
    writing-mode: horizontal-tb;
}

.scroll-hint-line {
    width: 1px;
    height: 38px;
    background: linear-gradient(to bottom, var(--line-3), transparent);
}

.scroll-hint:hover {
    color: var(--fg-1);
}

/* ---------- Scene states ---------- */

.home-hero[data-scene="booting"] .hero-bg::after,
.home-hero[data-scene="ready"] .hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    transition: opacity 600ms ease;
}

.home-hero[data-scene="booting"] .hero-bg::after {
    /* A turning mark while the model downloads; the glow underneath is already
       there, so the wait never looks like a broken box. */
    background: radial-gradient(circle, rgba(111, 214, 196, 0.35) 0 2px, transparent 3px);
    background-size: 100% 100%;
    border-radius: 50%;
    inset: auto 12% 20% auto;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line-2);
    border-top-color: var(--accent);
    animation: home-spin 900ms linear infinite;
    opacity: 0.7;
}

.home-hero[data-scene="ready"] .hero-bg::after {
    opacity: 0;
}

/* A very light CSS silhouette so "lite" still reads as intentional. */
.home-hero[data-scene="lite"] .hero-bg::before,
.home-hero[data-scene="error"] .hero-bg::before {
    content: "";
    position: absolute;
    right: -6%;
    top: 12%;
    width: min(52vw, 560px);
    aspect-ratio: 3 / 4;
    background:
        radial-gradient(ellipse at 50% 38%, rgba(224, 161, 107, 0.22), transparent 62%),
        conic-gradient(from 200deg at 50% 60%, rgba(111, 214, 196, 0.10), transparent 45%, rgba(224, 161, 107, 0.13));
    filter: blur(52px);
    opacity: 0.5;
}

@keyframes home-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Home sections ---------- */

.home-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-top: 1.7rem;
    border: 1px solid var(--line-1);
    border-radius: var(--r-3);
    background: var(--line-1);
    overflow: hidden;
}

.home-strip-cell {
    background: var(--ink-1);
    padding: 1.05rem 1.15rem;
}

.home-strip-cell dt {
    margin: 0;
    color: var(--fg-3);
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.home-strip-cell dd {
    margin: 0.4rem 0 0;
    font-family: var(--font-display);
    font-size: 1.95rem;
    font-weight: 700;
    color: var(--fg-1);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.home-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 1.2rem;
    margin-top: 1.6rem;
    align-items: start;
}

.home-aside {
    border: 1px solid var(--line-1);
    border-radius: var(--r-3);
    background: linear-gradient(180deg, var(--ink-2) 0%, var(--ink-1) 100%);
    box-shadow: var(--shadow-2);
    padding: 1.35rem 1.4rem 1.5rem;
}

.home-aside h3 {
    font-size: 1.35rem;
    color: var(--fg-1);
}

.home-aside p {
    color: var(--fg-3);
    font-size: 0.88rem;
    line-height: 1.7;
}

.home-aside .btn {
    margin-top: 1.1rem;
}

.home-intel-list .intel-list-title {
    font-size: 1.1rem;
}

.home-footnote {
    margin: 2.6rem 0 0;
    color: var(--fg-4);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .home-split {
        grid-template-columns: 1fr;
    }

    .home-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .home-hero {
        min-height: calc(var(--app-h, 100svh) - var(--glb-h, 58px) - var(--glb-hang, 12px));
        align-items: flex-end;
        padding-bottom: 6rem;
    }

    .hero-veil {
        background:
            linear-gradient(180deg, rgba(3, 6, 6, 0.55) 0%, rgba(3, 6, 6, 0.25) 30%, rgba(3, 6, 6, 0.94) 78%);
    }

    .scroll-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero[data-scene="booting"] .hero-bg::after {
        animation: none;
        opacity: 0.35;
    }
}

/* Short viewports: the fixed bottom bar owns the last ~50px, and the meta row
   is the least important line in the hero. Drop it before it can be covered. */
@media (max-height: 640px) {
    .hero-meta {
        display: none;
    }
}
