:root {
    --bg: #fffaf2;
    --surface: #fffefb;
    --soft: #f7f0e6;
    --soft-blue: #eaf7fb;
    --ink: #322f2a;
    --ink-strong: #24231f;
    --muted: #746d63;
    --line: #e8ddcd;
    --line-strong: #d6c7b4;
    --primary: #cf442e;
    --primary-dark: #a93623;
    --primary-soft: #ffede5;
    --accent: #ffc33f;
    --warm: #fff1c9;
    --sky: #45add5;
    --mint: #dff1df;
    --shadow: 0 16px 34px rgba(75, 54, 30, .1);
}

html {
    background: #f6efe5;
}

body {
    background: var(--bg);
    color: var(--ink);
}

::selection {
    background: #ffe18a;
    color: var(--ink-strong);
}

.site-header {
    border-bottom: 1px solid #eadfce;
    background: rgba(255, 252, 246, .94);
    box-shadow: 0 3px 0 rgba(88, 66, 39, .025);
}

.site-header-inner {
    min-height: 78px;
}

.site-brand-word,
.footer-brand strong {
    color: #f25538;
    background: linear-gradient(115deg, #f34e34 0%, #ff9e2d 48%, #3caad3 108%);
    background-size: 155% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.site-brand-word {
    font-size: 25px;
    text-shadow: 0 5px 18px rgba(242, 85, 56, .1);
}

.header-search {
    height: 44px;
    border: 1px solid #e4d7c6;
    border-radius: 999px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 4px 14px rgba(82, 61, 35, .055);
}

.header-search:focus-within {
    border-color: #e5a950;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 195, 63, .16);
}

.header-search input::placeholder {
    color: #a49a8d;
}

.header-search button {
    padding: 6px 13px;
    border: 1px solid #2e2c27;
    border-radius: 999px;
    background: #ffdc67;
    color: #2e2c27;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease;
}

.header-search button:hover {
    background: #ffc944;
    transform: translateY(-1px);
}

.site-nav {
    gap: 7px;
}

.site-nav a {
    padding: 7px 11px;
    border-radius: 999px;
    color: #5f584f;
    transition: color .16s ease, background .16s ease, transform .16s ease;
}

.site-nav a:hover {
    background: #fff0df;
    color: #c9432b;
    transform: translateY(-1px);
}

.archive-home {
    position: relative;
    background:
        radial-gradient(circle at 7% 10%, rgba(255, 194, 63, .2), transparent 20%),
        radial-gradient(circle at 91% 9%, rgba(69, 173, 213, .17), transparent 24%),
        radial-gradient(circle at 78% 39%, rgba(242, 85, 56, .07), transparent 20%),
        linear-gradient(180deg, #fff9ef 0%, #fffdf8 45%, #fffaf2 100%);
}

.archive-home::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .34;
    pointer-events: none;
    background:
        radial-gradient(circle at 5% 8%, #f7b92c 0 3px, transparent 3.5px),
        radial-gradient(circle at 91% 19%, #42a9d0 0 2px, transparent 2.5px),
        radial-gradient(circle at 82% 34%, #ef5b41 0 2px, transparent 2.5px);
}

.archive-home > .container {
    position: relative;
    z-index: 1;
}

.archive-intro {
    min-height: 390px;
    grid-template-columns: minmax(360px, .82fr) minmax(0, 1.18fr);
    gap: 28px;
    padding: 18px 0 28px;
}

.archive-intro-copy {
    padding-left: 5px;
}

.archive-intro::after {
    content: "";
    min-width: 0;
    width: calc(100% + 102px);
    aspect-ratio: 3 / 2;
    margin: -44px -74px -58px -28px;
    align-self: center;
    background: url("/assets/hanfile-friends-hero.webp") center / contain no-repeat;
    filter: saturate(1.05) drop-shadow(0 17px 19px rgba(69, 48, 26, .09));
    animation: friends-arrive .72s cubic-bezier(.22, .8, .32, 1) both;
}

.archive-intro-copy > p {
    display: inline-flex;
    align-items: center;
    margin-bottom: 17px;
    padding: 6px 11px 5px;
    border: 1.5px solid #2f2d29;
    border-radius: 999px;
    background: #ffdc67;
    color: #2f2d29;
    box-shadow: 3px 3px 0 #2f2d29;
    font-size: 11px;
    letter-spacing: .11em;
    transform: rotate(-1deg);
}

.archive-intro h1 {
    max-width: 600px;
    color: var(--ink-strong);
    font-size: clamp(42px, 5.25vw, 64px);
    font-weight: 850;
    line-height: 1.13;
    letter-spacing: -.065em;
}

.archive-intro h1 em {
    position: relative;
    z-index: 0;
    color: #ed5035;
    text-shadow: 2px 3px 0 rgba(255, 196, 64, .2);
}

.archive-intro h1 em::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -.04em;
    bottom: .02em;
    left: -.03em;
    height: .19em;
    border-radius: 999px;
    background: rgba(255, 198, 65, .78);
    transform: rotate(-1deg);
}

.archive-filter {
    gap: 12px;
    padding: 9px;
    border: 2px solid #312f2a;
    border-radius: 20px;
    background: #fffefa;
    box-shadow: 5px 6px 0 #edd8b7;
}

.archive-query-field input {
    height: 48px;
    padding-left: 14px;
    color: var(--ink-strong);
    font-size: 15px;
}

.archive-query-field input::placeholder {
    color: #a69b8c;
}

.archive-filter button {
    height: 48px;
    padding: 0 24px;
    border: 2px solid #312f2a;
    border-radius: 14px;
    background: #cf442e;
    color: #fff;
    cursor: pointer;
    box-shadow: 2px 2px 0 #312f2a;
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.archive-filter button:hover {
    background: #b73925;
    box-shadow: 1px 1px 0 #312f2a;
    transform: translate(1px, 1px);
}

.archive-filter > a {
    color: #746b60;
}

.archive-heading {
    margin-top: 62px;
    padding-bottom: 18px;
    border-bottom: 2px solid #39362f;
}

.archive-heading h2 {
    position: relative;
    z-index: 0;
    display: inline-block;
    color: var(--ink-strong);
    font-size: 30px;
    font-weight: 850;
}

.archive-heading h2::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -3px;
    bottom: 1px;
    left: -3px;
    height: 9px;
    border-radius: 99px;
    background: #ffe08a;
    transform: rotate(-1deg);
}

.archive-heading p {
    color: #746d64;
    font-size: 14px;
}

.archive-heading > span {
    padding: 6px 10px;
    border: 1px solid #dfd2bf;
    border-radius: 999px;
    background: #fffdfa;
    color: #71695f;
    font-size: 12px;
}

.archive-grid {
    gap: 18px;
}

.archive-card {
    --card-color: #43acd4;
    --card-soft: #e9f7fc;
    overflow: hidden;
    border: 1.5px solid #36332d;
    border-top: 6px solid var(--card-color);
    border-radius: 21px;
    background: #fffefb;
    box-shadow: 5px 6px 0 #eadcca;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.archive-card:nth-child(4n + 2) {
    --card-color: #f4b72f;
    --card-soft: #fff4cf;
}

.archive-card:nth-child(4n + 3) {
    --card-color: #ef6248;
    --card-soft: #ffede7;
}

.archive-card:nth-child(4n + 4) {
    --card-color: #70ad60;
    --card-soft: #eaf5e6;
}

.archive-card:hover {
    border-color: #26241f;
    box-shadow: 7px 9px 0 #e8d3af;
    transform: translateY(-4px) rotate(-.15deg);
}

.archive-card > a {
    min-height: 270px;
    padding: 21px;
}

.archive-card-meta > span {
    border: 1px solid #403c34;
    border-radius: 999px;
    background: var(--card-soft);
    color: #35322d;
    font-weight: 800;
}

.archive-card-stats,
.archive-card-stats time {
    color: #958b7e;
}

.archive-card-stats span::before {
    background: #bbae9d;
}

.archive-card h3 {
    color: #292722;
    font-size: 21px;
    font-weight: 820;
}

.archive-card > a > p {
    color: #746d64;
}

.archive-card-footer {
    color: #8b8174;
}

.archive-card-footer strong {
    color: #cf442e;
}

.empty-state {
    border: 1.5px solid #37342e;
    border-radius: 24px;
    background: #fff7df;
    box-shadow: 5px 6px 0 #ead9b8;
}

.pagination a {
    border: 1px solid transparent;
    border-radius: 999px;
    color: #6f675d;
}

.pagination a:hover {
    border-color: #e1d2bd;
    background: #fff1d8;
}

.pagination a.is-current {
    border-color: #302e29;
    background: #cf442e;
    box-shadow: 2px 2px 0 #302e29;
}

.preview-bar {
    background: #ffe68d;
    color: #493d22;
}

.article-page {
    background: #fffdf8;
}

.article-hero {
    border-bottom: 1px solid #eadfce;
    background:
        radial-gradient(circle at 13% 18%, rgba(255, 195, 63, .18), transparent 24%),
        radial-gradient(circle at 89% 35%, rgba(69, 173, 213, .14), transparent 24%),
        linear-gradient(180deg, #fffaf0 0%, #fffdf8 100%);
}

.story-breadcrumb {
    color: #8d8274;
}

.story-breadcrumb a:hover {
    color: #d9472e;
}

.article-category {
    padding: 7px 12px 6px;
    border: 1.5px solid #312f2a;
    border-radius: 999px;
    background: #ffdc67;
    color: #312f2a;
    box-shadow: 2px 2px 0 #312f2a;
    transform: rotate(-.7deg);
}

.article-hero h1 {
    color: #272520;
    font-size: clamp(40px, 5.3vw, 58px);
    font-weight: 850;
}

.article-subtitle,
.article-meta-line {
    color: #7d7469;
}

.article-meta-line span + span::before {
    background: #c8b9a6;
}

.article-lead {
    padding: 21px 23px;
    border-left: 5px solid #f25538;
    border-radius: 0 18px 18px 0;
    background: #fff6df;
    color: #3a3731;
}

.article-toc {
    border: 1.5px solid #34312c;
    border-radius: 20px;
    background: #fffdf8;
    box-shadow: 5px 6px 0 #eadcca;
}

.article-toc summary::after {
    border: 1px solid #312f2a;
    background: #ffdc67;
    color: #312f2a;
}

.article-toc nav {
    border-top-color: #eadfce;
}

.article-toc nav a {
    border-bottom-color: #eee4d7;
}

.article-toc nav a:hover {
    background: #fff6e1;
}

.article-toc nav a span,
.source-refs,
.source-refs a {
    color: #d74b34;
}

.article-toc nav a strong,
.section-body h2 {
    color: #2b2924;
}

.section-label p {
    color: #e14e35;
}

.section-label strong {
    color: #655e55;
}

.section-body blockquote {
    border-left-color: #f6ba37;
    background: #fff7df;
    color: #5b544b;
}

.article-paragraph {
    color: #393630;
}

.video-block,
.ad-block {
    border: 1.5px solid #36332d;
    border-radius: 22px;
    background: #fffefb;
    box-shadow: 5px 6px 0 #eadcca;
}

.youtube-play-mark {
    border: 2px solid #302e29;
    background: #ffdc67;
    box-shadow: 4px 5px 0 rgba(28, 27, 24, .78);
}

.youtube-play-mark i {
    border-left-color: #ef5137;
}

.youtube-lightbox-trigger:hover .youtube-play-mark {
    background: #ffc83d;
}

.youtube-lightbox-trigger:focus-visible {
    outline-color: rgba(242, 85, 56, .55);
}

.video-block figcaption,
.ad-block figcaption {
    background: #fffdfa;
}

.video-block figcaption p,
.ad-block figcaption p {
    color: #6d665d;
}

.ad-block-label {
    background: #fff1c9;
    color: #9c551f;
}

.ad-link,
.external-video-link {
    color: #d84930;
}

.closing-section {
    border: 1.5px solid #36332d;
    border-radius: 24px;
    background: #fff3d2;
    box-shadow: 5px 6px 0 #e6d3ad;
}

.closing-section blockquote {
    border: 1px solid #ead4a3;
    border-radius: 16px;
    background: #fffdf8;
    color: #704a31;
}

.source-list li {
    border-color: #e8ddce;
}

.source-list strong {
    color: #403c35;
}

.source-list a {
    color: #d84930;
}

.article-end {
    border-top-color: #e5d8c7;
    background: #f7f0e6;
}

.article-end a {
    border: 1.5px solid #38352f;
    border-radius: 18px;
    background: #fffdf8;
    box-shadow: 4px 5px 0 #e7d8c2;
}

.article-end a span:last-child {
    color: #d84930;
}

.not-found .eyebrow,
.not-found .text-link {
    color: #d84930;
}

.site-footer {
    position: relative;
    min-height: 158px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 42px 0;
    border-top: 1px solid #ddcfbc;
    background: #f4eee5;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 50%;
    right: max(12px, calc((100vw - 1240px) / 2 - 10px));
    width: min(650px, 54vw);
    aspect-ratio: 1672 / 941;
    opacity: .12;
    pointer-events: none;
    background: url("/assets/hanfile-friends-parade.webp") center / contain no-repeat;
    filter: grayscale(1) contrast(.84);
    transform: translateY(-49%);
}

.footer-divider {
    background: #d3c4af;
}

.footer-identity p,
.footer-meta {
    color: #746b5f;
}

.footer-meta a {
    border: 1px solid #d4c3aa;
    border-radius: 999px;
    background: #fff5df;
    color: #b44931;
}

.footer-meta a:hover {
    border-color: #302e29;
    background: #ffdc67;
    color: #302e29;
}

@media (max-width: 900px) {
    .archive-intro {
        min-height: 330px;
        grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
    }

    .archive-intro h1 {
        font-size: clamp(40px, 6vw, 52px);
    }
}

@media (max-width: 640px) {
    .site-header-inner {
        min-height: 66px;
    }

    .site-brand-word {
        font-size: 22px;
    }

    .header-search button {
        padding-inline: 11px;
    }

    .site-nav a {
        padding: 6px 8px;
    }

    .archive-home {
        padding-top: 30px;
    }

    .archive-intro {
        min-height: 0;
        grid-template-columns: 1fr;
        padding-top: 8px;
    }

    .archive-intro-copy > p {
        margin-bottom: 16px;
        font-size: 10px;
    }

    .archive-intro h1 {
        max-width: 360px;
        font-size: clamp(38px, 11.8vw, 48px);
        line-height: 1.15;
    }

    .archive-intro::after {
        width: 112%;
        margin: -18px -6% -38px;
    }

    .archive-filter {
        border-radius: 17px;
        box-shadow: 4px 5px 0 #ead3ad;
    }

    .archive-filter button {
        border-radius: 12px;
    }

    .archive-heading {
        margin-top: 48px;
    }

    .archive-heading h2 {
        font-size: 26px;
    }

    .archive-card {
        border-radius: 19px;
        box-shadow: 4px 5px 0 #eadcca;
    }

    .archive-card > a {
        min-height: 230px;
    }

    .article-category {
        box-shadow: 2px 2px 0 #312f2a;
    }

    .article-hero h1 {
        font-size: 38px;
        line-height: 1.26;
    }

    .article-lead {
        padding: 18px;
    }

    .article-toc,
    .video-block,
    .ad-block,
    .closing-section {
        box-shadow: 4px 5px 0 #eadcca;
    }

    .site-footer {
        min-height: 176px;
        padding: 38px 0;
    }

    .site-footer::before {
        right: -185px;
        width: 520px;
        opacity: .075;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-search button,
    .site-nav a,
    .archive-filter button,
    .archive-card {
        transform: none !important;
    }
}
