/* ---------- Theme variables ---------- */
:root {
  --background: 46 100% 94%;
  --foreground: 147 10% 45%;
  --accent: 20 38% 42%;
  --surface: 46 60% 89%;
  --border: 40 25% 78%;
  --muted: 147 8% 55%;
  --card-shadow: 0 10px 30px -14px hsl(24 40% 25% / 0.28);
  --card-shadow-hover: 0 16px 40px -12px hsl(24 40% 25% / 0.35);
}

:root.dark {
  --background: 147 10% 45%;
  --foreground: 46 100% 94%;
  --accent: 22 62% 70%;
  --surface: 147 10% 40%;
  --border: 147 8% 55%;
  --muted: 46 30% 82%;
  --card-shadow: 0 12px 32px -14px hsl(147 40% 8% / 0.5);
  --card-shadow-hover: 0 18px 44px -12px hsl(147 40% 8% / 0.6);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100%;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "DM Serif Display", serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background-color: hsl(var(--accent) / 0.28);
}

/* Smooth the light/dark transition on themed surfaces */
body,
.page,
.nav,
.section-alt,
.episode-card,
.host-card,
.listen-link {
  transition: background-color 0.3s ease, border-color 0.3s ease,
    color 0.3s ease;
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible {
  outline: 2px solid hsl(var(--accent));
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ---------- Layout ---------- */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: hsl(var(--background));
}

.container {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Theme-swapped logos ---------- */
/* Light mode shows the peach/brown artwork; dark mode swaps the two colors.
   Compound selectors keep these above the later `.logo { display: block }` rule. */
.logo.logo--dark,
.nav-logo.nav-logo--dark {
  display: none;
}
:root.dark .logo.logo--light,
:root.dark .nav-logo.nav-logo--light {
  display: none;
}
:root.dark .logo.logo--dark {
  display: block;
}
:root.dark .nav-logo.nav-logo--dark {
  display: inline-block;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  background-color: hsl(var(--background) / 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.nav-logo {
  height: 1.7rem;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
}

.nav-links a {
  color: hsl(var(--foreground));
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.nav-links a:hover {
  opacity: 1;
}

/* ---------- Hamburger menu ---------- */
.nav-toggle {
  display: none; /* shown only on mobile via media query */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 1.4rem;
  height: 2px;
  border-radius: 2px;
  background-color: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: hsl(var(--accent));
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.theme-toggle:hover {
  opacity: 0.8;
}

.theme-toggle .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Show sun in dark mode, moon in light mode */
.icon-sun {
  display: none;
}
.icon-moon {
  display: block;
}
:root.dark .icon-sun {
  display: block;
}
:root.dark .icon-moon {
  display: none;
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.hero-inner {
  width: 100%;
  max-width: 44rem;
}

.logo {
  display: block;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto 1.25rem;
}

.title {
  font-family: "Montserrat", sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 2.5rem;
  line-height: 1.1;
  color: hsl(var(--foreground));
}

.subtitle {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  letter-spacing: 0.03em;
  font-size: 1.125rem;
  line-height: 1.4;
  margin-top: 0.25rem;
  color: hsl(var(--foreground));
}

.tagline {
  margin: 1.75rem auto 0;
  max-width: 32rem;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.5;
  color: hsl(var(--accent));
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.7rem 1.5rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--accent));
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.btn-primary {
  background-color: hsl(var(--accent));
  color: hsl(var(--background));
}

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--accent));
}

/* ---------- Sections ---------- */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background-color: hsl(var(--surface));
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}

.eyebrow {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  color: hsl(var(--accent));
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2rem;
  line-height: 1.2;
  max-width: 30ch;
  margin-bottom: 1.5rem;
}

.section-lead {
  max-width: 46rem;
  font-size: 1.15rem;
  color: hsl(var(--muted));
  margin-bottom: 2.5rem;
}

.prose {
  max-width: 46rem;
  font-size: 1.2rem;
}

.prose p + p {
  margin-top: 1.25rem;
}

.prose em {
  color: hsl(var(--accent));
}

/* ---------- Episodes ---------- */
.episode-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
}

.episode-card {
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.episode-card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--accent));
  box-shadow: var(--card-shadow-hover);
}

.badge {
  display: inline-block;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.65rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--accent));
  color: hsl(var(--accent));
  margin-bottom: 1rem;
}

.episode-title {
  font-size: 1.35rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.episode-desc {
  font-size: 1rem;
  color: hsl(var(--muted));
}

/* ---------- Listen ---------- */
.listen-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .listen-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.listen-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.85rem;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.15s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.listen-link:hover {
  transform: translateY(-3px);
  border-color: hsl(var(--accent));
  box-shadow: var(--card-shadow-hover);
}

.listen-link .icon {
  width: 1.5rem;
  height: 1.5rem;
  color: hsl(var(--accent));
  flex-shrink: 0;
}

/* ---------- Hosts & Guests ---------- */
.subsection-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.host-card {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  background-color: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 1.75rem;
  max-width: 46rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.host-card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--accent));
  box-shadow: var(--card-shadow-hover);
}

.host-avatar {
  flex-shrink: 0;
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  object-fit: cover;
  object-position: 6% center;
  box-shadow: 0 0 0 4px hsl(var(--accent) / 0.15);
}

.host-name {
  font-size: 1.5rem;
  line-height: 1.2;
}

.host-role {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: hsl(var(--accent));
  margin: 0.25rem 0 0.9rem;
}

.host-role a,
.footer a {
  color: hsl(var(--accent));
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.host-role a:hover,
.footer a:hover {
  opacity: 0.75;
}

.host-bio {
  font-size: 1.05rem;
  color: hsl(var(--muted));
}

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid hsl(var(--border));
  font-family: "Montserrat", sans-serif;
  font-size: 0.8rem;
  color: hsl(var(--muted));
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .title {
    font-size: 3.5rem;
  }
  .subtitle {
    font-size: 1.5rem;
  }
  .section-title {
    font-size: 2.5rem;
  }
}

@media (min-width: 768px) {
  .title {
    font-size: 4.25rem;
  }
  .subtitle {
    font-size: 1.75rem;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
  }
  .theme-toggle {
    margin-left: auto;
  }
  /* Collapse the links into a dropdown panel below the bar */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 0.25rem 1.5rem 0.75rem;
    font-size: 1rem;
    background-color: hsl(var(--background) / 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid hsl(var(--border));
    box-shadow: var(--card-shadow);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 0.75rem 0.25rem;
    border-bottom: 1px solid hsl(var(--border) / 0.6);
  }
  .nav-links a:last-child {
    border-bottom: none;
  }
  .host-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}
