:root {
    --page: #f8f9f6;
    --paper: #ffffff;
    --ink: #20312d;
    --muted: #63716c;
    --line: #dde3dc;
    --accent: #315a46;
    --accent-soft: #e8eee5;
    --header: #0f1923;
}

/* ScrollTrigger must reposition immediately while measuring after archive expansion. */
:root { scroll-behavior: auto; scroll-padding-top: 24px; }
body.gallery-page { margin: 0; background: radial-gradient(ellipse at 80% 0, #dfe8d229, transparent 45%), var(--page); color: var(--ink); font-family: "Satoshi", system-ui, sans-serif; font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.gallery-page *, .gallery-page *::before, .gallery-page *::after { box-sizing: border-box; }
.gallery-page h1, .gallery-page h2, .gallery-page h3, .gallery-page p, .gallery-page figure { margin: 0; }
.gallery-page a { color: inherit; text-decoration: none; }
.gallery-page button { font: inherit; }
.gallery-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
.gallery-page img { max-width: 100%; }
.gallery-page svg { flex-shrink: 0; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 100; padding: 12px 20px; color: var(--ink); background: white; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { background: var(--header); color: #fff; }
.site-nav { max-width: 1480px; min-height: 80px; margin: 0 auto; padding: 16px 40px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.site-brand { display: flex; align-items: center; }
.site-brand img { width: 253px; height: auto; }
.site-nav-links { display: flex; align-items: center; gap: 32px; font-size: 14px; font-weight: 500; }
.site-nav-links a { min-height: 44px; display: inline-flex; align-items: center; gap: 12px; color: #e2e9e6; transition: color .2s; }
.site-nav-links a:hover { color: #fff; }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: #e5f0dc; }
.gallery-shell { max-width: 1480px; margin: 0 auto; padding: 42px 40px 88px; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 48px; align-items: start; }
.country-sidebar { position: sticky; top: 24px; min-width: 0; }
.country-picker summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 36px; }
.country-picker summary::-webkit-details-marker, .archive-year summary::-webkit-details-marker { display: none; }
.country-picker-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.country-picker-current { display: none; }
.picker-chevron { margin-left: auto; color: var(--muted); transition: transform .25s; }
.country-picker[open] .picker-chevron { transform: rotate(180deg); }
.country-links { display: grid; gap: 3px; padding: 12px 0 0; }
.country-link { display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: #52625b !important; transition: color .2s, background .2s; }
.country-link img { flex: 0 0 20px; border-radius: 2px; box-shadow: 0 0 0 1px #00000008; }
.country-link:hover { background: #edf0e9; }
.country-link[aria-current] { color: var(--accent) !important; background: var(--accent-soft); font-weight: 700; }
.country-active-dot { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: var(--accent); }
.sidebar-archive { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding: 20px 10px; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: 12px; }
.sidebar-archive:hover { color: var(--accent) !important; }
.gallery-main { min-width: 0; width: 100%; max-width: 100%; }
.page-heading { margin-bottom: 36px; }
.page-heading h1 { max-width: 64rem; font-size: clamp(28px, 2.7vw, 42px); line-height: 1.18; letter-spacing: -.045em; font-weight: 500; text-wrap: balance; }
.today-section { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.75fr); gap: 32px; align-items: center; padding: 16px 12px 20px 0; }
.section-label { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.today-caption { margin-top: 14px !important; font-size: clamp(18px, 1.5vw, 23px); line-height: 1.45; letter-spacing: -.025em; text-wrap: pretty; }
.photo-credit { margin-top: 14px !important; font-size: 12px; line-height: 1.7; color: var(--muted); }
.today-copy .button { margin-top: 24px; }
.button { display: inline-flex; min-height: 46px; justify-content: center; align-items: center; gap: 24px; padding: 12px 19px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 700; transition: background .2s, box-shadow .2s; }
.button-primary { color: #fff !important; background: var(--accent); }
.button-primary:hover { background: #244634; box-shadow: 0 4px 14px #315a4620; }
.button svg, .back-link svg { transition: transform .25s; }
.button:hover svg { transform: translateX(3px); }
.today-artwork { position: relative; isolation: isolate; min-width: 0; }
.artwork-layer { position: absolute; inset: 0; overflow: hidden; border-radius: 12px; pointer-events: none; background: #e6eadd; }
.artwork-layer img { width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.artwork-layer-1 { z-index: -1; transform: translate(5px, -8px) rotate(1.5deg); }
.artwork-layer-2 { z-index: -2; transform: translate(7px, -14px) rotate(3deg); }
.today-image-link { position: relative; display: block; overflow: hidden; border-radius: 12px; background: #e6eadd; box-shadow: 0 12px 32px #1c332517; }
.today-image { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; transition: transform .7s cubic-bezier(.2,.65,.3,1); }
.image-open { position: absolute; right: 16px; bottom: 16px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #ffffff55; background: #132c23bf; color: #fff; border-radius: 50%; opacity: 0; transform: translateY(5px); transition: opacity .25s, transform .25s; }
.today-image-link:hover .today-image, .today-image-link:focus-visible .today-image { transform: scale(1.035); }
.today-image-link:hover .image-open, .today-image-link:focus-visible .image-open { opacity: 1; transform: translateY(0); }
.page-intro { max-width: 760px; margin-top: 24px !important; color: var(--muted); font-size: 14px; line-height: 1.8; text-wrap: pretty; }
.wallpaper-collections { margin-top: 52px; }
.wallpaper-month + .wallpaper-month { margin-top: 56px; }
.collection-heading { border-top: 1px solid var(--line); padding: 24px 0 20px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.collection-heading h2 { font-size: 21px; letter-spacing: -.03em; font-weight: 500; }
.collection-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.wallpaper-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; gap: 28px 18px; }
.wallpaper-card { display: block; grid-column: span 3; min-width: 0; }
.wallpaper-media { position: relative; overflow: hidden; background: #e7ebe2; border-radius: 8px; aspect-ratio: 16/10; transform-origin: center; }
.wallpaper-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.65,.3,1); }
.wallpaper-overlay { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; padding: 14px; background: linear-gradient(transparent 35%, #11271bba); color: #fff; font-size: 11px; font-weight: 500; opacity: 0; transition: opacity .25s; }
.wallpaper-caption { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 10px; font-size: 12px; line-height: 1.5; color: #56635c; transition: color .2s; }
.wallpaper-card:hover .wallpaper-media img, .wallpaper-card:focus-visible .wallpaper-media img { transform: scale(1.05); }
.wallpaper-card:hover .wallpaper-overlay, .wallpaper-card:focus-visible .wallpaper-overlay { opacity: 1; }
.wallpaper-card:hover .wallpaper-caption { color: var(--accent); }

/* A four-column gallery ends in a full row: 2 x 6, 3 x 4, or 2 + 3 for a remainder of 1. */
.wallpaper-card:nth-last-child(2):nth-child(4n+1), .wallpaper-card:last-child:nth-child(4n+2) { grid-column: span 6; }
.wallpaper-card:nth-last-child(3):nth-child(4n+1), .wallpaper-card:nth-last-child(2):nth-child(4n+2), .wallpaper-card:last-child:nth-child(4n+3) { grid-column: span 4; }
.wallpaper-card:nth-last-child(5):nth-child(4n+1), .wallpaper-card:nth-last-child(4):nth-child(4n+2) { grid-column: span 6; }
.wallpaper-card:nth-last-child(3):nth-child(4n+3), .wallpaper-card:nth-last-child(2):nth-child(4n+4), .wallpaper-card:last-child:nth-child(4n+5) { grid-column: span 4; }
.wallpaper-card:only-child { grid-column: 1/-1; }
.wallpaper-card:only-child .wallpaper-media { aspect-ratio: 16/7; }
.empty-collection { grid-column: 1/-1; padding: 30px 0; color: var(--muted); }
.empty-collection a { text-decoration: underline; text-underline-offset: 4px; }
.archive-section { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.archive-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.archive-heading h2 { font-size: 26px; line-height: 1.3; font-weight: 500; letter-spacing: -.035em; }
.archive-heading p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.text-link { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted) !important; min-height: 44px; white-space: nowrap; }
.text-link:hover { color: var(--accent) !important; }
.archive-years { display: flex; flex-wrap: wrap; gap: 0 24px; }
.archive-year { flex: 1 1 calc((100% - 48px) / 3); min-width: 0; border-top: 1px solid var(--line); }
.archive-year[open] { flex-basis: 100%; padding-bottom: 20px; }
.archive-year summary { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.archive-year summary h3 { font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.year-toggle { position: relative; width: 14px; height: 14px; color: var(--muted); }
.year-toggle::before, .year-toggle::after { content: ""; position: absolute; top: 6px; left: 2px; width: 10px; height: 1px; background: currentColor; }
.year-toggle::after { transform: rotate(90deg); transition: transform .2s; }
.archive-year[open] .year-toggle::after { transform: rotate(0); }
.month-links { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.month-links a { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-size: 12px; color: var(--muted); transition: background .2s, color .2s, border-color .2s; }
.month-links a:hover, .month-links a[aria-current] { background: var(--accent-soft); color: var(--accent); border-color: #9cb39c; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted) !important; font-size: 12px; margin-bottom: 18px; }
.back-link:hover svg { transform: translateX(-3px); }
.page-breadcrumbs { margin-bottom: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.page-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.page-breadcrumbs li { min-width: 0; overflow-wrap: anywhere; }
.page-breadcrumbs li + li::before { content: "/"; margin-inline: 10px; color: #929d95; }
.page-breadcrumbs a { text-decoration: underline; text-underline-offset: 3px; }
.page-breadcrumbs a:hover { color: var(--accent); }
.related-wallpapers { margin-top: 32px; }
.related-wallpapers .collection-heading { gap: 16px; flex-wrap: wrap; }
.error-page { min-height: 45vh; padding-block: 64px; }
.error-page .button { margin-top: 24px; }
.archive-main .wallpaper-collections { margin-top: 32px; }
.detail-main { max-width: 1280px; width: 100%; margin: 0 auto; padding: 32px 40px 56px; }
.detail-heading { max-width: 1120px; margin-bottom: 28px; }
.detail-heading h1 { font-size: clamp(22px, 2.5vw, 36px); font-weight: 500; line-height: 1.35; letter-spacing: -.035em; text-wrap: pretty; }
.detail-heading .photo-credit { margin-top: 12px !important; }
.detail-artwork { overflow: hidden; border-radius: 12px; background: #e6eadd; box-shadow: 0 14px 40px #1c332514; }
.detail-artwork img { display: block; width: 100%; height: auto; }
.download-section { padding: 38px 0 44px; }
.download-heading h2 { font-size: 24px; font-weight: 500; letter-spacing: -.03em; }
.download-heading p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.download-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.download-option { display: flex; min-height: 82px; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 22px; border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: background .2s, border-color .2s; }
.download-option strong { display: block; font-size: 14px; font-weight: 700; }
.download-option small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.download-option svg { transition: transform .25s; }
.download-option:hover { background: #eef2e9; border-color: #b9c9b2; }
.download-option:hover svg { transform: translateY(3px); }
.download-primary { color: #fff !important; background: var(--accent); border-color: var(--accent); }
.download-primary small { color: #e1eade; }
.download-primary:hover { background: #244634; border-color: #244634; }
.site-footer { background: var(--header); color: #edf2ea; overflow: hidden; }
.footer-inner { max-width: 1480px; margin: auto; padding: 56px 40px 24px; }
.footer-discovery { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-bottom: 40px; }
.footer-discovery h2 { font-size: clamp(28px, 3.5vw, 48px); line-height: 1.2; letter-spacing: -.045em; font-weight: 400; }
.inline-art { display: inline-block; width: 88px; height: 44px; margin: 0 4px; border-radius: 28px; overflow: hidden; vertical-align: -.13em; background: #314331; }
.inline-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.button-light { color: #16271c !important; background: #edf2e7; flex-shrink: 0; }
.button-light:hover { background: #fff; }
.edition-marquee { display: flex; align-items: center; gap: 24px; padding: 24px 0; border-top: 1px solid #ffffff1c; }
.edition-marquee[hidden] { display: none; }
.marquee-window { overflow: hidden; min-width: 0; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.marquee-track { display: flex; width: max-content; }
.marquee-group { display: flex; gap: 40px; padding-right: 40px; flex-shrink: 0; }
.marquee-group span { color: #b7c3bf; font-size: 15px; white-space: nowrap; }
.marquee-control { min-height: 44px; min-width: 54px; padding: 6px 0; background: transparent; border: 0; color: #b7c3bf; font-size: 11px !important; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 22px; border-top: 1px solid #ffffff1c; color: #b7c3bf; font-size: 11px; }
.footer-bottom a { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }

@media (max-width: 1199px) {
    .site-nav { padding-inline: 28px; }
    .gallery-shell { grid-template-columns: 160px minmax(0, 1fr); gap: 30px; padding-inline: 28px; }
    .today-section { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 22px; }
    .today-caption { font-size: 18px; }
    .wallpaper-grid .wallpaper-card { grid-column: span 6; }
    .wallpaper-grid .wallpaper-card:last-child:nth-child(odd) { grid-column: 1/-1; }
    .wallpaper-grid .wallpaper-card:last-child:nth-child(odd) .wallpaper-media { aspect-ratio: 2.5/1; }
    .month-links { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 959px) {
    .site-nav { min-height: 70px; }
    .gallery-shell { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 20px; }
    .country-sidebar { position: static; }
    .country-picker { padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .country-picker summary { min-height: 48px; }
    .country-picker-label { font-size: 10px; }
    .country-picker-current { display: block; margin-left: auto; font-size: 12px; }
    .picker-chevron { margin-left: 4px; }
    .country-links { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px 0 12px; }
    .sidebar-archive { display: none; }
    .today-section { grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr); }
    .footer-inner { padding-inline: 28px; }
    .inline-art { width: 64px; height: 34px; }
}

@media (max-width: 599px) {
    .site-nav { min-height: 64px; padding: 10px 18px; gap: 16px; }
    .site-brand img { width: 190px; }
    .site-nav-links { gap: 16px; font-size: 12px; }
    .site-nav-links a { gap: 5px; }
    .site-nav-links a span { display: none; }
    .gallery-shell { padding: 16px 18px 48px; gap: 24px; }
    .country-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
    .country-link { font-size: 12px; padding-inline: 6px; }
    .page-heading { margin-bottom: 22px; }
    .page-heading h1 { font-size: 28px; line-height: 1.2; }
    .today-section { display: flex; flex-direction: column; align-items: stretch; gap: 22px; padding: 8px 3px 0 0; }
    .today-artwork { order: -1; }
    .artwork-layer-1 { transform: translate(3px, -5px) rotate(1deg); }
    .artwork-layer-2 { transform: translate(4px, -9px) rotate(2deg); }
    .today-copy { padding-right: 4px; }
    .today-caption { font-size: 19px; margin-top: 10px !important; }
    .today-copy .button { margin-top: 18px; }
    .page-intro { margin-top: 20px !important; font-size: 13px; }
    .wallpaper-collections { margin-top: 34px; }
    .wallpaper-month + .wallpaper-month { margin-top: 40px; }
    .collection-heading { padding: 20px 0 16px; }
    .collection-heading h2 { font-size: 20px; }
    .collection-count { font-size: 11px; }
    .wallpaper-grid { gap: 22px 12px; }
    .wallpaper-grid .wallpaper-card { grid-column: 1/-1; }
    .wallpaper-grid .wallpaper-card:last-child:nth-child(odd) .wallpaper-media, .wallpaper-media { aspect-ratio: 16/9; }
    .wallpaper-caption { font-size: 12px; }
    .archive-section { margin-top: 48px; padding-top: 24px; }
    .archive-heading { display: block; margin-bottom: 20px; }
    .archive-heading h2 { font-size: 24px; }
    .archive-heading .text-link { display: none; }
    .archive-years { column-gap: 20px; }
    .archive-year { flex-basis: calc((100% - 20px) / 2); }
    .month-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .detail-main { padding: 16px 18px 36px; }
    .detail-heading h1 { font-size: 20px; line-height: 1.4; }
    .detail-heading { margin-bottom: 22px; }
    .back-link { margin-bottom: 12px; }
    .detail-artwork { border-radius: 8px; }
    .download-section { padding: 26px 0 32px; }
    .download-heading h2 { font-size: 24px; }
    .download-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
    .download-primary { grid-column: 1/-1; }
    .download-option { min-height: 78px; padding: 14px; gap: 8px; }
    .download-option strong { font-size: 12px; }
    .download-option svg { width: 16px; }
    .footer-inner { padding: 38px 18px 20px; }
    .footer-discovery { display: block; padding-bottom: 30px; }
    .footer-discovery h2 { font-size: 28px; }
    .footer-discovery .button { margin-top: 24px; }
    .inline-art { width: 52px; height: 28px; margin-inline: 1px; }
    .edition-marquee { gap: 16px; padding-block: 16px; }
    .marquee-group { gap: 28px; padding-right: 28px; }
    .marquee-group span { font-size: 13px; }
    .footer-bottom { align-items: flex-start; gap: 12px; font-size: 10px; }
    .footer-bottom p { max-width: 205px; padding-top: 8px; }
    .footer-bottom a { white-space: nowrap; }
}

@media (max-width: 359px) {
    .site-brand img { width: 160px; }
    .site-nav-links { gap: 12px; }
    .page-heading h1 { font-size: 26px; }
    .footer-discovery h2 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    .gallery-page *, .gallery-page *::before, .gallery-page *::after { animation: none !important; transition: none !important; }
}
