@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");

:root {
    --bg: #050508;
    --bg-elev: #0c0c12;
    --ink: #f4f5f8;
    --muted: rgba(244, 245, 248, 0.55);
    --line: rgba(255, 255, 255, 0.08);
    --polar: #3b82f6;
    --scifi: #a78bfa;
    --scifi-hot: #67e8f9;
    --anim: #f59e0b;
    --doc: #34d399;
    --asia: #f43f5e;
    --font: Outfit, system-ui, sans-serif;
    --header-h: 60px;
    --max: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 50% -10%, rgba(103, 232, 249, 0.06), transparent 55%),
        radial-gradient(700px 380px at 10% 80%, rgba(167, 139, 250, 0.05), transparent 50%),
        radial-gradient(600px 320px at 90% 70%, rgba(244, 63, 94, 0.04), transparent 45%),
        var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
button { cursor: pointer; }

.preview-banner {
    position: sticky; top: 0; z-index: 120;
    display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem;
    padding: .65rem 1.2rem;
    background: #12101a; color: #fff; font-weight: 700; font-size: .88rem;
    border-bottom: 1px solid rgba(167, 139, 250, 0.35);
}
.preview-banner a { margin-left: auto; color: #c4b5fd; text-decoration: underline; }

/* Header */
.pu-header {
    position: sticky; top: 0; z-index: 100;
    height: var(--header-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0 clamp(1rem, 3vw, 2rem);
    background: rgba(5, 5, 8, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.pu-brand {
    display: inline-flex; align-items: center; gap: .65rem;
    font-weight: 700; letter-spacing: .02em;
}
.pu-logo {
    width: 32px; height: 32px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 4px;
    background: transparent;
}
.pu-brand-name { font-size: .95rem; }

.pu-nav {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem;
    list-style: none; margin: 0; padding: 0;
}
.pu-nav a {
    position: relative;
    padding: .45rem .9rem;
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}
.pu-nav a:hover { color: var(--ink); }
.pu-nav a.is-active { color: var(--ink); }
.pu-nav a.is-active::after {
    content: "";
    position: absolute; left: .9rem; right: .9rem; bottom: .1rem;
    height: 1.5px;
    background: var(--scifi-hot);
    box-shadow: 0 0 8px var(--scifi-hot);
}

.pu-tools { display: flex; align-items: center; gap: .4rem; position: relative; }
.pu-icon-btn {
    width: 36px; height: 36px; border-radius: 999px;
    border: 0; background: transparent; color: var(--ink);
    display: grid; place-items: center;
}
.pu-icon-btn:hover { background: rgba(255,255,255,.06); }
.pu-avatar {
    width: 30px; height: 30px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.22);
    background: linear-gradient(145deg, #2a2a38, #12121a);
    display: grid; place-items: center;
    font-size: .65rem; font-weight: 700; color: var(--muted);
}
.pu-search {
    display: none;
    position: absolute; right: 0; top: calc(100% + .35rem);
    min-width: 220px;
    padding: .5rem .7rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(12, 12, 18, 0.92);
    backdrop-filter: blur(12px);
    z-index: 40;
}
.pu-search.is-open { display: flex; }
.pu-search input {
    width: 100%; border: 0; outline: none;
    background: transparent; color: var(--ink);
}
.mobile-toggle { display: none; }

.pu-main {
    width: min(var(--max), calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1.5rem 0 3.5rem;
}

.universes-head {
    text-align: center;
    margin: .5rem 0 1.5rem;
}
.universes-head h1 {
    margin: 0;
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

/* Portals */
.portals {
    display: flex;
    align-items: stretch;
    gap: .7rem;
    min-height: 480px;
    margin-bottom: 1.75rem;
}
.portal {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    border: 0;
    padding: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 999px 999px 18px 18px;
    overflow: hidden;
    isolation: isolate;
    background: #0a0a10;
    transition:
        flex .45s cubic-bezier(.2, .8, .2, 1),
        box-shadow .35s ease,
        transform .35s ease;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--portal-color) 45%, transparent);
}
.portal::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 2px color-mix(in srgb, var(--portal-color) 70%, transparent),
        inset 0 0 24px color-mix(in srgb, var(--portal-color) 25%, transparent);
    pointer-events: none;
    z-index: 3;
}
.portal:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--portal-color) 55%, transparent),
        0 0 28px color-mix(in srgb, var(--portal-color) 35%, transparent);
}
.portal.is-active {
    flex: 2.4 1 0;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--portal-color) 80%, transparent),
        0 0 40px color-mix(in srgb, var(--portal-color) 45%, transparent),
        0 20px 50px rgba(0,0,0,.45);
}
.portal-media {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform .5s ease, filter .35s ease;
    filter: saturate(1.05) brightness(.85);
}
.portal.is-active .portal-media {
    transform: scale(1.04);
    filter: saturate(1.1) brightness(.95);
}
.portal-media::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(5,5,8,.15) 0%, rgba(5,5,8,.35) 40%, rgba(5,5,8,.92) 100%);
}
.portal-label {
    position: absolute;
    left: 0; right: 0; bottom: 1.1rem;
    z-index: 2;
    text-align: center;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0,0,0,.7);
    transition: opacity .25s ease;
}
.portal.is-active .portal-label { opacity: 0; }

.portal-panel {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 1.25rem 1.2rem 1.3rem;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .3s ease, transform .35s ease;
}
.portal.is-active .portal-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.portal-panel h2 {
    margin: 0 0 .45rem;
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.portal-panel p {
    margin: 0 0 .85rem;
    color: rgba(244, 245, 248, 0.78);
    font-size: .88rem;
    line-height: 1.45;
    max-width: 36ch;
}
.portal-latest-label {
    margin: 0 0 .45rem;
    font-size: .65rem;
    font-weight: 750;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--portal-color) 85%, #fff);
}
.portal-articles {
    list-style: none;
    margin: 0 0 .9rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.portal-articles a {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: .55rem;
    align-items: center;
}
.portal-articles .thumb {
    width: 52px; height: 36px;
    border-radius: 4px;
    overflow: hidden;
    background: #1a1a24;
}
.portal-articles .thumb img,
.portal-articles .thumb .cover-fallback {
    width: 100%; height: 100%; object-fit: cover;
}
.portal-articles strong {
    display: block;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.2;
}
.portal-articles span {
    font-size: .7rem;
    color: var(--muted);
}
.btn-explore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .6rem 1.2rem;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(135deg, #c4b5fd, #67e8f9);
    color: #0a0a12;
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(103, 232, 249, 0.25);
}
.btn-explore:hover { filter: brightness(1.06); }
.portal[data-universe="polar"] { --portal-color: var(--polar); }
.portal[data-universe="scifi"] { --portal-color: var(--scifi); }
.portal[data-universe="animation"] { --portal-color: var(--anim); }
.portal[data-universe="documentaire"] { --portal-color: var(--doc); }
.portal[data-universe="asie"] { --portal-color: var(--asia); }
.portal[data-universe="scifi"] .btn-explore {
    background: linear-gradient(135deg, #c4b5fd, #67e8f9);
}
.portal[data-universe="polar"] .btn-explore {
    background: linear-gradient(135deg, #93c5fd, #60a5fa);
}
.portal[data-universe="animation"] .btn-explore {
    background: linear-gradient(135deg, #fcd34d, #f59e0b);
}
.portal[data-universe="documentaire"] .btn-explore {
    background: linear-gradient(135deg, #6ee7b7, #34d399);
}
.portal[data-universe="asie"] .btn-explore {
    background: linear-gradient(135deg, #fda4af, #f43f5e);
}

/* Art fallbacks */
.art-polar { background: linear-gradient(160deg, #0a1528, #050810 50%, #122038), radial-gradient(circle at 40% 60%, rgba(59,130,246,.35), transparent 45%); }
.art-scifi { background: linear-gradient(160deg, #12082a, #050510 45%, #0a1830), radial-gradient(circle at 70% 30%, rgba(167,139,250,.4), transparent 40%), radial-gradient(circle at 30% 70%, rgba(103,232,249,.25), transparent 40%); }
.art-anim { background: linear-gradient(160deg, #2a1808, #0a0805 50%, #1a1008), radial-gradient(circle at 50% 30%, rgba(245,158,11,.4), transparent 45%); }
.art-doc { background: linear-gradient(160deg, #061810, #050805 50%, #0a1814), radial-gradient(circle at 45% 40%, rgba(52,211,153,.35), transparent 45%); }
.art-asia { background: linear-gradient(160deg, #1a0810, #080508 50%, #200810), radial-gradient(circle at 55% 35%, rgba(244,63,94,.4), transparent 45%), radial-gradient(circle at 70% 20%, rgba(255,200,120,.15), transparent 30%); }

/* Exploration frieze */
.exploration {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 2rem;
    padding: .35rem 0 1rem;
}
.exploration-label {
    flex: 0 0 auto;
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}
.exploration-track {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: 0 .25rem;
}
.exploration-track::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: rgba(255,255,255,.12);
    z-index: 0;
}
.exp-dot {
    position: relative;
    z-index: 1;
    width: 42px; height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.18);
    background: var(--bg-elev);
    color: var(--muted);
    display: grid; place-items: center;
    font-size: 1rem;
    transition: border-color .25s ease, box-shadow .25s ease, color .25s ease, transform .25s ease;
}
.exp-dot:hover {
    color: var(--ink);
    border-color: rgba(255,255,255,.4);
    transform: translateY(-2px);
}
.exp-dot.is-active {
    color: #fff;
    border-color: color-mix(in srgb, var(--dot-color) 80%, #fff);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--dot-color) 25%, transparent),
        0 0 18px color-mix(in srgb, var(--dot-color) 45%, transparent);
}

/* Bottom rail */
.recent-rail-wrap { position: relative; }
.recent-rail {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: .15rem .15rem .5rem;
    scrollbar-width: none;
}
.recent-rail::-webkit-scrollbar { display: none; }
.recent-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: .75rem;
    align-items: center;
    padding: .55rem;
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--line);
    transition: border-color .25s ease, background .25s ease;
}
.recent-card:hover {
    border-color: rgba(167, 139, 250, 0.35);
    background: rgba(255,255,255,.05);
}
.recent-thumb {
    width: 110px; height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: #15151e;
}
.recent-thumb img,
.recent-thumb .cover-fallback {
    width: 100%; height: 100%; object-fit: cover;
}
.recent-card h3 {
    margin: 0 0 .3rem;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
}
.recent-card .meta {
    font-size: .75rem;
    color: var(--muted);
}
.rail-next {
    position: absolute; right: -.15rem; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(5,5,8,.7);
    color: #fff;
    display: grid; place-items: center;
    backdrop-filter: blur(8px);
}
.rail-next:hover { border-color: #fff; }

.cover-fallback {
    display: grid; place-items: center;
    width: 100%; height: 100%;
    background: linear-gradient(145deg, #1a1a24, #0e0e14);
    color: rgba(244,245,248,.25);
    font-weight: 800; letter-spacing: .08em;
}

/* Pages */
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 0 1rem;
}
.section-head h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .85rem;
}
.card {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    transition: transform .25s ease, border-color .25s ease;
}
.card:hover {
    transform: translateY(-3px);
    border-color: rgba(167, 139, 250, 0.35);
}
.card-media { aspect-ratio: 2 / 3; overflow: hidden; background: #15151e; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: .8rem; }
.card-title {
    margin: .3rem 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}
.meta { color: var(--muted); font-size: .78rem; }
.badge {
    display: inline-flex;
    padding: .18rem .45rem;
    border-radius: 999px;
    font-size: .65rem; font-weight: 750;
    letter-spacing: .08em; text-transform: uppercase;
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.15);
}
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 999px;
    background: linear-gradient(135deg, #c4b5fd, #67e8f9);
    color: #0a0a12;
    padding: .7rem 1.2rem;
    font-size: .8rem; font-weight: 750;
}
.btn:hover { filter: brightness(1.06); }
.empty {
    padding: 2rem;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

.article-cover {
    width: min(var(--max), calc(100% - 1.5rem));
    margin: 0 auto 1.2rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.article-cover img { width: 100%; max-height: 420px; object-fit: cover; }
.article-wrap {
    width: min(720px, calc(100% - 1.5rem));
    margin: 0 auto 2.5rem;
}
.breadcrumb {
    display: flex; flex-wrap: wrap; gap: .4rem;
    color: var(--muted); font-size: .85rem; margin-bottom: .85rem;
}
.breadcrumb a:hover { color: #c4b5fd; }
.article-wrap h1 {
    margin: .4rem 0 .75rem;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.12;
}
.article-content {
    margin-top: 1.4rem;
    line-height: 1.8;
    font-size: 1.05rem;
    color: rgba(244,245,248,.9);
}
.article-content a { color: #c4b5fd; }
.article-content h2, .article-content h3 { color: var(--ink); }
.article-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    border-left: 2px solid var(--scifi);
    background: rgba(167, 139, 250, 0.08);
    border-radius: 0 10px 10px 0;
    font-style: italic;
}
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.4rem; }
.related { margin-top: 2.2rem; }

.pu-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .8rem;
}
.pu-footer-inner {
    width: min(var(--max), calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1.5rem 0;
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.pu-footer a:hover { color: #c4b5fd; }

@media (max-width: 1000px) {
    .portals {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        min-height: 420px;
        padding-bottom: .35rem;
    }
    .portal {
        flex: 0 0 180px;
        scroll-snap-align: center;
        min-height: 400px;
    }
    .portal.is-active {
        flex: 0 0 min(78vw, 360px);
    }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
    .pu-nav {
        display: none; position: absolute; left: .75rem; right: .75rem;
        top: calc(var(--header-h) + .3rem);
        flex-direction: column;
        background: var(--bg-elev);
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: .65rem; z-index: 50;
    }
    .pu-nav.is-open { display: flex; }
    .mobile-toggle { display: inline-grid; }
    .exploration { flex-direction: column; align-items: stretch; gap: .65rem; }
}
@media (max-width: 560px) {
    .cards-grid { grid-template-columns: 1fr; }
    .recent-card { flex-basis: 240px; }
}
