/* -- THEMING VARIABLES -- */
:root {
    color-scheme: dark;
    --red: #ff3131;
    --bg-color: #090909;
    --text-color: #ffffff;
    --text-muted: #aaaaaa;
    --text-sub: #777777;
    --card-bg: #111111;
    --card-hover: #181818;
    --border-color: rgba(255,255,255,0.07);
    --header-bg: rgba(9,9,9,0.96);
    --footer-bg: #000000;
    --overlay-bg: rgba(5,5,5,0.98);
    --bnav-bg: rgba(6,6,6,0.98);
    --grad-start: rgba(9,9,9,1);
    --grad-mid: rgba(9,9,9,0.65);
    --grad-card: rgba(9,9,9,0.75);
    --ghost-color: rgba(255,255,255,0.025);
}
[data-theme="light"] {
    color-scheme: light;
    --bg-color: #f4f4f4;
    --text-color: #111111;
    --text-muted: #666666;
    --text-sub: #555555;
    --card-bg: #ffffff;
    --card-hover: #fafafa;
    --border-color: rgba(0,0,0,0.08);
    --header-bg: rgba(244,244,244,0.96);
    --footer-bg: #e8e8e8;
    --overlay-bg: rgba(244,244,244,0.98);
    --bnav-bg: rgba(244,244,244,0.98);
    --grad-start: rgba(244,244,244,1);
    --grad-mid: rgba(244,244,244,0.75);
    --grad-card: rgba(244,244,244,0.85);
    --ghost-color: rgba(0,0,0,0.025);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}
a { text-decoration: none; color: inherit; }
img { display: block; }

/* -- HEADER -- */
.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 200;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 18px;
    transition: background 0.3s ease, border-color 0.3s ease;
}
@media(min-width:768px){ .site-header { padding: 0 36px; } }

.hdr-logo { font-family: 'Inter', sans-serif; font-weight: 900; font-size: 26px; letter-spacing: -2px; line-height: 1; }
.hdr-logo .z { color: var(--text-color); }
.hdr-logo .h { color: var(--red); }

.hdr-brand {
    font-family: 'Inter', sans-serif; font-weight: 800; font-size: 16px;
    letter-spacing: 3px; text-transform: uppercase; text-align: center;
    color: var(--text-color); white-space: nowrap;
}
.hdr-brand span { color: var(--red); }

.hdr-menu-btn {
    justify-self: end; background: none; border: none; cursor: pointer;
    padding: 6px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end;
}
.hdr-menu-btn .bar {
    display: block; height: 2px; background: var(--text-color);
    border-radius: 2px; transition: background 0.2s;
}
.hdr-menu-btn .bar:nth-child(1) { width: 22px; }
.hdr-menu-btn .bar:nth-child(2) { width: 16px; }
.hdr-menu-btn .bar:nth-child(3) { width: 22px; }
.hdr-menu-btn:hover .bar { background: var(--red); }

/* -- TICKER -- */
.ticker {
    position: fixed; top: 60px; left: 0; right: 0;
    z-index: 190; height: 32px;
    background: var(--red); display: flex; align-items: center; overflow: hidden;
}
.ticker-label {
    flex-shrink: 0; background: var(--card-bg); height: 100%;
    display: flex; align-items: center; gap: 7px; padding: 0 14px;
    font-family: 'Space Mono', monospace; font-size: 8px; font-weight: 700;
    letter-spacing: 2px; color: var(--red); text-transform: uppercase;
    transition: background 0.3s ease;
}
.live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--red); animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 0%,100%{ opacity:1; } 50%{ opacity:0.3; } }
.ticker-track-wrap { overflow: hidden; flex: 1; }
.ticker-track { display: flex; white-space: nowrap; animation: scroll-left 45s linear infinite; }
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
    font-family: 'Space Mono', monospace; font-size: 9px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase; color: #fff; padding: 0 28px;
}
.ticker-sep { opacity: 0.35; }

/* -- MAIN -- */
main { padding-top: 92px; padding-bottom: 72px; }

/* -- SECTION HEADER -- */
.sec-hd { display: flex; align-items: center; gap: 16px; padding: 28px 18px 14px; }
@media(min-width:768px){ .sec-hd { padding: 32px 36px 14px; } }
.sec-title {
    font-family: 'Inter', sans-serif; font-weight: 900; font-size: 11px;
    letter-spacing: 4px; text-transform: uppercase; color: var(--text-color); white-space: nowrap;
}
.sec-title span { color: var(--red); }
.sec-line { flex: 1; height: 1px; background: var(--border-color); }
.sec-link {
    font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--text-muted); white-space: nowrap; transition: color 0.2s;
}
.sec-link:hover { color: var(--red); }

/* -- HERO -- */
.hero-wrap { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--border-color); }
@media(min-width:768px){ .hero-wrap { grid-template-columns: 2fr 1fr; } }

.hero-main { position: relative; min-height: 440px; background: var(--card-bg); overflow: hidden; display: block; }
@media(min-width:768px){ .hero-main { min-height: 500px; } }
.hero-main img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0.38; transition: opacity 0.5s, transform 0.6s;
}
.hero-main:hover img { opacity: 0.55; transform: scale(1.03); }
.hero-main-grad {
    position: absolute; inset: 0;
    background: linear-gradient(to top, var(--grad-start) 0%, var(--grad-mid) 45%, transparent 100%);
    z-index: 1;
}
.hero-main-body {
    position: relative; z-index: 2; padding: 28px 24px; height: 100%;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-cat {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Space Mono', monospace; font-size: 8px; font-weight: 700;
    letter-spacing: 2.5px; text-transform: uppercase; color: var(--red);
    border: 1px solid rgba(255,49,49,0.4); padding: 3px 10px; border-radius: 2px;
    margin-bottom: 14px; width: fit-content;
}
.hero-cat-dot { width: 5px; height: 5px; background: var(--red); border-radius: 50%; }
.hero-h1 {
    font-family: 'Playfair Display', serif; font-size: clamp(24px,3.8vw,46px);
    font-weight: 900; line-height: 1.1; color: var(--text-color); margin-bottom: 14px;
}
.hero-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; max-width: 560px; }
.hero-meta {
    font-family: 'Space Mono', monospace; font-size: 9px; color: var(--text-sub);
    letter-spacing: 2px; text-transform: uppercase; display: flex; align-items: center; gap: 14px;
}
.hero-meta-cta { color: var(--red); }

.hero-side { display: flex; flex-direction: column; background: var(--card-bg); }
.hero-side-card {
    flex: 1; padding: 20px; display: flex; flex-direction: column;
    border-bottom: 1px solid var(--border-color); transition: background 0.2s; background: var(--card-bg);
}
.hero-side-card:last-child { border-bottom: none; }
.hero-side-card:hover { background: var(--card-hover); }
.side-thumb { width: 100%; height: 110px; object-fit: cover; opacity: 0.6; margin-bottom: 12px; transition: opacity 0.3s; }
.hero-side-card:hover .side-thumb { opacity: 0.9; }
.side-h3 {
    font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700; line-height: 1.35;
    color: var(--text-color); margin: 8px 0 6px; transition: color 0.2s;
}
.hero-side-card:hover .side-h3 { color: var(--red); }
.side-excerpt { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.side-date {
    font-family: 'Space Mono', monospace; font-size: 9px; color: var(--text-sub);
    text-transform: uppercase; letter-spacing: 1px; margin-top: auto; padding-top: 10px;
}

/* -- GRID -- */
.grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--border-color); }
@media(min-width:580px){ .grid { grid-template-columns: 1fr 1fr; } }
@media(min-width:1020px){ .grid { grid-template-columns: 1fr 1fr 1fr; } }

.card { background: var(--card-bg); overflow: hidden; display: block; transition: background 0.25s; }
.card:hover { background: var(--card-hover); }
.card-img { position: relative; height: 190px; overflow: hidden; background: var(--bg-color); }
.card-img img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0.6; transition: opacity 0.4s, transform 0.5s;
}
.card:hover .card-img img { opacity: 0.9; transform: scale(1.04); }
.card-img-grad { position: absolute; inset: 0; background: linear-gradient(to top, var(--grad-card) 0%, transparent 65%); }
.card-body { padding: 16px 18px 20px; }
.card-h3 {
    font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700; line-height: 1.35;
    color: var(--text-color); margin: 10px 0 8px; transition: color 0.2s;
}
.card:hover .card-h3 { color: var(--red); }
.card-excerpt { font-size: 12px; color: var(--text-muted); line-height: 1.65; }
.card-footer {
    font-family: 'Space Mono', monospace; font-size: 9px; color: var(--text-sub);
    text-transform: uppercase; letter-spacing: 1px; margin-top: 14px;
    display: flex; justify-content: space-between; align-items: center;
}
.card-arrow { color: var(--red); opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.card:hover .card-arrow { opacity: 1; transform: translateX(3px); }

/* -- TOPICS -- */
.topics { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--border-color); }
@media(min-width:768px){ .topics { grid-template-columns: repeat(4,1fr); } }
.topic {
    background: var(--card-bg); padding: 24px 20px; display: block;
    transition: background 0.2s; border-left: 3px solid transparent;
}
.topic:hover { background: var(--card-hover); border-left-color: var(--red); }
.topic-icon { font-size: 24px; margin-bottom: 10px; }
.topic-name { font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 700; color: var(--text-color); }
.topic-sub { font-family: 'Space Mono', monospace; font-size: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* -- FOOTER -- */
footer {
    border-top: 1px solid var(--border-color); background: var(--footer-bg);
    padding: 32px 18px 20px; transition: background 0.3s ease;
}
@media(min-width:768px){ footer { padding: 32px 36px 20px; } }
.ftr-brand { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 900; margin-bottom: 18px; color: var(--text-color); }
.ftr-brand span { color: var(--red); }
.ftr-rule { height: 1px; background: var(--border-color); margin-bottom: 18px; }
.ftr-bottom { display: flex; flex-direction: column; gap: 10px; }
@media(min-width:600px){ .ftr-bottom { flex-direction: row; justify-content: space-between; align-items: center; } }
.ftr-copy { font-family: 'Space Mono', monospace; font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.ftr-links { display: flex; gap: 18px; }
.ftr-lnk { font-family: 'Space Mono', monospace; font-size: 9px; color: var(--text-sub); text-transform: uppercase; letter-spacing: 1px; transition: color 0.2s; }
.ftr-lnk:hover { color: var(--text-color); }

/* -- BOTTOM NAV -- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; height: 64px;
    background: var(--bnav-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-color);
    display: grid; grid-template-columns: repeat(4,1fr); transition: background 0.3s ease;
}
.bnav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; color: var(--text-sub); transition: color 0.2s; position: relative; cursor: pointer;
}
.bnav-item:hover { color: var(--text-color); }
.bnav-item.active { color: var(--red); }
.bnav-item.active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 28px; height: 2px; background: var(--red); border-radius: 0 0 3px 3px;
}
.bnav-item i { font-size: 18px; }
.bnav-label { font-family: 'Space Mono', monospace; font-size: 8px; letter-spacing: 1.5px; text-transform: uppercase; }

/* -- MENU OVERLAY -- */
.menu-overlay {
    position: fixed; inset: 0; z-index: 300; background: var(--overlay-bg);
    display: flex; flex-direction: column; justify-content: center;
    padding: 60px 28px; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.3s ease;
}
@media(min-width:768px){ .menu-overlay { padding: 60px 64px; } }
.menu-overlay.open { opacity: 1; visibility: visible; }
.menu-x {
    position: absolute; top: 16px; right: 18px; background: none; border: none;
    color: var(--text-color); font-size: 22px; cursor: pointer;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; transition: color 0.2s;
}
.menu-x:hover { color: var(--red); }
.menu-nav { display: flex; flex-direction: column; gap: 0; }
.menu-nav-link {
    font-family: 'Playfair Display', serif; font-size: clamp(32px,7vw,76px);
    font-weight: 900; line-height: 1.1; color: var(--text-color);
    display: flex; align-items: center; gap: 14px;
    transition: color 0.2s, transform 0.25s; padding: 6px 0;
}
.menu-nav-link:hover { color: var(--red); transform: translateX(12px); }
.menu-n { font-family: 'Space Mono', monospace; font-size: 10px; font-weight: 700; color: var(--red); letter-spacing: 2px; min-width: 26px; align-self: center; }
.menu-sub-links { display: flex; gap: 24px; margin-top: 44px; flex-wrap: wrap; align-items: center; }
.menu-sub-lnk, .theme-toggle-btn {
    font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-sub);
    text-transform: uppercase; letter-spacing: 2px; transition: color 0.2s;
    background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 0;
}
.menu-sub-lnk:hover, .theme-toggle-btn:hover { color: var(--text-color); }
.menu-ghost {
    position: absolute; bottom: 30px; right: -10px;
    font-family: 'Playfair Display', serif; font-size: clamp(90px,20vw,200px);
    font-weight: 900; line-height: 1; color: var(--ghost-color);
    pointer-events: none; user-select: none; letter-spacing: -6px;
}

/* -- STATES -- */
.loading-msg {
    padding: 60px 24px; font-family: 'Space Mono', monospace; font-size: 10px;
    letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted);
    display: flex; align-items: center; gap: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1.2s linear infinite; display: inline-block; }

/* -- POST LAYOUT -- */
.post-main { padding-top: 92px; padding-bottom: 72px; }

.post-hero { position: relative; height: 380px; overflow: hidden; background: var(--card-bg); }
@media(min-width:768px){ .post-hero { height: 500px; } }
.post-hero-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.4; display: block; }
.post-hero-grad {
    position: absolute; inset: 0;
    background: linear-gradient(to top, var(--bg-color) 0%, var(--grad-mid) 55%, transparent 100%);
}

.post-container { max-width: 780px; margin: 0 auto; padding: 32px 18px 48px; }
@media(min-width:768px){ .post-container { padding: 44px 36px 64px; } }

.post-meta-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.post-date { font-family: 'Space Mono', monospace; font-size: 9px; color: var(--text-sub); text-transform: uppercase; letter-spacing: 2px; }
.post-title { font-family: 'Playfair Display', serif; font-size: clamp(28px,5vw,54px); font-weight: 900; line-height: 1.1; color: var(--text-color); margin-bottom: 20px; }
.post-rule { height: 1px; background: var(--border-color); margin-bottom: 36px; }

.post-content { font-size: 15px; line-height: 1.9; color: var(--text-muted); }
.post-content h2 { font-family: 'Playfair Display', serif; font-size: clamp(20px,3.2vw,30px); font-weight: 700; color: var(--text-color); margin: 40px 0 14px; line-height: 1.2; }
.post-content h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--text-color); margin: 30px 0 10px; }
.post-content p { margin-bottom: 22px; }
.post-content a { color: var(--red); border-bottom: 1px solid rgba(255,49,49,0.3); transition: border-color 0.2s; }
.post-content a:hover { border-bottom-color: var(--red); }
.post-content blockquote { border-left: 3px solid var(--red); margin: 32px 0; padding: 10px 22px; color: var(--text-color); font-style: italic; font-size: 16px; line-height: 1.7; }
.post-content ul, .post-content ol { margin: 0 0 22px 22px; }
.post-content li { margin-bottom: 8px; }
.post-content strong { color: var(--text-color); font-weight: 700; }
.post-content img { width: 100%; height: auto; margin: 32px 0; opacity: 0.85; }
.post-content hr { border: none; height: 1px; background: var(--border-color); margin: 40px 0; }
.post-content code { font-family: 'Space Mono', monospace; font-size: 12px; background: var(--card-bg); border: 1px solid var(--border-color); padding: 2px 6px; border-radius: 3px; color: var(--red); }

.post-back { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border-color); display: flex; gap: 28px; flex-wrap: wrap; }
.post-back-link { font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-sub); transition: color 0.2s; }
.post-back-link:hover { color: var(--red); }
