/* Philosophy, Programs, and Prompts
   Brand colors and font come from the PPP style guide. The "-ink" and
   "-light" tints are mixed from those colors so small text stays readable
   (WCAG AA) on off-white and on black. */

:root {
  /* style guide */
  --philosophy: #C4622D;
  --code: #4A6741;
  --black: #1C1C1E;
  --paper: #F5F0E8;
  --taupe: #8C7B6B;

  /* derived for legibility */
  --philosophy-ink: #9A5029;   /* small terracotta text on paper */
  --philosophy-light: #D0865C; /* terracotta text on black */
  --code-light: #8E9E84;       /* green text on black */
  --taupe-ink: #706358;        /* muted text on paper */
  --taupe-light: #A6988A;      /* muted text on black */
  --paper-dim: #BFBBB6;        /* secondary text on black */
  --rule: rgba(140, 123, 107, 0.35);

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gradient: linear-gradient(90deg, var(--philosophy), var(--code));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--black);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

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

.wrap {
  width: min(1080px, 100% - 2rem);
  margin: 0 auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--black);
  color: var(--paper);
  padding: 0.5rem 0.9rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* ---------- Top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.topbar::after {               /* the icon's terracotta-to-green divider, laid flat */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--gradient);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.brand img { width: 36px; height: 36px; }

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
  font-size: 0.95rem;
}

.topbar nav a {
  text-decoration: none;
  font-weight: 600;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

.topbar nav a:hover { border-bottom-color: var(--code); }

.topbar nav .home-link { color: var(--taupe-ink); }
.topbar nav .home-link::before { content: "\2190\00a0"; }

/* ---------- Hero ---------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5.5rem); }

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.eyebrow {
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--taupe-ink);
}

.eyebrow .prompt { color: var(--code); font-weight: 700; margin-right: 0.35rem; }

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.7rem, 7vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.hero h1 span { display: block; }
.w-phil { color: var(--philosophy); }
.w-code { color: var(--code); }

.tagline {
  margin: 1.4rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  line-height: 1.25;
}

.lead {
  max-width: 34rem;
  margin: 1rem 0 0;
  font-size: 1.15rem;
  color: #3a3a3c;
}

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

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--black);
  border-radius: 999px;
  background: var(--black);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover { background: var(--code); border-color: var(--code); color: var(--paper); }

.btn.ghost { background: transparent; color: var(--black); }
.btn.ghost:hover { background: transparent; border-color: var(--code); color: var(--code); }

.hero-mark { margin: 0; justify-self: center; width: min(100%, 380px); }

.hero-mark img {
  width: 100%;
  border-radius: 50%;
  box-shadow: 0 30px 60px -30px rgba(28, 28, 30, 0.55);
}

/* ---------- Hosts (black band, split like the icon) ---------- */

.hosts {
  background: var(--black);
  color: var(--paper);
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.hosts h2,
.section-head h2,
.listen h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  line-height: 1.1;
}

.hosts h2 { text-align: center; }

.host-pair {
  display: grid;
  grid-template-columns: 1fr 6px 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  margin-top: 3rem;
}

.divider {
  border-radius: 3px;
  background: linear-gradient(180deg, var(--philosophy), var(--code));
}

.host { padding: 0.5rem 0; }
.host-phil { text-align: right; }

.host .glyph {
  display: flex;
  align-items: center;
  height: 4.8rem;                /* same box for both glyphs so the names line up */
  font-size: 4.5rem;
  line-height: 1;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.host-phil .glyph { font-family: Georgia, "Times New Roman", serif; color: var(--philosophy); }
.host-code .glyph { font-family: var(--mono); color: var(--code-light); font-size: 3.6rem; }
.host-phil .glyph { justify-content: flex-end; }

.host h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
}

.host .role {
  margin: 0.2rem 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.host-phil .role { color: var(--philosophy-light); }
.host-code .role { color: var(--code-light); }

.host p { margin: 0; color: var(--paper-dim); }

.host p:not(.role) { max-width: 24rem; }
.host-phil p:not(.role) { margin-left: auto; }

.host-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--philosophy);
}

.host-link:hover { color: var(--philosophy-light); }
.host-code .host-link { border-bottom-color: var(--code-light); }
.host-code .host-link:hover { color: var(--code-light); }

/* ---------- Episodes ---------- */

.episodes { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }

.episodes .wrap { max-width: 880px; }

.section-head p {
  margin: 0.6rem 0 0;
  color: var(--taupe-ink);
}

.ep-list {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.ep {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}

.ep-num {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.6rem;
  border: 1.5px solid var(--black);
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
}

.is-new .ep-num { background: var(--black); color: var(--paper); }

.ep h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.3;
}

.ep h3 a {
  text-decoration: none;
  background-image: linear-gradient(var(--code), var(--code));
  background-size: 0 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.2s, color 0.15s;
}

.ep h3 a:hover { color: var(--code); background-size: 100% 2px; }

.ep-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.5rem;
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--taupe-ink);
}

.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--code);
  color: var(--paper);
}

.tag-alt { background: transparent; color: var(--philosophy-ink); border: 1.5px solid var(--philosophy); }

/* ---------- Listen + footer ---------- */

.listen {
  background: var(--black);
  color: var(--paper);
  padding: clamp(3.5rem, 8vw, 5rem) 0 2.5rem;
  text-align: center;
  position: relative;
}

.listen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
}

.listen p { margin: 0.7rem 0 0; color: var(--paper-dim); }

.listen .actions { justify-content: center; }

.btn.light { background: var(--paper); border-color: var(--paper); color: var(--black); }
.btn.light:hover { background: var(--code-light); border-color: var(--code-light); color: var(--black); }
.btn.ghost.light { background: transparent; color: var(--paper); border-color: rgba(245, 240, 232, 0.45); }
.btn.ghost.light:hover { border-color: var(--code-light); color: var(--code-light); }

.footer {
  background: var(--black);
  color: var(--taupe-light);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.9rem;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 2rem;
  border-top: 1px solid rgba(166, 152, 138, 0.3);
  padding-top: 1.5rem;
}

.footer p { margin: 0; }
.footer a { color: var(--paper); }
.footer a:hover { color: var(--philosophy-light); }

.ttl {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--paper-dim);
  white-space: pre;
  overflow-x: auto;
}

.ttl .s { color: var(--paper); }
.ttl .p { color: var(--philosophy-light); }
.ttl .o { color: var(--code-light); }
.ttl .l { color: var(--taupe-light); }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .topbar nav { width: 100%; gap: 0.25rem 1.1rem; font-size: 0.92rem; }
  .topbar nav .home-link { margin-left: auto; }

  .hero .wrap { grid-template-columns: 1fr; }
  .hero-mark { grid-row: 1; width: 140px; justify-self: start; }

  .host-pair { grid-template-columns: 1fr; gap: 2rem; }
  .divider { height: 4px; background: var(--gradient); }
  .host-phil { text-align: left; }
  .host-phil .glyph { justify-content: flex-start; }
  .host-phil p:not(.role) { margin-left: 0; }

  .ep { grid-template-columns: 2.8rem minmax(0, 1fr); gap: 0.85rem; }
  .ep-num { height: 2.3rem; font-size: 0.85rem; }
  .ep h3 { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ==========================================================================
   Episode pages and the sources page (generated by _build/build.py)
   ========================================================================== */

.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;
}

.wrap.narrow { max-width: 880px; }

.episode-page,
.sources-page { padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(3rem, 7vw, 5rem); }

.crumbs { margin: 0 0 1.5rem; font-size: 0.92rem; }
.crumbs a { color: var(--taupe-ink); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--code); }

.ep-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.ep-head .eyebrow { margin-bottom: 0.9rem; }
.ep-head .lead a,
.section-head p a,
.ep-description a { color: inherit; text-decoration-color: var(--philosophy); text-underline-offset: 3px; }

/* click-to-play player */
.player,
.player-frame {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 2rem;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--black);
  box-shadow: 0 24px 48px -28px rgba(28, 28, 30, 0.6);
}

.player img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; transition: opacity 0.2s; }
.player:hover img { opacity: 1; }

.player .play {
  position: absolute;
  left: 50%; top: 50%;
  width: 76px; height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, background-color 0.15s;
}

.player .play::after {             /* the triangle */
  content: "";
  position: absolute;
  left: 30px; top: 22px;
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent var(--black);
}

.player:hover .play { transform: scale(1.06); background: #fff; }

.listen-row { margin-top: 1.25rem; }

.ep-description { margin-top: 2rem; max-width: 46rem; }
.ep-description p { margin: 0 0 1rem; }
.ep-description ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.ep-description li { margin-bottom: 0.3rem; }

.ep-section { margin-top: 3rem; }

.ep-section h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.75rem;
}

/* chapters */
.chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2 22rem;
  column-gap: 2.5rem;
}

.chapters li { break-inside: avoid; }

.chapters a {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.45rem 0;
  text-decoration: none;
  line-height: 1.4;
}

.chapters .ts { font-family: var(--mono); font-size: 0.85rem; color: var(--code); padding-top: 0.12rem; }
.chapters a:hover .ch-name { text-decoration: underline; text-decoration-color: var(--code); text-underline-offset: 3px; }

/* sources */
.source-list { list-style: none; margin: 0; padding: 0; }

.source { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.source:first-child { padding-top: 0.2rem; }

.src-name { font-weight: 600; line-height: 1.4; text-decoration: none; }
a.src-name:hover { color: var(--code); text-decoration: underline; text-underline-offset: 3px; }

.src-meta,
.cited-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.6rem;
  margin: 0.3rem 0 0;
  font-size: 0.86rem;
  color: var(--taupe-ink);
}

.src-meta .kind {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.src-meta .also a,
.cited-in a { color: var(--black); font-weight: 600; }

.empty { color: var(--taupe-ink); }

/* related episodes */
.related { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.related a {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
}

.related a:hover .rel-name { color: var(--code); }
.rel-why { margin: 0.25rem 0 0 4.4rem; font-size: 0.88rem; color: var(--taupe-ink); }

/* previous / next */
.ep-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.ep-pager a {
  display: block;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.3;
}

.ep-pager a span {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--taupe-ink);
}

.ep-pager .next { text-align: right; grid-column: 2; }
.ep-pager a:hover { color: var(--code); }

/* sources page */
.sources-page .ep-head .lead { max-width: 42rem; }
.biblio { margin-top: 2.5rem; border-top: 1px solid var(--rule); }
.biblio .source:first-child { padding-top: 0.9rem; }

.chip {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.76rem;
  text-decoration: none;
}

.chip:hover { border-color: var(--code); color: var(--code); }
.chip-strong { border-color: var(--black); }

@media (max-width: 760px) {
  .chapters a { grid-template-columns: 4rem minmax(0, 1fr); }
  .related a { grid-template-columns: 2.8rem minmax(0, 1fr); font-size: 1.05rem; }
  .rel-why { margin-left: 3.8rem; }
  .ep-pager { grid-template-columns: 1fr; }
  .ep-pager .next { grid-column: 1; text-align: left; }
  .player .play { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .player .play::after { left: 24px; top: 17px; border-width: 13px 0 13px 21px; }
}

@media (max-width: 480px) {
  .topbar nav .nav-minor { display: none; }   /* keep the phone nav on one line */
}
