/* site.css — celestial, transparent, legible on any sky */
:root {
  --ink: #ffffff;
  --ink-strong: #ffffff;
  --mute: rgba(255,255,255,0.78);
  --accent: #f2d581;
  --hair: rgba(255,255,255,0.22);
  --hair-strong: rgba(255,255,255,0.4);
  --body: 'Newsreader', Georgia, serif;
  --display: 'Newsreader', Georgia, serif;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
  --max-content: 820px;    /* prose / page body */
  --max-wide: 1080px;      /* grids / lists */
  --page-pad: 40px;
  --shadow-deep: 0 2px 24px rgba(0,0,20,0.55), 0 1px 2px rgba(0,0,20,0.5);
  --shadow-soft: 0 1px 12px rgba(0,0,20,0.45);
}
/* Default sky palettes — lighter during daylight so the scene feels airy */
:root {
  --sky-top: #3a5a8a;
  --sky-horizon: #8aa8c4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: #0a0c1e;
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Global drop-shadow halo on text so it reads against any sky */
h1, h2, h3, h4, p, li, a, span, em, strong, blockquote, label, dt, dd {
  text-shadow: var(--shadow-soft);
}

a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--hair); transition: border-color 0.15s, color 0.15s; }
a:hover { border-bottom-color: var(--ink-strong); }

.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: lowercase; color: var(--mute); font-weight: 400; }

/* ───────────────── Top nav ───────────────── */
/* Nav — default: horizontal top bar (logo left, path right). One clean line. */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 24px var(--page-pad);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav .mark {
  font-family: var(--display);
  font-size: 22px;
  border: none;
  color: var(--ink-strong);
  letter-spacing: 0.01em;
  text-shadow: var(--shadow-deep);
  flex: none;
}
.nav .mark:hover { color: var(--ink-strong); }

.nav-github {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  border: none;
  text-shadow: var(--shadow-deep);
}
.nav-github:hover { color: var(--ink-strong); }

.nav-path {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
  column-gap: 14px;
  row-gap: 4px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: var(--shadow-deep);
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-path li { display: flex; align-items: baseline; white-space: nowrap; }
.nav-path .sep { color: var(--mute); padding-right: 1px; opacity: 0.55; }
.nav-path a {
  border: none;
  padding: 3px 2px;
  color: var(--ink);
  opacity: 0.78;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: baseline;
}
.nav-path a:hover { opacity: 1; }
.nav-path a.active { opacity: 1; font-weight: 600; }
.nav-path li.current a { border-bottom: 1.5px solid var(--ink-strong); padding-bottom: 1px; }
.nav .nav-right { display: none; }

/* ───────────────── Ambient scene ───────────────── */
.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* ───────────────── Home ───────────────── */
.home {
  position: relative; z-index: 2;
  min-height: 100vh;
  padding: 0 var(--page-pad);
  display: flex;
  flex-direction: column;
}
.home-inner {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.home .hero {
  margin-top: 28vh;
  max-width: 640px;
}
.home .greet {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.12;
  color: var(--ink-strong);
  text-wrap: pretty;
  text-shadow:
    0 2px 24px rgba(0,0,20,0.7),
    0 0 18px rgba(0,0,20,0.45),
    0 1px 2px rgba(0,0,20,0.8);
  letter-spacing: -0.005em;
}
.home .greet em { font-style: italic; color: var(--accent); }
.home .bio {
  margin-top: 20px;
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink);
  max-width: 54ch;
  text-wrap: pretty;
  text-shadow: var(--shadow-soft);
}
.home .bio + .bio { margin-top: 14px; }
.home .bio a { color: var(--accent); border-bottom-color: rgba(242, 213, 129, 0.4); }

.home-foot {
  margin-top: 28px;
  padding-bottom: 40px;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.home-foot a {
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 5px 11px;
  background: rgba(10, 14, 32, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-strong);
  opacity: 1;
  transition: background 0.15s, border-color 0.15s;
}
.home-foot a:hover { background: rgba(10, 14, 32, 0.6); border-color: var(--hair-strong); }

/* ───────────────── Content pages (live ON the sky) ───────────────── */
.page {
  position: relative; z-index: 2;
  padding: 104px var(--page-pad) 104px;
  min-height: 100vh;
}
.wrap { max-width: var(--max-content); margin: 0 auto; }
.wrap-wide { max-width: var(--max-wide); margin: 0 auto; }

/* Readable veil: a soft translucent card-like shape behind the content block
   that follows the sky (not a dark slab). Uses backdrop-filter for depth. */
.veil {
  position: relative;
  padding: 48px clamp(24px, 4vw, 64px) 56px;
  border-radius: 4px;
  background: linear-gradient(
    180deg,
    rgba(10, 14, 32, 0.44) 0%,
    rgba(10, 14, 32, 0.56) 40%,
    rgba(10, 14, 32, 0.62) 100%
  );
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 24px 60px -20px rgba(0,0,20,0.4);
}
/* High-contrast mode: near-solid panels, no blur */
[data-contrast="high"] .veil {
  background: rgba(8, 11, 26, 0.93);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(255,255,255,0.14);
}
[data-contrast="high"] .quiz,
[data-contrast="high"] .rec,
[data-contrast="high"] .build,
[data-contrast="high"] .ideas-note {
  background: rgba(8, 11, 26, 0.9);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-contrast="high"] .veil .mono,
[data-contrast="high"] .veil .page-sub,
[data-contrast="high"] .veil .b-desc,
[data-contrast="high"] .veil .rec-desc,
[data-contrast="high"] .veil .idea-desc { opacity: 1; }
/* Glass veil keeps its own legible palette regardless of sky */
.veil {
  --ink: #ffffff;
  --ink-strong: #ffffff;
  --mute: rgba(255,255,255,0.82);
  --hair: rgba(255,255,255,0.22);
}

.page-header { margin-bottom: 44px; max-width: 640px; }
.page-title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(28px, 3.2vw, 44px); line-height: 1.12; letter-spacing: -0.01em;
  color: var(--ink-strong);
  text-shadow: var(--shadow-deep);
}
.page-sub {
  margin-top: 14px; color: var(--ink); opacity: 0.85;
  max-width: 56ch;
  text-shadow: var(--shadow-soft);
}

/* ───────────────── Post list ───────────────── */
.list { list-style: none; }
.list > li {
  display: grid;
  grid-template-columns: 92px 110px 1fr auto;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hair);
  align-items: baseline;
}
.list .date { font-family: var(--mono); font-size: 11px; color: var(--mute); letter-spacing: 0.05em; }
.list .kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: lowercase;
  color: var(--mute);
  padding: 2px 8px;
  border: 1px solid var(--hair);
  justify-self: start;
}
.list .kind.opinion { color: var(--accent); border-color: currentColor; }
.list .kind.release { color: var(--ink-strong); border-color: currentColor; }
.list .kind.note { color: var(--mute); font-style: italic; text-transform: none; }
.list .title { font-family: var(--display); font-size: 22px; line-height: 1.3; color: var(--ink-strong); border: none; }
.list .title:hover { color: var(--accent); }
.list .tag { font-family: var(--mono); font-size: 10px; color: var(--mute); letter-spacing: 0.05em; }

/* ───────────────── Almanac ───────────────── */
.almanac {
  position: fixed; right: 24px; bottom: 24px; z-index: 5;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink);
  text-align: right;
  line-height: 1.7;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(0,0,20,0.9), 0 0 2px rgba(0,0,20,0.8);
  /* localized scrim so the readout stays legible over bright meadow greens */
  background: radial-gradient(120% 120% at 100% 100%, rgba(8,12,24,0.32), rgba(8,12,24,0) 78%);
  padding: 14px 6px 2px 30px;
  border-radius: 12px;
}
.almanac .k { opacity: 0.6; letter-spacing: 0.08em; text-transform: lowercase; margin-right: 6px; color: var(--mute); }
.almanac .v { color: var(--ink-strong); }

.loc-ask {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 10;
  background: rgba(10,14,32,0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hair);
  padding: 10px 16px;
  font-family: var(--mono); font-size: 12px;
  display: flex; gap: 16px; align-items: center;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  color: var(--ink);
  border-radius: 2px;
}
.loc-ask button {
  background: var(--ink-strong); color: #0a0c1e; border: none;
  padding: 6px 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em;
  text-transform: lowercase; cursor: pointer;
}
.loc-ask button.ghost { background: transparent; color: var(--mute); border: 1px solid var(--hair); }

/* ───────────────── Prose ───────────────── */
.prose { max-width: 62ch; font-size: 19px; line-height: 1.75; color: var(--ink); }
.prose p + p { margin-top: 1em; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 2em 0 0.6em; color: var(--ink-strong); }
.prose blockquote { border-left: 2px solid var(--accent); padding-left: 18px; color: var(--mute); font-style: italic; margin: 1.4em 0; }

/* ───────────────── Pills / Quiz ───────────────── */
.pill { background: none; border: 1px solid var(--hair); color: var(--mute); padding: 6px 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: lowercase; cursor: pointer; transition: all 0.15s; }
.pill:hover { color: var(--ink-strong); border-color: var(--ink-strong); }
.pill.active { background: var(--ink-strong); color: #0a0c1e; border-color: var(--ink-strong); }
.pill--accent:not(.active) { color: var(--accent); border-color: var(--accent); }

.recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 18px; }
.rec { display: block; min-width: 0; border: 1px solid var(--hair); padding: 20px; transition: border-color 0.2s, background 0.2s; background: rgba(10,14,32,0.18); }
.rec:hover { border-color: var(--hair-strong); background: rgba(10,14,32,0.3); }
.rec .rec-title { font-family: var(--display); font-size: 21px; line-height: 1.25; margin-bottom: 6px; color: var(--ink-strong); }
.rec .rec-by { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-bottom: 12px; }
.rec .rec-desc { font-size: 15px; color: var(--ink); line-height: 1.55; opacity: 0.92; }
.rec .rec-tags { margin-top: 10px; font-family: var(--mono); font-size: 10px; color: var(--mute); letter-spacing: 0.05em; }
.rec[data-rank]::before { content: attr(data-rank); float: right; font-family: var(--mono); font-size: 10px; color: var(--accent); letter-spacing: 0.08em; }

.quiz { max-width: 560px; margin: 0 0 40px; border: 1px solid var(--hair); padding: 24px; background: rgba(10,14,32,0.38); backdrop-filter: blur(8px); }
.quiz .q { font-family: var(--display); font-size: 23px; line-height: 1.3; margin-bottom: 16px; color: var(--ink-strong); }
.quiz .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz .opt { font-family: var(--mono); font-size: 12px; padding: 8px 12px; border: 1px solid var(--hair); background: transparent; color: var(--ink); cursor: pointer; transition: all 0.15s; }
.quiz .opt:hover { border-color: var(--ink-strong); }
.quiz .opt.selected { background: var(--ink-strong); color: #0a0c1e; border-color: var(--ink-strong); }
.quiz .progress { font-family: var(--mono); font-size: 10px; color: var(--mute); letter-spacing: 0.1em; text-transform: lowercase; margin-bottom: 10px; }
.quiz .actions { margin-top: 18px; display: flex; gap: 10px; justify-content: space-between; }
.quiz .actions button { background: none; border: none; color: var(--mute); font-family: var(--mono); font-size: 11px; cursor: pointer; letter-spacing: 0.05em; text-transform: lowercase; }
.quiz .actions button:hover { color: var(--ink-strong); }

.quiz-trigger {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; text-transform: lowercase;
  padding: 10px 18px; background: rgba(255,255,255,0.06); color: var(--ink-strong);
  border: 1px solid var(--hair-strong); cursor: pointer; transition: all 0.15s;
  margin-bottom: 28px;
}
.quiz-trigger:hover { background: rgba(255,255,255,0.12); }

/* ───────────────── Ideas ───────────────── */
.ideas-note { font-family: var(--mono); font-size: 12px; color: var(--mute); border: 1px dashed var(--hair); padding: 14px 18px; margin-bottom: 32px; max-width: 640px; line-height: 1.65; background: rgba(10,14,32,0.22); }
.ideas-note strong { color: var(--ink-strong); font-family: var(--body); font-weight: 500; font-style: italic; }
.ideas-list { list-style: none; }
.ideas-list > li { display: grid; grid-template-columns: 76px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--hair); align-items: baseline; }
.ideas-list .n { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.ideas-list .idea-title { font-family: var(--display); font-size: 21px; line-height: 1.3; color: var(--ink-strong); }
.ideas-list .idea-desc { font-size: 15px; color: var(--ink); opacity: 0.86; margin-top: 4px; line-height: 1.55; }
.ideas-list .status { font-family: var(--mono); font-size: 10px; color: var(--mute); text-transform: lowercase; letter-spacing: 0.08em; }

/* ───────────────── Builds ───────────────── */
.builds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.build { min-width: 0; overflow: hidden; border: 1px solid var(--hair); padding: 22px; transition: border-color 0.2s, background 0.2s; background: rgba(10,14,32,0.2); }
.build .b-title, .build .b-desc { overflow-wrap: break-word; }
.build:hover { border-color: var(--hair-strong); background: rgba(10,14,32,0.34); }
.b-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.b-head > div { min-width: 0; }
.b-mark { flex: 0 0 72px; width: 72px; height: 72px; overflow: hidden; border: 1px solid var(--hair); border-radius: 4px; background: rgba(255,255,255,0.06); }
.b-mark img, .b-mark svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.build .b-title { font-family: var(--display); font-size: 26px; line-height: 1.15; color: var(--ink-strong); }
.build .b-sub { font-family: var(--mono); font-size: 11px; color: var(--ink-strong); opacity: 1; margin-bottom: 5px; letter-spacing: 0.07em; text-transform: lowercase; font-weight: 500; text-shadow: 0 1px 6px rgba(0,0,20,0.75), 0 0 2px rgba(0,0,20,0.6); }
.build .b-desc { font-size: 15px; line-height: 1.55; color: var(--ink); opacity: 0.92; }
.build .b-meta { margin-top: 16px; display: flex; gap: 14px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-strong); opacity: 1; letter-spacing: 0.08em; text-transform: lowercase; font-weight: 500; text-shadow: 0 1px 6px rgba(0,0,20,0.75), 0 0 2px rgba(0,0,20,0.6); }
.b-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; list-style: none; }
.b-facts li { padding: 4px 8px; border: 1px solid var(--hair); font-family: var(--mono); font-size: 9px; line-height: 1.35; letter-spacing: 0.06em; text-transform: lowercase; color: var(--mute); }
.b-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 19px; margin-top: 20px; list-style: none; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--mute); }
.b-flow li { position: relative; }
.b-flow li:not(:last-child)::after { content: '→'; position: absolute; left: calc(100% + 6px); color: var(--accent); }

/* ───────────────── Thoughts empty state ───────────────── */
.thoughts-empty { display: grid; grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1.28fr); gap: clamp(28px, 6vw, 64px); align-items: center; padding: 10px 0 22px; }
.empty-folio { position: relative; aspect-ratio: 4 / 5; max-width: 220px; width: 100%; justify-self: center; border: 1px solid var(--hair-strong); background: rgba(255,255,255,0.035); box-shadow: 12px 12px 0 rgba(255,255,255,0.025); }
.empty-folio::before { content: ''; position: absolute; inset: 24% 16% 16%; background: repeating-linear-gradient(180deg, transparent 0 22px, var(--hair) 22px 23px); opacity: 0.72; }
.empty-folio::after { content: ''; position: absolute; left: 16%; top: 16%; width: 1px; height: 28px; background: var(--accent); }
.empty-folio span { position: absolute; right: 0; top: 0; width: 28%; aspect-ratio: 1; border-left: 1px solid var(--hair); border-bottom: 1px solid var(--hair); background: linear-gradient(225deg, rgba(255,255,255,0.08) 0 49%, transparent 50%); }
.empty-copy .mono { margin-bottom: 12px; }
.empty-copy h2 { max-width: 15ch; font-family: var(--display); font-size: clamp(25px, 3.2vw, 36px); font-weight: 400; line-height: 1.12; color: var(--ink-strong); }
.empty-copy > p:last-child { max-width: 38ch; margin-top: 16px; font-size: 16px; line-height: 1.6; color: var(--mute); }

/* ───────────────── Bionic ───────────────── */
[data-bionic="on"] .bionic-target b { font-weight: 700; color: var(--ink-strong); }
[data-bionic="on"] .bionic-target { font-weight: 400; }

/* ───────────────── Larger-text accessibility scale ───────────────── */
[data-text="large"] { font-size: 22px; }
[data-text="large"] .home .bio,
[data-text="large"] .page-sub,
[data-text="large"] .prose { font-size: 1.15em; }
[data-text="large"] .list .title,
[data-text="large"] .rec-desc,
[data-text="large"] .idea-desc,
[data-text="large"] .b-desc { font-size: 1.08em; }

/* ───────────────── Accessibility button + popover ───────────────── */
#a11y-btn {
  position: fixed; left: 20px; bottom: 20px; z-index: 110;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,14,32,0.78); color: var(--ink-strong);
  border: 1px solid var(--hair); cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,20,0.45);
  opacity: 1;
  transition: opacity 0.15s, background 0.15s, transform 0.15s;
}
/* The accessibility control stays fully visible. ::after pads the hit target
   to >=44px around the 36px visual chip. */
#a11y-btn::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; }
#a11y-btn:hover, #a11y-btn:focus-visible, #a11y-btn[aria-expanded="true"] { opacity: 1; }
#a11y-btn:hover { background: rgba(10,14,32,0.95); transform: translateY(-1px); }
#a11y-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#a11y-pop {
  position: fixed; left: 20px; bottom: 72px; z-index: 110;
  width: 230px;
  background: rgba(10,14,32,0.92); color: var(--ink);
  border: 1px solid var(--hair); border-radius: 4px;
  padding: 14px 16px;
  font-family: var(--mono); font-size: 12px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 36px rgba(0,0,20,0.5);
  display: none;
}
#a11y-pop.open { display: block; }
#a11y-pop h3 { font-size: 10px; letter-spacing: 0.1em; text-transform: lowercase; color: var(--mute); margin-bottom: 12px; font-weight: 400; }
#a11y-pop .a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#a11y-pop .a11y-row:last-child { margin-bottom: 0; }
#a11y-pop .a11y-row span { color: var(--ink); }
#a11y-pop .switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; }
#a11y-pop .switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
#a11y-pop .switch .track {
  position: absolute; inset: 0; border-radius: 11px;
  background: rgba(255,255,255,0.16); border: 1px solid var(--hair);
  transition: background 0.18s;
}
#a11y-pop .switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink-strong); transition: transform 0.18s;
}
#a11y-pop .switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
#a11y-pop .switch input:checked + .track::after { transform: translateX(16px); background: #0a0c1e; }
#a11y-pop .switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
#a11y-pop .seg { display: flex; border: 1px solid var(--hair); border-radius: 3px; overflow: hidden; }
#a11y-pop .seg button {
  background: transparent; color: var(--mute); border: none; cursor: pointer;
  font-family: var(--mono); padding: 4px 10px; transition: all 0.12s;
}
#a11y-pop .seg button:first-child { font-size: 12px; }
#a11y-pop .seg button:last-child { font-size: 14px; border-left: 1px solid var(--hair); }
#a11y-pop .seg button.on { background: var(--ink-strong); color: #0a0c1e; }
@media (max-width: 720px) {
  #a11y-btn { left: 12px; bottom: 12px; }
  #a11y-pop { left: 12px; bottom: 64px; }
}

/* ───────── Wide (≥1440): nav becomes a left-margin index; content stays
   centred to the VIEWPORT (the nav lives in the left margin, never offsets it) ── */
@media (min-width: 1180px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    right: auto;
    width: 170px;
    gap: 20px;
    padding: 30px 0 30px 32px;
  }
  .nav-path {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    row-gap: 4px;
  }
  /* content stays viewport-centred but always clears the left index */
  .wrap { max-width: min(var(--max-content), calc(100vw - 440px)); }
  .wrap-wide { max-width: min(var(--max-wide), calc(100vw - 440px)); }
}

/* ───────── Mobile / small (≤860): one compact row that scrolls away ── */
@media (max-width: 920px) {
  /* The fixed almanac readout collides with scrolling content on narrow
     viewports (seen at 768 and below) — hide it; the sky tells the story. */
  .almanac { display: none; }
}
@media (max-width: 860px) {
  .nav {
    position: absolute;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 18px var(--page-pad) 0;
  }
  .nav-path {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    column-gap: 12px;
    row-gap: 0;
    width: auto;
  }
  .home { padding-top: 66px; }
  .page { padding-top: 84px; }
  .home .hero { margin-top: 4vh; }
  .home .loc-ask {
    position: static;
    transform: none;
    width: 100%;
    max-width: 640px;
    margin: 4px auto 0;
    padding: 10px 12px;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  :root { --page-pad: 22px; }
  .nav .mark { font-size: 19px; }
  .nav-path { font-size: 12px; }
  .list > li { grid-template-columns: 80px 1fr; grid-template-areas: 'date title' 'kind tag'; gap: 8px 16px; }
  .list .date { grid-area: date; }
  .list .title { grid-area: title; font-size: 19px; }
  .list .kind { grid-area: kind; }
  .list .tag { grid-area: tag; }
  .veil { padding: 30px 20px; }

  /* Phone type + rhythm: one step smaller, ~30% tighter vertically —
     quiet and dense-ish, not cramped. */
  .home .loc-ask {
    padding: 12px;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 4px;
  }
  .home .loc-ask span { flex: 1 1 100%; }
  .home .loc-ask button { flex: 1 1 0; }
  .home .greet { font-size: 28px; }
  .home .bio { font-size: 15px; margin-top: 14px; }
  .home .bio + .bio { margin-top: 10px; }
  .home-foot { margin-top: 20px; padding-bottom: 30px; }
  .prose { font-size: 15px; line-height: 1.7; }
  .page-sub { font-size: 15px; margin-top: 10px; }
  .page-title { font-size: 26px; }
  .page-header { margin-bottom: 30px; }
  .builds { grid-template-columns: 1fr; }
  .thoughts-empty { grid-template-columns: 92px minmax(0, 1fr); gap: 22px; align-items: start; }
  .empty-folio { box-shadow: 7px 7px 0 rgba(255,255,255,0.025); }
  .empty-folio::before { inset: 25% 16% 14%; background-size: 100% 18px; }
  .empty-folio::after { height: 20px; }
  .empty-copy h2 { font-size: 24px; }
  .empty-copy > p:last-child { font-size: 14px; line-height: 1.55; }
}

@media (max-width: 480px) {
  .veil { padding: 26px 16px; }
  .build { padding: 18px 16px; }
  .rec { padding: 16px 14px; }
  .builds { gap: 16px; }
}

/* Rotated phones need a composed two-column moment: copy at left, city at
   right, with both above the fold. The regular page remains scrollable. */
@media (max-height: 520px) and (min-aspect-ratio: 7/5) {
  :root { --page-pad: 20px; }
  .nav { padding: 12px var(--page-pad) 0; }
  .home { padding-top: 50px; }
  .home-inner { max-width: none; }
  .home .hero { width: min(48vw, 405px); max-width: 405px; margin: 0; }
  .home .greet { font-size: 26px; }
  .home .bio { font-size: 14px; line-height: 1.45; margin-top: 10px; }
  .home .bio + .bio { margin-top: 6px; }
  .home-foot { margin-top: 10px; padding-bottom: 8px; gap: 12px; }
  .home-foot a { padding: 4px 9px; }
}

/* Large canvases get a modest reading-scale lift. This keeps the copy present
   in the composition without turning a 4K layout into an enlarged laptop. */
@media (min-width: 2000px) and (min-height: 1100px) {
  :root { --max-content: 960px; --max-wide: 1280px; --page-pad: 48px; }
  .home .hero { max-width: 720px; }
  .home .greet { font-size: 52px; }
  .home .bio { max-width: 56ch; font-size: 21px; line-height: 1.6; }
  .nav .mark { font-size: 24px; }
  .nav-path { font-size: 14px; }
  .almanac { font-size: 12px; }
}
