/* ==========================================================================
   Sajjad Bayat — personal blog
   RTL Persian design system, light & dark themes
   ========================================================================== */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 800 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;

    --bg: #f7f5f0;
    --bg-soft: #f0ece4;
    --surface: #ffffff;
    --surface-2: #faf8f4;
    --surface-3: #f3efe7;

    --ink: #1b1814;
    --ink-2: #423c34;
    --muted: #7c746a;
    --line: #e6e0d5;
    --line-strong: #d7cfc1;

    --accent-base: #0e7c6b;
    --accent: var(--accent-base);
    --accent-ink: #ffffff;
    --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
    --accent-2: #d97706;
    --accent-2-soft: #fdf3e3;

    --danger: #b42318;
    --danger-soft: #fdecea;
    --success: #087443;
    --success-soft: #e8f6ef;
    --info: #175cd3;
    --info-soft: #eaf2ff;

    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --radius-xl: 36px;

    --shadow-sm: 0 1px 2px rgba(27, 24, 20, 0.05);
    --shadow: 0 14px 36px rgba(27, 24, 20, 0.08);
    --shadow-lg: 0 34px 80px rgba(27, 24, 20, 0.14);

    --container: 1180px;
    --narrow: 760px;
    --header-h: 78px;
}

[data-theme='dark'] {
    --bg: #0d1110;
    --bg-soft: #111614;
    --surface: #151b19;
    --surface-2: #101513;
    --surface-3: #19211e;

    --ink: #ece9e3;
    --ink-2: #c9c4bb;
    --muted: #938f87;
    --line: #25302c;
    --line-strong: #37443f;

    --accent: color-mix(in srgb, var(--accent-base) 58%, #ffffff);
    --accent-ink: #062a24;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--surface));
    --accent-2: #f0b45c;
    --accent-2-soft: #2a2114;

    --danger: #ff8a80;
    --danger-soft: #2b1512;
    --success: #6ee7b7;
    --success-soft: #0e241b;
    --info: #93b4ff;
    --info-soft: #101c33;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 36px 90px rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body.menu-open,
body.search-open {
    overflow: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    line-height: 1.5;
    font-weight: 800;
    letter-spacing: 0;
}

p {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
}

figure {
    margin: 0;
}

::selection {
    background: color-mix(in srgb, var(--accent) 28%, transparent);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 26px;
}

.container-narrow {
    max-width: var(--narrow);
}

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

.skip-link {
    position: fixed;
    top: -100px;
    right: 16px;
    z-index: 200;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 10px 18px;
    border-radius: 0 0 12px 12px;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Buttons, chips, forms
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: 13px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 14.5px;
    line-height: 1.6;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}
.btn .icon {
    width: 18px;
    height: 18px;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}
.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 26%, transparent);
}
.btn-primary:hover {
    background: color-mix(in srgb, var(--accent) 88%, #000);
}
[data-theme='dark'] .btn-primary:hover {
    background: color-mix(in srgb, var(--accent) 88%, #fff);
}
.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink-2);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.btn-light {
    background: #ffffff;
    color: #0b4a40;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.btn-light:hover {
    background: #f2fbf8;
}
.btn-block {
    width: 100%;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 13px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.8;
    transition: background 0.18s ease;
}
.chip:hover {
    background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}
.chip .icon {
    width: 14px;
    height: 14px;
}
.chip-large {
    padding: 6px 16px;
    font-size: 13.5px;
    margin-bottom: 16px;
}
.chip-soft {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-weight: 600;
}
.chip-soft:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.chip-soft span {
    color: var(--muted);
    font-size: 11.5px;
    margin-right: 2px;
}
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}
.field label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-2);
}
.field .req {
    color: var(--danger);
}
.field .optional {
    color: var(--muted);
    font-weight: 400;
    font-size: 12px;
}
.field small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.9;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}
.field input::placeholder,
.field textarea::placeholder {
    color: var(--muted);
    opacity: 0.8;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px;
}
.form-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12.5px;
}
.form-note .icon {
    width: 16px;
    height: 16px;
}
.hp-field {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}
.social-row a {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    transition: all 0.18s ease;
}
.social-row a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}
.social-row .icon {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.is-scrolled {
    border-bottom-color: var(--line);
    box-shadow: 0 8px 30px rgba(20, 18, 15, 0.05);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
}
.header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 28px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}
.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}
.brand-name {
    font-weight: 800;
    font-size: 18px;
}
.brand-tagline {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 500;
    margin-top: 2px;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-right: 10px;
}
.main-nav a {
    position: relative;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-2);
    transition: color 0.18s ease, background 0.18s ease;
}
.main-nav a:hover {
    color: var(--accent);
    background: var(--accent-soft);
}
.main-nav a.active {
    color: var(--accent);
}
.main-nav a.active::after {
    content: '';
    position: absolute;
    right: 14px;
    left: 14px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
}
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}
.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--accent);
}
.icon-btn .icon {
    width: 20px;
    height: 20px;
}
.theme-toggle .theme-icon {
    display: flex;
}
.theme-icon-sun {
    display: none !important;
}
[data-theme='dark'] .theme-icon-sun {
    display: flex !important;
}
[data-theme='dark'] .theme-icon-moon {
    display: none !important;
}
.menu-toggle {
    display: none;
}
.menu-icon-close {
    display: none;
}
body.menu-open .menu-icon-open {
    display: none;
}
body.menu-open .menu-icon-close {
    display: flex;
}

/* Mobile nav */
.mobile-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 80;
    background: var(--bg);
    padding: 22px 0 40px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
body.menu-open .mobile-nav {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.mobile-nav nav {
    display: flex;
    flex-direction: column;
}
.mobile-nav nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 4px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
}
.mobile-nav nav a .icon {
    width: 18px;
    height: 18px;
    color: var(--muted);
}
.mobile-nav nav a.active {
    color: var(--accent);
}
.mobile-nav nav a.active .icon {
    color: var(--accent);
}
.mobile-socials {
    display: flex;
    gap: 10px;
    margin-top: 26px;
}
.mobile-socials a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
}
.mobile-nav-foot {
    margin-top: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12.5px;
}
.mobile-nav-foot a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 600;
}
.mobile-nav-foot .icon {
    width: 16px;
    height: 16px;
}

/* Search overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: color-mix(in srgb, #0b1512 68%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8vh 20px 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
body.search-open .search-overlay {
    opacity: 1;
    pointer-events: auto;
}
.search-panel {
    max-width: 680px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 26px 28px 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-14px) scale(0.99);
    transition: transform 0.22s ease;
}
body.search-open .search-panel {
    transform: none;
}
.search-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.search-kicker {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent);
}
.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface-2);
}
.search-field > .icon {
    width: 20px;
    height: 20px;
    color: var(--muted);
}
.search-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 8px 2px;
    font-size: 16px;
    outline: none;
}
.search-field .btn {
    padding: 10px 20px;
}
.search-hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    padding: 34px 0 16px;
}
.hero-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 46px;
    align-items: center;
    padding: 56px 52px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(120% 130% at 88% 0%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 52%),
        radial-gradient(90% 100% at 0% 100%, color-mix(in srgb, var(--accent-2) 12%, transparent) 0%, transparent 55%),
        var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.hero-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--accent) 14%, transparent) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.55;
    pointer-events: none;
    mask-image: linear-gradient(120deg, #000 0%, transparent 55%);
    -webkit-mask-image: linear-gradient(120deg, #000 0%, transparent 55%);
}
.hero-copy {
    position: relative;
    z-index: 1;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 5px 13px;
    border-radius: 999px;
    margin-bottom: 20px;
}
.eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.hero-title {
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.4;
    font-weight: 800;
    margin-bottom: 18px;
    text-wrap: balance;
}
.hero-title-accent {
    color: var(--accent);
    position: relative;
    white-space: nowrap;
}
.hero-title-accent::after {
    content: '';
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0.04em;
    height: 0.16em;
    border-radius: 999px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 32%, transparent), color-mix(in srgb, var(--accent-2) 32%, transparent));
    z-index: -1;
}
.hero-text {
    color: var(--ink-2);
    font-size: 16.5px;
    line-height: 2;
    max-width: 58ch;
    margin-bottom: 26px;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 26px;
}
.hero-socials {
    gap: 10px;
}
.hero-socials a {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    backdrop-filter: blur(4px);
}

.hero-side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.hero-avatar-wrap {
    position: relative;
    width: 226px;
    height: 226px;
}
.hero-avatar-glow {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: conic-gradient(from 120deg, color-mix(in srgb, var(--accent) 50%, transparent), color-mix(in srgb, var(--accent-2) 40%, transparent), color-mix(in srgb, var(--accent) 50%, transparent));
    filter: blur(16px);
    opacity: 0.55;
}
.hero-avatar {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--surface);
    box-shadow: var(--shadow);
    background: var(--surface-2);
}
.hero-badge {
    position: absolute;
    left: 8px;
    bottom: 14px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--surface);
    box-shadow: var(--shadow-sm);
}
.hero-badge .icon {
    width: 20px;
    height: 20px;
}
.hero-stats {
    display: flex;
    width: 100%;
    max-width: 320px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 10px;
    backdrop-filter: blur(8px);
}
.hero-stat {
    flex: 1;
    text-align: center;
    border-left: 1px solid var(--line);
}
.hero-stat:last-child {
    border-left: 0;
}
.hero-stat strong {
    display: block;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.4;
}
.hero-stat span {
    font-size: 11.5px;
    color: var(--muted);
}
.hero-quote {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}
.hero-quote .icon {
    width: 16px;
    height: 16px;
    color: var(--accent-2);
}

/* --------------------------------------------------------------------------
   Sections & cards
   -------------------------------------------------------------------------- */

.section {
    padding: 54px 0;
}
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 7px;
}
.section-kicker .icon {
    width: 16px;
    height: 16px;
}
.section-kicker-light {
    color: rgba(255, 255, 255, 0.82);
}
.section-title {
    font-size: clamp(23px, 2.6vw, 30px);
    font-weight: 800;
}
.section-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent);
    padding-bottom: 4px;
    white-space: nowrap;
}
.section-link .icon {
    width: 16px;
    height: 16px;
    transition: transform 0.18s ease;
}
.section-link:hover .icon {
    transform: translateX(-3px);
}

/* Featured */
.featured-card {
    display: grid;
    grid-template-columns: 1.04fr 0.96fr;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.featured-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.featured-cover {
    position: relative;
    min-height: 380px;
    overflow: hidden;
    background: var(--surface-3);
}
.featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.featured-card:hover .featured-cover img {
    transform: scale(1.035);
}
.featured-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(12, 22, 19, 0.62);
    color: #fff;
    backdrop-filter: blur(8px);
    font-size: 11.5px;
    font-weight: 700;
}
.featured-badge .icon {
    width: 14px;
    height: 14px;
}
.featured-body {
    padding: 40px 40px 36px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
.featured-title {
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.5;
    margin: 14px 0 12px;
}
.featured-title a:hover {
    color: var(--accent);
}
.featured-excerpt {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.95;
    margin-bottom: 18px;
}
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 20px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent);
}
.read-more .icon {
    width: 16px;
    height: 16px;
    transition: transform 0.18s ease;
}
.read-more:hover .icon {
    transform: translateX(-4px);
}

/* Post grid & cards */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}
.post-card-cover {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-3);
}
.post-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.post-card:hover .post-card-cover img {
    transform: scale(1.04);
}
.post-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 21px 22px 22px;
    flex: 1;
}
.post-card-title {
    font-size: 18.5px;
    line-height: 1.6;
    margin: 11px 0 8px;
}
.post-card-title a:hover {
    color: var(--accent);
}
.post-card-excerpt {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.9;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
    margin-top: auto;
}
.post-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.post-card-meta .icon {
    width: 14px;
    height: 14px;
}

/* Categories */
.section-categories {
    padding-top: 40px;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 18px;
}
.category-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: all 0.22s ease;
}
.category-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-3px);
}
.category-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 7px;
}
.category-icon .icon {
    width: 21px;
    height: 21px;
}
.category-name {
    font-weight: 800;
    font-size: 16.5px;
}
.category-description {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.85;
    min-height: 46px;
}
.category-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 8px;
}
.category-count .icon {
    width: 14px;
    height: 14px;
}

/* Newsletter */
.newsletter-band {
    padding: 26px 0 64px;
}
.newsletter-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 36px;
    align-items: center;
    padding: 42px 46px;
    border-radius: var(--radius-lg);
    color: #fff;
    background:
        radial-gradient(90% 120% at 90% 10%, rgba(255, 255, 255, 0.16) 0%, transparent 55%),
        linear-gradient(135deg, #0a3f37 0%, #0e7c6b 58%, #0b5a4e 100%);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.newsletter-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.4;
    mask-image: linear-gradient(90deg, #000, transparent 70%);
    -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%);
    pointer-events: none;
}
.newsletter-copy {
    position: relative;
    z-index: 1;
}
.newsletter-copy h2 {
    font-size: clamp(22px, 2.6vw, 30px);
    margin: 6px 0 10px;
}
.newsletter-copy p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.95;
    max-width: 52ch;
}
.newsletter-form {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 8px;
    border-radius: 16px;
    backdrop-filter: blur(6px);
}
.newsletter-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
}
.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.newsletter-form .btn {
    padding: 11px 20px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 70px 24px;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: 22px;
    color: var(--muted);
}
.empty-state > .icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    color: var(--accent);
}
.empty-state h3 {
    font-size: 19px;
    color: var(--ink);
    margin-bottom: 6px;
}
.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}
.empty-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* --------------------------------------------------------------------------
   Post page
   -------------------------------------------------------------------------- */

.reading-bar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: transparent;
    z-index: 100;
    pointer-events: none;
}
.reading-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.1s linear;
}
.reading-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    z-index: 100;
    pointer-events: none;
    display: none;
}
.reading-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
body.is-post .reading-progress {
    display: block;
}

.post-header {
    padding: 30px 0 30px;
}
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 22px;
}
.breadcrumb a {
    color: var(--muted);
    transition: color 0.18s ease;
}
.breadcrumb a:hover {
    color: var(--accent);
}
.breadcrumb-current {
    color: var(--ink-2);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-title {
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.45;
    margin-bottom: 14px;
}
.post-lead {
    color: var(--muted);
    font-size: 17px;
    line-height: 2;
    max-width: 70ch;
    margin-bottom: 22px;
}
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 12.5px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.post-author {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    color: var(--ink-2);
}
.post-author img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
}
.meta-sep {
    width: 1px;
    height: 18px;
    background: var(--line);
}
.post-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.post-meta-item .icon {
    width: 15px;
    height: 15px;
}
.post-cover {
    max-width: 1080px;
    margin: 8px auto 0;
    padding: 0 26px;
}
.post-cover img {
    width: 100%;
    aspect-ratio: 16 / 8.5;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: var(--surface-3);
}
.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 52px;
    padding-top: 46px;
}
.post-main {
    order: 1;
    min-width: 0;
}
.post-aside {
    order: 2;
}
.aside-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 18px;
}
.aside-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 14px;
}
.aside-card h3 .icon {
    width: 17px;
    height: 17px;
    color: var(--accent);
}
.aside-card-accent {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}
.aside-card-accent p {
    font-size: 13px;
    color: var(--ink-2);
    margin-bottom: 14px;
    line-height: 1.9;
}
.toc-card {
    position: sticky;
    top: calc(var(--header-h) + 20px);
}
.toc-list {
    list-style: none;
    font-size: 13px;
    border-right: 2px solid var(--line);
}
.toc-list li {
    position: relative;
}
.toc-list a {
    display: block;
    padding: 6px 14px;
    color: var(--muted);
    line-height: 1.8;
    transition: color 0.18s ease;
}
.toc-list a:hover,
.toc-list a.active {
    color: var(--accent);
}
.toc-list a.active {
    font-weight: 700;
}
.toc-list a.active::before {
    content: '';
    position: absolute;
    right: -2px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--accent);
}
.toc-level-3 a {
    padding-right: 26px;
    font-size: 12.3px;
}
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.share-buttons a,
.share-buttons button {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}
.share-buttons a:hover,
.share-buttons button:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.share-buttons .icon {
    width: 17px;
    height: 17px;
}
.copy-link-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    margin-top: 12px;
    padding: 8px 11px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    overflow: hidden;
}
.copy-link-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
}
.copy-link-btn .icon {
    width: 14px;
    height: 14px;
}

/* Prose */
.prose {
    font-size: 17.5px;
    line-height: 2.1;
    color: var(--ink-2);
    word-break: break-word;
}
.prose > *:first-child {
    margin-top: 0;
}
.prose p {
    margin: 0 0 1.3em;
}
.prose h2,
.prose h3,
.prose h4 {
    color: var(--ink);
    scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h2 {
    font-size: 26px;
    margin: 2.1em 0 0.7em;
    padding-right: 16px;
    position: relative;
}
.prose h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.28em;
    bottom: 0.28em;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.prose h3 {
    font-size: 21px;
    margin: 1.8em 0 0.6em;
}
.prose h4 {
    font-size: 18px;
    margin: 1.5em 0 0.5em;
}
.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.18s ease;
}
.prose a:hover {
    text-decoration-color: var(--accent);
}
.prose strong {
    color: var(--ink);
    font-weight: 700;
}
.prose ul,
.prose ol {
    margin: 0 0 1.3em;
    padding-right: 1.5em;
}
.prose ul {
    list-style: disc;
}
.prose ol {
    list-style: decimal;
}
.prose li {
    margin-bottom: 0.5em;
    padding-right: 0.2em;
}
.prose li::marker {
    color: var(--accent);
}
.prose blockquote {
    margin: 2em 0;
    padding: 20px 24px;
    border-right: 4px solid var(--accent);
    border-radius: 0 14px 14px 0;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 18px;
    line-height: 2;
}
.prose blockquote p:last-child {
    margin-bottom: 0;
}
.prose img {
    border-radius: 16px;
    margin: 2em auto;
    box-shadow: var(--shadow-sm);
}
.prose figure {
    margin: 2em 0;
}
.prose figcaption {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 8px;
}
.prose code {
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
    font-size: 0.86em;
    background: var(--surface-3);
    border: 1px solid var(--line);
    padding: 2px 6px;
    border-radius: 6px;
    direction: ltr;
    display: inline-block;
    line-height: 1.6;
}
.prose pre {
    direction: ltr;
    text-align: left;
    background: #101614;
    color: #e8e6df;
    padding: 20px 22px;
    border-radius: 14px;
    overflow-x: auto;
    margin: 2em 0;
    line-height: 1.8;
    border: 1px solid #24312c;
}
[data-theme='dark'] .prose pre {
    background: #080c0b;
    border-color: var(--line);
}
.prose pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: 13.5px;
    display: block;
}
.prose hr {
    border: 0;
    height: 1px;
    background: var(--line);
    margin: 2.6em auto;
    width: 60%;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 14px;
}
.prose th,
.prose td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: right;
}
.prose th {
    background: var(--surface-2);
    font-weight: 700;
}
.prose mark {
    background: color-mix(in srgb, var(--accent-2) 28%, transparent);
    color: inherit;
    padding: 0 3px;
    border-radius: 3px;
}
.heading-anchor {
    opacity: 0;
    margin-right: 9px;
    font-size: 0.62em;
    color: var(--accent) !important;
    text-decoration: none !important;
    transition: opacity 0.18s ease;
    vertical-align: middle;
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor {
    opacity: 1;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 34px 0 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.post-tags-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-left: 4px;
}
.post-tags-label .icon {
    width: 16px;
    height: 16px;
}
.post-share-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 34px;
}
.post-share-inline > span {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-2);
}

/* Author box */
.author-box {
    display: flex;
    gap: 22px;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    margin-bottom: 34px;
}
.author-box-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
}
.author-box-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent);
}
.author-box-body h3 {
    font-size: 18px;
    margin: 3px 0 7px;
}
.author-box-body p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.95;
    margin-bottom: 12px;
}
.author-box-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}
.author-box-actions > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}
.author-box-actions > a .icon {
    width: 15px;
    height: 15px;
}
.author-box-socials {
    display: inline-flex;
    gap: 6px;
}
.author-box-socials a {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.author-box-socials a:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.author-box-socials .icon {
    width: 15px;
    height: 15px;
}

/* Post nav */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 44px;
}
.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    transition: all 0.2s ease;
}
.post-nav-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.post-nav-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 600;
}
.post-nav-label .icon {
    width: 14px;
    height: 14px;
}
.post-nav-link strong {
    font-size: 13.5px;
    line-height: 1.7;
    font-weight: 700;
}
.post-nav-newer {
    text-align: left;
}
.post-nav-newer .post-nav-label {
    justify-content: flex-start;
}
.post-nav-older .post-nav-label {
    justify-content: flex-start;
}

/* Related */
.section-related {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Comments
   -------------------------------------------------------------------------- */

.comments-section {
    padding: 46px 0 20px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
}
.comments-head {
    margin-bottom: 26px;
}
.comments-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 24px;
}
.comments-head h2 .icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
}
.comments-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 2px 10px;
}
.comments-head p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 5px;
}
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 34px;
}
.comment {
    display: flex;
    gap: 14px;
}
.comment-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}
.comment-body {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
}
.comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}
.comment-author {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}
a.comment-author:hover {
    color: var(--accent);
}
.comment-time {
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}
.comment-text {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.95;
}
.comment-actions {
    margin-top: 8px;
}
.comment-reply {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
}
.comment-reply:hover {
    color: var(--accent);
    background: var(--accent-soft);
}
.comment-reply .icon {
    width: 13px;
    height: 13px;
}
.comment-children {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    padding-right: 16px;
    border-right: 2px solid var(--line);
}
.comments-empty {
    text-align: center;
    padding: 36px 20px;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    margin-bottom: 32px;
    color: var(--muted);
}
.comments-empty .icon {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    color: var(--accent);
}
.comments-empty h3 {
    font-size: 16px;
    color: var(--ink);
    margin-bottom: 4px;
}
.comments-empty p {
    font-size: 13px;
}
.comment-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.comment-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.comment-form-head h3 {
    font-size: 17px;
}
.reply-cancel {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--danger);
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
}
.reply-notice {
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    color: var(--ink-2);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 12.5px;
    margin-bottom: 16px;
}
.comments-disabled {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Archive / search / pages
   -------------------------------------------------------------------------- */

.archive-hero {
    padding: 44px 0 34px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
}
.archive-hero-large {
    padding-bottom: 42px;
}
.archive-title {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.4;
    margin: 10px 0 10px;
}
.archive-subtitle {
    color: var(--muted);
    font-size: 15px;
    line-height: 2;
    max-width: 72ch;
}
.archive-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent);
}
.archive-count .icon {
    width: 16px;
    height: 16px;
}
.archive-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 42px;
}
.page-numbers {
    display: flex;
    gap: 6px;
}
.page-link {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.18s ease;
}
.page-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.page-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.page-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}
.page-arrow .icon {
    width: 15px;
    height: 15px;
}
.page-info {
    font-size: 11.5px;
    color: var(--muted);
    margin-right: 8px;
}

.archive-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    align-items: start;
}
.archive-year-block {
    margin-bottom: 40px;
}
.archive-year-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 34px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 10px;
}
.archive-year-title span {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 500;
}
.archive-month-block {
    margin-bottom: 24px;
}
.archive-month-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}
.archive-month-title span {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 500;
}
.archive-items {
    list-style: none;
}
.archive-items li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 11px;
    transition: background 0.16s ease;
}
.archive-items li a:hover {
    background: var(--surface);
}
.archive-day {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.archive-item-title {
    flex: 1;
    font-size: 14.5px;
    font-weight: 600;
}
.archive-items li a:hover .archive-item-title {
    color: var(--accent);
}
.archive-item-cat {
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.archive-items li a > .icon {
    width: 15px;
    height: 15px;
    color: var(--muted);
}
.archive-aside {
    position: sticky;
    top: calc(var(--header-h) + 20px);
}
.aside-list {
    list-style: none;
}
.aside-list li + li {
    border-top: 1px solid var(--line);
}
.aside-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 2px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
}
.aside-list a:hover {
    color: var(--accent);
}
.aside-count {
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 0 9px;
    min-width: 26px;
    text-align: center;
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.tag-cloud .chip span {
    color: var(--muted);
    font-size: 10.5px;
}

.search-page-form {
    margin-top: 22px;
    max-width: 640px;
}
.search-page-form .search-field {
    background: var(--surface);
    border-radius: 16px;
    padding: 7px 7px 7px 14px;
    box-shadow: var(--shadow-sm);
}
.search-summary {
    margin-top: 16px;
    color: var(--muted);
    font-size: 13.5px;
}
.search-summary strong {
    color: var(--ink);
}
.search-suggestions {
    display: grid;
    gap: 22px;
}
.suggestion-block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
}
.suggestion-block h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    margin-bottom: 14px;
}
.suggestion-block h2 .icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

/* Static pages */
.page-hero {
    padding: 44px 0 28px;
    text-align: center;
}
.page-hero .breadcrumb {
    justify-content: center;
}
.page-title {
    font-size: clamp(28px, 4vw, 42px);
    margin: 10px 0 10px;
}
.page-updated {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}
.page-updated .icon {
    width: 15px;
    height: 15px;
}
.section-page {
    padding-top: 10px;
}
.about-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 26px;
    background: linear-gradient(140deg, var(--accent-soft), var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-radius: 22px;
    margin-bottom: 36px;
}
.about-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 4px solid var(--surface);
    box-shadow: var(--shadow-sm);
}
.about-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent);
}
.about-label .icon {
    width: 14px;
    height: 14px;
}
.about-card-body h2 {
    font-size: 22px;
    margin: 3px 0 6px;
}
.about-card-body p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.95;
    margin-bottom: 12px;
}
.about-topics {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}
.about-topics h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    margin-bottom: 14px;
}
.about-topics h2 .icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
}
.page-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 44px;
    padding: 26px 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
}
.page-cta h2 {
    font-size: 19px;
    margin-bottom: 4px;
}
.page-cta p {
    color: var(--muted);
    font-size: 13px;
}

/* Contact */
.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    align-items: start;
}
.contact-form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
}
.contact-form-card > h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 21px;
    margin-bottom: 5px;
}
.contact-form-card > h2 .icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}
.contact-form-intro {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 22px;
}
.contact-aside .aside-card {
    padding: 20px;
}
.contact-info-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    font-size: 13px;
    color: var(--ink-2);
    border-bottom: 1px dashed var(--line);
}
.contact-info-item:last-child {
    border-bottom: 0;
}
.contact-info-item .icon {
    width: 17px;
    height: 17px;
    color: var(--accent);
    flex: 0 0 auto;
}
.contact-info-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Message page */
.message-page {
    padding: 80px 0;
}
.message-card {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 54px 32px;
    box-shadow: var(--shadow-sm);
}
.message-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}
.message-icon .icon {
    width: 28px;
    height: 28px;
}
.message-card h1 {
    font-size: 25px;
    margin-bottom: 8px;
}
.message-card p {
    color: var(--muted);
    font-size: 14.5px;
    max-width: 56ch;
    margin: 0 auto 24px;
}

/* 404 */
.error-page {
    padding: 70px 0;
}
.error-card {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 54px 34px;
}
.error-code {
    display: block;
    font-size: clamp(64px, 10vw, 104px);
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
    opacity: 0.9;
    letter-spacing: 0.04em;
}
.error-card h1 {
    font-size: 26px;
    margin: 14px 0 8px;
}
.error-card > p {
    color: var(--muted);
    font-size: 14.5px;
    max-width: 56ch;
    margin: 0 auto 24px;
}
.error-card .search-page-form {
    margin: 0 auto 24px;
}
.error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}
.error-categories {
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}
.error-categories .chip-row {
    justify-content: center;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    background: var(--surface-2);
    border-top: 1px solid var(--line);
    padding-top: 54px;
    margin-top: 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.7fr 1fr;
    gap: 44px;
    padding-bottom: 40px;
}
.brand-footer {
    margin-bottom: 14px;
}
.footer-about p {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.95;
    max-width: 46ch;
    margin-bottom: 16px;
}
.footer-socials a {
    width: 38px;
    height: 38px;
    border-radius: 11px;
}
.footer-links h3,
.footer-newsletter h3 {
    font-size: 15px;
    margin-bottom: 14px;
}
.footer-links ul {
    list-style: none;
}
.footer-links li {
    margin-bottom: 8px;
}
.footer-links a {
    color: var(--muted);
    font-size: 13px;
    transition: color 0.16s ease;
}
.footer-links a:hover {
    color: var(--accent);
}
.footer-newsletter p {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.9;
    margin-bottom: 14px;
}
.newsletter-form-compact {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 6px;
    border-radius: 14px;
    flex-direction: column;
}
.newsletter-form-compact input {
    color: var(--ink);
    padding: 9px 10px;
}
.newsletter-form-compact input::placeholder {
    color: var(--muted);
}
.newsletter-form-compact .btn {
    width: 100%;
    padding: 10px;
    font-size: 13.5px;
}
.footer-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    margin-top: 10px;
}
.footer-note .icon {
    width: 13px;
    height: 13px;
}
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 26px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}
.footer-bottom-links {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.footer-bottom-links a {
    color: var(--muted);
}
.footer-bottom-links a:hover {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Toasts, reveal, misc
   -------------------------------------------------------------------------- */

.toast-region {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-width: min(380px, calc(100vw - 44px));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow);
    font-size: 13px;
    line-height: 1.8;
    animation: toast-in 0.28s ease both;
}
.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.toast-icon .icon {
    width: 14px;
    height: 14px;
}
.toast-success .toast-icon {
    background: var(--success-soft);
    color: var(--success);
}
.toast-error .toast-icon {
    background: var(--danger-soft);
    color: var(--danger);
}
.toast-info .toast-icon {
    background: var(--info-soft);
    color: var(--info);
}
.toast-text {
    flex: 1;
}
.toast-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0;
    display: flex;
}
.toast-close .icon {
    width: 15px;
    height: 15px;
}
.toast.is-hiding {
    animation: toast-out 0.24s ease both;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@keyframes toast-out {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(8px); }
}

.to-top {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 95;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}
.to-top:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}
.to-top.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.to-top {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
}
.to-top .icon {
    width: 19px;
    height: 19px;
}

.reveal.reveal-init {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1040px) {
    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .post-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
        gap: 34px;
    }
    .archive-layout {
        grid-template-columns: minmax(0, 1fr) 260px;
        gap: 34px;
    }
    .contact-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
    }
}

@media (max-width: 900px) {
    :root {
        --header-h: 70px;
    }
    .main-nav {
        display: none;
    }
    .menu-toggle {
        display: inline-flex;
    }
    .brand-tagline {
        display: none;
    }
    .hero-panel {
        grid-template-columns: 1fr;
        gap: 34px;
        padding: 40px 32px;
        text-align: center;
    }
    .hero-text {
        margin-right: auto;
        margin-left: auto;
    }
    .hero-actions,
    .hero-socials {
        justify-content: center;
    }
    .hero-side {
        flex-direction: column;
    }
    .hero-avatar-wrap {
        width: 190px;
        height: 190px;
    }
    .featured-card {
        grid-template-columns: 1fr;
    }
    .featured-cover {
        min-height: 300px;
    }
    .featured-body {
        padding: 28px;
    }
    .newsletter-inner {
        grid-template-columns: 1fr;
        padding: 34px 30px;
        text-align: center;
    }
    .newsletter-copy p {
        margin: 0 auto;
    }
    .newsletter-form {
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }
    .post-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .post-aside {
        order: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
    .post-aside .aside-card {
        margin-bottom: 0;
    }
    .toc-card {
        position: static;
    }
    .archive-layout {
        grid-template-columns: 1fr;
    }
    .archive-aside {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
    .archive-aside .aside-card {
        margin-bottom: 0;
    }
    .archive-aside .aside-card-accent {
        grid-column: 1 / -1;
    }
    .contact-layout {
        grid-template-columns: 1fr;
    }
    .contact-aside {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
    .contact-aside .aside-card {
        margin-bottom: 0;
    }
    .contact-aside .aside-card-accent {
        grid-column: 1 / -1;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .container {
        padding: 0 18px;
    }
    .section {
        padding: 40px 0;
    }
    .hero {
        padding-top: 18px;
    }
    .hero-panel {
        padding: 32px 22px;
        border-radius: 26px;
    }
    .hero-title {
        font-size: 29px;
    }
    .hero-side {
        gap: 14px;
    }
    .hero-avatar-wrap {
        width: 156px;
        height: 156px;
    }
    .hero-stats {
        max-width: 100%;
    }
    .post-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 22px;
    }
    .featured-cover {
        min-height: 220px;
    }
    .featured-body {
        padding: 22px;
    }
    .newsletter-inner {
        padding: 28px 20px;
        border-radius: 22px;
    }
    .newsletter-form {
        flex-direction: column;
        background: transparent;
        border: 0;
        padding: 0;
    }
    .newsletter-form input {
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 12px;
    }
    .post-header {
        padding-top: 22px;
    }
    .post-title {
        font-size: 27px;
    }
    .post-lead {
        font-size: 15.5px;
    }
    .post-meta {
        gap: 10px 14px;
    }
    .meta-sep {
        display: none;
    }
    .post-cover {
        padding: 0 18px;
    }
    .post-cover img {
        border-radius: 18px;
    }
    .post-layout {
        padding-top: 30px;
    }
    .post-aside {
        grid-template-columns: 1fr;
    }
    .prose {
        font-size: 16.5px;
        line-height: 2.05;
    }
    .prose h2 {
        font-size: 22px;
    }
    .prose h3 {
        font-size: 19px;
    }
    .prose blockquote {
        font-size: 16px;
        padding: 16px 18px;
    }
    .author-box {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }
    .post-nav {
        grid-template-columns: 1fr;
    }
    .comment-form {
        padding: 20px 18px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .comment-children {
        margin-right: 6px;
        padding-right: 12px;
    }
    .archive-hero {
        padding: 32px 0 26px;
    }
    .archive-title {
        font-size: 27px;
    }
    .archive-aside {
        grid-template-columns: 1fr;
    }
    .archive-items li a {
        padding: 10px 4px;
        gap: 9px;
    }
    .archive-item-cat {
        display: none;
    }
    .archive-item-title {
        font-size: 13.5px;
    }
    .page-title {
        font-size: 28px;
    }
    .about-card {
        flex-direction: column;
        text-align: center;
    }
    .about-card-body .social-row {
        justify-content: center;
    }
    .contact-form-card {
        padding: 22px 18px;
    }
    .contact-aside {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    .page-cta {
        flex-direction: column;
        text-align: center;
    }
    .search-panel {
        padding: 20px 18px;
    }
    .search-field .btn {
        padding: 9px 14px;
        font-size: 13px;
    }
    .toast-region,
    .to-top {
        left: 14px;
        bottom: 14px;
    }
    .post-share-inline {
        flex-direction: column;
        align-items: flex-start;
    }
    .error-card {
        padding: 38px 20px;
    }
    .message-card {
        padding: 38px 20px;
    }
}

@media (max-width: 420px) {
    .brand-name {
        font-size: 16px;
    }
    .brand-mark {
        width: 38px;
        height: 38px;
    }
    .icon-btn {
        width: 38px;
        height: 38px;
    }
    .header-inner {
        gap: 12px;
    }
    .hero-actions .btn,
    .error-actions .btn {
        width: 100%;
    }
    .pagination .page-info {
        width: 100%;
        text-align: center;
        margin: 4px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .site-header,
    .site-footer,
    .post-aside,
    .post-share-inline,
    .comments-section,
    .section-related,
    .to-top,
    .reading-progress,
    .reading-bar {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
    }
    .post-layout {
        display: block;
    }
    .post-cover img {
        box-shadow: none;
    }
}
