:root {
    --bg: #05070c;
    --bg-soft: #0b1020;
    --surface: rgba(14, 20, 37, .74);
    --surface-strong: rgba(17, 24, 39, .92);
    --surface-soft: rgba(255, 255, 255, .055);
    --text: #edf2ff;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, .18);
    --border-strong: rgba(148, 163, 184, .32);
    --accent: #22d3ee;
    --accent-2: #a78bfa;
    --accent-3: #34d399;
    --danger: #fb7185;
    --shadow: 0 26px 70px rgba(0, 0, 0, .35);
    --radius: 28px;
    --radius-sm: 18px;
    --container: 1180px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body.light-mode {
    --bg: #f7f9fc;
    --bg-soft: #eef2ff;
    --surface: rgba(255, 255, 255, .82);
    --surface-strong: rgba(255, 255, 255, .96);
    --surface-soft: rgba(15, 23, 42, .052);
    --text: #0f172a;
    --muted: #475569;
    --border: rgba(15, 23, 42, .12);
    --border-strong: rgba(15, 23, 42, .22);
    --shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 0%, rgba(34, 211, 238, .16), transparent 32rem),
        radial-gradient(circle at 80% 12%, rgba(167, 139, 250, .14), transparent 34rem),
        linear-gradient(180deg, var(--bg), var(--bg-soft) 46%, var(--bg));
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, .065) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .065) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 0, rgba(0, 0, 0, .2) 100%);
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
p { color: var(--muted); }
.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(820px, calc(100% - 40px)); }
.site-shell { overflow: hidden; }
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    background: var(--surface-strong);
    border-radius: 10px;
    clip: auto !important;
    clip-path: none;
    color: var(--text);
    display: block;
    height: auto;
    left: 12px;
    padding: 10px 14px;
    top: 12px;
    width: auto;
    z-index: 99999;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    background: rgba(5, 7, 12, .68);
}
body.light-mode .site-header { background: rgba(247, 249, 252, .74); }
.header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    border-radius: 16px;
    color: #061018;
    font-weight: 900;
    letter-spacing: -.04em;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 30px rgba(34, 211, 238, .24);
}
.brand-logo img { max-height: 46px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: -.02em; }
.brand-text small { color: var(--muted); font-size: 12px; }
.main-navigation { margin-left: auto; }
.main-navigation ul {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-navigation a {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 9px 13px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a { color: var(--text); background: var(--surface-soft); }
.theme-toggle,
.nav-toggle {
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
    border-radius: 999px;
    cursor: pointer;
}
.theme-toggle {
    width: 42px;
    height: 42px;
    font-size: 17px;
}
.nav-toggle { display: none; width: 44px; height: 44px; padding: 12px; }
.nav-toggle span:not(.screen-reader-text) {
    display: block;
    height: 2px;
    margin: 4px 0;
    background: var(--text);
    border-radius: 2px;
}
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1000;
    pointer-events: none;
}
.reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

.hero-section {
    position: relative;
    padding: 96px 0 44px;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
    align-items: center;
    gap: 44px;
}
.hero-copy h1,
.archive-hero h1,
.single-hero h1,
.not-found-hero h1 {
    margin: 16px 0;
    color: var(--text);
    font-size: clamp(42px, 7vw, 86px);
    line-height: .96;
    letter-spacing: -.07em;
}
.single-hero h1 { font-size: clamp(38px, 6vw, 70px); }
.hero-copy p { max-width: 720px; font-size: 20px; color: var(--muted); }
.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-family: var(--mono);
}
.eyebrow::before,
.section-kicker::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--accent-3);
    box-shadow: 0 0 18px var(--accent-3);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn,
.search-submit,
.wp-block-button__link,
button:not(.theme-toggle):not(.nav-toggle) {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 900;
    line-height: 1.1;
    cursor: pointer;
}
.btn-primary,
.search-submit,
.wp-block-button__link {
    color: #061018;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    box-shadow: 0 18px 40px rgba(34, 211, 238, .18);
}
.btn-primary:hover,
.search-submit:hover { color: #061018; transform: translateY(-1px); }
.btn-ghost {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}
.hero-terminal {
    position: relative;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(15, 23, 42, .9), rgba(15, 23, 42, .66));
    box-shadow: var(--shadow);
    overflow: hidden;
}
body.light-mode .hero-terminal { background: rgba(255, 255, 255, .86); }
.hero-terminal::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(34, 211, 238, .24), transparent 20rem);
    pointer-events: none;
}
.terminal-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    color: var(--muted);
    font-size: 13px;
}
.terminal-top span { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); }
.terminal-top span:nth-child(2) { background: #fbbf24; }
.terminal-top span:nth-child(3) { background: var(--accent-3); }
.terminal-top strong { margin-left: auto; font-weight: 500; }
.terminal-body { padding: 28px 24px 34px; font-family: var(--mono); }
.terminal-body p { margin: 12px 0; color: var(--text); }
.prompt { color: var(--accent); }
.success { color: var(--accent-3); }
.muted { color: var(--muted); }
.hero-glow { position: absolute; width: 320px; height: 320px; border-radius: 999px; filter: blur(60px); opacity: .35; pointer-events: none; }
.hero-glow-one { left: -80px; top: 60px; background: var(--accent); }
.hero-glow-two { right: -100px; bottom: 0; background: var(--accent-2); }

.feature-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    margin-top: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.feature-strip div {
    min-height: 110px;
    border-radius: 22px;
    padding: 20px;
    background: var(--surface-soft);
}
.feature-strip strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 18px; }
.feature-strip span { color: var(--muted); font-size: 14px; }

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-top: 76px;
    margin-bottom: 22px;
}
.section-head h2 {
    margin: 8px 0 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
    letter-spacing: -.05em;
}
.section-head > a { color: var(--accent); font-weight: 900; }
.card-grid { display: grid; gap: 20px; }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-card,
.note-card,
.widget,
.author-box,
.post-navigation-custom,
.comments-wrap,
.entry-content-wrap,
.not-found-hero {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.post-card { overflow: hidden; transition: transform .2s ease, border-color .2s ease; }
.post-card:hover { transform: translateY(-4px); border-color: rgba(34, 211, 238, .42); }
.post-card-link { display: flex; flex-direction: column; height: 100%; }
.post-card-media {
    display: grid;
    place-items: center;
    aspect-ratio: 16/10;
    margin: 0;
    overflow: hidden;
    background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, .18), transparent 18rem), var(--surface-soft);
}
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover img { transform: scale(1.035); }
.placeholder-media span {
    font-size: 58px;
    font-weight: 1000;
    letter-spacing: -.12em;
    color: rgba(255, 255, 255, .16);
}
body.light-mode .placeholder-media span { color: rgba(15, 23, 42, .16); }
.post-card-body { padding: 22px; }
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
    font-family: var(--mono);
}
.post-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--surface-soft);
}
.post-meta a { color: var(--accent); }
.post-card h2,
.note-card h3 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.18;
    letter-spacing: -.035em;
}
.post-card p,
.note-card p { margin: 0 0 18px; }
.read-more { color: var(--accent); font-weight: 900; }
.note-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 86px; }
.note-card { transition: transform .2s ease, border-color .2s ease; }
.note-card a { display: block; min-height: 220px; padding: 22px; }
.note-card:hover { transform: translateY(-4px); border-color: rgba(167, 139, 250, .44); }
.note-card span { display: block; color: var(--accent-2); font-family: var(--mono); font-size: 12px; margin-bottom: 14px; }
.empty-note { padding: 22px; grid-column: span 2; }
.no-results { grid-column: 1/-1; padding: 28px; border: 1px dashed var(--border); border-radius: var(--radius); }

.page-main { padding: 74px 0 90px; }
.archive-hero { margin-bottom: 28px; }
.archive-hero h1 { font-size: clamp(40px, 6vw, 74px); }
.archive-hero p,
.archive-description { max-width: 720px; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.sidebar { position: sticky; top: 100px; display: grid; gap: 16px; }
.widget { padding: 22px; }
.widget-title { margin: 0 0 14px; font-size: 18px; }
.widget ul { margin: 0; padding-left: 18px; color: var(--muted); }
.widget li { margin: 8px 0; }
.topic-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-cloud a,
.tag-cloud a {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 12px !important;
    font-weight: 800;
}
.pagination-wrap { margin-top: 30px; }
.nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.page-numbers {
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 8px 12px;
}
.page-numbers.current { background: var(--accent); color: #061018; border-color: transparent; }

.single-main { padding: 72px 0 90px; }
.back-link { display: inline-flex; margin-bottom: 18px; color: var(--accent); font-weight: 900; }
.single-excerpt { font-size: 20px; }
.single-featured { margin-top: 28px; margin-bottom: 28px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.single-featured img { display: block; width: 100%; max-height: 620px; object-fit: cover; }
.entry-content-wrap { padding: clamp(24px, 5vw, 54px); }
.entry-content {
    font-size: 18px;
    color: var(--text);
}
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -.04em;
    margin-top: 1.8em;
}
.entry-content h2 { font-size: clamp(30px, 4vw, 42px); }
.entry-content h3 { font-size: 26px; }
.entry-content a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.entry-content blockquote {
    margin: 32px 0;
    padding: 22px 24px;
    border-left: 4px solid var(--accent);
    border-radius: 18px;
    background: var(--surface-soft);
}
.entry-content code,
.entry-content kbd {
    font-family: var(--mono);
    color: var(--accent-3);
    background: rgba(34, 197, 94, .08);
    border: 1px solid rgba(52, 211, 153, .16);
    border-radius: 8px;
    padding: .1em .35em;
}
.entry-content pre {
    position: relative;
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #060914;
    color: #dbeafe;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.entry-content pre code {
    display: block;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
}
.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    min-height: 32px !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    background: rgba(255, 255, 255, .08) !important;
    color: #e2e8f0 !important;
    font-size: 12px;
}
.entry-content table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 18px; }
.entry-content th,
.entry-content td { border: 1px solid var(--border); padding: 12px; }
.entry-footer { margin-top: 32px; }
.author-box {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 20px;
    margin-top: 24px;
}
.author-avatar img { border-radius: 20px; }
.author-box span { color: var(--accent); font-family: var(--mono); font-size: 12px; }
.author-box h2 { margin: 2px 0 0; }
.author-box p { margin: 4px 0 0; }
.post-navigation-custom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    margin-top: 24px;
}
.post-navigation-custom div { min-height: 60px; display: flex; align-items: center; }
.post-navigation-custom div:last-child { justify-content: flex-end; text-align: right; }
.post-navigation-custom a { color: var(--text); font-weight: 900; }
.comments-wrap { margin-top: 24px; padding: 24px; }

.search-form { display: flex; gap: 8px; width: 100%; }
.search-form label { flex: 1; }
.search-field {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--text);
    background: var(--surface);
    outline: none;
}
.search-field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(34, 211, 238, .12); }
.not-found-hero { padding: clamp(28px, 6vw, 60px); text-align: center; }
.not-found-hero .search-form { max-width: 560px; margin: 20px auto; }

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(5, 7, 12, .52);
    padding: 46px 0 24px;
}
body.light-mode .site-footer { background: rgba(255, 255, 255, .52); }
.footer-grid {
    display: grid;
    grid-template-columns: 1.1fr .8fr 1fr;
    gap: 28px;
    align-items: start;
}
.footer-brand { font-size: 24px; font-weight: 1000; letter-spacing: -.05em; }
.footer-links ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.footer-links a { display: inline-flex; padding: 8px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .header-inner { min-height: 70px; }
    .brand { min-width: 0; }
    .brand-text small { display: none; }
    .nav-toggle { display: inline-block; margin-left: auto; }
    .main-navigation {
        position: absolute;
        top: calc(100% + 10px);
        left: 20px;
        right: 20px;
        display: none;
        margin: 0;
        border: 1px solid var(--border);
        border-radius: 24px;
        padding: 12px;
        background: var(--surface-strong);
        box-shadow: var(--shadow);
    }
    body.nav-open .main-navigation { display: block; }
    .main-navigation ul { flex-direction: column; align-items: stretch; }
    .main-navigation a { justify-content: center; }
    .hero-section { padding-top: 58px; }
    .hero-grid { grid-template-columns: 1fr; }
    .feature-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .three-col,
    .two-col,
    .content-layout,
    .footer-grid { grid-template-columns: 1fr; }
    .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar { position: static; }
}

@media (max-width: 620px) {
    .container,
    .narrow { width: min(100% - 28px, var(--container)); }
    .hero-copy h1,
    .archive-hero h1,
    .single-hero h1 { letter-spacing: -.055em; }
    .hero-copy p,
    .single-excerpt { font-size: 17px; }
    .hero-actions,
    .search-form,
    .footer-bottom { flex-direction: column; }
    .btn,
    .search-submit { width: 100%; }
    .feature-strip,
    .note-grid,
    .post-navigation-custom { grid-template-columns: 1fr; }
    .feature-strip div { min-height: auto; }
    .section-head { align-items: start; flex-direction: column; margin-top: 54px; }
    .post-card-body,
    .entry-content-wrap { padding: 20px; }
    .entry-content { font-size: 16px; }
    .terminal-body { font-size: 13px; padding: 22px 18px; }
}
