:root {
    --gap: 24px;
    --content-gap: 20px;
    --nav-width: 1024px;
    --main-width: 720px;
    --header-height: 60px;
    --footer-height: 60px;
    --radius: 14px;

    --theme: #f8f9fa;
    --entry: #ffffff;
    --primary: #202124;
    --secondary: #5f6368;
    --tertiary: #dadce0;
    --content: #202124;
    --code-block-bg: #202124;
    --code-bg: #f1f3f4;
    --border: #dadce0;

    --accent: #1a73e8;
    --accent-hover: #1558b0;
    --accent-soft: rgba(26, 115, 232, 0.08);
    --shadow-1: 0 1px 2px rgba(60, 64, 67, 0.10), 0 1px 3px 1px rgba(60, 64, 67, 0.06);
    --shadow-2: 0 4px 16px rgba(60, 64, 67, 0.12);
}

.dark {
    --theme: #202124;
    --entry: #303134;
    --primary: #e8eaed;
    --secondary: #9aa0a6;
    --tertiary: #3c4043;
    --content: #e8eaed;
    --code-block-bg: #1f1f1f;
    --code-bg: #303134;
    --border: #3c4043;

    --accent: #8ab4f8;
    --accent-hover: #aecbfa;
    --accent-soft: rgba(138, 180, 248, 0.10);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px 3px 1px rgba(0, 0, 0, 0.16);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.24);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--theme);
    color: var(--content);
    font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent-soft);
    color: var(--primary);
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--accent-hover);
}

.header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: saturate(180%) blur(14px);
    background: color-mix(in srgb, var(--theme) 88%, transparent);
    border-bottom: 1px solid var(--border);
}

.nav {
    max-width: calc(var(--main-width) + var(--gap) * 2);
    margin: 0 auto;
    padding-inline: var(--gap);
}

.logo a {
    letter-spacing: -0.01em;
    font-weight: 600;
}

.logo img,
.logo svg {
    border-radius: 0;
}

.main {
    max-width: calc(var(--main-width) + var(--gap) * 2);
}

.first-entry,
.post-entry,
.page-header,
.post-single,
.post-content,
.post-footer,
.pagination a,
.terms-tags a,
.cta__button,
a.button {
    border-radius: calc(var(--radius) + 2px);
}

.first-entry,
.post-entry,
.post-single,
.page-header,
.post-content,
.post-footer {
    background: var(--entry);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}

.first-entry:hover,
.post-entry:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}

.page-header {
    padding: 1.5rem;
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 2.6rem);
    letter-spacing: -0.03em;
}

.post-entry,
.first-entry {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.post-entry .entry-header h2,
.first-entry .entry-header h1,
.page-header h1 {
    letter-spacing: -0.025em;
}

.entry-content,
.post-content,
.page-header,
.post-footer {
    color: var(--content);
}

.post-content {
    padding: 1.5rem;
}

.post-footer {
    padding: 1.25rem 1.5rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    letter-spacing: -0.025em;
}

.post-content p,
.post-content li,
.post-content blockquote,
.post-content table {
    line-height: 1.75;
}

.post-content blockquote {
    border-inline-start: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.9rem 1rem;
}

img,
video,
iframe {
    border-radius: calc(var(--radius) + 4px);
}

.post-content img,
.entry-cover img,
.home-info img,
.profile .profile_inner img {
    box-shadow: var(--shadow-1);
}

.pagination {
    gap: 0.75rem;
}

.pagination a {
    background: var(--entry);
    color: var(--primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}

.pagination a:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-2);
}

.terms-tags a {
    background: var(--entry);
    border: 1px solid var(--border);
    color: var(--primary);
}

.terms-tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-1);
}

.cta,
a.button {
    display: inline-flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 1.25rem 0;
}

.cta__button,
a.button,
button,
input[type="submit"] {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.82rem 1.2rem;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff !important;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: var(--shadow-1);
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.cta__button:hover,
a.button:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.cta--secondary .cta__button {
    background: var(--entry);
    color: var(--accent) !important;
    border-color: var(--border);
}

.cta--secondary .cta__button:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-hover) !important;
}

.cta__note {
    margin: 0;
    color: var(--secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.breadcrumbs,
.share-buttons,
.post-navigation,
.paginav,
.toc,
.top-link,
.logo-switches,
.social-icons,
.page-header h1 a svg,
.page-header h1 a,
.post-footer .post-tags + .post-nav,
.post-footer .post-nav,
.post-footer .post-navigation,
.comments,
.post-comments,
.post-share,
.share-icons,
.post-footer .social-icons,
.post-footer .share-buttons {
    display: none !important;
}

.header .nav {
    min-height: var(--header-height);
}

.logo a,
.logo a:hover {
    color: var(--primary);
    text-decoration: none;
}

.post-tags a,
.post-content .tag,
.post-content .tags a {
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--entry);
    color: var(--secondary);
}

.post-tags a:hover,
.post-content .tag:hover,
.post-content .tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

@supports not (background: color-mix(in srgb, white 50%, transparent)) {
    .header {
        background: var(--theme);
    }
}

@media (max-width: 768px) {
    .page-header,
    .post-content,
    .post-footer {
        padding-inline: 1rem;
    }

    .nav {
        padding-inline: 1rem;
    }
}
