/* The Dark Forest. Colors from Sanzo Wada's "A Dictionary of Color Combinations":
   ink #172426, deep green #0a3b38, cream #d0c495, vermilion #d55c39, mint #83b5a1, mustard #be960d.
   Text and surface tints below are mixed from those six so contrast passes WCAG AA. */
:root {
  --ink: #172426;
  --forest: #0a3b38;
  --cream: #d0c495;
  --vermilion: #d55c39;
  --mint: #83b5a1;
  --mustard: #be960d;

  --bg: var(--ink);
  --bg-2: var(--forest);
  --card: #1e3033;
  --card-hi: #243a3d;
  --line: #2f4749;
  --text: #efe7cb;
  --muted: #a9b6a6;
  --accent: #e0643c;
  --accent-ink: #172426;
  --gold: #d6ad2b;
  --good: var(--mint);
  --bad: #e88a9b;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px rgba(0, 0, 0, 0.28);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f2ebd3;
  --bg-2: #e7ddb9;
  --card: #fbf7e9;
  --card-hi: #fffdf4;
  --line: #ddd1a8;
  --text: #172426;
  --muted: #4e5e57;
  --accent: #c13b0f;
  --accent-ink: #fffaf0;
  --gold: #8a6a00;
  --good: #2c7259;
  --bad: #a8324a;
  --shadow: 0 1px 2px rgba(23, 36, 38, 0.06), 0 10px 28px rgba(23, 36, 38, 0.09);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 6vw, 44px); }
h2 { font-size: 22px; margin: 32px 0 12px; }
.muted { color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); text-decoration: none; font-weight: 700;
  transition: transform 0.12s, background 0.12s, filter 0.12s;
}
.btn:hover { background: var(--card-hi); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.big { padding: 16px 28px; font-size: 18px; }
.btn:focus-visible, .choice:focus-visible, .vt:focus-visible, .latest:focus-visible, .nav a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.theme-toggle { display: block; margin: 0 auto 32px; padding: 8px 14px; font-size: 13px; min-height: 36px; }

/* ---------- Hub: portfolio page ---------- */
.home .wrap { padding-top: 16px; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0 24px; }
.wordmark { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 19px; }
.wordmark svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 10px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--text); background: var(--card); }

.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; margin: 0 0 14px; }
/* Non-Violent Communication Practice (nvc/) relies on these two. */
.hero h1 { font-size: clamp(38px, 6.5vw, 68px); line-height: 1.02; letter-spacing: -0.025em; max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 46ch; margin: 16px 0 12px; }
.text-link { color: var(--text); font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 2px; }

.qr svg { width: 100%; height: 100%; display: block; }
/* Night walk: a night scene on top (always dark, in both themes), then a trail sign over each section. */
.night { position: relative; overflow: hidden; background: linear-gradient(#061314, #0b2624 70%, #0a3b38); color: #efe7cb; }
.night-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.night-front { fill: var(--bg); }
.night-in {
  position: relative; max-width: 1080px; margin: 0 auto; padding: 16px 16px clamp(90px, 12vw, 130px);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 40px; align-items: center;
}
.night .top-bar { grid-column: 1 / -1; padding-bottom: 8px; }
.night .nav a { color: #c9c3a8; }
.night .nav a:hover { color: #efe7cb; background: rgba(239, 231, 203, 0.08); }
.night .eyebrow { color: #d6ad2b; }
.night h1 { font-size: clamp(36px, 5.6vw, 60px); line-height: 1.04; letter-spacing: -0.02em; }
.night h1 em { color: #d6ad2b; }
.night .lead { color: #c9c3a8; margin-bottom: 0; }
.latest {
  display: grid; text-decoration: none; background: rgba(30, 48, 51, 0.92); border: 1px solid #3c5a52; border-radius: 20px; overflow: hidden;
  box-shadow: 0 0 0 4px rgba(214, 173, 43, 0.12), 0 0 50px rgba(214, 173, 43, 0.25); transition: transform 0.15s, box-shadow 0.15s;
}
.latest:hover { transform: translateY(-3px); box-shadow: 0 0 0 4px rgba(214, 173, 43, 0.3), 0 0 64px rgba(214, 173, 43, 0.4); }
.latest .shot { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #0a3b38; }
.latest img { display: block; width: 100%; height: 100%; object-fit: cover; }
.latest .body { display: grid; gap: 6px; padding: 16px 20px 20px; }
.latest .eyebrow { margin: 0; }
.latest b { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.latest .line { color: #c9c3a8; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.latest .btn { justify-self: start; margin-top: 6px; --accent-ink: #172426; background: #e0643c; }

.trail-sec { padding: 22px 0 18px; scroll-margin-top: 12px; }
.trail-sec::after {
  content: ""; display: block; height: 30px; margin-top: 26px; background: var(--bg-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M0 30 10 6l10 24zM18 30 28 12l10 18z'/%3E%3C/svg%3E") repeat-x left bottom / 40px 30px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M0 30 10 6l10 24zM18 30 28 12l10 18z'/%3E%3C/svg%3E") repeat-x left bottom / 40px 30px;
}
.trail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.trail h2 {
  margin: 0; background: #5a3d22; color: #efe7cb; font-size: 22px; padding: 6px 34px 6px 16px; border-radius: 3px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); box-shadow: inset 0 -3px 0 #3a2715;
}
.trail p { margin: 0; color: var(--muted); font-size: 15px; flex: 1 1 220px; }
.vgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
.vt { position: relative; display: grid; gap: 6px; align-content: start; text-decoration: none; min-width: 0; }
.vt .shot { display: block; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--forest), var(--ink)); transition: box-shadow 0.2s; }
.vt img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.vt:hover .shot { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(214, 173, 43, 0.35); }
.vt:hover img { transform: scale(1.03); }
.vt .tag {
  position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
}
.vt b { font-size: 17px; }
.vt .line { font-size: 14.5px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.about-me h2 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 16px; }
.about-me { margin-top: clamp(64px, 10vw, 120px); }
.about-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; }
.avatar { width: clamp(88px, 14vw, 140px); height: auto; border-radius: 50%; display: block; }
.bio p { font-size: clamp(18px, 2.4vw, 22px); margin: 0 0 14px; max-width: 52ch; }
.bio p:first-child { font-family: var(--display); font-size: clamp(22px, 3vw, 30px); line-height: 1.3; }
.bio .links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.closer {
  margin-top: clamp(64px, 10vw, 120px); padding: clamp(32px, 6vw, 64px); border-radius: 28px; text-align: center;
  background: var(--forest); color: #efe7cb;
}
:root[data-theme='light'] .closer { background: var(--ink); }
.closer h2 { font-size: clamp(40px, 9vw, 96px); margin: 0 0 12px; line-height: 1; letter-spacing: -0.03em; }
.closer h2 em { color: var(--gold); font-style: italic; }
.closer-line { font-size: clamp(17px, 2.2vw, 20px); margin: 0 0 28px; opacity: .85; }
.closer-actions { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; }
.qr-mini { margin: 0; font-size: 13px; opacity: .9; }
.qr-mini .qr { width: 112px; height: 112px; border-radius: 10px; overflow: hidden; background: #fbf7e9; margin: 0 auto 6px; }
.closer .btn.primary { --accent-ink: #172426; background: #e0643c; }

.empty { color: var(--muted); }
.site-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 40px; color: var(--muted); font-size: 14px; }
.site-foot .theme-toggle { margin: 0; }
footer { margin-top: 48px; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .night-in { grid-template-columns: minmax(0, 1fr); }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .vt b { font-size: 16px; }
  .vt .line { font-size: 13.5px; }
  .nav a.opt { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Practice quizzes (Non-Violent Communication Practice, 7 Habits Practice): keyboard play ---------- */
.choice { display: flex; align-items: center; gap: 12px; }
.choices.row .choice { justify-content: center; }
.choice .key {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 13px; font-weight: 700;
}
.choice.right .key { border-color: var(--good); color: var(--text); }
.choice.wrong .key { border-color: var(--bad); color: var(--text); }
.quiz-hint { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.quiz-next {
  display: flex; width: 100%; max-width: 440px; min-height: 58px; margin: 18px auto 8px; font-size: 19px;
  animation: rise 0.25s ease-out;
}
.quiz-next kbd {
  font: 700 12px var(--sans); padding: 3px 7px; border-radius: 6px; margin-left: 4px;
  border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, transparent); opacity: 0.8;
}
@media (hover: none) { .quiz-hint, .quiz-next kbd { display: none; } }

/* ---------- Books: drawn covers (home band and books/) ---------- */
.cover {
  aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px; padding: 12px 10px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(90deg, rgba(0,0,0,.28) 0 7px, rgba(255,255,255,.08) 7px 9px, transparent 9px), var(--c);
  color: #efe7cb; box-shadow: var(--shadow); overflow: hidden; container-type: inline-size;
}
.cover .ct { font: 600 9.5cqi/1.15 var(--display); padding-left: 6px; }
.cover .ca { font-size: 7cqi; letter-spacing: .06em; text-transform: uppercase; opacity: .85; padding-left: 6px; }

/* The home book band: books by other people, set apart from the things I made by a wood shelf and a lighter panel. */
.book-band {
  margin: 34px 0 30px; padding: clamp(22px, 4vw, 36px); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-hi), var(--card)); border: 1px solid var(--line); scroll-margin-top: 12px;
}
.book-band .eyebrow { margin-bottom: 8px; }
.book-band h2 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 8px; }
.book-band h2 em { font-style: italic; color: var(--gold); }
.book-band .band-head p:not(.eyebrow) { margin: 0; color: var(--muted); max-width: 52ch; }
.spines {
  display: flex; gap: 18px; overflow-x: auto; padding: 24px 4px 0; margin: 0 -4px 22px;
  border-bottom: 10px solid #6b4a2b; box-shadow: 0 6px 0 -2px #3e2a18; scrollbar-width: thin;
}
.spine { flex: 0 0 112px; display: grid; gap: 6px; align-content: start; text-decoration: none; position: relative; padding: 14px 0 10px; }
.spine .cover { transition: transform .15s; }
.spine:hover .cover { transform: translateY(-6px) rotate(-1.5deg); }
.spine:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.spine b { font-size: 13px; line-height: 1.25; font-weight: 600; }
.spine .tag {
  position: absolute; top: 0; left: -4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--gold); color: var(--ink); white-space: nowrap;
}
@media (max-width: 640px) { .spine { flex-basis: 92px; } }
.cover.art { padding: 0; background: var(--card); }
.cover.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
