/* WRUniverse robot life layer: per-page hero machines, the homepage hangar and squad emblems.
   Additive over robot-art.css. Native CSS only; motion is disabled for reduced-motion users. */

/* ---- Page hero machines: one distinct robot per page (set on <body> by the header) ---- */
.page-hero::after {
    opacity: .3;
    /* Fit the machine to the hero's own height so short heroes never crop its head. */
    top: 6px;
    bottom: -34px;
    height: auto;
    width: min(38vw, 430px);
    filter: saturate(1.12) drop-shadow(0 26px 40px rgba(0,0,0,.6)) drop-shadow(0 0 22px rgba(61,124,255,.22));
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
    animation: wru-robot-arrive .9s cubic-bezier(.2,.8,.2,1) both, wru-robot-hover 7s ease-in-out .9s infinite;
}
.page-hero::before {
    background:
        radial-gradient(ellipse 42% 70% at 88% 92%, rgba(61,124,255,.2), transparent 70%),
        linear-gradient(100deg, rgba(5,7,13,.34), rgba(61,124,255,.08) 52%, rgba(255,207,55,.07));
}
@media (max-width: 1100px) {
    .page-hero::after { opacity: .2; }
}
@media (max-width: 760px) {
    .page-hero::after { top: auto; width: 200px; height: 200px; right: -30px; bottom: -30px; opacity: .13; }
}
html[data-theme="light"] .page-hero::after {
    filter: saturate(1.05) drop-shadow(0 18px 26px rgba(20,35,50,.28));
    opacity: .26;
}

@keyframes wru-robot-arrive {
    from { transform: translate3d(48px, 18px, 0) scale(.94); opacity: 0; }
}
@keyframes wru-robot-hover {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -9px, 0); }
}

/* ---- Homepage hangar ---- */
.wru-hangar {
    position: relative;
    max-width: 1200px;
    margin: 22px auto;
    padding: 22px 0 10px;
    border: 1px solid var(--line, #2c3744);
    border-radius: 14px;
    background:
        linear-gradient(transparent 96%, rgba(129,181,255,.07) 96%) 0 0 / 100% 26px,
        linear-gradient(90deg, transparent 96%, rgba(129,181,255,.05) 96%) 0 0 / 26px 100%,
        radial-gradient(ellipse 80% 60% at 50% 110%, rgba(61,124,255,.22), transparent 70%),
        var(--panel, #10161d);
    overflow: hidden;
}
.wru-hangar-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 22px;
}
.wru-hangar-head h2 { margin: 2px 0 0; }
.wru-hangar-row {
    list-style: none;
    display: flex;
    gap: 14px;
    margin: 18px 0 0;
    padding: 18px 22px 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 22px;
    scrollbar-width: thin;
    perspective: 900px;
}
.wru-hangar-bay {
    flex: 0 0 auto;
    scroll-snap-align: start;
    animation: wru-bay-in .7s cubic-bezier(.2,.8,.2,1) both;
    animation-delay: calc(var(--bay, 0) * 70ms);
}
.wru-hangar-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 170px;
    height: 200px;
    padding: 10px 10px 12px;
    border: 1px solid rgba(129,181,255,.22);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(61,124,255,.1));
    color: inherit;
    text-decoration: none;
    transform-style: preserve-3d;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
}
.wru-hangar-card img {
    position: absolute;
    left: 50%;
    bottom: 38px;
    width: 150px;
    height: 140px;
    object-fit: contain;
    transform: translateX(-50%) translateZ(30px);
    filter: drop-shadow(0 14px 16px rgba(0,0,0,.55));
    transition: transform .4s cubic-bezier(.2,.8,.2,1), filter .3s;
    animation: wru-bay-idle 6s ease-in-out infinite;
    animation-delay: calc(var(--bay, 0) * -.6s);
}
.wru-hangar-glow {
    position: absolute;
    left: 50%;
    bottom: 34px;
    width: 120px;
    height: 18px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(129,181,255,.55), transparent);
    opacity: .55;
    transition: opacity .3s;
}
.wru-hangar-name {
    position: relative;
    font-weight: 800;
    letter-spacing: .02em;
    text-align: center;
    transform: translateZ(40px);
}
.wru-hangar-card:hover,
.wru-hangar-card:focus-visible {
    transform: rotateX(6deg) rotateY(-8deg) translateY(-4px);
    border-color: rgba(255,207,55,.7);
    box-shadow: 0 18px 34px rgba(0,0,0,.4), 0 0 0 1px rgba(255,207,55,.35);
}
.wru-hangar-card:hover img,
.wru-hangar-card:focus-visible img {
    transform: translateX(-50%) translateZ(60px) scale(1.08);
    filter: drop-shadow(0 18px 18px rgba(0,0,0,.6)) drop-shadow(0 0 14px rgba(255,207,55,.35));
}
.wru-hangar-card:hover .wru-hangar-glow,
.wru-hangar-card:focus-visible .wru-hangar-glow { opacity: 1; }
.wru-hangar-card:focus-visible { outline: 2px solid #81b5ff; outline-offset: 3px; }
.wru-hangar-note { margin: 0; padding: 0 22px; font-size: 13px; color: var(--muted, #a9b1bd); }
html[data-theme="light"] .wru-hangar { background: linear-gradient(transparent 96%, rgba(21,93,165,.06) 96%) 0 0 / 100% 26px, radial-gradient(ellipse 80% 60% at 50% 110%, rgba(21,93,165,.14), transparent 70%), #fff; }
html[data-theme="light"] .wru-hangar-card { background: linear-gradient(180deg, #fff, #eaf0f5); border-color: var(--line, #c6d1de); }

@keyframes wru-bay-in {
    from { opacity: 0; transform: translateY(18px); }
}
@keyframes wru-bay-idle {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

/* ---- Squad emblems ---- */
.squad-card { position: relative; overflow: hidden; }
.squad-card > * { position: relative; z-index: 1; }
.squad-card-robot {
    position: absolute;
    z-index: 0;
    right: 96px;
    bottom: -18px;
    width: 130px;
    height: 110px;
    object-fit: contain;
    opacity: .22;
    pointer-events: none;
    filter: drop-shadow(0 10px 14px rgba(0,0,0,.5));
    transition: opacity .3s, transform .4s cubic-bezier(.2,.8,.2,1);
}
.squad-card:hover .squad-card-robot { opacity: .42; transform: translateY(-4px) scale(1.05); }
.squad-head { position: relative; }
.squad-head-robot {
    float: right;
    width: 140px;
    height: 110px;
    margin: -8px 0 0 12px;
    object-fit: contain;
    filter: drop-shadow(0 12px 16px rgba(0,0,0,.5)) drop-shadow(0 0 16px rgba(79,209,138,.18));
    animation: wru-robot-hover 7s ease-in-out infinite;
}
.squad-panel:has(.squad-voice.is-connected) .squad-head-robot {
    filter: drop-shadow(0 12px 16px rgba(0,0,0,.5)) drop-shadow(0 0 22px rgba(79,209,138,.55));
}
.squad-empty-robot {
    display: block;
    width: 180px;
    height: 150px;
    margin: 8px auto 0;
    object-fit: contain;
    opacity: .7;
    filter: grayscale(.4) drop-shadow(0 12px 16px rgba(0,0,0,.45));
}
@media (max-width: 640px) {
    .squad-card-robot { right: 8px; top: 6px; bottom: auto; width: 90px; height: 76px; opacity: .16; }
    .squad-head-robot { width: 96px; height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
    .page-hero::after,
    .wru-hangar-bay,
    .wru-hangar-card img,
    .squad-head-robot { animation: none; }
    .wru-hangar-card,
    .wru-hangar-card img,
    .squad-card-robot { transition: none; }
    .wru-hangar-card:hover,
    .wru-hangar-card:focus-visible { transform: none; }
}
