/* =====================================================
   Moban 8-10-9 — Bento v2 · main.css
   Left vertical icon rail + Bento content grid
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&display=swap');

/* Page-level horizontal overflow guard */
html, body { overflow-x: hidden; }

/* ===== Background atmosphere ===== */
body {
    background:
        radial-gradient(900px 500px at 85% -100px, rgba(124, 107, 174, .14), transparent 60%),
        radial-gradient(700px 400px at -100px 40%, rgba(124, 107, 174, .10), transparent 55%),
        var(--bg-soft);
    background-attachment: fixed;
}

/* ===== Icon rail (left, fixed on desktop) ===== */
.icon-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    background: linear-gradient(180deg, #3D3458 0%, var(--slate-deep) 100%);
    box-shadow: 4px 0 24px rgba(53, 61, 76, .18);
    min-width: 0;
}

.rail-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    padding: 4px;
    box-shadow: 0 0 0 2px rgba(201, 191, 232, .5);
    transition: transform .25s ease, box-shadow .25s ease;
}
.rail-logo:hover { transform: scale(1.08); box-shadow: 0 0 0 3px var(--lavender-light); }
.rail-logo .logo-img { width: 100%; height: 100%; object-fit: contain; }

.rail-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex: 1;
    min-width: 0;
}

.rail-item {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lavender-light);
    transition: background .25s ease, color .25s ease, transform .25s ease;
}
.rail-item:hover {
    background: rgba(124, 107, 174, .35);
    color: #fff;
    transform: translateY(-2px);
}
.rail-item .rail-icon { display: flex; align-items: center; justify-content: center; }
.rail-item .rail-label {
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: var(--slate-deep);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.rail-item:hover .rail-label {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}
.rail-item-accent {
    background: var(--grad-accent);
    color: #fff;
    box-shadow: 0 6px 14px rgba(124, 107, 174, .45);
}
.rail-item-accent:hover { background: var(--grad-main); }
.rail-item-active { background: rgba(124, 107, 174, .35); color: #fff; }

.rail-foot { padding-bottom: 6px; }
.rail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lavender-light);
    display: block;
    animation: rail-pulse 2.4s ease-in-out infinite;
}
@keyframes rail-pulse {
    0%, 100% { opacity: .4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.35); }
}

/* ===== Content area offset from rail ===== */
.content-area {
    margin-left: var(--rail-w);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main { flex: 1; padding: 10px 0 40px; min-width: 0; }

/* ===== Top bar ===== */
.top-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 28px 8px;
    min-width: 0;
}
.top-bar-info { min-width: 0; }
.top-bar-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--lavender);
    margin-bottom: 4px;
}
.top-bar-title {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--slate-deep), var(--lavender));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ===== Bento grid (areas defined HERE only) ===== */
.bento-grid {
    display: grid;
    grid-template-columns: 1.35fr 1.35fr 1fr 1fr;
    grid-template-areas:
        "hero hero dl   stats"
        "hero hero icons news"
        "games games games news";
    gap: 20px;
    margin-top: 14px;
}
.bento-hero  { grid-area: hero; }
.bento-download { grid-area: dl; }
.bento-stats { grid-area: stats; }
.bento-icons { grid-area: icons; }
.bento-news  { grid-area: news; }
.bento-games { grid-area: games; }

.bento-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 22px;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(124, 107, 174, .08);
    transition: transform .28s ease, box-shadow .28s ease;
}
.bento-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.card-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--lavender);
    margin-bottom: 8px;
}
.card-heading { font-size: 19px; margin-bottom: 8px; }
.card-text { font-size: 13.5px; color: #6B7280; margin-bottom: 14px; }
.card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    min-width: 0;
}
.card-head-row .card-heading { margin-bottom: 0; }
.card-more { font-size: 13px; font-weight: 600; color: var(--lavender); white-space: nowrap; }
.card-more:hover { color: var(--lavender-dark); }

/* --- Hero card --- */
.bento-hero { padding: 0; position: relative; min-height: 380px; display: flex; }
.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: relative;
    z-index: 1;
    margin-top: auto;
    width: 100%;
    padding: 60px 28px 26px;
    background: linear-gradient(180deg, transparent 0%, rgba(42, 34, 66, .72) 55%, rgba(42, 34, 66, .92) 100%);
    color: #fff;
}
.hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    backdrop-filter: blur(4px);
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}
.hero-title { color: #fff; font-size: 30px; margin-bottom: 8px; }
.hero-desc { font-size: 14px; color: rgba(255, 255, 255, .85); margin-bottom: 18px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-light { background: #fff; color: var(--lavender-dark); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.btn-light:hover { box-shadow: 0 10px 22px rgba(0, 0, 0, .18); }

/* --- Download CTA card --- */
.bento-download {
    background: var(--grad-main);
    color: #fff;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.bento-download .card-kicker { color: rgba(255, 255, 255, .8); }
.bento-download .card-heading { color: #fff; }
.bento-download .card-text { color: rgba(255, 255, 255, .85); }

/* --- Stats card --- */
.stats-list { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.stat-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(124, 107, 174, .25);
    min-width: 0;
}
.stat-item:last-child { border-bottom: 0; padding-bottom: 0; }
.stat-num {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 26px;
    font-weight: 800;
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 13px; color: #6B7280; text-align: right; }

/* --- Icon list card --- */
.icon-list { display: flex; flex-direction: column; gap: 6px; }
.icon-list-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    transition: background .2s ease, transform .2s ease;
    min-width: 0;
}
.icon-list-link:hover { background: var(--bg-soft); transform: translateX(4px); }
.icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 1px solid rgba(124, 107, 174, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}
.icon-list-text { display: flex; flex-direction: column; min-width: 0; }
.icon-list-text strong { font-size: 14px; color: var(--slate-deep); }
.icon-list-text em { font-style: normal; font-size: 12px; color: #8A93A6; }

/* --- News card --- */
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-item { display: flex; gap: 12px; align-items: center; min-width: 0; }
.news-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(124, 107, 174, .18);
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-body { min-width: 0; }
.news-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--slate-deep);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    transition: color .2s ease;
}
.news-item:hover .news-title { color: var(--lavender); }
.news-date { font-size: 12px; color: #8A93A6; }
.news-empty { font-size: 14px; color: #8A93A6; }

/* --- Games card --- */
.game-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.game-tile {
    background: var(--bg-soft);
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
    transition: transform .25s ease, box-shadow .25s ease;
}
.game-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.game-tile-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.game-tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.game-tile:hover .game-tile-img img { transform: scale(1.07); }
.game-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(35, 28, 58, .75);
    color: #FFD966;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    backdrop-filter: blur(3px);
}
.game-tile-info { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.game-tile-name {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Secondary bento strip --- */
.bento-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}
.strip-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    border: 1px solid rgba(124, 107, 174, .08);
    box-shadow: var(--shadow-card);
    padding: 22px;
    min-width: 0;
    transition: transform .25s ease, box-shadow .25s ease;
}
.strip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.strip-card-grad { background: var(--grad-accent); border: 0; }
.strip-card-grad .card-heading { color: #fff; }
.strip-card-grad .card-text { color: rgba(255, 255, 255, .85); }

/* ===== List pages (index / archive) ===== */
.page-head { margin: 14px 0 24px; }
.page-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--lavender);
    margin-bottom: 8px;
}
.page-title { font-size: 32px; margin-bottom: 8px; }
.page-desc { color: #6B7280; max-width: 620px; }

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.post-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    border: 1px solid rgba(124, 107, 174, .08);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-soft); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.post-card:hover .post-card-media img { transform: scale(1.06); }
.post-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.post-date { font-size: 12px; color: #8A93A6; }
.post-card-title { font-size: 16.5px; line-height: 1.35; }
.post-card-title a { color: var(--slate-deep); }
.post-card-title a:hover { color: var(--lavender); }
.post-card-excerpt { font-size: 13.5px; color: #6B7280; }
.post-card-more { margin-top: auto; font-size: 13px; font-weight: 700; color: var(--lavender); }
.posts-empty { grid-column: 1 / -1; color: #8A93A6; }

.pagination-wrap { margin-top: 30px; }
.pagination-wrap .nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination-wrap .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--slate);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-card);
    transition: background .2s ease, color .2s ease;
}
.pagination-wrap .page-numbers:hover { color: var(--lavender); }
.pagination-wrap .page-numbers.current { background: var(--grad-accent); color: #fff; }

/* ===== Single article ===== */
.article-card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    border: 1px solid rgba(124, 107, 174, .08);
    box-shadow: var(--shadow-card);
    padding: 36px;
    max-width: 860px;
    margin: 14px auto 0;
    min-width: 0;
}
.article-head { margin-bottom: 22px; }
.article-title { font-size: 32px; margin-bottom: 12px; }
.article-meta { font-size: 13px; color: #8A93A6; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.article-meta a { color: var(--lavender); }
.article-thumb { border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.article-content { font-size: 15.5px; line-height: 1.8; color: #4A5568; min-width: 0; }
.article-content p { margin-bottom: 16px; }
.article-content h2 { font-size: 24px; margin: 28px 0 12px; }
.article-content h3 { font-size: 20px; margin: 24px 0 10px; }
.article-content img { border-radius: 10px; }
.article-content ul, .article-content ol { margin: 0 0 16px 22px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content blockquote {
    border-left: 4px solid var(--lavender);
    background: var(--bg-soft);
    padding: 14px 18px;
    border-radius: 0 10px 10px 0;
    margin: 18px 0;
    font-style: italic;
}
.article-content a { color: var(--lavender); text-decoration: underline; }

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 860px;
    margin: 22px auto 0;
}
.post-nav-item {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 18px;
    min-width: 0;
}
.post-nav-item a { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.post-nav-label { font-size: 12px; color: var(--lavender); font-weight: 700; }
.post-nav-item strong {
    font-size: 14.5px;
    color: var(--slate-deep);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-nav-next { text-align: right; }
.post-nav-next a { align-items: flex-end; }

.article-download-banner {
    max-width: 860px;
    margin: 22px auto 0;
    background: var(--grad-main);
    border-radius: var(--radius-card);
    padding: 26px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: #fff;
    min-width: 0;
}
.dl-banner-text { min-width: 0; }
.dl-banner-text h3 { color: #fff; font-size: 20px; margin-bottom: 4px; }
.dl-banner-text p { font-size: 14px; color: rgba(255, 255, 255, .85); }

.article-comments { max-width: 860px; margin: 22px auto 0; }

/* ===== Footer ===== */
.site-footer {
    margin-top: auto;
    background: linear-gradient(180deg, #3D3458 0%, var(--slate-deep) 100%);
    color: #CBD2E0;
    padding: 44px 0 26px;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}
.footer-widget { min-width: 0; }
.footer-widget .widget-title { color: #fff; font-size: 16px; margin-bottom: 12px; }
.footer-widget a { color: #CBD2E0; }
.footer-widget a:hover { color: var(--lavender-light); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 24px; }
.disclaimer-text { font-size: 13px; line-height: 1.8; color: #A9B2C5; margin: 16px auto 10px; max-width: 720px; }
.footer-copy { font-size: 12px; color: #7E879B; }

/* ===== Reveal-on-scroll (activated by main.js) ===== */
html.has-io .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s cubic-bezier(.22, .61, .36, 1), transform .7s cubic-bezier(.22, .61, .36, 1);
    will-change: opacity, transform;
}
html.has-io .reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    html.has-io .reveal { opacity: 1; transform: none; transition: none; }
    * { animation-duration: .001s; }
}

/* ===== Bento grid collapse (areas stay in main.css) ===== */
@media (max-width: 1100px) {
    .bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "hero  hero"
            "dl    stats"
            "icons news"
            "games games";
    }
}
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hero"
            "dl"
            "stats"
            "icons"
            "news"
            "games";
    }
    .bento-hero { min-height: 300px; }
    .hero-title { font-size: 24px; }
    .game-tiles { grid-template-columns: repeat(2, 1fr); }
    .bento-strip { grid-template-columns: 1fr; }
    .posts-grid { grid-template-columns: 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { text-align: left; }
    .post-nav-next a { align-items: flex-start; }
}
