/* ============================================================
   stanleykwong.ca — v12 "Terminal Annual Report"
   Dark immersive editorial system. Warm near-black canvas,
   luminous amber accents, mono terminal labels, premium motion.
   Legacy variable NAMES are preserved (training-plan inline
   styles consume them); values are re-mapped for dark.
   ============================================================ */

:root {
  /* canvas layers */
  --bg: #0B0A08;
  --bg2: #12100C;
  --surface: #1A1712;
  --surface-2: #211D16;
  /* ink */
  --ink: #F2EFE9;
  --muted: #A8A096;
  --soft: #6E675D;
  /* amber scale */
  --amber: #E8A33D;
  --amber-bright: #F5C97B;
  --amber-deep: #BA7517;
  --amber-glow: rgba(232, 163, 61, 0.35);
  --amber-tint: rgba(232, 163, 61, 0.07);
  --amber-tint-strong: rgba(232, 163, 61, 0.14);
  --amber-light: rgba(232, 163, 61, 0.12); /* legacy name, remapped */
  /* lines */
  --border: rgba(242, 239, 233, 0.12);
  --border-strong: rgba(242, 239, 233, 0.22);
  /* geometry + type */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --sans: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
  --max: 760px;
  --wide: 1080px;
  --transition: 0.22s cubic-bezier(0.33, 1, 0.68, 1);
  --nav-h: 72px;
}

/* ---------- base ---------- */

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 85% -10%, rgba(232, 163, 61, 0.06), transparent 60%),
    var(--bg);
}

/* film grain — kills flat-black banding */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button, input, textarea { font: inherit; }

::selection { background: var(--amber-deep); color: var(--ink); }

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

* { scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page { display: none; animation: fadeIn 0.22s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem 4rem; }
.container-wide { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem 4rem; }
.page-text-wide h2,
.page-text-wide .lead,
.page-text-wide .body-text { max-width: none; }
.keep-together { white-space: nowrap; }

/* ---------- nav ---------- */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nav-h);
  margin: 0 0 2.5rem;
  /* full-width bar; content centered to --wide via responsive padding */
  padding: 0 max(1.5rem, calc((100vw - var(--wide)) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 10, 8, 0.86);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber-glow), transparent);
  opacity: 0.5;
  pointer-events: none;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.nav-logo::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber-glow);
  flex: none;
}

.nav-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.nav-links a {
  position: relative;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.35rem 0;
  transition: color var(--transition);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-links a:hover, .nav-links a.active { color: var(--amber); }
.nav-links a:hover::after, .nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- typography ---------- */

.eyebrow, .section-label, .meta, .chip, .post-type, .back-link, .all-link, .footer-note, .footer-links a {
  font-family: var(--mono);
}

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  /* block-level flex so it always takes its own line
     (inline-flex made it share a line with .back-link) */
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::after {
  content: "";
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, var(--amber-deep), transparent);
}

h1, h2, h3 {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(1.9rem, 3.4vw, 2.55rem); margin-bottom: 1.1rem; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.1rem); margin-bottom: 1rem; }
h3 { font-size: 20px; font-weight: 500; margin-bottom: 0.45rem; }

.lead, .body-text {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.section-index {
  color: var(--soft);
  margin-right: 0.5rem;
}

.meta {
  font-size: 13px;
  color: var(--soft);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

hr { border: none; border-top: 1px solid var(--border); margin: 2.75rem 0; }
.detail-intro-divider { margin-top: 1.35rem; }

a { color: var(--amber); }
a:hover { color: var(--amber-bright); }

/* ---------- reveal fallback (app.js IntersectionObserver path) ---------- */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* when GSAP is live, it owns these elements — kill the CSS transition */
.motion-on .reveal-on-scroll { transition: none; }
/* if motion.js declines (reduced motion / no CDN), make sure nothing stays hidden */
.motion-off .reveal-on-scroll { opacity: 1; transform: none; transition: none; }

/* ---------- home hero ---------- */

.home-hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 3rem 0 4rem;
  overflow: visible;
}

#hero-canvas {
  position: absolute;
  top: -2.5rem;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  /* static fallback painted underneath the WebGL canvas */
  background:
    radial-gradient(55% 70% at 72% 28%, rgba(232, 163, 61, 0.1), transparent 70%),
    radial-gradient(40% 50% at 18% 80%, rgba(232, 163, 61, 0.05), transparent 70%);
  mask-image: linear-gradient(180deg, black 62%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, black 62%, transparent 100%);
}
#hero-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-copy { position: relative; z-index: 2; }

.home-hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.032em;
  max-width: 980px;
  margin-bottom: 1.5rem;
}
.home-hero h1 em, .home-hero h1 .accent {
  font-style: normal;
  color: var(--amber);
}
.hero-copy .lead {
  font-size: 19px;
}

/* split-text spans (built by motion.js) */
.split-line { display: block; overflow: hidden; }
.split-word { display: inline-block; will-change: transform; }

.hero-scroll-cue {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}
.hero-scroll-cue::before {
  content: "";
  width: 3px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0%, rgba(232, 163, 61, 0.35) 42%, var(--amber-bright) 100%);
  box-shadow: 0 0 14px rgba(232, 163, 61, 0.42);
  animation: cueDrop 2.2s ease-in-out infinite;
}
@keyframes cueDrop {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  35% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  70% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0.4; }
}

.home-hero + hr { margin: 0 0 2.5rem; }

/* ---------- home sections ---------- */

.home-latest-section { display: grid; gap: 1.1rem; }
.home-latest-section + .home-latest-section { margin-top: 3.25rem; }

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.section-heading-row .section-label { margin-bottom: 0; }
.section-heading-row .all-link { margin-top: 0; white-space: nowrap; }

/* ---------- feature cards (emitted by app.js) ---------- */

.home-feature-list { display: grid; gap: 1.1rem; }

.home-feature-card {
  display: grid;
  grid-template-columns: minmax(260px, 32%) minmax(0, 1fr);
  min-height: 180px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.home-feature-card:hover {
  border-color: var(--amber-deep);
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px var(--amber-glow), 0 28px 56px -28px rgba(0, 0, 0, 0.75);
}

.home-feature-image-link {
  display: block;
  min-height: 180px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.home-feature-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  filter: saturate(0.92) contrast(0.98);
  transform: scale(1.001);
  transition: filter 0.45s ease, transform 0.65s cubic-bezier(0.33, 1, 0.68, 1);
}
.home-feature-image[src$="thought-claude-fable-5-redesign.png"] {
  object-fit: contain;
  background: #efe4cf;
}
.home-feature-card:hover .home-feature-image {
  filter: saturate(1) contrast(1);
  transform: scale(1.045);
}
.home-feature-card:hover .home-feature-image[src$="thought-claude-fable-5-redesign.png"] {
  transform: scale(1);
}

.home-feature-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 1.35rem 1.5rem;
}
.home-feature-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--soft);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}
.home-feature-copy h3 {
  font-size: 20px;
  line-height: 1.32;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.home-feature-copy h3 a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}
.home-feature-copy p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}
.home-feature-read {
  align-self: flex-start;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color var(--transition);
}
.home-feature-read::before {
  content: "\2192";
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform var(--transition);
}
.home-feature-read:hover { color: var(--amber-bright); }
.home-feature-card:hover .home-feature-read::before { transform: translateX(4px); }
.home-feature-read:hover,
.home-feature-copy h3 a:hover,
.home-feature-image-link:hover + .home-feature-copy h3 a { color: var(--amber); }
.home-feature-copy h3 a:hover { color: var(--amber-bright); }

/* ---------- generic grids + cards ---------- */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.card, .series-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 1.2rem;
  cursor: pointer;
  min-height: 100%;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}
.card:hover, .series-card:hover {
  border-color: var(--amber-deep);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.card p, .series-card p { color: var(--muted); font-size: 15px; line-height: 1.65; margin-top: 0.4rem; }
.card-link { color: inherit; text-decoration: none; }
a.card, a.series-card, a.content-item, a.note { color: inherit; text-decoration: none; display: block; }
a.content-item { display: grid; }

/* ---------- chips + filters ---------- */

.chip-row, .filter-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip, .filter {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.chip { font-size: 12px; font-family: var(--mono); padding: 0.3rem 0.6rem; margin-top: 0.75rem; display: inline-block; letter-spacing: 0.03em; }
.filter { font-family: var(--mono); font-size: 14px; padding: 0.42rem 0.72rem; }
.filter:hover, .filter.active, .chip:hover {
  border-color: var(--amber-deep);
  color: var(--amber);
  background: var(--amber-tint);
}

/* ---------- thoughts / insights headers ---------- */

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.insights-visual-column {
  display: grid;
  justify-items: end;
  gap: 0.6rem;
  flex: 0 0 340px;
}
.insights-visual {
  display: block;
  width: min(340px, 100%);
  height: 230px;
  object-fit: contain;
  opacity: 0.85;
  filter: saturate(0.95);
  border-radius: var(--radius-md);
}
.library-count { color: var(--soft); font-family: var(--mono); font-size: 13px; white-space: nowrap; }

.thoughts-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: center;
  gap: 2rem;
}
.thoughts-header h2,
.thoughts-header .lead { max-width: none; }
.thoughts-visual {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  filter: saturate(0.92);
}

/* ---------- content rows (emitted by app.js) ---------- */

.content-list { border-top: 1px solid var(--border); }
.content-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1.2rem 0.4rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), padding var(--transition);
}
.content-item:hover { background: var(--amber-tint); }
.content-title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 0.35rem;
  transition: color var(--transition);
}
.content-item:hover .content-title { color: var(--amber); }
.content-excerpt { font-size: 16px; color: var(--muted); line-height: 1.65; margin-bottom: 0.45rem; }
.content-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.content-date { font-family: var(--mono); font-size: 13px; color: var(--soft); white-space: nowrap; padding-top: 2px; }

.post-type {
  font-size: 12px;
  color: var(--amber);
  letter-spacing: 0.05em;
  text-transform: lowercase;
  border: 1px solid rgba(232, 163, 61, 0.3);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  background: var(--amber-tint);
}

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 2rem;
  align-items: start;
}
.note-list { border-top: 1px solid var(--border); }
.note {
  padding: 1rem 0.4rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.note:hover { background: var(--amber-tint); }
.note strong { display: block; font-size: 16px; line-height: 1.45; margin-bottom: 0.2rem; transition: color var(--transition); }
.note:hover strong { color: var(--amber); }
.note span { display: block; color: var(--muted); font-size: 15px; line-height: 1.55; }

.journey-list {
  display: grid;
  grid-template-rows: repeat(3, 112px);
  border-top: 1px solid var(--border);
}
.journey-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 112px;
  padding: 0.95rem 0.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  transition: background var(--transition);
}
.journey-item:hover { background: var(--amber-tint); }
.journey-date {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--soft);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.journey-title { display: block; font-size: 18px; font-weight: 500; line-height: 1.45; }
.journey-item:hover .journey-title { color: var(--amber); }

/* ---------- series dossiers (insights) ---------- */

.series-stack { display: grid; gap: 14px; }

.series-card .series-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.series-card .series-meta .meta {
  color: var(--amber);
  border: 1px solid rgba(232, 163, 61, 0.28);
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  background: var(--amber-tint);
}

.series-panel { display: grid; gap: 0; }
.series-panel summary { list-style: none; }
.series-panel summary::-webkit-details-marker { display: none; }
.series-panel > .series-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.25rem;
  border-left: 2px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.series-panel[open] > .series-card {
  border-color: var(--amber-deep);
  border-left: 2px solid var(--amber);
  background: var(--surface-2);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.series-panel .content-list { margin-bottom: 1.5rem; }
.series-panel .insights-feature-list {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-top: 0;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  background: var(--bg2);
}
.series-panel[open] .insights-feature-list {
  animation: seriesCardsFadeIn 0.4s cubic-bezier(0.33, 1, 0.68, 1) both;
}
.series-panel[open] .entry-series-label { display: none; }

.series-toggle::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--amber-deep);
  border-radius: 50%;
  color: var(--bg);
  background: var(--amber);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 0 18px rgba(232, 163, 61, 0.25);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background var(--transition);
}
.series-panel:hover .series-toggle::before { transform: scale(1.08); }
.series-panel[open] .series-toggle::before { content: "\2212"; transform: rotate(180deg); }

@keyframes seriesCardsFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- detail / reading experience ---------- */

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
  box-shadow: 0 0 10px var(--amber-glow);
}

.detail-shell { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem 4rem; }
.detail-shell h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.15; }
.detail-shell h1,
.detail-shell .lead { max-width: none; }

.detail-date { text-transform: none; }
.detail-reflection {
  color: var(--muted);
  font-size: 18px;
  font-style: italic;
  line-height: 1.7;
  margin: -0.35rem 0 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--amber-deep);
}
.detail-reflection + hr { margin-top: 1.25rem; }
.detail-subtitle {
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
  margin: -0.45rem 0 1.2rem;
}
.detail-hero-image { margin: 1.6rem 0 2rem; }
.detail-hero-image.detail-hero-compact img {
  width: 60%;
  margin-left: auto;
  margin-right: auto;
}
.detail-inline-image { margin: 0.4rem 0 1.8rem; }
.detail-hero-image img,
.detail-inline-image img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  filter: saturate(0.95);
}

.back-link {
  display: inline-block;
  color: var(--amber);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  margin-bottom: 1.5rem;
  text-decoration: none;
  transition: color var(--transition), transform var(--transition);
}
.back-link:hover { color: var(--amber-bright); transform: translateX(-3px); }
.detail-bottom-back { margin-top: 2rem; margin-bottom: 0; }

.detail-body {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.85;
}
.detail-body p { margin-bottom: 1.25rem; }
.detail-body strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.65;
}
.detail-body ul { margin: 0 0 1.3rem 1.1rem; color: var(--muted); }
.detail-body li { margin-bottom: 0.55rem; }
.detail-body code {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.08rem 0.3rem;
  background: var(--surface);
  color: var(--amber-bright);
  font-family: var(--mono);
  font-size: 0.85em;
}

.detail-code-block {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.8rem;
  overflow-x: auto;
  white-space: pre;
}

.detail-graph-image { margin: 0.4rem 0 2rem; }
.detail-graph-image img { cursor: zoom-in; }
.detail-graph-image figcaption {
  margin-top: 0.7rem;
  font-size: 14px;
  font-style: italic;
  line-height: 1.55;
  color: var(--muted);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(20, 16, 12, 0.88);
  cursor: zoom-out;
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-overlay img {
  max-width: 95vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.detail-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---------- resources ---------- */

.resource-hero h2,
.resource-hero .lead { max-width: none; }

.resource-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.resource-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.resource-card:hover,
.resource-card:focus-visible {
  border-color: var(--amber-deep);
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px var(--amber-glow), 0 32px 64px -32px rgba(0, 0, 0, 0.8);
  outline: none;
}
.resource-card-visual {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.resource-card-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92);
  transition: transform 0.7s cubic-bezier(0.33, 1, 0.68, 1), filter 0.45s ease;
}
.resource-card:hover .resource-card-visual img {
  transform: scale(1.05);
  filter: saturate(1);
}
.resource-card-copy { padding: 1.25rem 1.35rem 1.45rem; }
.resource-card-copy h3 {
  margin-bottom: 0.45rem;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.resource-card-copy h3::after {
  content: "\2192";
  font-family: var(--mono);
  font-size: 18px;
  color: var(--amber);
  transition: transform var(--transition);
}
.resource-card:hover .resource-card-copy h3::after { transform: translateX(5px); }
.resource-card-copy p { color: var(--muted); font-size: 16px; line-height: 1.65; }

.resource-empty-state {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

/* ---------- prompt library ---------- */

.prompt-library-grid { display: grid; gap: 0.9rem; margin-top: 1.4rem; }

.prompt-category-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.25rem 0 0;
}
.prompt-category-link {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.prompt-category-link:hover,
.prompt-category-link:focus-visible {
  border-color: var(--amber-deep);
  background: var(--amber-tint);
  color: var(--amber);
  outline: none;
}

.prompt-category-section { scroll-margin-top: calc(var(--nav-h) + 16px); }
.prompt-category-section + .prompt-category-section { margin-top: 3rem; }
.prompt-category-heading { align-items: flex-end; }
.prompt-category-count {
  margin: -0.5rem 0 0;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
}

.prompt-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition);
}
.prompt-entry:hover { border-color: var(--border-strong); }
.prompt-entry[open] {
  border-color: var(--amber-deep);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--amber-glow);
}
.prompt-entry-header {
  position: relative;
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem 3.2rem 1.1rem 1.15rem;
  cursor: pointer;
  list-style: none;
}
.prompt-entry-header::-webkit-details-marker { display: none; }
.prompt-entry-header::after {
  content: "+";
  position: absolute;
  top: 1.05rem;
  right: 1.05rem;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--amber-deep);
  border-radius: 999px;
  color: var(--bg);
  background: var(--amber);
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 0 16px rgba(232, 163, 61, 0.22);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.prompt-entry:hover .prompt-entry-header::after { transform: scale(1.08); }
.prompt-entry[open] .prompt-entry-header::after { content: "\2212"; transform: rotate(180deg); }
.prompt-entry-title {
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
}
.prompt-entry-purpose { color: var(--muted); font-size: 15px; line-height: 1.55; }
.prompt-tag-row { margin-top: 0.1rem; }
.prompt-tag-row .chip { margin-top: 0; }
.prompt-entry .prompt-block,
.prompt-entry > pre { margin: 0 1rem 1rem; }
.prompt-entry .prompt-block pre { margin: 0; }

.draft-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}
.draft-meta-row .post-type { cursor: default; }

.draft-body h2 { margin-top: 2.25rem; padding-top: 0.25rem; }
.draft-body h2:first-child { margin-top: 0; }
.draft-body h3 { margin-top: 1.8rem; font-size: 24px; }
.draft-body h4 {
  margin-top: 1.35rem;
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}
.draft-body .draft-section-heading {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}
.draft-body .draft-section-heading:first-child { border-top: 0; padding-top: 0; }
.draft-body p code,
.draft-body li code,
.draft-body td code {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.08rem 0.3rem;
  background: var(--bg2);
  color: var(--amber-bright);
  font-family: var(--mono);
  font-size: 0.88em;
}

/* terminal-window code blocks */
.draft-body pre {
  margin: 0.5rem 0 1.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0E0D0A;
  overflow-x: auto;
}
.draft-body pre code {
  display: block;
  min-width: 0;
  padding: 1rem 1.15rem;
  color: #D8D2C8;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  /* wrap long prompt lines instead of forcing horizontal scroll —
     keeps mobile readable; line breaks in the prompt are preserved */
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.prompt-block {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0E0D0A;
  overflow: hidden;
}
/* terminal title bar with three dots */
.prompt-block::before {
  content: "";
  display: block;
  height: 34px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle 5px at 20px 17px, rgba(232, 163, 61, 0.65) 4.5px, transparent 5.5px),
    radial-gradient(circle 5px at 38px 17px, rgba(168, 160, 150, 0.4) 4.5px, transparent 5.5px),
    radial-gradient(circle 5px at 56px 17px, rgba(110, 103, 93, 0.4) 4.5px, transparent 5.5px),
    var(--surface);
}
.prompt-block pre {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.copy-btn {
  position: absolute;
  top: 5px;
  right: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.6rem;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
  letter-spacing: 0.05em;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.copy-btn:hover {
  color: var(--ink);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.copy-btn.copied {
  color: var(--amber);
  border-color: var(--amber-deep);
  background: var(--amber-tint);
}

/* ---------- toc (training plans) ---------- */

.toc-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}
.toc-sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
  padding-bottom: 2rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.toc-sidebar::-webkit-scrollbar { display: none; }
.toc-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  max-width: none;
  border-left: 1px solid var(--border);
  border-bottom: 0;
  padding: 0 0 0 0.85rem;
  margin: 0;
}
.toc-nav-header {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.toc-phase-label {
  display: block;
  margin: 0.45rem 0 0.1rem;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toc-nav a {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.15s ease;
}
.toc-nav a:hover { color: var(--ink); }
.toc-nav a.toc-active {
  color: var(--amber);
  font-weight: 400;
  display: inline-block;
  border: 1px solid var(--amber-deep);
  border-radius: var(--radius-sm);
  background: var(--amber-tint);
  padding: 0.1rem 0.25rem;
  margin-left: -0.26rem;
}
.toc-main-content { flex: 1; min-width: 0; }

/* ---------- glossary ---------- */

.glossary-shell { max-width: 1180px; }
.glossary-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  grid-template-areas:
    "intro controls"
    "results results";
  gap: 1.35rem 2rem;
  align-items: start;
}
.glossary-intro { grid-area: intro; min-width: 0; }
.glossary-intro .lead { margin-bottom: 0; }
.glossary-results-column { grid-area: results; min-width: 0; }
.glossary-controls-column { grid-area: controls; min-width: 0; align-self: start; }

.glossary-body { color: var(--muted); }

.glossary-controls {
  position: static;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
}
.glossary-filter-column { display: grid; gap: 0.55rem; min-width: 0; }
.glossary-search-group {
  min-width: 0;
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}
.glossary-search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
  padding: 8px 11px;
  font-size: 14px;
  line-height: 1.35;
  caret-color: var(--amber);
}
.glossary-control-group { min-width: 0; margin-top: 0; }
.glossary-filter-column .glossary-control-group + .glossary-control-group {
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}
.glossary-control-label {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.glossary-filter-row,
.glossary-letter-filter-row { display: flex; flex-wrap: wrap; gap: 0.32rem; }

.glossary-filter-btn,
.glossary-letter-btn,
.glossary-clear-btn,
.glossary-toggle {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.glossary-filter-btn {
  min-height: 28px;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.glossary-letter-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.glossary-letter-btn:first-child {
  width: auto;
  min-width: 44px;
  padding: 0 0.55rem;
}
.glossary-filter-btn:hover,
.glossary-letter-btn:hover {
  border-color: var(--amber-deep);
  background: var(--amber-tint);
  color: var(--amber);
}
.glossary-filter-btn.is-active,
.glossary-letter-btn.is-active {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--bg);
  font-weight: 500;
  box-shadow: 0 0 14px rgba(232, 163, 61, 0.25);
}
.glossary-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.glossary-count {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
}
.glossary-clear-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--amber);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.glossary-clear-btn:hover { background: transparent; color: var(--amber-bright); }

.glossary-letter-section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 2rem;
}
.glossary-letter-section:first-child { border-top: 0; padding-top: 0; }
.glossary-letter-heading {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  margin-bottom: 0.95rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.glossary-letter-heading h2 {
  margin: 0;
  padding: 0;
  color: var(--amber);
  font-family: var(--mono);
  font-weight: 500;
}
.glossary-letter-count {
  margin-bottom: 0.25rem;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* CSS-keyframe entrance — re-fires automatically when app.js
   replaces #glossary-results innerHTML on search/filter */
.glossary-entry {
  margin-top: 0.75rem;
  padding: 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
  animation: glossaryIn 0.4s cubic-bezier(0.33, 1, 0.68, 1) both;
}
@keyframes glossaryIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.glossary-entry:hover,
.glossary-entry.is-open {
  border-color: var(--amber-deep);
  background: var(--surface-2);
}
.glossary-entry.is-open { box-shadow: 0 0 0 1px var(--amber-glow); }
.glossary-entry-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.glossary-entry-copy { min-width: 0; }
.glossary-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}
.glossary-body .glossary-entry-title {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}
.glossary-category-pill {
  display: inline-block;
  border: 1px solid rgba(232, 163, 61, 0.28);
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  line-height: 1.3;
  background: var(--amber-tint);
}
.glossary-summary { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.glossary-toggle {
  flex-shrink: 0;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--amber-deep);
  border-radius: var(--radius-sm);
  background: var(--amber);
  color: var(--bg);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(232, 163, 61, 0.2);
}
.glossary-toggle:hover {
  border-color: var(--amber-bright);
  background: var(--amber-bright);
  color: var(--bg);
}
.glossary-detail {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.glossary-empty-state {
  margin-top: 2rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.glossary-empty-state h2 { margin: 0 0 0.5rem; color: var(--ink); }
.glossary-empty-state p { margin: 0 0 0.9rem; color: var(--soft); }
.glossary-empty { margin: 0; color: var(--soft); font-size: 15px; }

/* ---------- links / buttons / forms ---------- */

.text-link, .all-link {
  color: var(--amber);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}
.text-link:hover, .all-link:hover { color: var(--amber-bright); }
.all-link {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1rem;
}
.all-link::after {
  content: "\2192";
  display: inline-block;
  margin-left: 0.4rem;
  transition: transform var(--transition);
}
.all-link:hover::after { transform: translateX(4px); }

.newsletter, .contact-form {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: var(--surface);
}
.newsletter p { color: var(--muted); font-size: 16px; line-height: 1.7; margin-bottom: 1rem; }
.input-row { display: flex; gap: 8px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg2);
  color: var(--ink);
  outline: none;
  padding: 9px 12px;
  font-size: 16px;
  transition: border-color var(--transition);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--amber-deep); }
input::placeholder, textarea::placeholder { color: var(--soft); }
label {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.contact-form { display: grid; gap: 1rem; }

button, .btn-amber {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.05em;
  padding: 10px 18px;
  border: 1px solid var(--amber-deep);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--amber);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), border-color var(--transition);
}
button:hover, .btn-amber:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--bg);
  box-shadow: 0 0 24px rgba(232, 163, 61, 0.3);
}
.success-msg { font-family: var(--mono); font-size: 14px; color: var(--amber); display: none; }

/* large magnetic contact block */
.contact-cta {
  display: block;
  margin-top: 0.5rem;
  padding: 2rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.contact-cta:hover {
  border-color: var(--amber-deep);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--amber-glow), 0 28px 56px -28px rgba(0, 0, 0, 0.75);
  color: var(--ink);
}
.contact-cta-label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.6rem;
}
.contact-cta-title {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.contact-cta-title::after {
  content: "\2192";
  font-family: var(--mono);
  color: var(--amber);
  transition: transform var(--transition);
}
.contact-cta:hover .contact-cta-title::after { transform: translateX(6px); }

/* ---------- footer ---------- */

footer {
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.footer-disclaimer {
  flex: 1 0 100%;
  max-width: 980px;
  margin: 0 0 0.35rem;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.footer-note { font-size: 14px; font-weight: 500; color: var(--ink); letter-spacing: 0.02em; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--amber); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  html { font-size: 17px; }
  nav { margin-bottom: 2rem; }
  .nav-links { gap: 0.8rem 1rem; }
  .home-hero {
    min-height: calc(100vh - var(--nav-h));
    min-height: calc(100svh - var(--nav-h));
    padding: 2rem 0 3rem;
  }
  .home-hero h1 { font-size: clamp(1.9rem, 8vw, 2.5rem); }
  .hero-scroll-cue { margin-top: 2rem; }
  .hero-scroll-cue::before { height: 48px; }
  .grid, .grid-3, .split-band, .resource-card-grid { grid-template-columns: 1fr; }
  .home-feature-card { grid-template-columns: 1fr; }
  .home-feature-image-link { border-right: 0; border-bottom: 1px solid var(--border); }
  .home-feature-image-link,
  .home-feature-image { min-height: 210px; }
  .library-header { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  .insights-visual-column { width: 100%; justify-items: start; }
  .insights-visual { width: 100%; max-width: 360px; height: 180px; }
  .thoughts-header { grid-template-columns: 1fr; }
  .thoughts-visual { max-width: 360px; height: 200px; }
  .content-item { grid-template-columns: 1fr; gap: 0.35rem; }
  .toc-layout { display: block; padding: 0; }
  .toc-sidebar { display: none; }
  .glossary-page-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "controls"
      "results";
    gap: 0;
  }
  .glossary-intro,
  .glossary-controls-column,
  .glossary-results-column { grid-row: auto; }
  .glossary-controls {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.7rem;
  }
  .glossary-filter-column { gap: 0.65rem; }
  .glossary-search-group { margin-top: 0.65rem; }
  .glossary-status-row,
  .glossary-entry-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .glossary-toggle { width: 100%; text-align: center; }
  .prompt-entry-header { padding-right: 2.8rem; }
  .prompt-category-jump { gap: 0.35rem; }
  .prompt-category-link { font-size: 12px; padding: 0.34rem 0.62rem; }
  .input-row { flex-direction: column; }
}

@media (max-width: 520px) {
  nav {
    min-height: var(--nav-h);
    padding: 0.85rem 1.15rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .nav-links { justify-content: flex-start; }
  .container, .container-wide, .detail-shell { padding-left: 1.15rem; padding-right: 1.15rem; }
  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }
  .home-feature-copy { padding: 1rem; }
  .home-feature-image-link,
  .home-feature-image { min-height: 180px; }
  footer { flex-direction: column; align-items: flex-start; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
  }
  .hero-scroll-cue::before { animation: none; }
  .glossary-entry { animation: none; }
}
