:root {
    --article-cream: #f8f3eb;
    --article-ink: #183c56;
    --article-coral: #bd503b;
    --article-blue: #86b7d7;
    --article-gold: #dda944;
    --article-lavender: #e7e3ef;
    --article-line: rgb(24 60 86 / 24%);
}

html.site-theme .article-site .standalone-main {
    background-color: var(--article-cream);
    background-image: url("/assets/rice-paper-page.svg?v=20260813-2");
}

html.site-theme .article-site .standalone-main::after {
    right: 5%;
    bottom: 6rem;
    width: 7rem;
    opacity: 0.2;
}

html.site-theme .article-index-site .standalone-main {
    background-color: var(--article-cream);
    background-image: none;
}

html.site-theme .article-index-site .standalone-main::after {
    display: none;
}

.article-scroll {
    max-width: 58rem;
    margin: 0 auto;
    padding-bottom: 4rem;
}

.article-scroll--index {
    max-width: none;
    padding: 0 0 4rem;
}

.article-back {
    margin-bottom: 1.2rem;
}

.article-reading-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 8;
    padding-inline: 1.75rem;
    color: var(--article-ink);
    pointer-events: none;
}

html.site-theme .article-site .app-header {
    z-index: 10;
    border-bottom: 0;
    overflow: visible;
}

.article-reading-progress__track {
    position: relative;
    height: 0.2rem;
    background: rgb(24 60 86 / 18%);
}

.article-reading-progress__fill {
    position: absolute;
    inset: 0 auto 0 0;
    display: block;
    width: 0;
    height: 100%;
    background: var(--article-coral);
    transition: width 120ms linear;
}

.article-reading-progress__milestone {
    position: absolute;
    top: 50%;
    bottom: auto;
    left: var(--milestone);
    width: 0.5rem;
    height: 0.5rem;
    border: 1px solid var(--article-ink);
    border-radius: 50%;
    background: var(--article-cream);
    transform: translate(-50%, -50%);
}

.article-reading-progress__reader {
    position: absolute;
    top: 50%;
    bottom: auto;
    left: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 2px solid var(--article-cream);
    border-radius: 50%;
    background: var(--article-gold);
    color: var(--article-ink);
    font: 600 0.58rem/1 "IBM Plex Mono", monospace;
    text-align: center;
    box-shadow: 0 0 0 1px var(--article-ink);
    transform: translate(-50%, -50%);
    transition: left 120ms linear;
}

.article-index-hero,
.article-hero,
.article-card,
.article-body,
.article-related {
    position: relative;
    z-index: 1;
}

.article-hero {
    isolation: isolate;
    min-height: 16.5rem;
    overflow: hidden;
    padding: clamp(1.4rem, 5vw, 3rem);
    border: 1px solid var(--article-line);
    background: rgb(251 248 242 / 94%);
}

.article-hero::before,
.article-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

.article-hero::before {
    top: -6rem;
    right: -3rem;
    width: 15rem;
    height: 12rem;
    background: var(--article-lavender);
    transform: rotate(-18deg);
}

.article-hero::after {
    right: 6rem;
    bottom: -5rem;
    width: 10rem;
    height: 8rem;
    background: rgb(221 169 68 / 42%);
}

.article-kicker,
.article-meta,
.article-card__meta,
.article-source-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
}

.article-kicker {
    margin: 0 0 0.75rem;
    color: var(--article-coral);
}

.article-hero h1 {
    max-width: 17ch;
    margin: 0;
    color: var(--article-coral);
    font-family: "Newsreader", Georgia, serif;
    font-size: clamp(2.15rem, 6vw, 4.1rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 0.94;
}

.article-hero__intro {
    max-width: 46rem;
    margin: 1rem 0 0;
    color: var(--article-ink);
    font-family: "Newsreader", Georgia, serif;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    line-height: 1.35;
}

.article-index-hero {
    min-height: 16.5rem;
}

html.site-theme .rice-paper-illustration--articles {
    background: var(--article-cream);
}

html.site-theme .rice-paper-illustration--articles > img {
    position: absolute;
    inset: auto;
    width: 7.5rem;
    height: auto;
    object-fit: contain;
}

html.site-theme .rice-paper-illustration--articles > img:nth-of-type(1) {
    top: 2rem;
    right: 1rem;
    transform: rotate(-18deg) scale(0.55);
}

html.site-theme .rice-paper-illustration--articles > img:nth-of-type(2) {
    right: -1.2rem;
    bottom: 0.3rem;
    transform: rotate(-8deg) scale(0.92);
}

.article-index-intro {
    max-width: 29rem;
    margin: 0.8rem 0 0;
    color: var(--article-ink);
    font-family: "Newsreader", Georgia, serif;
    font-size: clamp(0.92rem, 2vw, 1.05rem);
    line-height: 1.4;
}

.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 0.75rem;
    width: min(calc(100% - 2rem), 58rem);
    margin: 1rem auto 0;
}

.article-card {
    display: grid;
    align-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    overflow: hidden;
    border: 1px solid var(--article-line);
    background: rgb(251 248 242 / 94%);
    color: var(--article-ink);
    text-decoration: none;
}

.article-card:nth-child(3n + 2) {
    background: rgb(231 227 239 / 82%);
}

.article-card:nth-child(3n) {
    background: rgb(134 183 215 / 19%);
}

.article-card::after {
    content: "";
    position: absolute;
    right: -2.2rem;
    bottom: -2.4rem;
    width: 6rem;
    height: 4.5rem;
    border-radius: 50%;
    background: var(--article-blue);
    opacity: 0.72;
    transform: rotate(-24deg);
}

.article-card:nth-child(3n + 2)::after {
    background: var(--article-gold);
}

.article-card:nth-child(3n)::after {
    background: var(--article-coral);
    opacity: 0.52;
}

.article-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    color: rgb(24 60 86 / 72%);
    font-size: 0.6rem;
}

.article-card h2 {
    max-width: 14ch;
    margin: 0.5rem 0 0;
    color: var(--article-coral);
    font-family: "Newsreader", Georgia, serif;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.02;
}

.article-card p {
    max-width: 38rem;
    margin: 0.5rem 0 0;
    font-size: 0.79rem;
    line-height: 1.42;
}

.article-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    width: fit-content;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid currentColor;
    font-weight: 700;
    font-size: 0.8rem;
}

.article-card:hover,
.article-card:focus-visible {
    outline: 3px solid var(--article-coral);
    outline-offset: -3px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    margin-top: 1.4rem;
    color: rgb(24 60 86 / 70%);
}

.article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.2rem;
}

.article-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.65rem 1rem;
    border: 1px solid var(--article-ink);
    border-radius: 999px;
    background: var(--article-cream);
    color: var(--article-ink);
    font-family: "Archivo", Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.article-action--primary {
    border-color: var(--article-coral);
    background: var(--article-coral);
    color: var(--article-cream);
}

.article-action:hover,
.article-action:focus-visible {
    outline: 3px solid rgb(189 80 59 / 32%);
    outline-offset: 2px;
}

.article-body {
    max-width: 48rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 3rem) clamp(0.2rem, 2vw, 1rem);
    color: #172b3b;
    font-family: "Newsreader", Georgia, serif;
    font-size: clamp(1.05rem, 2vw, 1.18rem);
    line-height: 1.62;
}

.article-body > p:first-of-type {
    margin-top: 0;
    padding: 1.1rem 1.2rem;
    border-left: 0.35rem solid var(--article-blue);
    background: rgb(134 183 215 / 16%);
    font-size: 1.08em;
}

.article-body h2 {
    margin: 2.2rem 0 0.65rem;
    color: var(--article-ink);
    font-family: "Archivo", Arial, sans-serif;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.18;
}

.article-body p {
    margin: 0.8rem 0;
}

.article-body ul {
    padding-left: 1.3rem;
}

.article-body li + li {
    margin-top: 0.55rem;
}

.article-body strong {
    font-weight: 600;
}

.article-body a {
    color: #205d75;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

.article-body a.article-action--primary {
    color: #fff;
}

.article-body sup a {
    font-family: "Archivo", Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
}

.article-scenario {
    margin: 1.4rem 0;
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--article-line);
    border-bottom: 1px solid var(--article-line);
    background: rgb(221 169 68 / 13%);
}

.article-scenario .article-source-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--article-coral);
}

.article-timeline {
    width: 100%;
    margin: 1rem 0 1.5rem;
    border-collapse: collapse;
    font-family: "Archivo", Arial, sans-serif;
    font-size: 0.82rem;
    line-height: 1.45;
}

.article-timeline th,
.article-timeline td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--article-line);
    text-align: left;
    vertical-align: top;
}

.article-timeline th {
    width: 7.7rem;
    color: var(--article-coral);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.72rem;
}

.article-sources {
    margin-top: 2.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--article-line);
    scroll-margin-top: 5rem;
    font-family: "Archivo", Arial, sans-serif;
    font-size: 0.78rem;
    line-height: 1.5;
}

.article-sources h2 {
    margin-top: 0;
}

.article-sources ol {
    padding-left: 1.25rem;
}

.article-sources li + li {
    margin-top: 0.6rem;
}

.article-related {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    max-width: 48rem;
    margin: 0 auto 2rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--article-line);
    background: rgb(231 227 239 / 82%);
    color: var(--article-ink);
    text-decoration: none;
}

.article-related small,
.article-related strong {
    display: block;
}

.article-related small {
    margin-bottom: 0.25rem;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.64rem;
    text-transform: uppercase;
}

.article-related strong {
    font-family: "Newsreader", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.15;
}

.article-related span {
    font-size: 1.5rem;
}

.article-related:hover,
.article-related:focus-visible {
    outline: 3px solid var(--article-coral);
    outline-offset: -3px;
}

@media (max-width: 700px) {
    .article-list {
        grid-template-columns: 1fr;
    }

    .article-card {
        gap: 0.7rem;
        padding: 0.8rem 0.9rem;
    }

    .article-hero {
        padding: 1.35rem 1rem;
    }

    .article-hero h1 {
        max-width: 14ch;
    }

    .article-card h2 {
        font-size: 1.6rem;
    }

    .article-timeline,
    .article-timeline tbody,
    .article-timeline tr,
    .article-timeline th,
    .article-timeline td {
        display: block;
    }

    .article-timeline tr {
        padding: 0.65rem 0;
        border-bottom: 1px solid var(--article-line);
    }

    .article-timeline th,
    .article-timeline td {
        width: auto;
        padding: 0;
        border: 0;
    }

    .article-timeline td {
        margin-top: 0.2rem;
    }
}

@media print {
    .article-site .app-header,
    .article-site .app-tabbar,
    .article-back,
    .article-reading-progress,
    .article-actions,
    .article-related {
        display: none;
    }

    .article-site .app-shell,
    .article-site .standalone-main,
    .article-site .standalone-scroll {
        display: block;
        height: auto;
        max-width: none;
        overflow: visible;
        background: #fff;
        box-shadow: none;
    }
}
