/* ============================================================
   9569 SILVER KNIGHTS — homepage
   (depends on css/theme.css design tokens)
   ============================================================ */

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

.hero {
    position: relative;
    max-width: 1360px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.25rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
    text-align: center;
}

/* The reticle frame "locks on" to the robot. The hero image is never altered —
   everything here lives in the margin around it. */
.hero-frame {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

/* soft radial energise behind the robot */
.hero-frame::before {
    content: '';
    position: absolute;
    inset: -2% 0 4%;
    z-index: -1;
    background: radial-gradient(48% 52% at 50% 46%, rgba(49, 102, 188, 0.34), transparent 70%);
    filter: blur(18px);
}

.hero-inner {
    --hero-max-width: 1200px;
    --hero-height-limit: 72vh;
    --hero-height-limit: 72dvh;
    --robot-width: min(58%, 568px);
    --robot-x: 53%;
    --robot-y: 66%;

    position: relative;
    width: min(100%, var(--hero-max-width), calc(var(--hero-height-limit) * 1.621));
    aspect-ratio: 5502 / 3395;
    margin: 0 auto;
    isolation: isolate;
    animation: heroIn 1s var(--ease-out) 0.15s both;
}

.hero-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url('../images/hero-title.webp') center / contain no-repeat;
    pointer-events: none;
}

.hero-video {
    position: absolute;
    top: var(--robot-y);
    left: var(--robot-x);
    z-index: 1;
    display: block;
    width: var(--robot-width);
    height: auto;
    aspect-ratio: 91 / 68;
    margin: 0 auto;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.hero-video.is-active {
    opacity: 1;
}

.hero-video-play {
    --c: 9px;
    position: absolute;
    right: clamp(0.65rem, 2vw, 1.1rem);
    bottom: clamp(0.65rem, 2vw, 1.1rem);
    z-index: 3;
    width: clamp(2.8rem, 6vw, 3.4rem);
    aspect-ratio: 1;
    display: inline-grid;
    place-items: center;
    color: #051320;
    background: linear-gradient(135deg, var(--cyan), var(--blue-deep));
    border: 0;
    cursor: pointer;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    filter: drop-shadow(0 12px 28px rgba(49, 102, 188, 0.48));
    transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}

.hero-video-play[hidden] {
    display: none;
}

.hero-video-play:hover {
    transform: translateY(-3px);
    filter: brightness(1.08) drop-shadow(0 0 16px var(--accent-glow));
}

.hero-video-play svg {
    width: 1.35rem;
    height: 1.35rem;
    transform: translateX(1px);
}

.hero-video-play[data-direction="reverse"] svg {
    transform: rotate(180deg) translateX(1px);
}

@keyframes heroIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

/* --- corner reticle brackets --- */
.rc {
    position: absolute;
    width: clamp(26px, 5vw, 46px);
    height: clamp(26px, 5vw, 46px);
    border: 2px solid var(--cyan);
    box-shadow: 0 0 14px var(--accent-glow);
    opacity: 0;
    animation: bracketDraw 0.6s var(--ease-spring) both;
}

.rc.tl {
    top: 0;
    left: 0;
    border-right: 0;
    border-bottom: 0;
    animation-delay: 0.45s;
}

.rc.tr {
    top: 0;
    right: 0;
    border-left: 0;
    border-bottom: 0;
    animation-delay: 0.55s;
}

.rc.bl {
    bottom: 0;
    left: 0;
    border-right: 0;
    border-top: 0;
    animation-delay: 0.65s;
}

.rc.br {
    bottom: 0;
    right: 0;
    border-left: 0;
    border-top: 0;
    animation-delay: 0.75s;
}

/* --- HUD telemetry tags (bottom corners only, clear of the wordmark) --- */
.hud-tag {
    position: absolute;
    bottom: clamp(0.5rem, 2vw, 1.1rem);
    font-family: var(--font-mono);
    font-size: clamp(0.55rem, 1.4vw, 0.7rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-dim);
    white-space: nowrap;
    animation: bootIn 0.8s var(--ease-out) 0.9s both;
}

.hud-tag.left {
    left: clamp(0.75rem, 3vw, 2rem);
}

.hud-tag.right {
    right: clamp(0.75rem, 3vw, 2rem);
}

.hud-tag b {
    color: var(--cyan);
    font-weight: 700;
}

.hud-tag .dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.4rem;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--accent-glow);
    vertical-align: middle;
    animation: blink 1.8s steps(1, end) infinite;
}

/* --- single scanline sweep on load --- */
.hero-scan {
    position: absolute;
    inset: clamp(1.25rem, 3vw, 2.5rem);
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.hero-scan::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 11%;
    background: linear-gradient(180deg, transparent, rgba(92, 208, 236, 0.16) 60%, rgba(92, 208, 236, 0.45));
    animation: scanSweep 2.6s var(--ease) 0.6s 1 both;
}

/* --- CTAs --- */
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: clamp(1.25rem, 3vw, 2rem);
    animation: bootIn 0.8s var(--ease-out) 0.85s both;
}

.scroll-cue {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    margin-top: clamp(1.5rem, 4vw, 2.75rem);
    color: var(--muted-dim);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    transition: color 0.25s var(--ease);
    animation: bootIn 0.8s var(--ease-out) 1.05s both;
}

.scroll-cue:hover {
    color: var(--cyan);
}

.scroll-cue svg {
    width: 22px;
    height: 22px;
    animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {

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

    50% {
        transform: translateY(6px);
        opacity: 1;
    }
}

/* ---------------- Stats — instrument console ---------------- */

/* wrapper carries the page gutter so the panel lines up with .about-card */
.stats-section {
    margin-block: clamp(1rem, 3vw, 2rem) var(--section-gap);
}

.stats {
    --c: var(--cut);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 720px) {
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat {
    position: relative;
    text-align: center;
    padding: clamp(1.4rem, 3vw, 2.1rem) 1rem;
}

/* internal dividers between console cells */
.stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 18%;
    height: 64%;
    width: 1px;
    background: var(--line);
}

@media (max-width: 719px) {
    .stat:nth-child(odd)::after {
        display: block;
    }

    .stat:nth-child(even)::after {
        display: none;
    }

    .stat:nth-child(-n+2)::before {
        content: '';
        position: absolute;
        left: 12%;
        bottom: 0;
        width: 76%;
        height: 1px;
        background: var(--line);
    }
}

.stat .num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.7rem, 4.4vw, 2.4rem);
    line-height: 1;
    letter-spacing: 0.01em;
}

.stat .label {
    margin-top: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-dim);
}

/* ---------------- About ---------------- */

.about-section {
    margin-block: var(--section-gap);
}

.about-card {
    --c: var(--cut);
    display: flex;
    flex-direction: column;
    gap: clamp(1.75rem, 4vw, 3.25rem);
    align-items: center;
    padding: clamp(1.75rem, 5vw, 3.5rem);
    box-shadow: var(--shadow);
}

@media (min-width: 850px) {
    .about-card {
        flex-direction: row;
    }
}

.about-content {
    flex: 1.1;
}

.about-content h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--h2);
    line-height: 1.08;
    text-transform: uppercase;
}

.about-content .rule {
    width: 64px;
    margin: 1.2rem 0 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

.about-content p {
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.85;
}

.about-image {
    flex: 1;
    width: 100%;
}

.about-image img {
    --c: var(--cut);
    width: 100%;
    height: auto;
    aspect-ratio: 1280 / 848;
    object-fit: cover;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ---------------- What we do — system modules ---------------- */

.pillars {
    margin-block: var(--section-gap);
}

.pillar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 720px) {
    .pillar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pillar {
    --c: var(--cut);
    position: relative;
    padding: 2.1rem 1.85rem;
    transition: transform 0.32s var(--ease-out), filter 0.32s var(--ease);
}

/* module index, top-right corner */
.pillar .idx {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted-dim);
}

.pillar:hover {
    transform: translateY(-6px);
    filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.5));
    background: linear-gradient(135deg, var(--cyan), var(--line));
}

.pillar:hover .ic {
    color: var(--silver-hi);
    background: var(--cyan);
}

.pillar:hover .idx {
    color: var(--cyan);
}

.pillar .ic {
    --c: 9px;
    position: relative;
    isolation: isolate;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 1.2rem;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background: var(--line-strong);
    color: var(--cyan);
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.pillar .ic::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
            calc(100% - 8px) 100%, 0 100%, 0 8px);
    background: linear-gradient(135deg, rgba(92, 208, 236, 0.22), rgba(49, 102, 188, 0.12)), var(--bg-soft);
}

.pillar .ic svg {
    width: 27px;
    height: 27px;
}

.pillar h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.6rem;
}

.pillar p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.75;
}

/* ---------------- Sponsors ---------------- */

.sponsors-section {
    margin-block: var(--section-gap);
}

.loading-row {
    display: flex;
    justify-content: center;
    padding: 2.5rem 0;
}

.tier-section {
    margin-bottom: clamp(2.75rem, 5vw, 4rem);
}

.tier-section:last-of-type {
    margin-bottom: 0;
}

.tier-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.tier-head::before,
.tier-head::after {
    content: '';
    height: 1px;
    flex: 1;
    max-width: 120px;
    background: linear-gradient(90deg, transparent, var(--line-strong));
}

.tier-head::after {
    background: linear-gradient(90deg, var(--line-strong), transparent);
}

.tier-head h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.3rem, 3.2vw, 1.9rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.tier-head .tier-badge {
    position: relative;
    isolation: isolate;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    padding: 0.32em 0.7em;
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
    background: currentColor;
    opacity: 0.9;
}

.tier-head .tier-badge::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
    background: var(--bg);
}

.diamond-tier .tier-head h3 {
    color: var(--diamond);
    text-shadow: 0 0 24px rgba(185, 242, 255, 0.5);
}

.gold-tier .tier-head h3 {
    color: var(--gold);
    text-shadow: 0 0 24px rgba(255, 212, 121, 0.45);
}

.silver-tier .tier-head h3 {
    color: var(--silver-tier);
    text-shadow: 0 0 24px rgba(210, 217, 224, 0.4);
}

/* Flex (not grid) so a partial final row — e.g. Diamond's 5th logo or
   Gold's last 3 — stays centered instead of clinging to the left edge. */
.sponsor-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(1rem, 2.5vw, 1.6rem);
    max-width: 980px;
    margin: 0 auto;
}

/* Cards MUST stay dark — most sponsor logos are white-on-transparent. */
.sponsor-card {
    --c: 11px;
    flex: 0 1 224px;
    position: relative;
    isolation: isolate;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)),
            calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
    background: linear-gradient(135deg, var(--line), var(--line-strong));
    transition: transform 0.32s var(--ease-out), filter 0.32s var(--ease);
}

.sponsor-card::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px),
            calc(100% - 10px) 100%, 0 100%, 0 10px);
    background: linear-gradient(155deg, rgba(49, 102, 188, 0.2), rgba(7, 11, 20, 0.92));
}

@media (min-width: 720px) {
    .sponsor-card {
        height: 170px;
    }
}

/* Two-up on phones; a lone last card then centers at half-width. */
@media (max-width: 520px) {
    .sponsor-card {
        flex-basis: calc(50% - 0.5rem);
    }
}

.sponsor-card:hover {
    transform: translateY(-7px);
    filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px var(--accent-glow));
}

.sponsor-card img {
    max-width: 100%;
    max-height: 96px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.32s var(--ease);
}

.sponsor-card:hover img {
    transform: scale(1.05);
}

#gene-haas-logo {
    max-height: 120px;
}

.sponsor-cta {
    text-align: center;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.sponsor-cta p {
    color: var(--muted);
    margin-bottom: 1.4rem;
    font-size: 1.02rem;
}

/* ---------------- Donate ---------------- */

.donate-section {
    margin-block: var(--section-gap);
}

.donate-card {
    --c: var(--cut);
    text-align: center;
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3.5rem);
    box-shadow: var(--shadow);
}

.donate-card.panel::before {
    background:
        radial-gradient(130% 120% at 50% 0%, rgba(92, 208, 236, 0.16), transparent 58%),
        var(--panel-2);
}

.donate-card .eyebrow {
    justify-content: center;
}

.donate-card h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--h2);
    text-transform: uppercase;
    line-height: 1.08;
    margin-bottom: 1rem;
}

.donate-card p {
    color: var(--muted);
    max-width: 50ch;
    margin: 0 auto 2rem;
    font-size: 1.02rem;
    line-height: 1.75;
}

.donate-card .btn svg {
    color: #ff6b81;
}

/* ---------------- Mobile polish ---------------- */

@media (max-width: 600px) {
    .hero {
        padding-top: clamp(0.75rem, 3vw, 1.25rem);
    }

    .hero-frame {
        padding: clamp(0.9rem, 4vw, 1.4rem);
    }

    .hero-inner {
        --hero-height-limit: 56vh;
        --hero-height-limit: 56dvh;
        --robot-width: 62%;
        --robot-y: 67%;
    }

    .hero-video-play {
        right: 0.55rem;
        bottom: 0.55rem;
        width: 2.6rem;
    }

    /* keep the hero uncluttered on phones */
    .hud-tag {
        display: none;
    }
}

@media (max-width: 380px) {
    .hero-inner {
        --robot-width: 66%;
        --robot-y: 68%;
    }
}

@media (max-height: 720px) and (min-width: 720px) {
    .hero {
        padding-top: 0.75rem;
        padding-bottom: 2rem;
    }

    .hero-inner {
        --hero-height-limit: 58vh;
        --hero-height-limit: 58dvh;
    }

    .hero-cta,
    .scroll-cue {
        margin-top: 1rem;
    }
}

@media (max-height: 620px) and (min-width: 720px) {
    .hero {
        padding-bottom: 1rem;
    }

    .hero-frame {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .hero-inner {
        --hero-height-limit: 50vh;
        --hero-height-limit: 50dvh;
    }

    .scroll-cue {
        margin-top: 0.75rem;
    }
}

@media (max-width: 460px) {
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .sponsor-cta .btn,
    .donate-card .btn {
        width: 100%;
    }
}
