﻿:root {
    --bg: #070A12;
    --panel: rgba(255,255,255,.06);
    --panel2: rgba(255,255,255,.045);
    --stroke: rgba(255,255,255,.10);
    --stroke2: rgba(255,255,255,.14);
    --text: #EAF0FF;
    --muted: #A9B7D6;
    --brand: #7C5CFF;
    --mint: #2EE9A6;
    --shadow: 0 22px 70px rgba(0,0,0,.55);
    --radius: 18px;
    --blur: 18px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background: var(--bg);
    color: var(--text);
}

/* ---------- Background (glow + grain) ---------- */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(28px);
    opacity: .85;
}

.orb-1 {
    width: 620px;
    height: 520px;
    left: -120px;
    top: -120px;
    background: radial-gradient(circle at 30% 30%, rgba(124,92,255,.55), transparent 60%);
}

.orb-2 {
    width: 680px;
    height: 560px;
    right: -180px;
    top: 60px;
    background: radial-gradient(circle at 30% 30%, rgba(46,233,166,.35), transparent 62%);
}

.orb-3 {
    width: 640px;
    height: 520px;
    left: 20%;
    bottom: -240px;
    background: radial-gradient(circle at 30% 30%, rgba(124,92,255,.25), transparent 62%);
}

.grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
    opacity: .14;
    mix-blend-mode: overlay;
}

/* ---------- Glass utility ---------- */
.glass {
    background: linear-gradient(180deg, var(--panel), var(--panel2));
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
}

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 0;
}

.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 900;
    letter-spacing: .2px;
}

.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, var(--mint), var(--brand));
    box-shadow: 0 0 18px rgba(124,92,255,.35);
}

.topbar-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    opacity: .95;
}

.tag {
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,.04);
    color: var(--muted);
}

    .tag.ghost {
        background: rgba(255,255,255,.02);
        border-color: rgba(255,255,255,.08);
    }

.topbar-nav {
    margin-left: auto;
}

.navbtn {
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    font-size: 13px;
    padding: 9px 12px;
    border-radius: 14px;
    border: 1px solid rgba(124,92,255,.30);
    background: rgba(124,92,255,.12);
}

/* ---------- Layout: left sidebar + centered main ---------- */
.shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px 16px;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 76px; /* below topbar */
    height: fit-content;
    border-radius: var(--radius);
    padding: 14px;
}

.main {
    max-width: 860px; /* center reading width */
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 980px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    .main {
        max-width: 100%;
    }
}

/* ---------- Author card ---------- */
.author-head {
    display: flex;
    gap: 12px;
    align-items: center;
}

.avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--stroke2);
    background: rgba(255,255,255,.04);
}

.author-name {
    font-weight: 950;
    letter-spacing: .2px;
}

.author-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.author-bio {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.chips {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    font-size: 11px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.03);
    color: #DDE6FF;
}

.divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 14px 0;
}

.mini-title {
    font-weight: 900;
    font-size: 12px;
    color: #DDE6FF;
    margin-bottom: 10px;
}

.mini-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-pill {
    font-size: 11px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(46,233,166,.18);
    background: rgba(46,233,166,.08);
    color: #CFFFEF;
}

/* ---------- Sections & cards ---------- */
.section {
    margin-top: 14px;
}

.card {
    border-radius: var(--radius);
    padding: 14px;
}

.hero {
    border-radius: var(--radius);
    padding: 18px;
}

    .hero h1 {
        margin: 0 0 6px;
        font-size: 30px;
        letter-spacing: .2px;
    }

    .hero p {
        margin: 0;
        color: var(--muted);
        line-height: 1.55;
    }

.metrics {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 720px) {
    .metrics {
        grid-template-columns: 1fr;
    }
}

.metric {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.03);
    padding: 10px 12px;
}

.metric-k {
    font-size: 12px;
    color: var(--muted);
}

.metric-v {
    margin-top: 4px;
    font-weight: 900;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

    .section-head h2 {
        margin: 0;
        font-size: 16px;
        letter-spacing: .2px;
    }

.badge {
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .6px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(46,233,166,.24);
    background: rgba(46,233,166,.10);
    color: #CFFFEF;
}

/* ---------- Buttons ---------- */
.btn {
    border: 1px solid rgba(124,92,255,.28);
    background: rgba(124,92,255,.12);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 900;
}

    .btn.ghost {
        border: 1px solid rgba(255,255,255,.10);
        background: rgba(255,255,255,.03);
        color: var(--muted);
    }

/* ---------- Post content ---------- */
.post-title {
    margin: 0;
    font-size: 22px;
    letter-spacing: .2px;
}

.meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.media {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.10);
    margin: 12px 0 8px;
}

.content {
    line-height: 1.7;
    color: #DCE6FF;
}

/* ---------- Cards grid ---------- */
.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card-link {
    display: block;
    padding: 14px;
    border-radius: var(--radius);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

    .card-link:hover {
        transform: translateY(-2px);
        border-color: rgba(124,92,255,.32);
        box-shadow: 0 30px 90px rgba(0,0,0,.60);
    }

.card-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.card-title {
    font-weight: 950;
}

.card-date {
    color: var(--muted);
    font-size: 12px;
}

.thumb {
    width: 100%;
    height: 155px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.10);
    margin-top: 10px;
}

.card-snippet {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.card-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 950;
    color: #D7D0FF;
}

.spark {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid rgba(124,92,255,.28);
    background: rgba(124,92,255,.12);
}

/* ---------- Comments ---------- */
.comments {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.comments-title {
    font-weight: 950;
}

    .comments-title .count {
        color: var(--muted);
        font-weight: 800;
    }

.comment-form {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

input, textarea {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.03);
    color: var(--text);
    padding: 11px 12px;
    outline: none;
}

textarea {
    resize: vertical;
}

.comment-list {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.comment {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.02);
    padding: 10px 12px;
}

.comment-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.comment-name {
    font-weight: 950;
    font-size: 13px;
}

.comment-time {
    color: var(--muted);
    font-size: 12px;
}

.comment-text {
    margin-top: 6px;
    color: #DCE6FF;
    line-height: 1.55;
    white-space: pre-wrap;
}

/* ---------- Flash ---------- */
.flashwrap {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.flash {
    padding: 12px 12px;
    border-radius: 16px;
}

    .flash.error {
        border-color: rgba(255, 90, 90, .25);
        background: rgba(255, 90, 90, .10);
    }

    .flash.success {
        border-color: rgba(46,233,166, .25);
        background: rgba(46,233,166, .08);
    }

/* ---------- Empty text ---------- */
.empty {
    color: var(--muted);
    padding: 10px 0;
}

/* ---------- Footer ---------- */
.footer {
    padding: 22px 16px;
    color: var(--muted);
    border-top: 1px solid rgba(255,255,255,.08);
    text-align: center;
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
}

/* optional: trending hover variant */
body.trending .card-link:hover {
    border-color: rgba(46,233,166,.28);
    box-shadow: 0 30px 95px rgba(46,233,166,.08), 0 30px 90px rgba(0,0,0,.60);
}
