:root {
    --green: #2f6b55;
    --deep: #1f4a3c;
    --moss: #6f9a5b;
    --bark: #6b3f2a;
    --clay: #8a5a3c;
    --sand: #d9b995;
    --cream: #f3e3c7;
    --forest: linear-gradient(135deg, var(--green), var(--deep));
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--deep);
    color: var(--cream);
    font: 15px/1.6 Inter, sans-serif;
}

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

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

h1:focus {
    outline: none;
}

h1, h2, h3, .wordmark {
    font-family: Fraunces, serif;
    line-height: 1.15;
}

.wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Nav: a frosted pill floating over every page */

.site-header {
    position: fixed;
    top: 12px;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0 24px;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 952px;
    height: 56px;
    margin: 0 auto;
    padding: 0 10px 0 24px;
    border: 1px solid #f3e3c726;
    border-radius: 99px;
    background: #1f4a3c8c;
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 10px 30px #0003;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    font-size: 20px;
}

.wordmark img {
    width: 1.3em;
    height: 1.3em;
}

.nav-links {
    display: flex;
    gap: 4px;
    font-size: 14px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 99px;
    opacity: .8;
    transition: background .2s, opacity .2s;
}

.nav-links a:hover {
    background: #f3e3c71f;
    opacity: 1;
}

/* Shared */

.pill {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 99px;
    background: #0003;
    font-size: 12px;
    font-weight: 600;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    opacity: .7;
}

.card {
    padding: 26px 28px;
    border-radius: 22px;
    box-shadow: 0 12px 28px #0005;
}

.moss {
    background: var(--moss);
}

.forest {
    background: var(--forest);
}

.empty {
    padding: 64px 0;
    opacity: .7;
}

/* Home tiles and news cards cycle through the palette */

:is(.tiles > .tile, .feed > .card):nth-child(4n+1) {
    background: var(--moss);
}

:is(.tiles > .tile, .feed > .card):nth-child(4n+2) {
    background: var(--bark);
}

:is(.tiles > .tile, .feed > .card):nth-child(4n+3) {
    background: var(--clay);
}

:is(.tiles > .tile, .feed > .card):nth-child(4n) {
    background: var(--forest);
}

/* Home hero */

.hero {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 480px;
    background: linear-gradient(var(--green) 70%, var(--deep));
}

.hero-text {
    align-self: center;
    padding: 124px 24px 60px max(24px, calc(50vw - 476px));
}

.hero h1 {
    font-size: clamp(40px, 6vw, 64px);
}

.hero p {
    margin: 20px 0 32px;
    max-width: 400px;
    opacity: .85;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 99px;
    background: linear-gradient(var(--cream), var(--sand));
    color: var(--bark);
    font-weight: 600;
    box-shadow: 0 8px 20px #0004;
}

plum-hero {
    position: absolute;
    grid-area: 1/2;
    inset: 0;
    display: block;
    background: linear-gradient(160deg, var(--bark), var(--deep));
    clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%);
}

plum-hero canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Home tiles */

.tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 64px 0;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    padding: 28px;
    border-radius: 22px;
    box-shadow: 0 12px 28px #0005;
    transition: transform .3s;
}

.tile:hover {
    transform: translateY(-6px);
}

.tile-link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.tile h3 {
    font-size: 20px;
    margin: 14px 0 10px;
}

.tile p {
    font-size: 14px;
    opacity: .85;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.tile .meta {
    margin-top: auto;
    padding-top: 20px;
}

.span-2 {
    grid-column: span 2;
}

#posts, #sources {
    scroll-margin-top: 80px;
}

#sources {
    background: var(--forest);
}

#sources a {
    border-bottom: 1.5px solid var(--cream);
}

.source-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 20px;
}

.source-pills .pill {
    border: 1.5px solid #f3e3c766;
    background: none;
}

/* Page header (post and news) */

.page-hero {
    background: linear-gradient(20deg, var(--bark) 12%, var(--green) 12%);
    padding: 108px 0 72px;
}

.back-link {
    display: block;
    width: fit-content;
    margin-bottom: 32px;
    font-size: 14px;
    opacity: .75;
}

.back-link:hover {
    opacity: 1;
}

.page-hero h1 {
    max-width: 720px;
    margin: 18px 0 16px;
    font-size: clamp(32px, 5vw, 52px);
}

.page-hero .meta {
    font-size: 13px;
    opacity: .8;
}

/* Post */

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    align-items: start;
    padding: 56px 24px 72px;
}

.standfirst {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
}

.post-body p {
    margin-top: 22px;
    font-size: 17px;
    line-height: 1.75;
    opacity: .85;
}

.key-points {
    margin-top: 40px;
}

.key-points h2 {
    font-size: 20px;
    margin-bottom: 14px;
}

.sidebar {
    position: sticky;
    top: 88px;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 14px;
}

.recent-list {
    list-style: none;
}

.recent-list li + li {
    border-top: 1px solid #f3e3c733;
}

.recent-list a {
    display: block;
    padding: 12px 0;
}

.recent-list li:first-child a {
    padding-top: 0;
}

.recent-list li:last-child a {
    padding-bottom: 0;
}

.recent-title {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.recent-list a:hover .recent-title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Bullet lists (post key points, news summaries) */

.bullets ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bullets li {
    position: relative;
    padding-left: 22px;
    font-size: 15px;
}

.bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cream);
}

.bullets p + p {
    margin-top: 12px;
}

.bullets a {
    border-bottom: 1.5px solid var(--cream);
    overflow-wrap: anywhere;
}

/* News feed */

.feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 768px;
    padding-top: 56px;
    padding-bottom: 72px;
}

.feed h2 {
    font: 600 20px/1.35 Inter, sans-serif;
    margin-bottom: 14px;
}

.feed h2 a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.feed .meta {
    margin-top: 18px;
}

footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 24px;
    font-size: 13px;
    opacity: .6;
}

@media (prefers-reduced-motion: reduce) {
    .tile, .nav-links a {
        transition: none;
    }
}

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

    .sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .wordmark {
        font-size: 18px;
        white-space: nowrap;
    }

    .site-header {
        padding: 0 16px;
    }

    .nav-inner {
        gap: 16px;
        height: 52px;
        padding-left: 20px;
    }

    .nav-links a {
        padding: 6px 12px;
        font-size: 13px;
    }

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

    .hero-text {
        position: relative;
        z-index: 1;
    }

    .hero h1, .hero p {
        text-shadow: 0 0 3px var(--deep), 0 2px 14px var(--deep);
    }

    plum-hero {
        grid-column: 1;
        clip-path: none;
    }

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

    .span-2 {
        grid-column: auto;
    }
}

@media (max-width: 360px) {
    .wordmark {
        font-size: 16px;
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 12px;
    }
}
