:root {
    --bg: #0b0b0d;
    --bg-soft: #14141a;
    --fg: #e7e7ea;
    --muted: #9aa0a6;
    --accent: #ffcb47;
    --border: #2a2a33;
    --max: 880px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    font-size: 17px;
}
.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.25rem;
}
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    margin-bottom: 2rem;
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand {
    color: var(--fg);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    letter-spacing: 0.1em;
}
nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
nav a, footer a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
}
nav a:hover, footer a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; color: #fff; }
h1 { font-size: 2.25rem; margin-top: 0.5rem; }
h2 { font-size: 1.6rem; margin-top: 2rem; }
h3 { font-size: 1.25rem; }
.intro {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0 0 1.5rem 0;
}
.hero {
    width: 100%;
    margin: 1.5rem 0 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.hero img { width: 100%; height: auto; display: block; }
article.post img, .content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}
.meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.content a { color: var(--accent); }
.content code {
    background: var(--bg-soft);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95em;
}
.content pre {
    background: var(--bg-soft);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin: 1.5rem 0;
}
@media (max-width: 700px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .gallery { grid-template-columns: 1fr; } }
.gallery a,
.content .gallery a {
    display: block;
    margin: 0;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    cursor: zoom-in;
    position: relative;
    padding: 0;
}
.gallery img,
.content .gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    border-radius: 0;
    transition: transform 0.25s, opacity 0.25s;
}
.gallery a:hover img,
.content .gallery a:hover img { transform: scale(1.04); opacity: 0.9; }

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox__figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
}
.lightbox__img {
    max-width: 100%;
    max-height: calc(100vh - 6rem);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.lightbox__caption {
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}
.lightbox__close,
.lightbox__nav {
    position: absolute;
    background: rgba(20,20,26,0.7);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: var(--bg-soft); border-color: var(--accent); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__nav--prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 1rem; top: 50%; transform: translateY(-50%); }
.video {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    margin: 1.5rem 0;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}
.video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    color: var(--muted);
    margin: 1rem 0;
}
.home-hero {
    position: relative;
    width: calc(100% + 4rem);
    max-width: 1040px;
    margin: -1rem auto 2rem;
    aspect-ratio: 16 / 7;
    max-height: 480px;
    overflow: hidden;
    background: #000;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.home-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.home-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.65) 100%);
}
.home-hero__content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
}
.home-hero__logo {
    width: 180px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}
.home-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.15em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.home-hero p {
    max-width: 560px;
    margin: 0;
    color: var(--fg);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    opacity: 0.9;
}

.sections-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    margin: 1rem 0 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.sections-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sections-nav a:hover { color: var(--accent); border-color: var(--accent); }
.sections-nav a.is-active { color: var(--accent); border-color: var(--accent); background: rgba(255,203,71,0.07); }
.sections-nav .count {
    color: var(--muted);
    font-size: 0.75rem;
    background: var(--bg);
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0 3rem 0;
}
.post-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, border-color 0.15s;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.post-card a { color: var(--fg); text-decoration: none; display: block; height: 100%; }
.post-card .thumb {
    background: #000;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .body { padding: 1rem; flex: 1; }
.post-card h3 { margin: 0 0 0.4rem 0; font-size: 1.05rem; color: #fff; }
.post-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.post-card time { color: var(--muted); font-size: 0.8rem; }
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}
.site-footer .wrap {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.posts-list { list-style: none; padding: 0; }
.posts-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; }
.posts-list a { color: var(--fg); text-decoration: none; }
.posts-list a:hover { color: var(--accent); }
.posts-list time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
