/* Classically Conditioned — pond-side salon.
   Warm paper, deep pond green, Mr. Bray Labs brand fonts
   (Baloo 2 headings, Familjen Grotesk body — same as mrbray.com).
   Accessibility first: large type, high contrast, visible focus,
   no motion tricks. */

:root {
  --paper: #faf5e9;
  --paper-deep: #f1e8d2;
  --ink: #26331f;
  --ink-soft: #47543c;
  --pond: #0a2a5e;
  --pond-deep: #1e4028;
  --gold: #96690f;
  --line: #d8cbab;
  --card: #fffdf6;
  --navy: #012677;
  --navy-deep: #02103a;
  --navy-water: #062a5e;
  --cream: #f4edd8;
  --gold-bright: #e9b949;
}

* { box-sizing: border-box; }

html { font-size: 118.75%; } /* ~19px base */

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--pond-deep);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

a { color: var(--pond-deep); text-decoration-thickness: 0.08em; }
a:hover { color: var(--pond); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* header */
.site-header {
  border-bottom: 3px double rgba(233, 185, 73, 0.45);
  padding: 1.2rem 1rem 0.8rem;
  text-align: center;
  background: linear-gradient(180deg, #02103a, var(--navy));
}
.site-brand { margin: 0; font-size: 1.9rem; letter-spacing: 0.02em; }
.site-brand a { color: var(--cream); text-decoration: none; }
.site-tagline { margin: 0.2rem 0 0.8rem; color: #b9c8e8; font-style: italic; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; justify-content: center;
}
.site-nav a { font-size: 1.05rem; color: var(--cream); }
.site-nav a:hover { color: var(--gold-bright); }
.site-header::after {
  content: "";
  display: block;
  height: 12px;
  margin-top: 0.7rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12'%3E%3Cpath d='M0 6 Q 12 0 24 6 T 48 6' fill='none' stroke='%23e9b949' stroke-width='2.5'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.55;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
main:has(.episode-list) { max-width: 62rem; }

h1, h2, .site-brand { font-family: "Baloo 2", "Familjen Grotesk", sans-serif; }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0.4rem 0 0.8rem; font-weight: 800; }
h2 {
  font-size: 1.45rem; margin: 1.8rem 0 0.5rem; color: var(--pond-deep); font-weight: 600;
  text-decoration: underline wavy var(--gold) 2px;
  text-underline-offset: 6px;
}
p { margin: 0.6rem 0; }
.lede { font-size: 1.2rem; }
.note { color: var(--ink-soft); font-size: 0.95rem; font-style: italic; }

/* hero */
.hero { display: grid; gap: 1.4rem; align-items: center; margin-bottom: 1rem; position: relative; }
.pads { position: absolute; left: -4px; bottom: -16px; width: 150px; height: 92px; pointer-events: none; }
.pad { position: absolute; animation: bob 5s ease-in-out infinite alternate; }
.pad-a { width: 92px; left: 0; bottom: 0; }
.pad-b { width: 56px; left: 76px; bottom: 30px; animation-delay: 1.2s; }
.pad-c { width: 38px; left: 38px; bottom: 56px; animation-delay: 2.1s; }
@keyframes bob {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-6px) rotate(2deg); }
}
.theme-play { margin: 1.1rem 0 0; }
.theme-play figcaption {
  font-family: "Baloo 2", "Familjen Grotesk", sans-serif;
  font-weight: 600;
  color: var(--pond-deep);
  margin-bottom: 0.3rem;
}
.theme-play audio { width: 100%; max-width: 22rem; }
.hero-art {
  display: block;
  width: 100%; max-width: 330px; height: auto;
  margin: 0 auto;
  /* The ink drawing sits straight on the paper — no box, no frame. */
}
@media (min-width: 760px) {
  .hero { grid-template-columns: 1fr 1.15fr; }
}
.button {
  display: inline-block;
  background: var(--pond);
  color: #fff !important;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: "Baloo 2", "Familjen Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.08rem;
  margin: 0.5rem 0;
  transition: transform 0.15s ease, background 0.15s ease;
}
.button:hover { background: var(--pond-deep); transform: translateY(-2px); }

/* funnel / newsletter */
.funnel {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--gold);
  border-radius: 8px;
  padding: 1rem 1.3rem 1.2rem;
  margin: 2rem 0;
}
.newsletter label { display: block; font-weight: bold; margin-bottom: 0.3rem; }
.nl-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.nl-row input {
  flex: 1 1 16rem;
  font: inherit;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--ink-soft);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.nl-row button {
  font: inherit;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}
.nl-row button:hover { background: #7a560c; }

/* episode cards + lists */
.episode-cards { list-style: none; padding: 0; }
.episode-cards li {
  margin: 0.6rem 0;
  font-size: 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--pond);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.episode-cards li:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(38, 51, 31, 0.14);
}

.filters {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}
.filters label { display: block; font-weight: bold; margin-bottom: 0.25rem; }
.filters input, .filters select {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--ink-soft);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-width: 15rem;
}

.episode-list { list-style: none; padding: 0; margin: 0; }
.ep-row { border-bottom: 1px solid var(--line); }
.ep-row a {
  display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; align-items: baseline;
  padding: 0.65rem 0.4rem; text-decoration: none;
}
.ep-row a:hover { background: var(--paper-deep); }
.ep-num { color: var(--gold); min-width: 6.2rem; font-size: 0.95rem; font-weight: 600; }
.ep-title { font-size: 1.08rem; text-decoration: underline; text-decoration-thickness: 0.06em; }
.ep-topic {
  margin-left: auto;
  color: var(--pond-deep);
  background: #e6eeda;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.12rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ep-row[hidden] { display: none; }

/* episode pages */
.ep-meta { color: var(--ink-soft); font-style: italic; }
.player {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1.2rem 0 1.6rem;
}
.player audio { width: 100%; }
.player .note { margin-bottom: 0; }
.credit {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 1.2rem 1rem;
  margin-top: 2rem;
}
.credit h2 { margin-top: 0.6rem; }
.ep-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 2rem; font-size: 1.05rem;
}
.back { margin-bottom: 0; }

/* archive */
.module-list { line-height: 1.9; }
.module-list .ep-topic { margin-left: 0.5rem; }

/* footer */
.site-footer {
  border-top: 3px double var(--line);
  background: var(--paper-deep);
  text-align: center;
  padding: 1.4rem 1rem 2rem;
  color: var(--ink-soft);
}
.site-footer .signoff { font-style: italic; color: var(--pond-deep); font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  .button, .episode-cards li { transition: none; }
  .button:hover, .episode-cards li:hover { transform: none; }
  .pad { animation: none; }
}

/* ——— Night pond hero (Nov 24 redesign, Jesse's direction) ———
   Light Sigmund on Mr. Bray Labs navy, twinkling stars, a pond with
   a moonlight path and the Doctor's reflection. */
.night-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: -1.5rem;
  overflow: hidden;
  background: linear-gradient(180deg, #010a2a 0%, var(--navy) 46%, #0a3a8f 68%, var(--navy-water) 78%, #031b45 100%);
  color: var(--cream);
}
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i {
  position: absolute;
  border-radius: 50%;
  background: #fdf6da;
  animation: twinkle 3.4s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.15; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1.2); }
}
.moon {
  position: absolute;
  top: 34px; right: 6.5%;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fffbe8, #f4edd8 55%, #e3d3a1);
  box-shadow: 0 0 34px 10px rgba(244, 237, 216, 0.35), 0 0 110px 44px rgba(244, 237, 216, 0.13);
}
.night-grid {
  position: relative;
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.6rem 1rem 0;
  display: grid;
  gap: 1.6rem;
  align-items: start;
}
@media (min-width: 760px) {
  .night-grid { grid-template-columns: 0.92fr 1.08fr; }
}
.night-art { position: relative; text-align: center; }
.night-art .hero-art { max-width: 350px; filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.45)); }
.reflection-wrap {
  height: 118px;
  overflow: hidden;
  margin-top: 2px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.85), transparent 92%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.85), transparent 92%);
}
.reflection {
  width: 100%; max-width: 350px; height: auto;
  transform: scaleY(-1);
  transform-origin: top center;
  opacity: 0.34;
  filter: blur(1.2px);
  animation: ripple 5.5s ease-in-out infinite alternate;
}
@keyframes ripple {
  from { transform: scaleY(-1) translateX(-3px) skewX(-0.7deg); }
  to { transform: scaleY(-1) translateX(3px) skewX(0.7deg); }
}
.night-text h1 { color: var(--cream); font-size: 2.6rem; margin-top: 0.6rem; }
.night-text .lede { color: #dfe7fa; }
.night-text a { color: var(--gold-bright); }
.button-gold {
  background: var(--gold-bright);
  color: var(--navy-deep) !important;
}
.button-gold:hover { background: #f6cd6b; }
.night-hero .theme-play figcaption { color: var(--cream); }
.pond-line {
  position: relative;
  height: 86px;
  margin-top: -8px;
  background: linear-gradient(180deg, rgba(6, 42, 94, 0) 0%, rgba(3, 24, 66, 0.55) 55%, rgba(2, 16, 58, 0.9) 100%);
}
.moonpath {
  position: absolute;
  top: 0; right: 5.2%;
  width: 96px; height: 100%;
  background: linear-gradient(180deg, rgba(244, 237, 216, 0.5), rgba(244, 237, 216, 0.05) 78%);
  filter: blur(5px);
  animation: shimmer 4.2s ease-in-out infinite alternate;
}
@keyframes shimmer {
  from { opacity: 0.55; transform: scaleX(0.92); }
  to { opacity: 0.95; transform: scaleX(1.08); }
}
.night-hero .pads { left: 4.5%; bottom: 12px; z-index: 2; }

/* animated letters */
.ltr-word { display: inline-block; white-space: nowrap; }
.ltr {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(2.5deg);
  animation: ltr-in 0.65s cubic-bezier(0.2, 0.7, 0.3, 1.25) forwards;
  animation-delay: calc(var(--i) * 48ms + 150ms);
}
@keyframes ltr-in { to { opacity: 1; transform: none; } }

/* ——— Branded waveform player ——— */
.frog-player {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: linear-gradient(180deg, #0a2e6e, var(--navy));
  border: 1px solid rgba(233, 185, 73, 0.45);
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  color: var(--cream);
  box-shadow: 0 4px 16px rgba(2, 16, 58, 0.25);
}
.fp-btn {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--gold-bright);
  color: var(--navy-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.fp-btn:hover { background: #f6cd6b; transform: translateY(-1px); }
.fp-wave {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  cursor: pointer;
  padding: 2px 0;
}
.fp-wave span {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: rgba(244, 237, 216, 0.32);
  transition: background 0.2s ease;
}
.fp-wave span.on { background: var(--gold-bright); }
.frog-player.playing .fp-wave span {
  animation: fp-pulse 0.9s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}
@keyframes fp-pulse {
  from { transform: scaleY(0.72); }
  to { transform: scaleY(1.05); }
}
.fp-time {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: #dfe7fa;
  min-width: 5.6rem;
  text-align: right;
}
.fp-engine { display: none; }
.night-hero .frog-player { background: rgba(2, 16, 58, 0.45); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .stars i, .reflection, .moonpath, .frog-player.playing .fp-wave span { animation: none; }
  .ltr { opacity: 1; transform: none; animation: none; }
}

/* Page-wide star sparkle — gold dust over the paper, stars over the pond. */
.stars-page { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.stars-page i {
  position: absolute; border-radius: 50%; background: #E9B949;
  animation: twinkle 3.4s ease-in-out infinite alternate;
}
body > header, body > main, body > footer { position: relative; z-index: 1; }
