:root {
    --theme-bg: #fbfcfe;
    --theme-surface: #ffffff;
    --theme-surface-soft: #f2f5f9;
    --theme-surface-deep: #e7ecf3;
    --theme-text: #1b1c1e;
    --theme-muted: #5a6169;
    --theme-primary: #0b57d0;
    --theme-primary-hover: #0842a0;
    --theme-primary-soft: #d7e3ff;
    --theme-on-primary: #ffffff;
    --theme-warning: #8a5300;
    --theme-warning-soft: #ffe9c7;
    --theme-radius-xl: 36px;
    --theme-radius-lg: 26px;
    --theme-radius-md: 18px;
    --theme-radius-pill: 999px;
    --theme-ease: cubic-bezier(0.2, 0, 0, 1);
    --theme-speed: 240ms;
    --theme-scrollbar-thumb: #c3cddb;
    --theme-scrollbar-track: #eef2f7;
    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-scrollbar-thumb) var(--theme-scrollbar-track);
}

body {
    margin: 0;
    background: var(--theme-bg);
    color: var(--theme-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

html::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

html::-webkit-scrollbar-track {
    background: var(--theme-scrollbar-track);
}

html::-webkit-scrollbar-thumb {
    background: var(--theme-scrollbar-thumb);
    border-radius: 999px;
    border: 3px solid var(--theme-scrollbar-track);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--theme-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
textarea,
select {
    font: inherit;
}

.shell {
    width: min(1200px, 100%);
    margin-inline: auto;
    padding-inline: 20px;
}

.site-content {
    min-height: 60vh;
}

.site-content:focus {
    outline: none;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 999;
    transform: translateY(-140%);
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    padding: 10px 18px;
    border-radius: var(--theme-radius-pill);
    transition: transform var(--theme-speed) var(--theme-ease);
}

.skip-link:focus {
    transform: none;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--theme-bg) 92%, transparent);
    backdrop-filter: blur(18px);
    transition: background var(--theme-speed) var(--theme-ease);
}

.site-header[data-scrolled="true"] {
    background: color-mix(in srgb, var(--theme-surface) 94%, transparent);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 78px;
}

.site-branding {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.site-title-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--theme-text);
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
}

.site-title-mark {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-soft));
}

.site-logo img {
    max-height: 48px;
    width: auto;
}

.site-description {
    margin: 0;
    font-size: 12px;
    color: var(--theme-muted);
}

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

.primary-menu,
.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: var(--theme-radius-pill);
    color: var(--theme-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--theme-speed) var(--theme-ease), color var(--theme-speed) var(--theme-ease);
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
}

.primary-menu .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    list-style: none;
    margin: 0;
    padding: 8px;
    background: var(--theme-surface);
    border-radius: var(--theme-radius-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--theme-speed) var(--theme-ease), transform var(--theme-speed) var(--theme-ease), visibility var(--theme-speed);
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.primary-menu .sub-menu a {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
}

.header-cta,
.theme-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border: 0;
    border-radius: var(--theme-radius-pill);
    background: var(--theme-surface-deep);
    color: var(--theme-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--theme-speed) var(--theme-ease), color var(--theme-speed) var(--theme-ease), transform var(--theme-speed) var(--theme-ease);
}

.header-cta,
.theme-button-primary {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
}

.header-cta:hover,
.theme-button-primary:hover {
    background: var(--theme-primary-hover);
    color: var(--theme-on-primary);
    text-decoration: none;
}

.theme-button-ghost:hover,
.header-cta:hover {
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--theme-radius-pill);
    background: var(--theme-surface-soft);
    cursor: pointer;
}

.nav-toggle-box {
    display: grid;
    gap: 5px;
    justify-content: center;
}

.nav-toggle-box span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--theme-text);
    transition: transform var(--theme-speed) var(--theme-ease), opacity var(--theme-speed) var(--theme-ease);
}

.site-header[data-menu-open="true"] .nav-toggle-box span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header[data-menu-open="true"] .nav-toggle-box span:nth-child(2) {
    opacity: 0;
}

.site-header[data-menu-open="true"] .nav-toggle-box span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hero {
    padding: 56px 0 32px;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 36px;
    align-items: center;
}

.hero-copy {
    animation: theme-rise var(--theme-speed) var(--theme-ease) both;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--theme-primary);
}

.hero-title {
    margin: 0 0 14px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -1.6px;
    font-weight: 700;
}

.hero-text {
    margin: 0 0 24px;
    max-width: 62ch;
    font-size: 17px;
    color: var(--theme-muted);
}

.hero-search {
    margin-bottom: 18px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-panel {
    display: flex;
    justify-content: center;
    animation: theme-rise 320ms var(--theme-ease) both;
}

.hero-device {
    width: min(320px, 100%);
    background: var(--theme-surface-soft);
    border-radius: 44px;
    padding: 18px;
    transform: rotate(3deg);
}

.hero-device-top {
    width: 72px;
    height: 8px;
    border-radius: 999px;
    background: var(--theme-surface-deep);
    margin: 0 auto 16px;
}

.hero-device-screen {
    background: var(--theme-surface);
    border-radius: 32px;
    padding: 22px;
    display: grid;
    gap: 12px;
}

.hero-pill {
    height: 14px;
    width: 55%;
    border-radius: 999px;
    background: var(--theme-primary-soft);
}

.hero-pill.is-wide {
    width: 85%;
    background: var(--theme-surface-deep);
}

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

.hero-grid span {
    aspect-ratio: 1;
    border-radius: 20px;
    background: var(--theme-surface-soft);
}

.stats-section,
.latest-section,
.front-content-section {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.stat-card,
.empty-card,
.content-card,
.entry-card,
.post-card,
.error-card {
    background: var(--theme-surface-soft);
    border-radius: var(--theme-radius-lg);
    padding: 24px;
    animation: theme-rise var(--theme-speed) var(--theme-ease) both;
}

.stat-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--theme-muted);
    margin-bottom: 6px;
}

.stat-value {
    display: block;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.6px;
}

.section-link,
.text-link {
    font-weight: 700;
    font-size: 14px;
}

.device-grid,
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.archive-shell,
.single-shell,
.error-shell {
    padding-top: 40px;
    padding-bottom: 56px;
}

.archive-header,
.entry-header {
    margin-bottom: 24px;
}

.archive-title,
.entry-title {
    margin: 0 0 10px;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.12;
    letter-spacing: -1px;
}

.archive-description,
.entry-subtitle {
    margin: 0;
    color: var(--theme-muted);
    max-width: 70ch;
}

.entry-meta {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--theme-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.post-card {
    padding: 0;
    overflow: hidden;
}

.post-card-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.post-card-body {
    padding: 20px;
}

.post-card-title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--theme-text);
}

.post-card-excerpt {
    color: var(--theme-muted);
    margin-bottom: 12px;
}

.entry-card {
    padding: 32px;
}

.entry-thumbnail {
    margin-bottom: 24px;
    border-radius: var(--theme-radius-md);
    overflow: hidden;
}

.entry-thumbnail img {
    width: 100%;
}

.entry-content {
    font-size: 17px;
    line-height: 1.85;
}

.entry-content > :first-child {
    margin-top: 0;
}

.entry-content > :last-child {
    margin-bottom: 0;
}

.entry-content h2,
.entry-content h3 {
    letter-spacing: -0.4px;
    line-height: 1.25;
}

.entry-content blockquote {
    margin: 24px 0;
    padding: 18px 22px;
    background: var(--theme-surface);
    border-radius: var(--theme-radius-md);
    color: var(--theme-muted);
}

.entry-content code {
    background: var(--theme-surface-deep);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.9em;
}

.entry-content pre {
    background: var(--theme-surface-deep);
    padding: 18px;
    border-radius: var(--theme-radius-md);
    overflow-x: auto;
}

.entry-content pre code {
    background: transparent;
    padding: 0;
}

.pagination,
.post-navigation {
    margin-top: 28px;
}

.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: var(--theme-radius-pill);
    background: var(--theme-surface-soft);
    color: var(--theme-text);
    font-weight: 700;
}

.pagination .page-numbers.current {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.post-navigation a {
    display: inline-flex;
    padding: 10px 18px;
    border-radius: var(--theme-radius-pill);
    background: var(--theme-surface-soft);
    font-weight: 700;
}

.error-card {
    text-align: center;
    padding: 48px 32px;
}

.error-code {
    margin: 0;
    font-size: 88px;
    font-weight: 800;
    letter-spacing: -4px;
    color: var(--theme-primary);
}

.error-title {
    margin: 0 0 10px;
    font-size: 32px;
}

.error-text {
    margin: 0 auto 20px;
    max-width: 52ch;
    color: var(--theme-muted);
}

.error-search {
    max-width: 520px;
    margin: 0 auto 20px;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.site-footer {
    background: var(--theme-surface-soft);
    padding: 36px 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.4fr;
    gap: 24px;
    align-items: start;
}

.footer-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-text);
}

.footer-description,
.footer-meta p {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--theme-muted);
}

.footer-menu {
    flex-direction: column;
    align-items: flex-start;
}

.footer-menu a {
    color: var(--theme-muted);
    font-weight: 600;
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: var(--theme-radius-pill);
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity var(--theme-speed) var(--theme-ease), transform var(--theme-speed) var(--theme-ease), background var(--theme-speed) var(--theme-ease);
}

.back-to-top[data-visible="true"] {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.back-to-top:hover {
    background: var(--theme-primary-hover);
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form label {
    flex: 1;
}

.search-form .search-field {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: var(--theme-radius-pill);
    background: var(--theme-surface);
    padding: 12px 18px;
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.search-form .search-submit {
    min-height: 48px;
    border: 0;
    border-radius: var(--theme-radius-pill);
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    padding: 12px 22px;
    font-weight: 700;
    cursor: pointer;
}

.search-form .search-field:focus {
    outline-color: var(--theme-primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--theme-primary);
    outline-offset: 3px;
}

@keyframes theme-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --theme-bg: #16181b;
        --theme-surface: #1f2124;
        --theme-surface-soft: #26292e;
        --theme-surface-deep: #31353b;
        --theme-text: #e4e4e7;
        --theme-muted: #a9aeb6;
        --theme-primary: #a8c7fa;
        --theme-primary-hover: #c4d8fb;
        --theme-primary-soft: #23405f;
        --theme-on-primary: #062e6f;
        --theme-warning: #ffcf8b;
        --theme-warning-soft: #3d2f16;
        --theme-scrollbar-thumb: #3f444b;
        --theme-scrollbar-track: #22252a;
        color-scheme: dark;
    }
}

@media (max-width: 960px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        display: none;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 782px) {
    .shell {
        padding-inline: 16px;
    }

    .site-header-inner {
        min-height: 68px;
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .header-actions {
        display: none;
    }

    .primary-nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height var(--theme-speed) var(--theme-ease), opacity var(--theme-speed) var(--theme-ease);
    }

    .site-header[data-menu-open="true"] .primary-nav {
        max-height: 420px;
        opacity: 1;
        padding-bottom: 14px;
    }

    .primary-menu {
        flex-direction: column;
        align-items: stretch;
        background: var(--theme-surface-soft);
        border-radius: var(--theme-radius-lg);
        padding: 10px;
    }

    .primary-menu a {
        width: 100%;
    }

    .primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        padding-left: 14px;
        min-width: 0;
    }

    .hero {
        padding-top: 32px;
    }

    .entry-card {
        padding: 22px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-navigation {
        flex-direction: column;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-delay: 0ms !important;
        transition-duration: 1ms !important;
    }
}