/* ==========================================================================
   Home — interactive solar system (gallery by celestial body)
   ========================================================================== */

.solar-section{
    background: #060708;
}

.solar-layout{
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr);
    align-items: start;
    gap: clamp(32px, 5vw, 72px);
}

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

/* ---- Stage --------------------------------------------------------------- */

.solar{
    position: relative;
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
    aspect-ratio: 1;
    container-type: inline-size;
}

.orbit{
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--r) * 1%);
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.orbit--dwarf{
    border-style: dashed;
    border-color: #1b1e23;
}

.orbit--moon{
    width: 6.8%;
    border-style: dashed;
    border-color: var(--border-strong);
    will-change: transform;
}

.body{
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: max(32px, var(--d));
    height: max(32px, var(--d));
    transform: translate(-50%, -50%);
    border-radius: 50%;
    will-change: transform;
    z-index: 1;
}

.body:focus-visible{
    outline-offset: 2px;
    border-radius: 50%;
}

.body-disc{
    position: relative;
    display: block;
    width: var(--d);
    height: var(--d);
    border-radius: 50%;
    background: var(--planet);
    transition: box-shadow var(--dur) var(--ease);
}

.body:hover .body-disc,
.body.is-selected .body-disc{
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent);
}

.body--sun .body-disc,
.body--sun.body .body-disc{
    box-shadow: 0 0 calc(var(--d) * .6) rgba(245, 158, 11, .28);
}

.body--sun:hover .body-disc,
.body--sun.is-selected .body-disc{
    box-shadow: 0 0 calc(var(--d) * .6) rgba(245, 158, 11, .28), 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent);
}

.body-label{
    position: absolute;
    top: calc(50% + max(16px, var(--d) / 2) + 6px);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-2);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease);
}

.body:hover .body-label,
.body:focus-visible .body-label,
.body.is-selected .body-label{
    opacity: 1;
}

@media (max-width: 560px){
    .body-label{ display: none; }
}

/* ---- Bodies: sizes are not to scale; artwork in static/images/planets ---- */

.body--sun{ --d: 13cqw; --planet: url(/static/images/planets/sun.svg) center / cover no-repeat; }
.body--mercury{ --d: 2.2cqw; --planet: url(/static/images/planets/mercury.svg) center / cover no-repeat; }
.body--venus{ --d: 3cqw; --planet: url(/static/images/planets/venus.svg) center / cover no-repeat; }
.body--earth{ --d: 3.2cqw; --planet: url(/static/images/planets/earth.svg) center / cover no-repeat; }
.body--moon{ --d: 1.5cqw; --planet: url(/static/images/planets/moon.svg) center / cover no-repeat; }
.body--mars{ --d: 2.6cqw; --planet: url(/static/images/planets/mars.svg) center / cover no-repeat; }
.body--jupiter{ --d: 5.6cqw; --planet: url(/static/images/planets/jupiter.svg) center / cover no-repeat; }
.body--saturn{ --d: 4.6cqw; --planet: url(/static/images/planets/saturn.svg) center / cover no-repeat; }
.body--uranus{ --d: 3.4cqw; --planet: url(/static/images/planets/uranus.svg) center / cover no-repeat; }
.body--neptune{ --d: 3.3cqw; --planet: url(/static/images/planets/neptune.svg) center / cover no-repeat; }
.body--pluto{ --d: 1.6cqw; --planet: url(/static/images/planets/pluto.svg) center / cover no-repeat; }

.body--saturn .body-disc::after,
.body-disc.body--saturn::after,
.panel-zoom.body--saturn .body-disc::after{
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 210%;
    height: 56%;
    border: max(1.5px, calc(var(--d) * .1)) solid rgba(217, 195, 143, .75);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(-18deg);
}

/* ---- Picker chips (always reachable, also on phones) --------------------- */

.body-picker{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.chip{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}

.chip:hover{
    color: var(--text);
    border-color: var(--border-strong);
}

.chip[aria-pressed="true"]{
    color: var(--text);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.chip-dot{
    --d: 10px;
    flex: none;
}

.chip-dot.body--saturn::after{
    width: 170%;
    height: 50%;
    border-width: 1px;
}

.chip-count{
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
}

/* ---- Side panel: static, never moves with the orbits --------------------- */

.solar-panel{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: clamp(24px, 3vw, 32px);
    min-height: 420px;
}

@media (max-width: 900px){
    .solar-panel{
        min-height: 0;
    }
}

@media (min-width: 901px){
    .solar-panel{
        position: sticky;
        top: calc(var(--header-h) + 24px);
    }
}

.panel-empty p{
    margin: 14px 0 28px;
    color: var(--text-2);
}

.panel-head{
    display: flex;
    align-items: center;
    gap: 24px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.panel-head .h2{
    margin: 6px 0 4px;
}

.panel-zoom{
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
}

.panel-zoom .body-disc{
    --d: 88px;
    animation: planet-zoom .55s var(--ease) both;
}

.panel-zoom.body--sun .body-disc{
    --d: 96px;
    box-shadow: 0 0 48px rgba(245, 158, 11, .3);
}

.panel-zoom.body--moon .body-disc,
.panel-zoom.body--mercury .body-disc{
    --d: 72px;
}

.panel-zoom.body--saturn .body-disc{
    --d: 60px;
}

@keyframes planet-zoom{
    from{ transform: scale(.15); opacity: 0; }
    to{ transform: scale(1); opacity: 1; }
}

.panel-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    max-height: 432px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.panel-grid button{
    display: block;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-2);
    cursor: zoom-in;
}

.panel-grid img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ease);
}

.panel-grid button:hover img{
    transform: scale(1.04);
}

.panel-undiscovered{
    padding: 32px 0 8px;
}

.panel-undiscovered p{
    margin-top: 8px;
    font-size: var(--fs-h3);
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--text-2);
}

.solar-section .gallery-cta{
    display: flex;
    justify-content: center;
    margin-top: clamp(40px, 5vw, 56px);
}

.panel-note{
    padding: 32px 0 8px;
}

.panel-note p{
    margin-top: 8px;
    font-size: var(--fs-h3);
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--text-2);
}

.panel-note + .panel-grid{
    margin-top: 24px;
}
