/* Hamgeek — shared styles */

:root {
  --paper: #f7f2e8;
  --surface: #fffdf8;
  --surface-2: #efe7d7;
  --ink: #1d2721;
  --ink-soft: #4a554e;
  --muted: #6f776f;
  --line: #e0d6c2;
  --forest: #2e5b47;
  --forest-ink: #f4efe4;
  --sunset: #c8642a;
  --sky: #3f7891;
  --code-bg: #1e2622;
  --code-ink: #e8e2d4;
  --shadow: 0 1px 2px rgba(40, 32, 18, .06), 0 8px 24px -12px rgba(40, 32, 18, .18);
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1160px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%232e5b47' stroke-opacity='.09' stroke-width='1.2'%3E%3Cpath d='M-20 120c80-60 160 40 260-10s170-90 260-30 120 20 140 0'/%3E%3Cpath d='M-20 160c90-50 170 40 260-5s160-80 250-25 130 25 150 5'/%3E%3Cpath d='M-20 200c100-40 180 40 270 0s150-70 240-20 140 30 160 10'/%3E%3Cpath d='M-20 300c70 30 150-50 240-10s140 90 230 50 150-60 200-40'/%3E%3Cpath d='M-20 340c80 30 150-40 240-5s150 80 240 45 140-50 190-30'/%3E%3Cpath d='M-20 380c90 30 160-30 250 0s150 70 240 40 130-40 180-20'/%3E%3Cpath d='M-20 480c120-30 200 40 300 10s170-50 340-10'/%3E%3Cpath d='M-20 520c120-20 200 40 300 15s170-40 340-5'/%3E%3Cellipse cx='450' cy='260' rx='40' ry='22'/%3E%3Cellipse cx='450' cy='260' rx='70' ry='40'/%3E%3Cellipse cx='120' cy='430' rx='30' ry='16'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131a16;
    --surface: #1a231e;
    --surface-2: #222d27;
    --ink: #ece6d8;
    --ink-soft: #c3c0b4;
    --muted: #979d93;
    --line: #2f3b34;
    --forest: #7fb89a;
    --forest-ink: #10170f;
    --sunset: #ef9b62;
    --sky: #7fb4cc;
    --code-bg: #0e1411;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%237fb89a' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M-20 120c80-60 160 40 260-10s170-90 260-30 120 20 140 0'/%3E%3Cpath d='M-20 160c90-50 170 40 260-5s160-80 250-25 130 25 150 5'/%3E%3Cpath d='M-20 200c100-40 180 40 270 0s150-70 240-20 140 30 160 10'/%3E%3Cpath d='M-20 300c70 30 150-50 240-10s140 90 230 50 150-60 200-40'/%3E%3Cpath d='M-20 340c80 30 150-40 240-5s150 80 240 45 140-50 190-30'/%3E%3Cpath d='M-20 380c90 30 160-30 250 0s150 70 240 40 130-40 180-20'/%3E%3Cpath d='M-20 480c120-30 200 40 300 10s170-50 340-10'/%3E%3Cpath d='M-20 520c120-20 200 40 300 15s170-40 340-5'/%3E%3Cellipse cx='450' cy='260' rx='40' ry='22'/%3E%3Cellipse cx='450' cy='260' rx='70' ry='40'/%3E%3Cellipse cx='120' cy='430' rx='30' ry='16'/%3E%3C/g%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131a16;
  --surface: #1a231e;
  --surface-2: #222d27;
  --ink: #ece6d8;
  --ink-soft: #c3c0b4;
  --muted: #979d93;
  --line: #2f3b34;
  --forest: #7fb89a;
  --forest-ink: #10170f;
  --sunset: #ef9b62;
  --sky: #7fb4cc;
  --code-bg: #0e1411;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%237fb89a' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M-20 120c80-60 160 40 260-10s170-90 260-30 120 20 140 0'/%3E%3Cpath d='M-20 160c90-50 170 40 260-5s160-80 250-25 130 25 150 5'/%3E%3Cpath d='M-20 200c100-40 180 40 270 0s150-70 240-20 140 30 160 10'/%3E%3Cpath d='M-20 300c70 30 150-50 240-10s140 90 230 50 150-60 200-40'/%3E%3Cpath d='M-20 340c80 30 150-40 240-5s150 80 240 45 140-50 190-30'/%3E%3Cpath d='M-20 380c90 30 160-30 250 0s150 70 240 40 130-40 180-20'/%3E%3Cpath d='M-20 480c120-30 200 40 300 10s170-50 340-10'/%3E%3Cpath d='M-20 520c120-20 200 40 300 15s170-40 340-5'/%3E%3Cellipse cx='450' cy='260' rx='40' ry='22'/%3E%3Cellipse cx='450' cy='260' rx='70' ry='40'/%3E%3Cellipse cx='120' cy='430' rx='30' ry='16'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 136px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--forest); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--sunset); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--sunset); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--forest); color: var(--forest-ink); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--forest); background: color-mix(in srgb, var(--forest) 12%, transparent); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--forest); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
@media (max-width: 880px) {
  .menu-btn { display: inline-grid; margin-left: auto; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--topo) center/600px repeat, var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero .wrap { display: grid; gap: 40px; padding-top: 64px; padding-bottom: 72px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; padding-top: 88px; padding-bottom: 96px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 .78rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--sunset); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.hero h1 em { font-style: italic; color: var(--forest); }
.lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .98rem; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--forest); color: var(--forest-ink); }
.btn-primary:hover { color: var(--forest-ink); background: color-mix(in srgb, var(--forest) 88%, var(--ink)); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { color: var(--ink); border-color: var(--forest); }

.collage { position: relative; height: 480px; max-width: 520px; width: 100%; justify-self: center; }
.collage figure { position: absolute; margin: 0; background: var(--surface); padding: 10px 10px 34px; border-radius: 4px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.collage figure img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.collage figcaption { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font: italic 500 .9rem var(--font-display); color: var(--ink-soft); }
.collage .p1 { width: 60%; height: 48%; left: 0; top: 3%; transform: rotate(-4deg); }
.collage .p2 { width: 44%; height: 53%; right: 0; top: 0; transform: rotate(5deg); }
.collage .p3 { width: 56%; height: 42%; left: 22%; bottom: 0; transform: rotate(-1.5deg); }
@media (max-width: 520px) { .collage { height: 380px; } }

/* ---------- Page header (inner pages) ---------- */
.page-head { background: var(--topo) center/600px repeat, var(--paper); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-top: 56px; padding-bottom: 48px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page-head .lede { margin-bottom: 0; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section + .section { padding-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.section-head p { color: var(--ink-soft); max-width: 40em; margin: 0; }
.section-head h2 { margin: 0; }
.kicker { font: 600 .78rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--sunset); margin-bottom: 10px; display: block; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-link { text-decoration: none; color: inherit; transition: transform .2s ease, border-color .2s ease; }
.card-link:hover { color: inherit; transform: translateY(-3px); border-color: color-mix(in srgb, var(--forest) 40%, var(--line)); }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card-link:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { color: var(--ink-soft); margin: 0; font-size: .97rem; }
.card-meta { margin-top: auto; padding-top: 10px; font-size: .85rem; font-weight: 600; color: var(--forest); }
.card-meta::after { content: " →"; }

/* Stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 22px 20px; }
.stat b { display: block; font: 600 2rem/1 var(--font-display); color: var(--forest); margin-bottom: 6px; }
.stat span { font-size: .9rem; color: var(--ink-soft); }

/* Quote / callout */
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sunset); border-radius: var(--radius-sm); padding: 18px 22px; color: var(--ink-soft); }
.callout p:last-child { margin: 0; }
.pull { font: italic 400 clamp(1.3rem, 2.6vw, 1.75rem)/1.4 var(--font-display); color: var(--ink); max-width: 30em; }
.pull cite { display: block; margin-top: 10px; font: 500 .9rem var(--font-body); color: var(--muted); font-style: normal; }

/* ---------- Chips (album / video links) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 500; line-height: 1.3;
}
.chip::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; }
.chip--photo { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='15' rx='2'/%3E%3Ccircle cx='9' cy='11' r='2'/%3E%3Cpath d='M21 17l-5-5-9 8'/%3E%3C/svg%3E"); }
.chip--photo::before { color: var(--forest); }
.chip--video { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.5v15l13-7.5z' fill='black'/%3E%3C/svg%3E"); }
.chip--video::before { color: var(--sunset); }
.chip--file { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M14 3v6h6'/%3E%3C/svg%3E"); }
.chip--file::before { color: var(--sky); }
.chip--lost { color: var(--muted); border-style: dashed; background: transparent; cursor: default; }
.chip--lost::before { display: none; }
a.chip:hover { border-color: var(--forest); color: var(--ink); background: var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; color: var(--muted); align-items: center; }
.legend .chip { pointer-events: none; }

/* ---------- Journey timeline ---------- */
.chapter-nav { position: sticky; top: 64px; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.chapter-nav .wrap { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.chapter-nav .wrap::-webkit-scrollbar { display: none; }
.chapter-nav a { flex: none; font-size: .86rem; font-weight: 500; text-decoration: none; color: var(--ink-soft); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.chapter-nav a:hover, .chapter-nav a.active { color: var(--forest-ink); background: var(--forest); border-color: var(--forest); }

.chapter { padding: 56px 0 8px; }
.chapter-head { display: grid; gap: 6px; margin-bottom: 28px; max-width: 46em; }
.chapter-head h2 { margin: 0; }
.chapter-head p { color: var(--ink-soft); margin: 0; }
.timeline { position: relative; display: grid; gap: 18px; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 12px); }
.stop { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.stop::before { content: ""; position: absolute; left: -27px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 3px solid var(--forest); }
.stop-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 8px; }
.stop-head h3 { margin: 0; font-size: 1.35rem; }
.stop-place { font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sunset); }
.stop p { color: var(--ink-soft); }
.stop .chips { margin-top: 4px; }
.stop-note { font-size: .88rem; color: var(--muted); font-style: italic; margin: 10px 0 0; }
@media (min-width: 720px) { .timeline { padding-left: 40px; } .stop::before { left: -37px; } .timeline::before { left: 13px; } }

/* ---------- Hike log ---------- */
.hike { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
@media (min-width: 900px) { .hike { grid-template-columns: 1.15fr 1fr; } .hike.flip .hike-maps { order: 2; } }
.hike-maps { background: var(--surface-2); display: grid; }
.hike-maps .tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); }
.hike-maps .tabs button { font: 600 .82rem var(--font-body); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.hike-maps .tabs button[aria-selected="true"] { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.hike-maps .panel { aspect-ratio: 16 / 10; background: var(--surface-2); }
.hike-maps .panel img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.hike-body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 10px; }
.hike-body h3 { margin: 0; font-size: 1.5rem; }
.hike-body p { color: var(--ink-soft); margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 4px 0; padding: 0; list-style: none; font-size: .9rem; }
.facts li { color: var(--ink-soft); }
.facts b { color: var(--ink); font-weight: 600; }
.hike-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.hike-mini { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.hike-mini h3 { margin: 0; font-size: 1.2rem; }
.hike-mini p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Galleries ---------- */
.gallery { columns: 3 240px; column-gap: 14px; }
.gallery figure { break-inside: avoid; margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: var(--shadow); }
.gallery img { width: 100%; border-radius: 6px; cursor: zoom-in; background: var(--surface-2); }
.gallery figcaption { font-size: .85rem; color: var(--muted); padding: 8px 4px 2px; }
.gallery-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin: 0 0 18px; }
.gallery-head h2 { margin: 0; }
.gallery-head p { margin: 0; color: var(--ink-soft); font-style: italic; font-family: var(--font-display); font-size: 1.1rem; }
.gallery-block { padding: 48px 0 8px; }
.gallery-block + .gallery-block { border-top: 1px solid var(--line); }
.sepia img { filter: sepia(.12) contrast(1.02); }

/* ---------- Workshop ---------- */
.board-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.board h3 { margin: 0; }
.board .tag { align-self: flex-start; font: 600 .72rem/1 var(--font-mono); letter-spacing: .04em; padding: 5px 8px; border-radius: 6px; background: color-mix(in srgb, var(--sky) 14%, transparent); color: var(--sky); }
.board p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
details.code { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
details.code + details.code { margin-top: 8px; }
details.code summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: .92rem; list-style: none; display: flex; align-items: center; gap: 10px; }
details.code summary::-webkit-details-marker { display: none; }
details.code summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--forest); border-bottom: 2px solid var(--forest); transform: rotate(-45deg); transition: transform .2s; flex: none; }
details.code[open] summary::before { transform: rotate(45deg); }
details.code summary small { font-weight: 400; color: var(--muted); }
pre { margin: 0; background: var(--code-bg); color: var(--code-ink); font: 400 .82rem/1.55 var(--font-mono); padding: 16px 18px; overflow-x: auto; border-radius: 0 0 10px 10px; tab-size: 2; }
code { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.feature { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .feature { grid-template-columns: 1fr 1fr; } }
.shot { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.shot img { border-radius: 8px; cursor: zoom-in; width: 100%; }
.shot figcaption { font-size: .85rem; color: var(--muted); padding: 8px 4px 0; }
.shots { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }

/* ---------- Books ---------- */
.shelf-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; }
.search:focus-within { border-color: var(--forest); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 12px 0; outline: none; min-width: 0; }
.shelf-count { font-size: .9rem; color: var(--muted); }
.shelf { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); align-items: start; }
.author { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.author summary { cursor: pointer; list-style: none; padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.author summary::-webkit-details-marker { display: none; }
.author summary h3 { margin: 0; font-size: 1.15rem; flex: 1; }
.author summary .n { font: 600 .78rem var(--font-body); color: var(--forest); background: color-mix(in srgb, var(--forest) 12%, transparent); border-radius: 999px; padding: 4px 10px; }
.author ol { margin: 0; padding: 4px 18px 16px 40px; columns: 1; color: var(--ink-soft); font-size: .93rem; border-top: 1px dashed var(--line); }
.author li { padding: 3px 0; }
.author li.hit { color: var(--ink); background: color-mix(in srgb, var(--sunset) 16%, transparent); border-radius: 4px; }
.author[hidden] { display: none; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 14, 12, .92); display: none; align-items: center; justify-content: center; padding: 56px 16px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1200px, 100%); max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox .lb-cap { position: absolute; bottom: 14px; left: 16px; right: 16px; text-align: center; color: #e9e4d8; font-size: .92rem; }
.lightbox button { position: absolute; width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lightbox button:hover { background: rgba(255, 255, 255, .18); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Misc pages ---------- */
.split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.1fr; } }
.sat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.sat-grid figure { margin: 0; background: #0b0f0d; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.sat-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }
.sat-grid figcaption { padding: 10px 14px 12px; font-size: .9rem; color: #d9d4c7; }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.link-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.link-list span { color: var(--muted); font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; padding-top: 28px; padding-bottom: 28px; font-size: .9rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--forest); }

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