/* Jameson · portfolio
   Night is the default; day follows the system or the toggle in the bar. Gold is the lantern, the clarity thread;
   moss is the return to nature; steel is the workshop. The terrain at the top is drawn by site.js. */

:root {
  color-scheme: dark;
  --bg: #0a0d0c;
  --bg-2: #0e1312;
  --surface: #111816;
  --surface-2: #18211e;
  --ink: #ece6d6;
  --ink-2: #c4bdaa;
  --muted: #8f978f;
  --hair: rgba(236, 230, 214, 0.1);
  --hair-2: rgba(236, 230, 214, 0.22);
  --gold: #d9b15f;
  --gold-ink: #ecca80;
  --on-gold: #17130a;
  --moss: #86b896;
  --moss-ink: #a6d3b4;
  --steel: #8ea9cf;
  --steel-ink: #aec4e3;
  /* the terrain: its lines, the lantern's lines, the lantern's glow and the shade that keeps the words legible */
  --contour: #a7bcaf;
  --lantern: #f3d590;
  --glow: 243 213 144;
  --shade: 10 13 12;
  --lit-glow: rgb(243 213 144 / 0.45);
  --shadow: 0 34px 80px -44px rgba(0, 0, 0, 0.9);
  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-body: "Spectral", Georgia, "Times New Roman", serif;
  --font-ui: "IBM Plex Sans Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-han: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --radius: 18px;
  --nav-h: 64px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eef0e9;
    --bg-2: #e6eae1;
    --surface: #f8f9f4;
    --surface-2: #e3e8de;
    --ink: #17201b;
    --ink-2: #37433c;
    --muted: #59665e;
    --hair: rgba(23, 32, 27, 0.12);
    --hair-2: rgba(23, 32, 27, 0.24);
    --gold: #8c6515;
    --gold-ink: #6f4f0e;
    --on-gold: #fffaf0;
    --moss: #2f6b4b;
    --moss-ink: #245a3d;
    --steel: #3e5f8c;
    --steel-ink: #2f4f7c;
    --contour: #4a6355;
    --lantern: #8f5f0a;
    --glow: 214 160 60;
    --shade: 238 240 233;
    --lit-glow: rgb(214 160 60 / 0.22);
    --shadow: 0 30px 70px -44px rgba(20, 30, 25, 0.45);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0e9;
  --bg-2: #e6eae1;
  --surface: #f8f9f4;
  --surface-2: #e3e8de;
  --ink: #17201b;
  --ink-2: #37433c;
  --muted: #59665e;
  --hair: rgba(23, 32, 27, 0.12);
  --hair-2: rgba(23, 32, 27, 0.24);
  --gold: #8c6515;
  --gold-ink: #6f4f0e;
  --on-gold: #fffaf0;
  --moss: #2f6b4b;
  --moss-ink: #245a3d;
  --steel: #3e5f8c;
  --steel-ink: #2f4f7c;
  --contour: #4a6355;
  --lantern: #8f5f0a;
  --glow: 214 160 60;
  --shade: 238 240 233;
  --lit-glow: rgb(214 160 60 / 0.22);
  --shadow: 0 30px 70px -44px rgba(20, 30, 25, 0.45);
}

/* ───── Base ───── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17.5px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; }
img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgb(var(--glow) / 0.35); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--gold); color: var(--on-gold);
  font-family: var(--font-ui); font-weight: 600; text-decoration: none;
  transition: top 0.2s;
}
.skip:focus { top: 12px; }

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 10px 20px;
  border: 1px solid var(--hair-2); border-radius: 999px;
  background: transparent; color: var(--ink);
  font-family: var(--font-ui); font-size: 1rem; font-weight: 500; letter-spacing: 0.04em; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s, transform 0.2s, box-shadow 0.3s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--gold); border-color: transparent; color: var(--on-gold); font-weight: 600; box-shadow: 0 12px 30px -16px rgb(var(--glow) / 0.75); }
@media (hover: hover) {
  .btn:hover { border-color: var(--gold); color: var(--gold-ink); }
  .btn.primary:hover { color: var(--on-gold); transform: translateY(-1px); box-shadow: 0 16px 36px -14px rgb(var(--glow) / 0.9); }
}
.btn:active { transform: none; }
.icon-btn {
  width: 42px; height: 42px; flex: none;
  display: inline-grid; place-items: center;
  border: 1px solid var(--hair-2); border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn svg { width: 19px; height: 19px; }
@media (hover: hover) { .icon-btn:hover { color: var(--gold-ink); border-color: var(--gold); } }
.ico { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ───── The bar ───── */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s, border-color 0.35s;
}
.nav.solid {
  background: rgb(var(--shade) / 0.84);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--hair);
}
.nav-in { position: relative; max-width: var(--maxw); height: var(--nav-h); margin: 0 auto; padding-inline: var(--gutter); display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 11px; margin-right: auto; text-decoration: none; font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; letter-spacing: 0.1em; }
.mark { width: 30px; height: 30px; flex: none; }
.mark .m-sun { fill: var(--gold); }
.mark .m-shade { fill: var(--bg); }
.mark .m-ridge { fill: none; stroke: var(--moss); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 8px 13px; border-radius: 999px;
  font-family: var(--font-ui); font-size: 0.96rem; letter-spacing: 0.04em;
  color: var(--ink-2); text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
@media (hover: hover) { .nav-links a:hover { color: var(--ink); background: var(--hair); } }
.nav-links a.active { color: var(--gold-ink); }
.theme-btn[data-mode="dark"] .i-moon, .theme-btn[data-mode="light"] .i-sun { display: none; }
.menu-btn { display: none; }
.menu-btn .i-close, .nav.open .menu-btn .i-menu { display: none; }
.nav.open .menu-btn .i-close { display: block; }
@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .nav-links {
    position: absolute; top: calc(100% + 6px); left: var(--gutter); right: var(--gutter);
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px; border: 1px solid var(--hair-2); border-radius: 16px;
    background: var(--surface); box-shadow: var(--shadow);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 10px; font-size: 1.05rem; }
}

/* ───── The hero: a lantern over the terrain ───── */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center;
  min-height: max(640px, 100vh);
  min-height: max(640px, 100svh);
  background: var(--bg);
}
.terrain, .terrain > * { position: absolute; inset: 0; }
.terrain { z-index: -1; }
.terrain canvas { width: 100%; height: 100%; }
/* the lantern's light and glow are drawn into the canvas by site.js, not masked here: a CSS mask moved every frame
   can be dropped for a frame by Chrome's compositor, which shows as a flicker */
/* over a symbol on the land: click it, and the serpent goes for it */
.hero.on-sign { cursor: pointer; }
.terrain-shade {
  background:
    linear-gradient(90deg, rgb(var(--shade) / 0.92) 0%, rgb(var(--shade) / 0.7) 34%, rgb(var(--shade) / 0) 60%),
    linear-gradient(180deg, rgb(var(--shade) / 0.6) 0%, rgb(var(--shade) / 0) 20%, rgb(var(--shade) / 0) 78%, var(--bg) 100%);
}
.hero-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: calc(var(--nav-h) + 56px) var(--gutter) 96px; }
.hero-copy { max-width: min(640px, 54vw); }
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 20px;
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-ink);
}
.eyebrow::before { content: ""; width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 14px rgb(var(--glow) / 0.8); }
.hero h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.1rem, 1.15rem + 3.7vw, 3.75rem); line-height: 1.1; letter-spacing: 0.01em;
  text-wrap: balance;
}
.hero h1 .lit { color: var(--gold-ink); text-shadow: 0 0 28px var(--lit-glow); }
.hero-sub { margin: 16px 0 0; font-size: clamp(1.18rem, 1rem + 0.75vw, 1.55rem); font-style: italic; font-weight: 300; line-height: 1.4; color: var(--ink-2); text-wrap: balance; }
.hero-lede { margin: 24px 0 0; max-width: 33em; font-size: 1.06rem; color: var(--ink-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-made { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; margin: 22px 0 0; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--muted); }
.hero-made::before { content: ""; width: 7px; height: 7px; flex: none; transform: rotate(45deg); border: 1px solid var(--gold); }
.hero-made a { color: var(--ink-2); text-underline-offset: 3px; }
@media (hover: hover) { .hero-made a:hover { color: var(--gold-ink); } }
.terrain-cap {
  position: absolute; right: var(--gutter); bottom: 22px; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--muted);
}
.cap-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 32px; padding: 5px 12px;
  border: 1px solid var(--hair-2); border-radius: 999px;
  background: rgb(var(--shade) / 0.55); color: var(--ink-2);
  font: inherit; letter-spacing: 0.06em; cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.cap-btn svg { width: 13px; height: 13px; }
@media (hover: hover) { .cap-btn:hover { color: var(--gold-ink); border-color: var(--gold); } }

/* the trail's waypoints, placed by site.js along the path to the summit */
.marks { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.wp {
  --near: 0; --hov: 0; --l: max(var(--near), var(--hov));
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  color: var(--ink); text-decoration: none; pointer-events: none;
  opacity: 0; transition: opacity 0.8s;
}
/* each comes into view as the snake's head passes it on the way up; site.js adds the class */
.wp.shown { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .wp:hover { --hov: 1; } }
.wp-dot {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px;
  transform: rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 0 4px rgb(var(--glow) / 0.14), 0 0 calc(6px + var(--l) * 20px) rgb(var(--glow) / calc(0.25 + var(--l) * 0.6));
}
.wp.next .wp-dot { background: var(--bg); border: 1.5px dashed var(--moss); box-shadow: 0 0 0 4px rgb(var(--shade) / 0.5); }
.wp.summit .wp-dot { left: -11px; top: -15px; width: 22px; height: 20px; transform: none; background: none; box-shadow: none; filter: drop-shadow(0 0 calc(4px + var(--l) * 12px) rgb(var(--glow) / 0.8)); }
.wp.summit .wp-dot svg { width: 100%; height: 100%; fill: var(--gold); }
.wp-label {
  position: absolute; left: 18px; top: 0; transform: translateY(-50%);
  display: grid; gap: 1px; padding: 6px 10px 7px;
  border: 1px solid rgb(var(--glow) / calc(var(--l) * 0.45)); border-radius: 8px;
  background: rgb(var(--shade) / 0.62);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  white-space: nowrap;
  opacity: calc(0.7 + var(--l) * 0.3);
}
.wp.summit .wp-label { left: 20px; top: -4px; }
.wp.flip .wp-label { left: auto; right: 18px; text-align: right; }
.wp-k { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink); }
.wp.next .wp-k { color: var(--moss-ink); }
.wp-t { font-family: var(--font-ui); font-size: 0.95rem; font-weight: 500; letter-spacing: 0.02em; }

/* on a phone or a tall screen the words sit low and the summit high */
@media not all and (min-width: 760px) and (min-aspect-ratio: 21/20) {
  .hero { align-items: flex-end; }
  .hero-inner { padding-top: max(calc(var(--nav-h) + 40px), 40vh); padding-bottom: 64px; }
  .hero-copy { max-width: 640px; }
  .terrain-shade {
    background:
      linear-gradient(0deg, var(--bg) 0%, rgb(var(--shade) / 0.9) 36%, rgb(var(--shade) / 0.5) 58%, rgb(var(--shade) / 0) 76%),
      linear-gradient(180deg, rgb(var(--shade) / 0.55) 0%, rgb(var(--shade) / 0) 16%);
  }
  .terrain-cap { top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 10px); bottom: auto; }
  .terrain-cap > span { display: none; }
}
@media (max-width: 759px) { .marks { display: none; } }

/* ───── Sections ───── */
.sec { position: relative; padding-block: clamp(84px, 11vw, 150px); }
.sec-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.kicker {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 14px;
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-ink);
}
.kicker::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.sec h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.9rem, 1.25rem + 2.3vw, 2.85rem); line-height: 1.12; letter-spacing: 0.01em; text-wrap: balance; }
.intro { margin: 18px 0 0; max-width: 40em; font-size: 1.14rem; color: var(--ink-2); }
.label { margin: 0; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
/* three contour lines between sections */
.contours { max-width: var(--maxw); height: 26px; margin: 0 auto; padding-inline: var(--gutter); }
.contours::before {
  content: ""; display: block; height: 100%;
  background: var(--hair-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='26' viewBox='0 0 220 26'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.1'%3E%3Cpath d='M0 13C36.7 4 73.3 4 110 13S183.3 22 220 13'/%3E%3Cpath opacity='.5' d='M0 7C36.7-1 73.3 0 110 7S183.3 15 220 7'/%3E%3Cpath opacity='.5' d='M0 19C36.7 11 73.3 12 110 19S183.3 27 220 19'/%3E%3C/g%3E%3C/svg%3E") repeat-x 0 50% / 220px 26px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='26' viewBox='0 0 220 26'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.1'%3E%3Cpath d='M0 13C36.7 4 73.3 4 110 13S183.3 22 220 13'/%3E%3Cpath opacity='.5' d='M0 7C36.7-1 73.3 0 110 7S183.3 15 220 7'/%3E%3Cpath opacity='.5' d='M0 19C36.7 11 73.3 12 110 19S183.3 27 220 19'/%3E%3C/g%3E%3C/svg%3E") repeat-x 0 50% / 220px 26px;
}

/* ───── The main quest: two threads ───── */
.threads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 30px); }
.thread {
  --c: var(--gold); --c-ink: var(--gold-ink);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: clamp(26px, 3.4vw, 44px);
  border: 1px solid var(--hair); border-radius: var(--radius);
  background: var(--surface);
}
.thread.return { --c: var(--moss); --c-ink: var(--moss-ink); }
.thread::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--c), transparent 75%); }
.thread::after { content: ""; position: absolute; right: -110px; top: -110px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 70%); opacity: 0.1; pointer-events: none; }
.thread-top { display: flex; align-items: center; gap: 14px; }
.thread-icon { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--c); border-radius: 50%; color: var(--c-ink); }
.thread-icon svg { width: 24px; height: 24px; }
.thread-no { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--c-ink); }
.thread h3 { margin: 22px 0 12px; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.32rem, 1.05rem + 0.9vw, 1.7rem); line-height: 1.22; text-wrap: balance; }
.thread > p { margin: 0; color: var(--ink-2); }
.thread blockquote { margin: 26px 0 0; padding: 2px 0 2px 20px; border-left: 2px solid var(--c); }
.thread blockquote p { margin: 0; font-size: 1.12rem; font-style: italic; line-height: 1.5; color: var(--ink); }
.thread cite { display: block; margin-top: 10px; font-family: var(--font-mono); font-size: 0.7rem; font-style: normal; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.thread cite i { font-family: var(--font-body); font-size: 0.95rem; letter-spacing: 0.02em; text-transform: none; }
.practiced { margin-top: auto; padding-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border: 1px solid var(--hair-2); border-radius: 999px;
  font-family: var(--font-ui); font-size: 0.92rem; letter-spacing: 0.02em;
  color: var(--ink-2); text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.chip.strong { border-color: var(--c); color: var(--c-ink); }
.chip.strong::before { content: ""; width: 6px; height: 6px; transform: rotate(45deg); background: var(--c); }
.chip.ahead { border-style: dashed; }
@media (hover: hover) { a.chip:hover { border-color: var(--c); color: var(--c-ink); } }
@media (max-width: 880px) { .threads { grid-template-columns: 1fr; } }

/* ───── Side quests ───── */
.quests { display: grid; gap: clamp(22px, 3vw, 36px); }
.quest {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  overflow: hidden;
  border: 1px solid var(--hair); border-radius: calc(var(--radius) + 4px);
  background: var(--surface); box-shadow: var(--shadow);
}
.quest.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.quest.flip .quest-art { order: 2; }
.quest-art { position: relative; display: block; min-height: 440px; overflow: hidden; background: #060807; }
.quest-art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.9) brightness(0.92);
  transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.8s;
}
.quest-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(4, 6, 5, 0.75)); pointer-events: none; }
@media (hover: hover) { .quest:hover .quest-art img { transform: scale(1.04); filter: saturate(1.02) brightness(1); } }
#quest-syzygy .quest-art img { object-position: 50% 30%; }
#quest-wuwei .quest-art img { object-position: 30% 60%; }
/* the essay's poster, shown whole: its words would be lost to a crop. It gets a wider share of the card, edge to edge,
   and the column behind it is the exact near-black of the poster's own margin, unfiltered, so any space above and below
   reads as more of that margin around its gold frame. */
#quest-representation { grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); }
/* zoomed in past its outer margin and thin frame: its panels, title and closing quote all stay whole (they sit at least
   5.5% in from every edge) */
#quest-representation .quest-art { background: #041114; --pz: 1.1; }
#quest-representation .quest-art img { object-fit: contain; filter: none; transform: scale(var(--pz)); }
#quest-representation .quest-art::after { content: none; }
@media (hover: hover) { #quest-representation:hover .quest-art img { transform: scale(calc(var(--pz) * 1.015)); filter: none; } }
/* on a narrower desktop the words run much taller than the poster: it starts at the top and stays in view while they
   are read (clip rather than hidden, so the card doesn't become a scroll box and the poster can stick) */
@media (min-width: 881px) and (max-width: 1180px) {
  #quest-representation, #quest-representation .quest-art { overflow: clip; }
  #quest-representation .quest-art img { position: sticky; top: calc(var(--nav-h) + 16px); height: auto; transform-origin: 50% 0; }
}
.quest-roman { position: absolute; left: 22px; bottom: 12px; z-index: 1; font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; line-height: 1; color: #f6ead0; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7); }
.quest-body { display: flex; flex-direction: column; padding: clamp(26px, 3.6vw, 48px); }
.quest-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.quest-meta span:first-child { color: var(--gold-ink); }
/* each item after the first carries its own marker, so a wrapped line still reads as a list */
.quest-meta span + span::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 10px; border: 1px solid var(--hair-2); transform: translateY(-2px) rotate(45deg); }
.quest-title { margin: 12px 0 0; font-family: var(--font-display); font-size: clamp(1.7rem, 1.2rem + 1.7vw, 2.4rem); font-weight: 600; line-height: 1.1; letter-spacing: 0.01em; }
.quest-title .han { margin-left: 0.3em; font-family: var(--font-han); font-size: 0.88em; font-weight: 600; color: var(--gold-ink); }
.quest-dek { margin: 6px 0 0; font-size: 1.1rem; font-style: italic; color: var(--ink-2); }
.quest-sum { margin: 16px 0 0; color: var(--ink-2); }
.serves { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--hair); }
.tn { --c: var(--gold); --c-ink: var(--gold-ink); display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; margin-top: 14px; }
.tn.return { --c: var(--moss); --c-ink: var(--moss-ink); }
.tn-k { display: flex; align-items: center; gap: 9px; height: 1.65em; font-family: var(--font-ui); font-size: 0.84rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-ink); }
.tn-k i { width: 7px; height: 7px; flex: none; transform: rotate(45deg); background: var(--c); }
.tn p { margin: 0; font-size: 1rem; color: var(--ink-2); }
.inside-wrap { margin-top: 26px; }
.inside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 26px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 0.98rem; line-height: 1.5; color: var(--ink-2); }
.inside li { position: relative; padding-left: 18px; }
.inside li::before { content: ""; position: absolute; left: 1px; top: 0.58em; width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid var(--gold); }
.quest-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: auto; padding-top: 30px; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stack li { padding: 3px 9px; border: 1px solid var(--hair); border-radius: 6px; background: var(--bg-2); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--muted); }
.next-wp {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 22px clamp(20px, 3vw, 32px);
  border: 1.5px dashed var(--hair-2); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: border-color 0.25s, background-color 0.25s;
}
@media (hover: hover) { .next-wp:hover { border-color: var(--moss); background: var(--bg-2); } }
.next-dot { width: 15px; height: 15px; margin: 0 4px; transform: rotate(45deg); border: 1.5px dashed var(--moss); }
.next-wp.reached { border-style: solid; border-color: var(--hair-2); background: var(--surface); }
.next-wp.reached .next-dot { border: 0; background: var(--moss); box-shadow: 0 0 0 4px rgb(134 184 150 / 0.16); }
.next-wp .label { color: var(--moss-ink); }
.next-t { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 1.2rem; }
.next-wp svg { width: 22px; height: 22px; color: var(--moss-ink); }
@media (max-width: 880px) {
  .quest, .quest.flip, #quest-representation { grid-template-columns: 1fr; }
  .quest.flip .quest-art { order: 0; }
  .quest-art { min-height: 0; aspect-ratio: 16 / 10; }
  #quest-representation .quest-art { aspect-ratio: 992 / 1586; --pz: 1.08; }   /* the poster at its own shape, its margin trimmed */
  #quest-representation .quest-roman { display: none; }   /* it would sit on the poster's words; the card says Side quest I */
}
@media (max-width: 640px) { .inside { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .tn { grid-template-columns: 1fr; gap: 2px; } }

/* ───── Field kit ───── */
.kit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
@media (max-width: 1100px) { .kit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kit-card { padding: clamp(24px, 2.8vw, 34px); border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface); }
.kit-head { display: flex; align-items: center; gap: 14px; }
.kit-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border: 1px solid var(--hair-2); border-radius: 12px; background: var(--bg-2); color: var(--steel-ink); }
.kit-icon svg { width: 22px; height: 22px; }
.kit-card h3 { margin: 0; font-family: var(--font-ui); font-size: 1.12rem; font-weight: 600; letter-spacing: 0.04em; }
.kit-sub { margin: 1px 0 0; font-size: 0.95rem; line-height: 1.4; color: var(--muted); }
.kit-items { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.kit-items li { padding: 8px 14px; border: 1px solid var(--hair-2); border-radius: 10px; background: var(--bg-2); font-family: var(--font-ui); font-size: 1.02rem; font-weight: 500; letter-spacing: 0.02em; }
.kit-note { max-width: 62em; margin: 24px 0 0; font-size: 0.98rem; color: var(--muted); }
.kit-note b { font-weight: 500; color: var(--ink-2); }

/* how this page was made */
.made { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(16px, 2vw, 24px); }
.made-list { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 1.02rem; line-height: 1.5; color: var(--ink-2); }
.made-list li { position: relative; padding-left: 20px; text-wrap: pretty; }
.made-list li::before { content: ""; position: absolute; left: 1px; top: 0.6em; width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid var(--gold); }
@media (max-width: 760px) { .made { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .kit { grid-template-columns: 1fr; } }

/* ───── Off the clock: from the workshop to the trail ───── */
.sp-ends { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 26px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }
.sp-ends .w { color: var(--steel-ink); }
.sp-ends .t { color: var(--moss-ink); }
.sp-band { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; margin-bottom: 16px; }
.sp-bracket { position: relative; grid-column: 2 / 5; height: 16px; margin-inline: 9%; border: 1px solid rgb(var(--glow) / 0.55); border-bottom: 0; border-radius: 10px 10px 0 0; }
.sp-bracket span {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%);
  padding: 0 12px; background: var(--bg); white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink);
}
.sp-line { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 40px 0 0; list-style: none; }
.sp-line::before { content: ""; position: absolute; top: 9px; left: 10%; right: 10%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--steel), var(--gold) 50%, var(--moss)); opacity: 0.85; }
.sp-item { --dot: var(--gold); position: relative; text-align: center; }
.sp-item:nth-child(1) { --dot: var(--steel); }
.sp-item:nth-child(2) { --dot: color-mix(in oklab, var(--steel) 45%, var(--gold)); }
.sp-item:nth-child(4) { --dot: color-mix(in oklab, var(--gold) 45%, var(--moss)); }
.sp-item:nth-child(5) { --dot: var(--moss); }
.sp-item::before { content: ""; position: absolute; top: -38px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border: 2px solid var(--dot); border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 5px var(--bg); }
.sp-icon { width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center; border: 1px solid var(--hair-2); border-radius: 50%; background: var(--surface); color: var(--dot); }
.sp-icon svg { width: 26px; height: 26px; }
.sp-item h3 { margin: 0; font-family: var(--font-ui); font-size: 1.08rem; font-weight: 600; letter-spacing: 0.03em; }
.sp-item p { max-width: 17em; margin: 6px auto 0; font-size: 0.97rem; line-height: 1.5; color: var(--ink-2); text-wrap: balance; }
.sp-tag { display: none; }
.lamp { display: flex; align-items: center; gap: 18px; max-width: 560px; margin: clamp(40px, 5vw, 60px) auto 0; padding: 20px 24px; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface); }
.lamp .sp-icon { margin: 0; flex: none; color: var(--gold); }
.lamp h3 { margin: 0; font-family: var(--font-ui); font-size: 1.08rem; font-weight: 600; letter-spacing: 0.03em; }
.lamp p { margin: 2px 0 0; color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 760px) {
  .sp-band { display: none; }
  .sp-line { grid-template-columns: 1fr; gap: 26px; padding: 0 0 0 36px; }
  .sp-line::before { top: 8px; bottom: 8px; left: 9px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--steel), var(--gold) 50%, var(--moss)); }
  .sp-item { display: grid; grid-template-columns: 54px minmax(0, 1fr); column-gap: 16px; align-items: start; text-align: left; }
  .sp-item::before { top: 19px; left: -34px; margin-left: 0; }
  .sp-icon { grid-row: span 3; margin: 0; }
  .sp-item p { max-width: none; margin: 4px 0 0; text-wrap: pretty; }
  .sp-tag {
    display: inline-block; justify-self: start; margin-top: 8px; padding: 2px 9px;
    border: 1px solid rgb(var(--glow) / 0.5); border-radius: 999px;
    font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-ink);
  }
}

/* ───── The nature gallery: six days from across the year ───── */
.gallery-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 32px; margin-bottom: clamp(32px, 4vw, 48px); }
.gallery-head .sec-head { margin-bottom: 0; }
.teaser { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.t-card {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 7px 7px 11px;
  border: 1px solid var(--hair); border-radius: 14px; background: var(--surface);
  color: var(--ink); text-decoration: none;
  transition: border-color 0.25s, transform 0.25s;
}
.t-img { display: block; aspect-ratio: 4 / 5; margin-bottom: 8px; overflow: hidden; border-radius: 9px; background: var(--surface-2); }
.t-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
.t-d { padding: 0 4px; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-ink); }
.t-t { padding: 0 4px; font-family: var(--font-ui); font-size: 0.98rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.25; }
@media (hover: hover) {
  .t-card:hover { border-color: var(--gold); transform: translateY(-2px); }
  .t-card:hover .t-img img { transform: scale(1.05); }
}
@media (max-width: 980px) { .teaser { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .teaser { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (prefers-reduced-motion: reduce) { .t-card, .t-img img { transition: none; } }

/* ───── Footer ───── */
.foot { padding-block: clamp(52px, 7vw, 84px) calc(36px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--hair); }
.foot-in { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 34px 48px; }
.foot-brand { display: inline-flex; align-items: center; gap: 12px; margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: 0.1em; }
.foot-brand .mark { width: 36px; height: 36px; }
.foot-tag { max-width: 27em; margin: 14px 0 0; font-style: italic; color: var(--ink-2); }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.foot-links:not(:has(li)) { display: none; }
.foot-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.foot-nav ul { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.foot-nav a { font-family: var(--font-ui); letter-spacing: 0.03em; color: var(--ink-2); text-decoration: none; }
@media (hover: hover) { .foot-nav a:hover { color: var(--gold-ink); } }
.foot-small { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; margin: 0; padding-top: 24px; border-top: 1px solid var(--hair); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); }
.foot-small a { color: var(--ink-2); }
@media (max-width: 760px) { .foot-in { grid-template-columns: 1fr; } }

/* ───── Things rise into place as they scroll in, where the browser can tie motion to scrolling ───── */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
