:root {
    --bg: #0a1630;
    --bg-darker: #070f24;
    --primary: #8ab4ff;
    --text: #e6eefc;
    --muted: #9db0d0;
    --panel: #0f1f44cc;
    --panel-solid: #0f1f44;
    --ring: rgba(138, 180, 255, 0.35);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --radius: 22px;
}
* {
    box-sizing: border-box;
}
body {
    height: 100%;
}
body {
    margin: 0;
    font:
        16px/1.6 system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Inter,
        Helvetica,
        Arial,
        sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 800px at 70% -10%, #16234b, transparent 60%),
        radial-gradient(700px 500px at 20% 110%, #13224a, transparent 60%),
        var(--bg);
    background-size: cover, cover, auto;
    overflow-x: hidden;
}

/* Star field */
.stars,
.stars:before,
.stars:after {
    position: fixed;
    inset: 0;
    content: "";
    pointer-events: none;
    background-repeat: repeat;
    animation: drift 120s linear infinite;
}
.stars {
    background-image:
        radial-gradient(1px 1px at 20px 30px, #fff 60%, transparent 61%),
        radial-gradient(1px 1px at 130px 80px, #cfe1ff 55%, transparent 56%),
        radial-gradient(1px 1px at 250px 120px, #fff 60%, transparent 61%),
        radial-gradient(1px 1px at 300px 30px, #cfe1ff 60%, transparent 61%);
    background-size: 400px 200px;
    opacity: 0.7;
}
.stars:before {
    background-image:
        radial-gradient(1.5px 1.5px at 90px 60px, #fff 60%, transparent 61%),
        radial-gradient(
            1.5px 1.5px at 200px 160px,
            #bcd3ff 55%,
            transparent 56%
        ),
        radial-gradient(1.5px 1.5px at 340px 40px, #fff 60%, transparent 61%);
    background-size: 600px 300px;
    opacity: 0.6;
    animation-duration: 180s;
}
.stars:after {
    background-image:
        radial-gradient(2px 2px at 120px 20px, #e9f0ff 60%, transparent 61%),
        radial-gradient(2px 2px at 360px 140px, #fff 60%, transparent 61%);
    background-size: 800px 400px;
    opacity: 0.4;
    animation-duration: 240s;
}
@keyframes drift {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(200px);
    }
}

/* Shell */
#wrapper {
    position: relative;
    min-height: 100dvh;
    padding-top: 2rem;
}
header {
    display: grid;
    place-items: center;
    padding: 7vh 20px 20px;
    text-align: center;
}
.inner {
    width: min(980px, 95vw);
    background: linear-gradient(180deg, var(--panel), rgba(15, 31, 68, 0.7));
    border: 1px solid var(--ring);
    backdrop-filter: blur(6px);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 48px 28px 34px;
}
.logo {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    display: inline-grid;
    place-items: center;
    margin: 0 auto 18px;
    background: #0a193b;
    border: 1px solid var(--ring);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
h1 {
    font-size: clamp(28px, 5vw, 46px);
    margin: 0.2rem 0 0;
    font-weight: 800;
    letter-spacing: 0.4px;
}
.subtitle {
    color: var(--muted);
    margin: 0.6rem 0 1.2rem;
}
.paragraph {
    margin: 1.2rem 4rem;
}
.cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 18px 0 8px;
}
.btn {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    color: #051028;
    background: #e6eefc;
    font-weight: 700;
    text-decoration: none;
}
.btn:hover {
    filter: brightness(1.05);
}
.btn.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--ring);
}
nav {
    margin-top: 14px;
}
nav a {
    display: inline-block;
    margin: 4px 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}
nav a:hover {
    color: var(--text);
    border-color: var(--ring);
}

/* Panels */
.panel {
    position: fixed;
    inset: 0;
    padding: 90px 18px 28px;
    display: none;
    place-items: center;
    z-index: 4;
    background: linear-gradient(
        180deg,
        rgba(7, 15, 36, 0.75),
        rgba(7, 15, 36, 0.9)
    );
    backdrop-filter: blur(5px);
}
.panel:target {
    display: grid;
}
.panel article {
    width: min(980px, 94vw);
    background: linear-gradient(180deg, var(--panel), rgba(15, 31, 68, 0.78));
    border: 1px solid var(--ring);
    border-radius: var(--radius);
    padding: 28px 26px 24px;
    box-shadow: var(--shadow);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.panel h2 {
    margin: 0 0 0.4rem;
    font-size: clamp(22px, 3.2vw, 32px);
}
.panel p {
    color: #d6e6ff;
}
.grid {
    display: grid;
    gap: 16px;
    margin: 12px 0 4px;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding-bottom: 6px;
}
.card {
    background: linear-gradient(
        180deg,
        rgba(16, 34, 76, 0.75),
        rgba(16, 34, 76, 0.6)
    );
    border: 1px solid var(--ring);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
}
.card h3 {
    margin: 0.2rem 0 0.4rem;
    font-size: 18px;
}
.card p {
    font-size: 15px;
    color: #cadeff;
}
.card img {
    max-height: clamp(120px, 26vh, 240px);
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}
.gallery {
    display: grid;
    gap: 14px;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    margin-top: 10px;
    padding-bottom: 6px;
}
.gallery img {
    width: 100%;
    height: clamp(140px, 28vh, 220px);
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--ring);
    background: #0b1a3b;
}
.close {
    display: inline-block;
    margin-top: 14px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px dotted var(--muted);
}
footer {
    /* position: fixed; */
    bottom: 12px;
    left: 0;
    right: 0;
    text-align: center;
    color: #7f96bf;
    font-size: 13px;
    opacity: 0.9;
    padding-top: 40px; /* Add some space above the footer */
    padding-bottom: 10px;
}

@media (prefers-reduced-motion: no-preference) {
    header,
    .panel article {
        transition:
            transform 0.35s ease,
            opacity 0.35s ease;
    }
    .panel:target article {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Horizontal scroll helpers to fit any screen height */
.grid > *,
.gallery > * {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.panel article > .grid,
.panel article > .gallery {
    flex: 1 1 auto;
    min-height: 0;
}

/* Small devices tweaks */
@media (max-width: 480px) {
    /* Base type + spacing */
    body {
        font-size: 15px;
        line-height: 1.55;
    }
    h1 {
        font-size: 26px;
        letter-spacing: 0.2px;
    }
    .subtitle {
        font-size: 14px;
        margin: 0.5rem 0 0.8rem;
    }
    .paragraph {
        margin: 0.9rem 0;
    }

    /* Shell and header */
    header {
        padding: 4vh 14px 0;
    }
    .inner {
        padding: 28px 16px 20px;
        border-radius: 18px;
    }
    .logo {
        width: 84px;
        height: 84px;
        border-radius: 20px;
    }

    /* Buttons and nav */
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    nav {
        margin-top: 8px;
    }
    nav a {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* Panels */
    .panel {
        padding: 70px 12px 16px;
    }
    .panel article {
        padding: 18px 14px 14px;
        max-height: calc(100dvh - 70px - 16px);
    }
    .panel h2 {
        font-size: 20px;
    }

    /* Horizontal lanes */
    .grid {
        gap: 12px;
        grid-auto-columns: minmax(220px, 80%);
    }
    .gallery {
        gap: 10px;
        grid-auto-columns: minmax(200px, 80%);
    }

    /* Cards */
    .card {
        padding: 12px;
        border-radius: 14px;
    }
    .card h3 {
        font-size: 16px;
    }
    .card p {
        font-size: 14px;
    }
    .card img {
        max-height: clamp(100px, 24vh, 200px);
    }
    .gallery img {
        height: clamp(120px, 24vh, 200px);
        border-radius: 14px;
    }

    /* Footer */
    footer {
        font-size: 12px;
        bottom: 8px;
    }
}

@media (max-width: 360px) {
    h1 {
        font-size: 24px;
    }
    .btn {
        font-size: 13px;
        padding: 9px 12px;
    }
    .grid {
        grid-auto-columns: minmax(190px, 85%);
    }
    .gallery {
        grid-auto-columns: minmax(180px, 85%);
    }
}
