/* =========================================================
   roudari.xyz
   Palette sampled from "The Lantern Keeper": night sky,
   robe blue, scarf stripes and the cyan glow of its eyes.
   ========================================================= */

@font-face {
    font-family: 'Fraunces';
    src: url('/fonts/fraunces.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fraunces';
    src: url('/fonts/fraunces-italic.woff2') format('woff2');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* Night is the default; theme.js swaps to day before first paint */
:root {
    color-scheme: dark;

    --sky-top: #060a13;
    --sky-mid: #0f1726;
    --sky-low: #1a2739;
    --bg: #0b111d;
    --surface: rgba(19, 30, 50, 0.66);
    --surface-strong: #111b2c;
    --line: rgba(134, 166, 195, 0.16);
    --line-strong: rgba(134, 166, 195, 0.32);
    --ink: #e7eef8;
    --ink-2: #a8b9cf;
    --ink-3: #7a8fab;
    --robe: #2d5888;
    --robe-deep: #1f3e63;
    --scarf: #cfe0ef;
    --glow: #4eeefb;
    --glow-ink: #7ff3ff;
    --glow-soft: rgba(78, 238, 251, 0.16);
    --glow-faint: rgba(78, 238, 251, 0.06);
    --on-glow: #04151a;
    --tree-back: #142036;
    --tree-front: #0a1321;
    --ground: #0a1321;
    --snowbank: #1b2a40;
    --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);

    --font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;

    --radius: 18px;
    --radius-sm: 12px;
    --wrap: 1120px;
    --gutter: 16px;
    --header-h: 64px;
}

:root[data-theme="day"] {
    color-scheme: light;

    --sky-top: #c9d8e9;
    --sky-mid: #e2eaf3;
    --sky-low: #f2f6fa;
    --bg: #eef3f8;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: #ffffff;
    --line: rgba(31, 62, 99, 0.14);
    --line-strong: rgba(31, 62, 99, 0.3);
    --ink: #0f1a2b;
    --ink-2: #3a4d6a;
    --ink-3: #56688a;
    --robe: #2a5487;
    --robe-deep: #1f3e63;
    --scarf: #ffffff;
    --glow: #087f8e;
    --glow-ink: #08707f;
    --glow-soft: rgba(8, 127, 142, 0.14);
    --glow-faint: rgba(8, 127, 142, 0.05);
    --on-glow: #ffffff;
    --tree-back: #a9bcd2;
    --tree-front: #7790ae;
    --ground: #233a58;
    --snowbank: #f7fafd;
    --shadow: 0 24px 48px -30px rgba(31, 62, 99, 0.5);
}

@media (min-width: 640px) {
    :root { --gutter: 24px; }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
    html[data-motion="on"] { scroll-behavior: smooth; }
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-variation-settings: 'SOFT' 100, 'WONK' 0;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.015em;
    margin: 0;
    text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--glow-ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: var(--glow); color: var(--on-glow); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

svg use { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg .fill, svg use .fill { fill: currentColor; stroke: none; }
symbol .fill { fill: currentColor; stroke: none; }

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--glow);
    color: var(--on-glow);
    font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Sky, snow and the lantern light ---------- */

.sky {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(120% 70% at 85% 0%, rgba(45, 88, 136, 0.28), transparent 60%),
        linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-low) 100%);
}

.sky-canvas { width: 100%; height: 100%; }

.lantern-light {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(280px circle at var(--mx, -999px) var(--my, -999px), var(--glow-faint), transparent 70%);
}
[data-theme="day"] .lantern-light { display: none; }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
}

.header-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    margin-right: auto;
}

.brand-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line-strong), 0 0 18px -2px var(--glow-soft);
    transition: box-shadow 0.3s ease;
}
.brand:hover .brand-avatar { box-shadow: 0 0 0 1px var(--glow), 0 0 22px 0 var(--glow-soft); }

.brand-name {
    font-family: var(--font-display);
    font-variation-settings: 'SOFT' 100, 'WONK' 1;
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
}

.nav { display: flex; gap: 4px; }
.nav a {
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}
.nav a:hover { color: var(--ink); background: var(--glow-faint); }

.header-tools { display: flex; gap: 6px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.icon-btn:hover { color: var(--glow-ink); border-color: var(--line-strong); background: var(--glow-faint); }
.icon-btn svg { width: 20px; height: 20px; }

[data-theme="night"] .when-day,
[data-theme="day"] .when-night,
[data-motion="on"] .when-motion-off,
[data-motion="off"] .when-motion-on { display: none; }

@media (max-width: 520px) {
    .brand-name { display: none; }
    .nav a { padding: 8px 7px; }
}

/* ---------- Shared bits ---------- */

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.rune {
    width: 22px;
    height: 22px;
    flex: none;
    color: var(--glow);
    filter: drop-shadow(0 0 6px var(--glow-soft));
}

.glow-text {
    color: var(--glow-ink);
    text-shadow: 0 0 28px var(--glow-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: 600 1rem/1.2 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-glow {
    background: var(--glow);
    color: var(--on-glow);
    box-shadow: 0 0 0 0 var(--glow-soft), 0 10px 30px -12px var(--glow);
}
.btn-glow:hover { box-shadow: 0 0 0 6px var(--glow-soft), 0 12px 34px -10px var(--glow); }

.btn-ghost {
    color: var(--ink);
    border-color: var(--line-strong);
    background: var(--surface);
}
.btn-ghost:hover { border-color: var(--glow); color: var(--glow-ink); }

.flip { transform: scaleX(-1); }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}
.tags li {
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--ink-2);
}
.tags-lg li { font-size: 0.82rem; padding: 5px 12px; }

/* Cursor-following glow on cards */
[data-glow] { position: relative; isolation: isolate; }
[data-glow]::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--x, 50%) var(--y, 50%), var(--glow-soft), transparent 45%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
[data-glow]:hover::before { opacity: 1; }

/* ---------- Hero ---------- */

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
    padding-block: 48px 72px;
}

@media (min-width: 900px) {
    .hero {
        grid-template-columns: 1.15fr 0.85fr;
        gap: 64px;
        min-height: calc(100vh - var(--header-h));
        min-height: calc(100svh - var(--header-h));
        padding-block: 40px 80px;
    }
}

.hero h1 {
    font-size: clamp(2.7rem, 7vw, 5rem);
    font-weight: 600;
    margin-bottom: 26px;
}

.lead {
    font-size: clamp(1.1rem, 1.9vw, 1.28rem);
    color: var(--ink-2);
    max-width: 36em;
    margin-bottom: 32px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.keeper {
    position: relative;
    margin: 0 auto;
    width: min(100%, 400px);
}

.keeper-frame {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    /* arched like the top of a standing stone */
    border-radius: 50% 50% 20px 20px / 37.5% 37.5% 20px 20px;
    border: 1px solid var(--line-strong);
    background: #0f1621;
    box-shadow:
        0 0 0 8px var(--surface),
        0 0 0 9px var(--line),
        0 0 90px -10px var(--glow-soft),
        var(--shadow);
}
.keeper-frame::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50% 50% 12px 12px / 36% 36% 12px 12px;
    border: 1px solid rgba(207, 224, 239, 0.18);
    pointer-events: none;
}

.keeper-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.keeper figcaption {
    margin-top: 22px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ink-3);
}

.keeper-runes {
    position: absolute;
    top: 22%;
    left: -46px;
    display: none;
    flex-direction: column;
    gap: 18px;
    color: var(--glow);
}
.keeper-runes svg {
    width: 22px;
    height: 22px;
    opacity: 0.5;
    filter: drop-shadow(0 0 6px var(--glow));
}
@media (min-width: 1040px) { .keeper-runes { display: flex; } }

@media (prefers-reduced-motion: no-preference) {
    [data-motion="on"] .keeper-runes svg { animation: rune-pulse 6s ease-in-out infinite; }
    [data-motion="on"] .keeper-runes svg:nth-child(2) { animation-delay: 1.5s; }
    [data-motion="on"] .keeper-runes svg:nth-child(3) { animation-delay: 3s; }
    [data-motion="on"] .keeper-runes svg:nth-child(4) { animation-delay: 4.5s; }
}

@keyframes rune-pulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.95; }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(64px, 10vw, 120px); }

.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2,
.page h1 {
    font-size: clamp(2.1rem, 4.6vw, 3.3rem);
    margin-bottom: 14px;
}
.section-lede { color: var(--ink-2); font-size: 1.1rem; margin: 0; }

/* scarf stripes under each section title */
.section-head h2::after,
.page h1::after {
    content: '';
    display: block;
    width: 84px;
    height: 6px;
    margin-top: 18px;
    border-radius: 3px;
    background: repeating-linear-gradient(90deg, var(--robe) 0 12px, var(--scarf) 12px 24px);
    opacity: 0.9;
}

/* ---------- Games ---------- */

.games {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.game {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.game:hover { border-color: var(--line-strong); }

.game-cover {
    position: relative;
    display: block;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.game:hover .game-cover img { transform: scale(1.035); }

.badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(6, 10, 19, 0.78);
    color: #e7eef8;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(207, 224, 239, 0.25);
}

.game-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 26px 26px 28px;
}
.game-body h3 { font-size: 1.9rem; margin-bottom: 12px; }
.game-body > p { color: var(--ink-2); }
.game-body .btn { align-self: flex-start; margin-top: auto; }

.game-body .game-meta {
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--glow-ink);
}

/* ---------- Gallery ---------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    font: 500 0.9rem/1.2 var(--font-body);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-3); }
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip[aria-pressed="true"] {
    color: var(--glow-ink);
    border-color: var(--glow);
    background: var(--glow-soft);
}
.chip[aria-pressed="true"] span { color: var(--glow-ink); }

.masonry {
    columns: 2;
    column-gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 760px) { .masonry { columns: 3; column-gap: 16px; } }

.tile {
    break-inside: avoid;
    margin-bottom: 12px;
}
@media (min-width: 760px) { .tile { margin-bottom: 16px; } }
.tile[hidden] { display: none; }

/* With JS, a grid of 2px rows so pieces read left to right; site.js sets each row span */
.masonry.is-grid {
    display: grid;
    columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 2px;
    column-gap: 12px;
}
@media (min-width: 760px) {
    .masonry.is-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 16px; }
}
.is-grid .tile { margin-bottom: 0; }

.tile-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-strong);
    cursor: zoom-in;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.tile-btn img,
.tile-btn video { width: 100%; height: auto; }

.tile-btn:hover {
    border-color: var(--glow);
    box-shadow: 0 0 0 4px var(--glow-faint), 0 18px 40px -22px var(--glow);
}

.tile-cap {
    position: absolute;
    inset: auto 0 0 0;
    padding: 28px 12px 10px;
    background: linear-gradient(transparent, rgba(4, 8, 16, 0.86));
    color: #eef4fb;
    font: 600 0.92rem/1.3 var(--font-display);
    text-align: left;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tile-btn:hover .tile-cap,
.tile-btn:focus-visible .tile-cap { opacity: 1; transform: none; }

.tile-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 6px;
    border-radius: 999px;
    background: rgba(4, 8, 16, 0.72);
    color: #eef4fb;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.tile-badge svg { width: 12px; height: 12px; }
.tile-badge svg use { fill: currentColor; stroke: none; }

/* Lightbox */

.lightbox {
    width: min(100vw - 24px, 1200px);
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-strong);
    color: var(--ink);
    box-shadow: 0 0 120px -20px var(--glow-soft), var(--shadow);
    overflow: hidden;
}
.lightbox::backdrop {
    background: rgba(3, 6, 12, 0.84);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.lightbox[open] { display: flex; flex-direction: column; }

.lb-stage {
    display: grid;
    place-items: center;
    min-height: 0;
    background: #05080f;
    touch-action: pan-y;
}
.lb-stage img,
.lb-stage video {
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 24px - 66px);
    max-height: calc(100dvh - 24px - 66px);
    object-fit: contain;
}

.lb-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 18px;
    border-top: 1px solid var(--line);
}
.lb-caption {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-count { margin-left: 8px; font-family: var(--font-mono); font-weight: 400; font-size: 0.78rem; color: var(--ink-3); }
.lb-tools { display: flex; gap: 6px; }

/* ---------- About ---------- */

.about {
    display: grid;
    gap: 40px;
    grid-template-columns: 1fr;
}
@media (min-width: 900px) {
    .about { grid-template-columns: 1.35fr 1fr; gap: 64px; align-items: start; }
}

.about-text > p { color: var(--ink-2); max-width: 38em; }
.about-text .big {
    font-family: var(--font-display);
    font-variation-settings: 'SOFT' 100, 'WONK' 0;
    font-size: clamp(1.6rem, 3.2vw, 2.25rem);
    line-height: 1.2;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 22px;
}

blockquote {
    margin: 30px 0;
    padding: 4px 0 4px 22px;
    border-left: 2px solid var(--glow);
    box-shadow: -10px 0 24px -16px var(--glow);
}
blockquote p {
    margin: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.25rem, 2.3vw, 1.5rem);
    line-height: 1.35;
    color: var(--ink);
}

.toolbox-title {
    margin: 30px 0 14px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.workbench {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.workbench h3 { font-size: 1.45rem; margin-bottom: 18px; }
.workbench ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.workbench li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.workbench li:first-child { border-top: 0; }
.workbench strong { display: block; font-weight: 600; }
.workbench li span:not(.wb-icon) { display: block; color: var(--ink-3); font-size: 0.92rem; line-height: 1.4; }

.wb-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--glow-faint);
    color: var(--glow-ink);
}
.wb-icon svg { width: 22px; height: 22px; }

/* ---------- Elsewhere ---------- */

.links {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.link-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 16px;
    align-items: center;
    padding: 22px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.link-card:hover { border-color: var(--glow); transform: translateY(-2px); }

.link-icon { grid-row: span 2; width: 30px; height: 30px; color: var(--ink); }
.link-name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.2; }
.link-handle { grid-column: 2; font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-3); }
.link-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 20px;
    height: 20px;
    color: var(--ink-3);
    transition: transform 0.25s ease, color 0.25s ease;
}
.link-card:hover .link-arrow { color: var(--glow-ink); transform: translateX(3px); }

/* ---------- Colophon & 404 ---------- */

.page { padding-block: clamp(48px, 8vw, 96px); }

.prose { max-width: 40em; color: var(--ink-2); }
.prose h2 { font-size: 1.6rem; color: var(--ink); margin: 2em 0 0.6em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--glow); }
.prose .btn { margin-top: 1.5em; }

.lost {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-block: clamp(56px, 10vw, 120px);
}
.lost .eyebrow { justify-content: center; }
.lost h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); margin-bottom: 18px; }
.lost .lead { margin-inline: auto; }
.lost-face {
    width: 160px;
    height: 160px;
    margin-bottom: 30px;
    border-radius: 50%;
    box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--line-strong), 0 0 80px -6px var(--glow-soft);
}

/* ---------- Footer ---------- */

.site-footer { margin-top: 40px; }

/* A fixed 120px band showing the middle of a 3840-wide forest at 1:1. Only
   screens wider than the forest grow the band (by its aspect ratio, matching
   the viewBox in layout.ejs) rather than cropping the treetops. */
.treeline {
    width: 100%;
    height: auto;
    min-height: 120px;
    aspect-ratio: 3840 / 120;
    margin-bottom: -1px;
}
.trees-back { fill: var(--tree-back); }
.trees-front { fill: var(--tree-front); }
.treeline use { fill: inherit; stroke: none; }
.snowbank { fill: var(--snowbank); }

.ground {
    background: var(--ground);
    color: #a8b9cf;
    border-top: 1px solid var(--snowbank);
}
[data-theme="day"] .ground { color: #d6e2f0; }

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    padding-block: 26px 30px;
    font-size: 0.9rem;
}
.footer-inner p { margin: 0; }
.footer-inner a { color: #e7eef8; }

.footer-sign { display: flex; align-items: center; gap: 10px; color: #e7eef8; }
.footer-sign img { width: 28px; height: 28px; border-radius: 50%; }
.footer-note { flex: 1; min-width: 220px; }

.footer-links { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.footer-links a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #cfdbea;
}
.footer-links a:hover { background: rgba(78, 238, 251, 0.12); color: #7ff3ff; }
.footer-links svg { width: 18px; height: 18px; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
