:root{
    --bg:#071225;
    --bg-soft:#0d1a32;
    --card:#101b33;
    --card-2:#142142;
    --line:rgba(255,255,255,.08);
    --text:#eef4ff;
    --muted:#a6b1cb;
    --blue:#4d8dff;
    --blue-2:#77a9ff;
    --gold:#dca15f;
    --danger:#ff6b81;
    --shadow:0 20px 60px rgba(0,0,0,.35);
    --radius:22px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{scroll-behavior:smooth}
body{
    font-family:Inter, Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top center, rgba(62,100,197,.18), transparent 30%),
        linear-gradient(180deg, #06101f 0%, #081426 55%, #08111f 100%);
    color:var(--text);
}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}
button,input,textarea{font:inherit}
button{cursor:pointer}
.container{width:min(1240px, calc(100% - 32px));margin:0 auto}
.sr-only{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
}

/* HEADER */

.site-header{
    position:sticky;
    top:0;
    z-index:1000;
    backdrop-filter:blur(18px);
    background:rgba(6,16,31,.82);
    border-bottom:1px solid var(--line);
}
.header-shell{
    display:flex;
    flex-direction:column;
    gap:14px;
    padding:14px 0 16px;
}
.header-top{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:18px;
    align-items:center;
}
.header-bottom{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:16px;
    align-items:center;
}

.brand{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
}
.brand-mark{
    width:60px;
    height:60px;
    border-radius:18px;
    background:linear-gradient(135deg, rgba(116,168,255,.18), rgba(246,179,109,.16));
    border:1px solid rgba(255,255,255,.08);
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 60px;
    overflow:hidden;
}
.brand-logo{
    width:42px;
    height:42px;
    object-fit:contain;
}
.brand-copy{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
}
.brand-name{
    font-size:30px;
    font-weight:900;
    line-height:1;
    background:linear-gradient(90deg,#74a8ff,#f6b36d);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
}
.brand-tagline{
    font-size:12px;
    letter-spacing:.06em;
    text-transform:uppercase;
    color:#c5d0eb;
    opacity:.95;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.header-right{
    display:flex;
    align-items:center;
    gap:12px;
}
.search-form{
    width:min(360px, 100%);
}
.search-form input{
    width:100%;
    height:48px;
    border:none;
    outline:none;
    border-radius:999px;
    padding:0 18px;
    background:rgba(255,255,255,.06);
    color:#fff;
    border:1px solid rgba(255,255,255,.08);
}
.search-form input::placeholder{color:#b5c1dc}

.menu-toggle{
    display:none;
    width:48px;
    height:48px;
    border-radius:14px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
    color:#fff;
    font-size:20px;
}

.main-nav{
    display:flex;
    align-items:center;
    gap:18px;
    flex-wrap:wrap;
}
.main-nav a{
    color:#d9e3f8;
    font-weight:700;
    opacity:.92;
}
.main-nav a:hover{color:#fff}

.header-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:12px;
    flex-wrap:wrap;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:46px;
    padding:0 18px;
    border-radius:14px;
    border:1px solid rgba(255,255,255,.08);
    font-weight:700;
    transition:.2s ease;
}
.btn:hover{transform:translateY(-1px)}
.btn-primary{
    background:linear-gradient(135deg,#cf9655,#e4b071);
    color:#fff;
    box-shadow:0 12px 30px rgba(220,161,95,.25);
}
.btn-dark{
    background:rgba(255,255,255,.04);
    color:#fff;
}

/* GLOBAL */

.site-main{padding:24px 0 56px}
.alert{
    background:#13213d;
    border:1px solid rgba(255,255,255,.08);
    color:#fff;
    border-radius:16px;
    padding:14px 18px;
    margin-bottom:18px;
}
.empty-card{
    background:linear-gradient(180deg, rgba(17,28,54,.96), rgba(11,19,37,.96));
    border:1px solid var(--line);
    border-radius:20px;
    padding:18px;
    color:var(--muted);
}

/* HERO */

.hero{padding:14px 0 24px}
.hero-grid{
    display:grid;
    grid-template-columns:1.15fr .85fr;
    gap:20px;
}
.hero-card{
    background:linear-gradient(180deg, rgba(20,33,66,.95), rgba(15,25,48,.95));
    border:1px solid var(--line);
    border-radius:28px;
    box-shadow:var(--shadow);
}
.hero-copy{padding:34px}
.badge{
    display:inline-flex;
    align-items:center;
    height:32px;
    padding:0 12px;
    border-radius:999px;
    background:rgba(77,141,255,.18);
    color:#9fc0ff;
    font-weight:800;
    font-size:13px;
}
.hero-copy h1{
    margin:14px 0 8px;
    font-size:56px;
    line-height:.95;
}
.hero-slogan{
    font-size:15px;
    text-transform:uppercase;
    letter-spacing:.12em;
    color:#ffd9b3;
    font-weight:700;
    margin-bottom:16px;
}
.hero-copy p{
    color:var(--muted);
    font-size:17px;
    line-height:1.75;
    max-width:700px;
}
.hero-actions{
    display:flex;
    gap:12px;
    margin-top:20px;
    flex-wrap:wrap;
}
.hero-feature{overflow:hidden}
.hero-feature-link{display:block;height:100%}
.hero-feature-media{
    aspect-ratio:16/10;
    background:#0a1225;
    overflow:hidden;
}
.hero-feature-media img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.hero-feature-body{padding:18px 20px}
.hero-feature-body h3{
    margin:0 0 10px;
    line-height:1.3;
}
.hero-feature-empty{padding:0}
.meta-row{
    display:flex;
    justify-content:space-between;
    gap:10px;
    color:var(--muted);
    font-size:14px;
    flex-wrap:wrap;
}

/* HOME CONTENT */

.feed-section{padding-top:10px}
.content-grid{
    display:grid;
    grid-template-columns:minmax(0, 2fr) 360px;
    gap:22px;
}
.section-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}
.section-head h2{margin:0 0 6px}
.section-head p{margin:0;color:var(--muted)}
.section-counter{
    color:#f0bf84;
    font-weight:700;
    white-space:nowrap;
}

.feed-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(260px, 320px));
    gap:18px;
    justify-content:start;
    align-items:start;
}

.post-card{
    width:100%;
    max-width:320px;
    background:linear-gradient(180deg, rgba(17,28,54,.95), rgba(12,20,39,.95));
    border:1px solid var(--line);
    border-radius:20px;
    overflow:hidden;
    transition:.2s ease;
}
.post-card:hover{
    transform:translateY(-4px);
    box-shadow:var(--shadow);
}
.post-card-link{display:block;height:100%}
.post-card-media{
    aspect-ratio:1/1;
    background:#091224;
    overflow:hidden;
}
.post-card-media img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.post-card-body{
    padding:14px;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.card-topline{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}
.mini-badge{
    display:inline-flex;
    align-items:center;
    min-height:28px;
    padding:0 10px;
    border-radius:999px;
    background:rgba(77,141,255,.14);
    color:#9fc0ff;
    font-weight:800;
    font-size:12px;
}
.card-category{
    color:#f0bf84;
    font-size:13px;
    font-weight:700;
}
.post-card-body h3{
    margin:0;
    font-size:20px;
    line-height:1.35;
}
.post-card-stats{
    display:flex;
    flex-direction:column;
    gap:8px;
    color:var(--muted);
    font-size:14px;
}

/* SIDEBAR */

.sidebar{
    display:flex;
    flex-direction:column;
    gap:18px;
}
.side-card,
.comments-card,
.detail-card{
    background:linear-gradient(180deg, rgba(17,28,54,.96), rgba(11,19,37,.96));
    border:1px solid var(--line);
    border-radius:22px;
    box-shadow:var(--shadow);
}
.side-card{padding:18px}
.side-card-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:14px;
}
.side-card-head h3{margin:0}

.trend-list,
.comment-preview-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.trend-item{
    display:flex;
    gap:12px;
    align-items:center;
    padding:10px;
    border-radius:16px;
    background:rgba(255,255,255,.02);
    border:1px solid rgba(255,255,255,.04);
    transition:.2s ease;
}
.trend-item:hover{
    transform:translateY(-2px);
    background:rgba(255,255,255,.04);
}
.trend-thumb{
    width:76px;
    height:76px;
    border-radius:14px;
    overflow:hidden;
    flex:0 0 76px;
    background:#0b1325;
}
.trend-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.trend-copy{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:0;
}
.trend-copy strong{
    display:block;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.trend-copy span{
    color:var(--muted);
    font-size:13px;
}

.random-post{
    display:block;
    overflow:hidden;
    border-radius:18px;
    background:rgba(255,255,255,.02);
    border:1px solid rgba(255,255,255,.04);
}
.random-post-media{
    aspect-ratio:16/10;
    background:#0b1325;
}
.random-post-media img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.random-post-body{
    padding:14px;
    display:flex;
    flex-direction:column;
    gap:6px;
}
.random-post-body span{
    color:var(--muted);
    font-size:13px;
}

.comment-preview{
    display:block;
    padding:14px;
    border-radius:16px;
    background:rgba(255,255,255,.02);
    border:1px solid rgba(255,255,255,.04);
    transition:.2s ease;
}
.comment-preview:hover{
    transform:translateY(-2px);
    background:rgba(255,255,255,.04);
}
.comment-preview strong{display:block;margin-bottom:4px}
.comment-preview-post{
    display:block;
    color:#f0bf84;
    font-size:13px;
    margin-bottom:6px;
}
.comment-preview p{
    margin:0;
    color:var(--muted);
    font-size:14px;
    line-height:1.5;
}

/* MEDIA */

.media-fallback,
.trend-fallback{
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#9eb4e5;
    font-weight:700;
    background:linear-gradient(135deg,#0c1730,#122245);
    text-align:center;
    padding:18px;
}
.media-fallback.large{
    min-height:420px;
    border-radius:18px;
}

/* DETAIL */

.detail-page{padding-top:10px}
.detail-grid{
    display:grid;
    grid-template-columns:minmax(0, 2fr) 340px;
    gap:22px;
}
.detail-main{
    min-width:0;
}
.detail-card{padding:22px}
.detail-head-top{
    display:flex;
    justify-content:space-between;
    gap:16px;
}
.detail-title-wrap{
    display:flex;
    flex-direction:column;
    gap:12px;
    min-width:0;
}
.detail-head h1{
    margin:0;
    font-size:clamp(2rem, 3vw, 3rem);
    line-height:1.02;
}
.detail-meta{
    display:flex;
    flex-wrap:wrap;
    gap:14px;
    color:var(--muted);
    font-size:14px;
}
.detail-media-wrap{margin-top:18px}
.detail-media{
    width:100%;
    max-height:78vh;
    object-fit:contain;
    background:#091224;
    border-radius:18px;
    border:1px solid rgba(255,255,255,.06);
}
.detail-video{
    min-height:420px;
}
.detail-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:18px;
}
.inline-form{margin:0}
.inline-form button{
    appearance:none;
}
.action-chip{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:42px;
    padding:0 15px;
    border-radius:999px;
    background:rgba(255,255,255,.05);
    border:1px solid rgba(255,255,255,.09);
    color:#f5f8ff;
    font-weight:700;
    transition:.2s ease;
}
.action-chip:hover{
    background:rgba(255,255,255,.09);
    transform:translateY(-1px);
}
.action-chip.active{
    background:rgba(220,161,95,.16);
    border-color:rgba(220,161,95,.38);
    color:#ffd4a5;
}
.detail-description{
    margin-top:18px;
    color:var(--muted);
    line-height:1.75;
    font-size:15px;
}

.comments-card{
    margin-top:20px;
    padding:22px;
}
.comment-form{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-bottom:24px;
}
.comment-form textarea{
    width:100%;
    min-height:120px;
    border:none;
    outline:none;
    resize:vertical;
    border-radius:18px;
    padding:16px;
    background:#0b152b;
    color:#fff;
    border:1px solid rgba(255,255,255,.08);
}
.comment-list{
    display:flex;
    flex-direction:column;
    gap:14px;
}
.comment-item{
    display:flex;
    gap:14px;
    padding:14px;
    border-radius:18px;
    background:rgba(255,255,255,.03);
    border:1px solid rgba(255,255,255,.05);
}
.comment-avatar{
    width:44px;
    height:44px;
    border-radius:50%;
    flex:0 0 44px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    background:linear-gradient(135deg,#4d8dff,#dca15f);
}
.comment-body{flex:1}
.comment-top{
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
    color:var(--muted);
    font-size:13px;
    flex-wrap:wrap;
}
.comment-body p{margin:0;line-height:1.6}

.login-notice{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:16px;
    margin-bottom:20px;
    border-radius:18px;
    background:rgba(255,255,255,.03);
    border:1px solid rgba(255,255,255,.05);
}

/* DASHBOARD */

.dashboard-grid,
.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:18px;
}
.stat-box{
    background:linear-gradient(180deg, rgba(17,28,54,.96), rgba(11,19,37,.96));
    border:1px solid var(--line);
    border-radius:22px;
    padding:24px;
    text-align:center;
}
.stat-box strong{
    display:block;
    font-size:34px;
    margin-bottom:8px;
}
.stat-box span{color:var(--muted)}

/* LIGHTBOX */

.lightbox{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.88);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:2000;
    padding:24px;
}
.lightbox img{
    max-width:95vw;
    max-height:92vh;
    border-radius:16px;
    box-shadow:0 20px 80px rgba(0,0,0,.5);
}
.lightbox.show{display:flex}

/* RESPONSIVE */

@media (max-width: 1100px){
    .hero-grid,
    .content-grid,
    .detail-grid{
        grid-template-columns:1fr;
    }

    .header-bottom{
        grid-template-columns:1fr;
    }

    .header-actions{
        justify-content:flex-start;
    }
}

@media (max-width: 860px){
    .menu-toggle{
        display:inline-flex;
        align-items:center;
        justify-content:center;
    }

    .header-top{
        grid-template-columns:1fr auto;
    }

    .header-bottom{
        display:none;
        padding-top:4px;
    }

    .header-bottom.is-open{
        display:grid;
    }

    .main-nav{
        flex-direction:column;
        align-items:flex-start;
        gap:12px;
    }

    .header-actions{
        flex-direction:column;
        align-items:stretch;
    }

    .header-actions .btn{
        width:100%;
    }

    .search-form{
        width:100%;
    }

    .header-right{
        width:100%;
        justify-content:flex-end;
    }
}

@media (max-width: 760px){
    .brand{
        align-items:flex-start;
    }

    .brand-copy{
        align-items:flex-start;
    }

    .brand-name{
        font-size:26px;
    }

    .brand-tagline{
        white-space:normal;
        overflow:visible;
        text-overflow:clip;
    }

    .hero-copy{
        padding:24px;
    }

    .hero-copy h1{
        font-size:42px;
    }

    .detail-card,
    .comments-card,
    .side-card{
        padding-left:16px;
        padding-right:16px;
    }

    .login-notice{
        flex-direction:column;
        align-items:flex-start;
    }
}
