:root {
    --ink: #1b2528;
    --muted: #617076;
    --paper: #fbfaf7;
    --paper-alt: #f1f4f1;
    --line: #d9e0dc;
    --blue: #2f6f86;
    --green: #547f62;
    --coral: #de6c5d;
    --yellow: #e9b949;
    --max-width: 1180px;
}

html {
    scroll-behavior: smooth;
    background: var(--paper);
}

body {
    background: var(--paper);
    color: var(--ink);
    overflow-x: hidden;
}

body,
body p,
body a,
body h1,
body h2,
body h3,
body code,
body th,
body td {
    color: var(--ink);
}

a {
    color: var(--blue);
    transition: color 160ms ease, opacity 160ms ease;
}

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

.planwam-hero {
    background:
        linear-gradient(110deg, rgba(251, 250, 247, 0.98) 0%, rgba(251, 250, 247, 0.96) 39%, rgba(251, 250, 247, 0.28) 72%, rgba(251, 250, 247, 0.08) 100%),
        var(--paper);
    padding: 7rem 6vw 0;
}

.hero-inner {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
}

.hero-copy {
    width: 100%;
    max-width: none;
    padding: 2rem 0 3rem;
}

.eyebrow,
.section-kicker,
.question-label,
.table-note,
.hero-status,
.hero-authors,
.metric span,
.metric small,
.setup-strip span,
.principle-number,
.method-index,
.equation-card span {
    font-family: "Poppins", sans-serif;
}

.eyebrow,
.section-kicker {
    color: var(--coral);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-copy h1 {
    max-width: none;
    margin: 0.8rem 0 1.2rem;
    color: var(--ink);
    font-family: "Poppins", sans-serif;
    font-size: 4.2rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.06;
}

.hero-authors {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-style: normal;
    font-weight: 600;
    line-height: 1.55;
}

.hero-status {
    margin: 0.15rem 0 1.5rem;
    color: var(--ink);
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

.hero-abstract {
    max-width: none;
    margin: 0;
    color: #344247;
    font-family: "Charter", serif;
    font-size: 1.15rem;
    line-height: 1.72;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 2rem;
}

.button.icon {
    margin: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.8rem 1rem;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}

.button.icon i {
    padding-left: 0.65rem;
}

.primary-action {
    background: var(--ink) !important;
    color: var(--paper) !important;
}

.primary-action:hover {
    background: var(--blue) !important;
    color: white !important;
    opacity: 1 !important;
}

.secondary-action {
    background: transparent !important;
    border-color: var(--line) !important;
    color: var(--ink) !important;
}

.secondary-action:hover {
    border-color: var(--blue) !important;
    color: var(--blue) !important;
    opacity: 1 !important;
}

.hero-visual {
    position: relative;
    margin: 0 auto 2.4rem;
    padding: 0.7rem 0.7rem 0.85rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(217, 224, 220, 0.92);
    box-shadow: 0 20px 50px rgba(31, 52, 57, 0.09);
}

.lead-video {
    width: 100%;
    max-width: 100%;
}

.hero-visual::before {
    position: absolute;
    top: -0.55rem;
    left: -0.55rem;
    width: 4rem;
    height: 4rem;
    border-top: 3px solid var(--coral);
    border-left: 3px solid var(--coral);
    content: "";
}

.hero-visual img,
.hero-visual video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: fill;
    background: #111;
}

.hero-visual figcaption,
.figure-wide figcaption,
.figure-medium figcaption {
    margin-top: 0.8rem;
    color: var(--muted);
    font-family: "Poppins", sans-serif;
    font-size: 0.76rem;
    line-height: 1.55;
}

.hero-rule {
    max-width: 1450px;
    margin: 3rem auto 0;
    border-bottom: 1px solid var(--line);
}

.container.blog.main.section-block {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 5rem 2rem;
}

.container.blog.main.gray {
    max-width: none;
    padding-right: max(2rem, calc((100vw - var(--max-width)) / 2 + 2rem));
    padding-left: max(2rem, calc((100vw - var(--max-width)) / 2 + 2rem));
    background: var(--paper-alt);
}

.section-kicker {
    margin-bottom: 0.55rem;
}

.container.blog.main.section-block h1 {
    margin: 0 0 1.7rem;
    padding: 0;
    color: var(--ink);
    font-family: "Poppins", sans-serif;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
}

.container.blog.main.section-block h2 {
    margin: 0 0 0.6rem;
    padding: 0;
    color: var(--ink);
    font-family: "Poppins", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
}

.container.blog.main.section-block p.text {
    max-width: 820px;
    padding: 0.55rem 0;
    color: #39484c;
    font-size: 1.03rem;
    line-height: 1.76;
}

.container.blog.main.section-block p.text.lead {
    color: var(--ink);
    font-size: 1.22rem;
    line-height: 1.65;
}

.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr);
    gap: 4rem;
    align-items: start;
}

.intro-grid > *,
.three-column > *,
.results-two-column > *,
.equation-grid > * {
    min-width: 0;
}

.question-panel {
    position: relative;
    min-height: 215px;
    padding: 1.7rem;
    overflow: hidden;
    background: #eaf0eb;
    border-left: 4px solid var(--green);
}

.question-panel p {
    position: relative;
    z-index: 1;
    margin: 1.1rem 0 0;
    color: #294238;
    font-family: "Charter", serif;
    font-size: 2rem;
    line-height: 1.14;
}

.question-label {
    position: relative;
    z-index: 1;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.question-mark {
    position: absolute;
    right: -0.15em;
    bottom: -0.33em;
    color: rgba(84, 127, 98, 0.13);
    font-family: "Charter", serif;
    font-size: 15rem;
    line-height: 0.8;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 3.5rem;
    background: var(--line);
    border: 1px solid var(--line);
}

.metric {
    min-height: 150px;
    padding: 1.2rem 1.1rem;
    background: var(--paper);
}

.metric:nth-child(2) {
    background: #f6f7f2;
}

.metric:nth-child(3) {
    background: #fdf4ee;
}

.metric:nth-child(4) {
    background: #f2f6f6;
}

.metric strong {
    display: block;
    color: var(--blue);
    font-family: "Poppins", sans-serif;
    font-size: 3.4rem;
    font-weight: 600;
    line-height: 1;
}

.metric span {
    display: block;
    margin-top: 0.55rem;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.metric small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.68rem;
}

.figure-wide,
.figure-medium {
    margin: 2.4rem auto 0;
}

.figure-wide img,
.figure-medium img {
    cursor: zoom-in;
}

.figure-medium {
    max-width: 980px;
}

.three-column,
.results-two-column {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.3rem;
    margin-top: 3rem;
}

.results-two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.principle {
    padding-top: 1rem;
    border-top: 2px solid var(--line);
}

.principle:nth-child(1) {
    border-color: var(--coral);
}

.principle:nth-child(2) {
    border-color: var(--green);
}

.principle:nth-child(3) {
    border-color: var(--blue);
}

.principle-number {
    display: block;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.method-list {
    margin-top: 2.8rem;
    border-top: 1px solid var(--line);
}

.method-row {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: 1.2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--line);
}

.method-index {
    color: var(--coral);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

code {
    color: #8f4b42;
    font-family: "Fira Code", monospace;
    font-size: 0.88em;
}

.equation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.equation-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.2rem;
    background: #f4f1e7;
    border: 1px solid #e6dfca;
}

.equation-card span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.equation-card code {
    color: var(--ink);
    font-size: 0.95rem;
}

.setup-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    margin: 2.2rem 0 3rem;
    background: var(--line);
    border: 1px solid var(--line);
}

.setup-strip div {
    min-height: 95px;
    padding: 1rem;
    background: var(--paper);
}

.setup-strip strong {
    display: block;
    color: var(--blue);
    font-family: "Poppins", sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
}

.setup-strip span {
    display: block;
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.3;
}

.table-note {
    margin: -0.35rem 0 0.85rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.table-wrap {
    margin: 0.8rem 0 2rem;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--paper);
}

table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
    font-family: "Poppins", sans-serif;
    font-size: 0.75rem;
}

.section-block table th,
.section-block table td {
    padding: 0.62rem 0.55rem;
    border-bottom: 1px solid #e9eeeb;
    text-align: center;
    white-space: nowrap;
}

.section-block table th:first-child,
.section-block table td:first-child {
    min-width: 148px;
    text-align: center;
}

thead {
    background: #e6eeea;
}

.section-block table th {
    color: #31504a;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fafcf9;
}

tr.group td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: #f3f5f1;
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

tr.baseline td {
    color: #65736f;
}

tr.ours td {
    background: #fff1e9;
    color: #793c31;
    font-weight: 700;
}

.section-block td.best {
    font-weight: 700;
}

.compact-table table {
    min-width: 560px;
}

.result-block + .result-block {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--line);
}

.annotation {
    margin: -0.4rem 0 2.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--coral);
    color: var(--muted);
    font-family: "Charter", serif;
    font-size: 1rem;
    line-height: 1.55;
}

.citation-box {
    position: relative;
    margin-top: 1.5rem;
}

.citation-box pre {
    position: relative;
    margin: 0;
    padding: 1.4rem 4rem 1.4rem 1.4rem;
    overflow-x: auto;
    background: #202a2c;
    border-radius: 3px;
}

.citation-box pre code {
    color: #e9eee9;
    font-family: "Fira Code", monospace;
    font-size: 0.78rem;
    line-height: 1.75;
}

.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 0.9rem;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.17);
    color: white;
}

.site-footer {
    padding: 2.3rem max(2rem, calc((100vw - var(--max-width)) / 2 + 2rem));
    background: #202a2c;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #dfe8e3;
    font-family: "Poppins", sans-serif;
    font-size: 0.76rem;
}

.footer-inner a {
    color: #dfe8e3;
}

.footer-inner a:hover {
    color: #f1c5a4;
}

.image-modal {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: rgba(20, 29, 31, 0.92);
}

.image-modal.open {
    display: flex;
}

.image-modal img {
    max-width: min(1400px, 94vw);
    max-height: 88vh;
    object-fit: contain;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.7rem;
    height: 2.7rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: transparent;
    color: white;
}

@media (max-width: 900px) {
    .planwam-hero {
        padding-top: 5rem;
    }

    .hero-inner,
    .intro-grid {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        max-width: 900px;
    }

    .hero-copy h1 {
        font-size: 3rem;
    }

    .container.blog.main.section-block h1 {
        font-size: 2.5rem;
    }

    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .three-column {
        grid-template-columns: 1fr;
    }

    .setup-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 620px) {
    .planwam-hero {
        padding: 4rem 1.1rem 0;
    }

    .hero-copy {
        padding-bottom: 2rem;
    }

    .hero-copy h1 {
        font-size: 2rem;
    }

    .hero-abstract {
        font-size: 1rem;
    }

    .hero-visual {
        padding: 0.7rem;
    }

    .container.blog.main.section-block,
    .container.blog.main.gray.section-block {
        padding: 3.5rem 1.1rem;
    }

    .container.blog.main.section-block h1 {
        font-size: 2rem;
    }

    .container.blog.main.section-block p.text {
        font-size: 0.98rem;
    }

    .container.blog.main.section-block p.text.lead {
        font-size: 1.08rem;
    }

    .question-panel {
        min-height: 180px;
    }

    .metric-grid,
    .equation-grid,
    .results-two-column {
        grid-template-columns: 1fr;
    }

    .metric {
        min-height: 125px;
    }

    .setup-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .setup-strip div:last-child {
        grid-column: span 2;
    }

    .method-row {
        grid-template-columns: 3.2rem minmax(0, 1fr);
        gap: 0.7rem;
    }

    .equation-card code {
        font-size: 0.75rem;
    }

    .footer-inner {
        align-items: flex-start;
        font-size: 0.7rem;
    }

    .image-modal {
        padding: 1rem;
    }
}
