/* =============================================================================
   Dougie Smash theme
   Logo-led hero on a slashed green paint stripe, a "right now" bar, three zones
   that each keep score differently (trip log / achievements / game save), and a
   filterable photo wall. Single dark look, taken from the logo.
   ============================================================================= */

/* ---------- tokens ---------- */
:root {
    --ink: #121411;        /* charcoal, nudged toward the logo green */
    --ink-2: #191c18;
    --ink-3: #232720;
    --line: #333a2f;
    --bone: #ece8dc;       /* the shard / letter white */
    --mute: #a3aa9d;
    --slime: #6bdb3c;      /* sampled from the SMASH lettering */
    --slime-ink: #0d1a08;
    --sun: #ffc93c;        /* The Crew */
    --volt: #a99dff;       /* Player 1 */
    --display: "Bowlby One SC", "Arial Black", Impact, sans-serif;
    --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
    --hud: "Chakra Petch", "Barlow", ui-monospace, monospace;
    --gutter-l: max(16px, env(safe-area-inset-left, 0px));
    --gutter-r: max(16px, env(safe-area-inset-right, 0px));
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    color-scheme: dark;
}

/* Zone colors: every element tagged z-<slug> picks up --zc. */
.z-out-there { --zc: var(--slime); }
.z-the-crew { --zc: var(--sun); }
.z-player-1 { --zc: var(--volt); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ink) var(--grain);
    color: var(--bone);
    font: 400 17px/1.6 var(--body);
    -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ink); }
img { max-width: 100%; height: auto; }
/* Components set their own display, which would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--slime); outline-offset: 3px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.hud { font-family: var(--hud); text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; font-weight: 600; }
h1, h2, h3, .h2 { font-family: var(--display); font-weight: 400; line-height: .98; margin: 0; text-wrap: balance; letter-spacing: .01em; }
.empty { color: var(--mute); margin: 0; }

/* ---------- header ---------- */
header.top {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
    background: color-mix(in srgb, var(--ink) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 12px 24px; padding-block: 12px; flex-wrap: wrap; }
.wordmark { font-family: var(--display); font-size: 22px; text-decoration: none; letter-spacing: .02em; line-height: 1; transform: rotate(-3deg); display: inline-block; }
.wordmark span { color: var(--slime); }
nav.main { margin-left: auto; }
/* {{navigation}} renders ul.nav > li.nav-<slug>[.nav-current] > a */
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 22px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--mute); }
.nav a:hover, .nav .nav-current a { color: var(--bone); }
.nav .nav-current a { box-shadow: inset 0 -3px 0 var(--slime); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: 40px 56px; }
.stripe {
    position: absolute; left: -10%; right: -10%; top: 52%; height: 150px;
    background: var(--slime);
    transform: translateY(-50%) rotate(-7deg);
    clip-path: polygon(0 18%, 6% 8%, 14% 14%, 27% 4%, 41% 12%, 55% 0, 70% 9%, 84% 2%, 100% 10%, 100% 86%, 92% 95%, 78% 88%, 63% 100%, 47% 90%, 33% 97%, 19% 88%, 7% 96%, 0 84%);
    opacity: .92;
}
.stripe::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(0, 0, 0, .08) 22px 24px), var(--grain); mix-blend-mode: multiply; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1fr minmax(0, 520px); gap: 32px; align-items: center; }
.hero-copy { display: grid; gap: 20px; align-content: center; min-width: 0; }
.eyebrow { color: var(--slime); }
.hero h1 { font-size: clamp(44px, 7vw, 86px); }
.hero h1 em { font-style: normal; color: var(--ink); background: var(--bone); padding: 0 .12em; display: inline-block; transform: rotate(-2deg); }
.lede { max-width: 30em; font-size: 19px; margin: 0; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
    font-family: var(--hud); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 14px;
    text-decoration: none; padding: 12px 20px; border: 2px solid var(--bone); color: var(--bone); background: var(--ink);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 93% 100%, 0 100%);
    display: inline-block;
}
.btn.primary { background: var(--slime); color: var(--slime-ink); border-color: var(--slime); }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--bone); }
.logo-slot { position: relative; aspect-ratio: 1; max-width: 100%; }
.logo-slot img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
    animation: smash .75s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes smash { from { transform: scale(1.35) rotate(-10deg); opacity: .35; filter: blur(4px); } to { transform: none; opacity: 1; filter: none; } }

/* ---------- now bar ---------- */
.nowbar { border-block: 1px solid var(--line); background: var(--ink-2); }
.nowbar .wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.now { padding-block: 16px; padding-inline: 0 20px; display: grid; gap: 2px; min-width: 0; text-decoration: none; }
.now + .now { border-left: 1px solid var(--line); padding-left: 20px; }
.now .k { color: var(--zc); display: flex; align-items: center; gap: 8px; }
.now .k i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.now .v { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now:hover .v { color: var(--zc); }
.now .s { color: var(--mute); font-size: 14px; }
@media (prefers-reduced-motion: no-preference) { .now .k i.live { animation: blink 1.6s steps(2) infinite; } }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- section headings ---------- */
.block { padding-block: 64px 8px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.sec-head h2, .sec-head .h2 { font-size: clamp(32px, 4.4vw, 52px); position: relative; padding-bottom: 6px; isolation: isolate; }
.sec-head h2::after, .sec-head .h2::after { content: ""; position: absolute; left: -6px; right: -14px; bottom: 0; height: 14px; background: var(--slime); z-index: -1; transform: skewX(-18deg) rotate(-1.5deg); }
.sec-head p { color: var(--mute); margin: 0; }

/* ---------- zone tag chip ---------- */
.tag {
    display: inline-block; justify-self: start; text-decoration: none;
    font-family: var(--hud); font-weight: 700; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
    padding: 2px 8px; background: var(--zc, var(--bone)); color: var(--ink);
}

/* ---------- image frames + placeholders ---------- */
.ph {
    position: relative; overflow: hidden; display: block; width: 100%; max-width: 100%;
    background: var(--ink-3); border: 1px solid var(--line);
}
.ph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, color-mix(in srgb, var(--zc, var(--mute)) 30%, var(--ink-3)), var(--ink) 80%), var(--grain); }
.ph img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; }
.ph .glyph { position: absolute; right: 8%; bottom: 10%; width: 34%; max-width: 120px; aspect-ratio: 4 / 3; color: var(--bone); opacity: .5; }

/* ---------- latest posts ---------- */
.latest { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; }
.feature { display: grid; gap: 14px; align-content: start; min-width: 0; }
.feature .ph { aspect-ratio: 16 / 10; }
.feature h3 { font-size: clamp(28px, 3.2vw, 40px); }
.feature h3 a, .card h3 a { text-decoration: none; }
.feature h3 a:hover, .card h3 a:hover { color: var(--zc, var(--slime)); }
.feature p { margin: 0; color: var(--mute); max-width: 38em; }
.postlist { display: grid; align-content: start; min-width: 0; }
.postlist a { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding-block: 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.postlist a:first-child { padding-top: 0; }
.postlist .ph { aspect-ratio: 1; }
.postlist h4 { margin: 4px 0 2px; font-size: 19px; line-height: 1.25; font-weight: 700; }
.postlist a:hover h4 { color: var(--zc, var(--slime)); }
.meta { color: var(--mute); font-size: 14px; }

/* ---------- zones ---------- */
.zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.zone { background: var(--ink-2); border: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr auto; min-width: 0; position: relative; }
.zone::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--zc); }
.zone header { padding: 22px 22px 6px; display: grid; gap: 6px; }
.zone header .hud { color: var(--zc); }
.zone h3 { font-size: 34px; }
.zone .body { padding: 10px 22px 18px; display: grid; gap: 14px; align-content: start; }
.zone footer { padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.zone footer a { font-family: var(--hud); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 13px; text-decoration: none; color: var(--zc); }
.zone footer a:hover { text-decoration: underline; }
.ph.wide { aspect-ratio: 16 / 9; }

.triplog, .ach, .save { list-style: none; margin: 0; padding: 0; display: grid; }
.triplog li { display: grid; gap: 2px; padding-block: 10px; border-bottom: 1px dashed var(--line); }
.triplog li:last-child { border-bottom: 0; }
.triplog a { font-weight: 700; text-decoration: none; }
.triplog a:hover { color: var(--slime); }
.triplog small { color: var(--mute); font-size: 14px; }

.ach { gap: 12px; }
.ach li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.ach svg { width: 44px; height: 44px; color: var(--sun); }
.ach a, .ach b { display: block; font-weight: 700; line-height: 1.25; text-decoration: none; }
.ach a:hover { color: var(--sun); }
.ach small { color: var(--mute); font-size: 13.5px; font-family: var(--hud); letter-spacing: .06em; text-transform: uppercase; }
.ach .locked { opacity: .5; }
.ach .locked b { font-style: italic; font-weight: 500; }

/* Game rows, built by smash.js from Player 1 excerpt lines. */
.save { gap: 16px; }
.game { display: grid; gap: 6px; }
.game .row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.game a { font-weight: 700; text-decoration: none; min-width: 0; }
.game a:hover { color: var(--volt); }
.hrs { font-family: var(--hud); font-variant-numeric: tabular-nums; color: var(--mute); font-size: 13px; }
.bar { height: 8px; background: var(--ink-3); border: 1px solid var(--line); position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; width: var(--p); background: repeating-linear-gradient(90deg, var(--volt) 0 10px, transparent 10px 12px); }
.pill { font-family: var(--hud); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; padding: 1px 7px; border: 1px solid currentColor; white-space: nowrap; }
.pill.on { color: var(--volt); }
.pill.done { color: var(--slime); }
.pill.shelf { color: var(--mute); }
.backlog { color: var(--mute); }
.backlog b { color: var(--bone); }

/* ---------- snapshots ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
    font-family: var(--hud); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px;
    color: var(--bone); background: transparent; border: 1px solid var(--line); padding: 7px 14px; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.filters button:hover:not([aria-pressed="true"]) { border-color: var(--bone); }
.wall { columns: 4 220px; column-gap: 14px; }
.shot {
    all: unset; box-sizing: border-box; display: block; width: 100%; margin-bottom: 14px; cursor: zoom-in;
    break-inside: avoid; position: relative; border: 1px solid var(--line); background: var(--ink-3);
}
.shot:focus-visible { outline: 3px solid var(--slime); outline-offset: 3px; }
/* Lazy images have no height until loaded; keep a tappable tile meanwhile. */
.shot img { display: block; width: 100%; min-height: 140px; object-fit: cover; transition: transform .25s ease; }
.shot:hover img { transform: scale(1.03); }
.shot { overflow: hidden; }
.shot .tag { position: absolute; top: 10px; left: 10px; z-index: 1; }
.shot.gone { display: none; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 40px; align-items: start; }
.about-copy { display: grid; gap: 14px; max-width: 38em; }
.about-copy p, .about-copy ul { margin: 0; font-size: 18px; }
.about-copy ul { padding-left: 1.2em; display: grid; gap: 8px; }
.about-copy a { color: var(--slime); }
.about-aside { border: 1px dashed var(--line); padding: 18px 20px; display: grid; gap: 8px; }
.about-aside .hud { color: var(--mute); }
.about-aside p { margin: 0; color: var(--mute); font-size: 15px; }
.about-aside a { font-family: var(--hud); font-weight: 700; letter-spacing: .06em; text-decoration: none; }
.about-aside a:hover { color: var(--slime); }

/* ---------- archive cards (index + tag) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 32px 24px; }
.card { display: grid; gap: 10px; align-content: start; min-width: 0; }
.card .ph { aspect-ratio: 4 / 3; }
.card h3 { font-family: var(--body); font-weight: 700; font-size: 21px; line-height: 1.25; letter-spacing: 0; }
.tag-head { position: relative; overflow: hidden; padding-block: 48px 36px; border-bottom: 4px solid var(--zc, var(--slime)); background: var(--ink-2); }
.tag-head .wrap { display: grid; gap: 10px; }
.tag-head .hud { color: var(--zc, var(--slime)); }
.tag-head h1 { font-size: clamp(44px, 8vw, 96px); }
.tag-head p { margin: 0; color: var(--mute); max-width: 36em; font-size: 18px; }

/* {{pagination}} renders nav.pagination > a.newer-posts, span.page-number, a.older-posts */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; font-family: var(--hud); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 13px; }
.pagination a { text-decoration: none; border: 1px solid var(--line); padding: 8px 14px; }
.pagination a:hover { border-color: var(--slime); }
.page-number { color: var(--mute); }

/* ---------- single post ---------- */
.post-head { display: grid; gap: 16px; justify-items: start; padding-block: 56px 32px; max-width: 860px; }
.post-head h1 { font-size: clamp(38px, 6vw, 68px); }
.dek { font-size: 21px; color: var(--mute); margin: 0; max-width: 34em; }
.post-image { margin: 0 auto 40px; }
.post-image img { display: block; width: auto; max-width: 100%; max-height: 80vh; margin-inline: auto; border: 1px solid var(--line); }
.post-image figcaption, .gh-content figcaption { color: var(--mute); font-size: 14px; padding-top: 8px; text-align: center; }

/* Player 1 save-file card */
.gamecard { width: min(520px, 100%); background: var(--ink-2); border: 1px solid var(--line); border-top: 4px solid var(--volt); padding: 16px 18px; display: grid; gap: 8px; }
.gamecard .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.gamecard b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.05; }

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; padding-block: 32px 0; max-width: 760px; }
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-block: 40px 0; }
.post-nav a { display: grid; gap: 4px; text-decoration: none; border: 1px solid var(--line); padding: 16px 18px; font-weight: 700; }
.post-nav a:hover { border-color: var(--zc, var(--slime)); }
.post-nav .hud { color: var(--mute); }
.post-nav .prev { grid-column: 1; }
.post-nav .next { grid-column: 2; text-align: right; }

/* Post body. A named-line grid so editor cards can break out to wide/full. */
.gh-content {
    display: grid;
    grid-template-columns:
        [full-start] minmax(var(--gutter-l), 1fr)
        [wide-start] minmax(0, 160px)
        [main-start] min(700px, calc(100% - 32px))
        [main-end] minmax(0, 160px)
        [wide-end] minmax(var(--gutter-r), 1fr) [full-end];
    font-size: 19px; line-height: 1.7;
}
.about .gh-content { display: block; }
.gh-content > * { grid-column: main; margin-block: 0 1.2em; min-width: 0; }
.gh-content > .kg-width-wide { grid-column: wide; }
.gh-content > .kg-width-full { grid-column: full; }
.gh-content > .kg-width-full img { width: 100%; }
.gh-content h2, .gh-content h3 { margin-top: 1.4em; }
.gh-content h2 { font-size: 36px; }
.gh-content h3 { font-size: 26px; }
.gh-content a { color: var(--slime); }
.gh-content blockquote { border-left: 4px solid var(--zc, var(--slime)); padding-left: 20px; font-style: italic; }
.gh-content hr { border: 0; height: 14px; background: var(--slime); transform: skewX(-18deg); width: 120px; justify-self: center; }
.gh-content code { font-family: ui-monospace, Menlo, monospace; font-size: .88em; background: var(--ink-3); padding: 1px 5px; }
.gh-content pre { background: var(--ink-2); border: 1px solid var(--line); padding: 16px; overflow-x: auto; }
.gh-content pre code { background: none; padding: 0; }
.gh-content figure { margin-inline: 0; }
.gh-content .kg-image-card img, .gh-content .kg-gallery-image img { cursor: zoom-in; }

/* ---------- error ---------- */
.error { display: grid; gap: 18px; justify-items: start; padding-block: 96px; }
.error .hud { color: var(--slime); }
.error h1 { font-size: clamp(40px, 6vw, 72px); max-width: 14em; }
.error p { color: var(--mute); margin: 0; }

/* ---------- lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 20; background: rgba(8, 9, 8, .94); display: grid; place-items: center;
    padding: max(24px, env(safe-area-inset-top, 0px)) var(--gutter-r) max(24px, env(safe-area-inset-bottom, 0px)) var(--gutter-l);
}
.lightbox .frame { width: min(1100px, 100%); display: grid; gap: 12px; }
.lightbox img { display: block; max-height: 78vh; width: auto; max-width: 100%; justify-self: center; }
.lightbox .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lb-text { display: grid; gap: 4px; }
.lightbox h3 { font-size: 24px; }
.lb-text a { color: var(--slime); text-decoration: none; }
.lightbox .x { background: var(--bone); color: var(--ink); border: 0; padding: 8px 14px; cursor: pointer; }

/* ---------- footer ---------- */
footer.site { margin-top: 80px; position: relative; overflow: hidden; border-top: 1px solid var(--line); }
footer.site .stripe { top: 50%; height: 70px; opacity: .14; }
footer.site .wrap { position: relative; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-block: 36px 44px; align-items: center; }
footer.site .wordmark { font-size: 30px; }
.foot-meta { display: grid; gap: 8px; justify-items: end; }
.foot-meta p { margin: 0; color: var(--mute); font-size: 15px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .hero .wrap { grid-template-columns: 1fr; }
    .logo-slot { order: -1; width: min(420px, 100%); justify-self: center; }
    .stripe { top: 30%; }
    .latest, .zones, .about { grid-template-columns: 1fr; }
    .nowbar .wrap { grid-template-columns: 1fr; }
    .now + .now { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
    .foot-meta { justify-items: start; }
}
@media (max-width: 520px) {
    nav.main { margin-left: 0; width: 100%; }
    .postlist a { grid-template-columns: 72px 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .logo-slot img { animation: none; }
    .shot img { transition: none; }
}
