body {
    --bg: #0d0c16;
    --surface: rgba(28, 25, 44, 0.8);
    --surface-strong: rgba(34, 30, 54, 0.94);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(139, 111, 255, 0.25);
    --text: #f4f0ff;
    --text2: rgba(244, 240, 255, 0.78);
    --text3: rgba(244, 240, 255, 0.46);
    --accent: #8b6fff;
    --accent-soft: rgba(139, 111, 255, 0.16);
    --font-serif: "Cormorant Garamond", Georgia, serif;
    --font-mono: "Inconsolata", monospace;
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 16%, rgba(139, 111, 255, 0.16), transparent 28%),
        radial-gradient(circle at 78% 8%, rgba(168, 255, 212, 0.08), transparent 22%),
        linear-gradient(180deg, #0d0c16 0%, #0b0b13 100%);
    font-family: var(--font-mono);
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.page-shell {
    width: min(1260px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 42px;
}

.topbar {
    position: relative;
    padding: 30px 32px 26px 132px;
    margin-bottom: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.back-button {
    position: absolute;
    left: 28px;
    top: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text2);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.03);
    transition: 0.16s ease;
}

.back-button:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--accent-soft);
}

.eyebrow,
.panel-kicker {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text3);
}

.topbar h1 {
    margin: 6px 0 0;
    font-family: var(--font-serif);
    font-size: clamp(44px, 6vw, 74px);
    line-height: 0.92;
    font-weight: 500;
}

.intro {
    margin: 14px 0 0;
    max-width: 60ch;
    color: var(--text2);
    line-height: 1.8;
    font-size: 14px;
}

.orbus-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.side-panel,
.carousel-panel,
.detail-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.side-panel,
.detail-panel {
    padding: 22px;
    position: sticky;
    top: 18px;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.category-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text2);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: 0.16s ease;
}

.category-btn:hover,
.category-btn:focus {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(139, 111, 255, 0.12);
    outline: none;
}

.panel-note {
    margin-top: 16px;
    color: var(--text3);
    font-size: 11px;
    line-height: 1.7;
}

.carousel-panel {
    padding: 24px;
    min-height: 640px;
}

.panel-head {
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 6px 0 0;
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 500;
}

#carousel-container {
    position: relative;
    width: 100%;
    height: 520px;
    margin: 0 auto;
    perspective: 1200px;
    overflow: hidden;
    touch-action: none;
    border-radius: 22px;
    padding: 18px;
    background:
        radial-gradient(circle at center, rgba(139, 111, 255, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.04);
}

#carousel-container.arc-layout {
    background:
        radial-gradient(circle at 50% 24%, rgba(139, 111, 255, 0.12), transparent 46%),
        linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.03));
}

#carousel {
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    transition: transform 1s ease-in-out;
    width: 100%;
    height: 100%;
    position: relative;
}

.card {
    position: absolute;
    width: 108px;
    height: 162px;
    transition: transform 0.8s ease, opacity 0.3s ease;
    transform-style: preserve-3d;
}

.card img {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    backface-visibility: hidden;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
    background: #13121e;
}

.card-label {
    text-align: center;
    font-size: 10px;
    margin-top: 8px;
    color: var(--text2);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#card-details {
    color: var(--text2);
    line-height: 1.8;
    font-size: 12px;
}

#card-details p {
    margin: 0;
}

#image-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.82);
    z-index: 1000;
    cursor: pointer;
}

#image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 14px;
}

#text-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 44%;
    background: rgba(24, 22, 38, 0.98);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.32);
    transform: translateY(120%);
    transition: transform 0.3s ease-out;
    overflow-y: auto;
    z-index: 1100;
    cursor: pointer;
}

#text-modal.open {
    transform: translateY(0);
}

#text-modal-content {
    padding: 16px;
    color: var(--text2);
    font-size: 12px;
    line-height: 1.8;
}

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

    .side-panel,
    .detail-panel {
        position: static;
    }

    .category-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 100%);
        padding-top: 12px;
    }

    .topbar {
        padding: 78px 20px 20px;
        border-radius: 18px;
    }

    .back-button {
        left: 18px;
        top: 18px;
    }

    .side-panel,
    .carousel-panel,
    .detail-panel,
    #carousel-container {
        border-radius: 18px;
    }

    #carousel-container {
        height: 360px;
    }

    .card {
        width: 86px;
        height: 129px;
    }
}
