:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #16181d;
    --muted: #6b7280;
    --line: #e6e9ee;
    --accent: #f5c518;
    --shadow: 0 10px 30px rgba(22, 24, 29, 0.05);
}

[data-theme="dark"] {
    --bg: #0e1116;
    --surface: #171b22;
    --text: #f3f5f7;
    --muted: #a0a8b4;
    --line: #2c3340;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.blog {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Manrope, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color-scheme: light;
}

[data-theme="dark"] body.blog {
    color-scheme: dark;
}

.blog a {
    color: inherit;
}

.blog h1,
.blog h2,
.blog h3 {
    font-weight: 700;
}

.wrap {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

.icon {
    width: 18px;
    height: 18px;
    display: block;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.icon-github { --icon: url("blog/icons/github.svg"); }
.icon-linkedin { --icon: url("blog/icons/linkedin.svg"); }
.icon-telegram { --icon: url("blog/icons/telegram.svg"); }
.icon-x { --icon: url("blog/icons/x.svg"); }
.icon-sun { --icon: url("blog/icons/sun.svg"); }
.icon-moon { --icon: url("blog/icons/moon.svg"); }
.icon-arrow { --icon: url("blog/icons/arrow.svg"); }
.icon-code { --icon: url("blog/icons/code.svg"); }
.icon-pen { --icon: url("blog/icons/pen.svg"); }
.icon-send { --icon: url("blog/icons/send.svg"); }
.icon-mic { --icon: url("blog/icons/mic.svg"); }
.icon-users { --icon: url("blog/icons/users.svg"); }
.icon-heart { --icon: url("blog/icons/heart.svg"); }
.icon-game { --icon: url("blog/icons/game.svg"); }
.icon-film { --icon: url("blog/icons/film.svg"); }
.icon-book { --icon: url("blog/icons/book.svg"); }
.icon-plane { --icon: url("blog/icons/plane.svg"); }
.icon-karate { --icon: url("blog/icons/karate.svg"); }
.icon-boxing { --icon: url("blog/icons/boxing.svg"); }
.icon-tree { --icon: url("blog/icons/tree.svg"); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.bar,
.footer-bar,
.tools,
.socials {
    display: flex;
    align-items: center;
}

.bar {
    min-height: 72px;
    gap: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: 18px;
}

.brand-mark {
    font-family: Unbounded, Manrope, sans-serif;
    font-size: 15px;
}

.tools {
    margin-left: auto;
    gap: 4px;
}

.socials {
    gap: 8px;
}

.icon-btn {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: transparent;
    color: var(--text);
    padding: 0;
    cursor: pointer;
}

.icon-btn .icon {
    pointer-events: none;
}

.icon-btn:hover {
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}

:root:not([data-theme="dark"]) [data-set-theme="light"],
[data-theme="dark"] [data-set-theme="dark"] {
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}

.blog main {
    padding: 18px 0 72px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(220px, 0.82fr) minmax(250px, 0.96fr);
    gap: 28px 32px;
    align-items: start;
}

.hello {
    display: inline-flex;
    margin: 8px 0 0;
    padding: 4px 10px;
    border-radius: 8px;
    background: #ffe14d;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 800;
}

.intro h1,
.section-title,
.post-title,
.cta h2 {
    font-family: Unbounded, Manrope, sans-serif;
    letter-spacing: -0.04em;
}

.intro h1 {
    margin: 14px 0 16px;
    font-size: clamp(42px, 4.4vw, 62px);
    line-height: 0.98;
}

.lede,
.story p,
.story-row p,
.source,
.hint,
.footer-note,
.legal,
.meta,
.side-label {
    color: var(--muted);
}

.lede {
    max-width: 36ch;
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.55;
}

.portrait {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    overflow: hidden;
    background: #14161b;
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    filter: grayscale(1) contrast(1.05);
    display: block;
}

.portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

.keep-going {
    position: absolute;
    z-index: 1;
    left: 8%;
    bottom: 7%;
    margin: 0;
    color: #ffe14a;
    font-family: Caveat, cursive;
    font-size: clamp(23px, 2.5vw, 34px);
    font-weight: 700;
    line-height: 0.78;
    transform: rotate(-8deg);
    text-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.side-card,
.panel,
.story,
.story-row {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.side-card,
.panel {
    border-radius: 22px;
    padding: 20px 20px 16px;
}

.side-card h2,
.panel h2 {
    margin: 0 0 14px;
    font-size: 16px;
}

.facts,
.links,
.stack,
.interests {
    list-style: none;
    margin: 0;
    padding: 0;
}

.facts {
    display: grid;
    gap: 12px;
}

.facts li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    font-size: 14px;
    line-height: 1.45;
}

.facts .icon {
    margin-top: 2px;
    color: var(--muted);
}

.facts a {
    font-weight: 700;
}

.side-label {
    margin: 16px 0 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.form-card .side-label {
    display: block;
    border: 0;
    padding: 0;
    margin: 0 0 6px;
}

.links {
    display: grid;
    gap: 8px;
}

.links a,
.interest {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.links img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.section {
    margin-top: 56px;
}

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

.section-title {
    margin: 0;
    font-size: clamp(26px, 3vw, 32px);
    line-height: 1.1;
}

.section-title::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: var(--accent);
}

.more,
.to-top {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.more:hover,
.to-top:hover,
.facts a:hover,
.links a:hover {
    color: var(--text);
}

.stories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.story,
.story-row {
    border-radius: 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.story:hover,
.story-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(16, 24, 40, 0.08);
}

.story {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
}

.story-media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #1a1c20;
}

.story-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
}

.story h3,
.story-row h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.story time,
.story-row .meta {
    font-size: 13px;
}

.story p,
.story-row p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stack {
    display: grid;
    gap: 12px;
}

.story-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
}

.story-row img,
.mark {
    width: 92px;
    height: 68px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg);
}

.mark {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
}

.chevron {
    color: var(--muted);
    padding-right: 6px;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.72fr);
    gap: 28px;
    align-items: start;
}

.rail {
    display: grid;
    gap: 16px;
    align-content: start;
}

.rail-solo {
    max-width: 360px;
    margin-left: auto;
}

.cta {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(255, 213, 0, 0.18), transparent 46%),
        #0d1424;
}

.cta::after {
    content: "def ship():\A    return fast";
    position: absolute;
    top: 18px;
    right: 16px;
    color: #fff;
    opacity: 0.14;
    font-family: ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre;
}

.cta-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffe14a;
}

.cta h2 {
    position: relative;
    margin: 14px 0 10px;
    color: #ffe14a;
    font-size: 28px;
    line-height: 1.12;
}

.cta p {
    position: relative;
    margin: 0 0 16px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.5;
}

.btn-yellow {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: 0;
    border-radius: 999px;
    background: #ffd400;
    color: #1a1a1a;
    font: inherit;
    font-weight: 800;
    padding: 12px 16px;
    cursor: pointer;
}

.btn-yellow:hover {
    color: #1a1a1a;
    filter: brightness(1.05);
}

.interests {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 8px;
}

.interest {
    display: grid;
    justify-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.interest .icon {
    width: 22px;
    height: 22px;
    color: var(--text);
}

.motto {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 18px 8px 4px;
    text-align: center;
    font-family: Caveat, cursive;
    font-size: 22px;
    line-height: 1.2;
}

.motto .icon {
    color: #e11d48;
    flex: none;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 26px 0 22px;
}

.footer-bar {
    justify-content: space-between;
    gap: 16px;
}

.footer-note {
    margin: 0;
    font-size: 14px;
}

.legal {
    margin: 18px 0 0;
    font-size: 12px;
}

.announce {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff8d6;
    border: 1px solid #f0e2a0;
    color: #3a3208;
}

[data-theme="dark"] .announce {
    background: #2a2412;
    border-color: #4a3f1a;
    color: #f6e7a8;
}

.form-card {
    max-width: 520px;
}

.blog .form-control {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
}

.hint {
    margin: 8px 0 14px;
    font-size: 13px;
}

.post-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 720px);
    gap: 36px;
    align-items: start;
    justify-content: center;
}

.post-toc {
    position: sticky;
    top: 88px;
}

.blog .js-toc a {
    color: var(--muted);
    font-size: 14px;
}

.blog .is-active-link {
    color: var(--text);
    font-weight: 800;
}

.blog .is-active-link::before {
    background-color: var(--accent);
}

.post-title {
    display: block;
    margin: 0 0 8px;
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.1;
}

.post-cover {
    width: 100%;
    border-radius: 16px;
    margin: 16px 0 20px;
}

.post-body {
    font-size: 17px;
    line-height: 1.7;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    display: inline;
    font-family: Unbounded, Manrope, sans-serif;
    letter-spacing: -0.03em;
    line-height: 1.25;
}

.post-body a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-body img,
.post-body pre {
    border-radius: 12px;
}

.post-body img {
    max-width: 100%;
}

.share {
    margin: 28px 0;
}

.source {
    margin: 8px 0 0;
}

[data-theme="dark"] .blog .card {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}

.icon-btn:focus-visible,
.btn-yellow:focus-visible,
.story:focus-visible,
.story-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 980px) {
    .hero,
    .split,
    .post-layout {
        grid-template-columns: 1fr;
    }

    .intro {
        order: -1;
    }

    .portrait {
        max-width: 420px;
    }

    .post-toc {
        display: none;
    }

    .stories {
        grid-template-columns: 1fr 1fr;
    }

    .rail-solo {
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .footer-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .stories,
    .interests {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .stories {
        grid-template-columns: 1fr;
    }

    .story-row img,
    .mark {
        width: 72px;
        height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story,
    .story-row {
        transition: none;
    }
}
