:root {
  --bg: #0a0a0a;
  --text: #f5f5f5;
  --accent: #ffffff;
  --muted: #888888;
  --transition: 150ms ease;
  --container-max: 1400px;
  --container-pad: 40px;
  --container-pad-mobile: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Keep real content above the grain */
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
}

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

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

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* ----- Header ----- */
.site-header {
  padding-top: 8px;
  padding-bottom: 8px;
}

.site-header .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.header-logo {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  transition: opacity var(--transition);
}

.header-logo:hover {
  opacity: 0.8;
}

.header-logo img {
  height: 100px;
  width: auto;
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.primary-nav a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  transition: color var(--transition);
}

.primary-nav a:hover {
  color: var(--muted);
}

.social-nav {
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(3, 32px);
  gap: 4px 8px;
}

.social-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.social-nav svg {
  width: 18px;
  height: 18px;
  stroke: var(--text);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--transition);
}

.social-nav a:hover svg {
  stroke: var(--muted);
}

.social-nav svg.threads-icon {
  fill: var(--text);
  stroke: none;
  transition: fill var(--transition);
}

.social-nav svg.x-icon {
  fill: var(--text);
  stroke: none;
  width: 16px;
  height: 16px;
  transition: fill var(--transition);
}

.social-nav a:hover svg.threads-icon {
  fill: var(--muted);
  stroke: none;
}

.social-nav a:hover svg.x-icon {
  fill: var(--muted);
  stroke: none;
}

/* ----- Hamburger menu toggle ----- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: inherit;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  stroke: var(--text);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--transition);
}

.menu-toggle:hover svg {
  stroke: var(--muted);
}

.menu-toggle .icon-close { display: none; }
.menu-toggle .icon-open  { display: block; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.menu-toggle[aria-expanded="true"] .icon-open  { display: none; }

/* ----- Mobile footer (social icons) ----- */
.mobile-footer {
  display: none;
}

/* ----- Main shared ----- */
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* ----- Home ----- */
.home-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.home-page .site-header,
.home-page main,
.home-page .site-footer {
  min-height: 0;
}

.home-main {
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding: clamp(8px, 3vh, 32px) 0 16px;
  gap: clamp(8px, 1.8vh, 18px);
}

.home-page .wordmark {
  max-height: clamp(160px, 38vh, 400px);
  object-fit: contain;
  margin: 0 auto;
}

.home-page .tagline {
  margin-top: 0;
}

.home-page .site-footer {
  margin-top: 0;
  margin-bottom: 24px;
  padding-top: 8px;
}

.wordmark {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.tagline {
  margin-top: 48px;
  max-width: 1100px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  text-wrap: balance;
}

/* ----- Content page ----- */
.content-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.content-page .site-header,
.content-page main,
.content-page .site-footer {
  min-height: 0;
}

.content-page main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.content-page .site-footer {
  margin-top: 0;
  margin-bottom: 24px;
}

.season-heading {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  margin: 24px 0 clamp(28px, 5vh, 56px);
  color: var(--text);
}

/* Coming soon state */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(60px, 12vh, 120px) 0;
}

.coming-soon-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, rgba(245, 245, 245, 0.45));
  margin: 0 0 16px;
}

.coming-soon .season-heading {
  margin: 0 0 clamp(20px, 4vh, 36px);
}

.coming-soon-sub {
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.65;
  color: var(--muted, rgba(245, 245, 245, 0.55));
  max-width: 480px;
  margin: 0 0 clamp(32px, 6vh, 48px);
}

.coming-soon-cta {
  display: inline-block;
  padding: 14px 32px;
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.18s ease, color 0.18s ease;
}

.coming-soon-cta:hover {
  background: var(--text);
  color: var(--bg, #0a0a0a);
}

.episodes-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 80px;
  row-gap: 0;
}

.ep-row {
  display: block;
}

.ep-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(18px, 3vh, 28px) 0 clamp(10px, 1.6vh, 16px);
  border-bottom: 1px solid rgba(245, 245, 245, 0.18);
  color: var(--text);
  transition: color var(--transition), border-color var(--transition);
}

.ep-link:hover {
  color: var(--muted);
  border-bottom-color: rgba(245, 245, 245, 0.4);
}

.ep-name {
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.ep-date {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ----- About page ----- */
.about {
  max-width: 600px;
  margin: 120px auto 0;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  text-wrap: pretty;
}

.about p {
  margin: 0;
}

/* ----- Episode detail page ----- */
.episode-page main {
  padding-bottom: 80px;
}

.back-link {
  display: inline-block;
  margin: 8px 0 32px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--text);
}

.episode-hero {
  text-align: center;
  margin-bottom: 72px;
}

.episode-meta {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  font-variant-numeric: tabular-nums;
}

.episode-title-lg {
  font-size: clamp(40px, 5.5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 40px;
  text-wrap: balance;
}

.portrait-frame {
  margin: 0 auto;
  max-width: 360px;
  aspect-ratio: 1 / 1;
}

.portrait-placeholder {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(245, 245, 245, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background-image: linear-gradient(135deg, rgba(245,245,245,0.025) 25%, transparent 25%, transparent 50%, rgba(245,245,245,0.025) 50%, rgba(245,245,245,0.025) 75%, transparent 75%);
  background-size: 12px 12px;
}

.episode-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 56px;
  max-width: 1080px;
  margin: 0 auto;
}

.media-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.media-heading {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(245, 245, 245, 0.12);
}

.embed-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(245, 245, 245, 0.14);
  border-radius: 8px;
  background: rgba(245, 245, 245, 0.02);
  transition: border-color var(--transition), background var(--transition);
}

.embed-card:hover {
  border-color: rgba(245, 245, 245, 0.28);
  background: rgba(245, 245, 245, 0.04);
}

.embed-thumb {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  border: 1px solid rgba(245, 245, 245, 0.08);
}

.embed-spotify .embed-thumb {
  background: linear-gradient(135deg, #1db954 0%, #0a3d1f 100%);
  opacity: 0.45;
}

.embed-apple .embed-thumb {
  background: linear-gradient(135deg, #fc3c44 0%, #5a1518 100%);
  opacity: 0.45;
}

.embed-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.embed-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.embed-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.embed-sub {
  font-size: 12px;
  color: var(--muted);
}

.embed-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(245, 245, 245, 0.25);
  background: transparent;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.embed-play:hover {
  background: rgba(245, 245, 245, 0.08);
  border-color: rgba(245, 245, 245, 0.5);
}

.embed-youtube {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yt-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(245, 245, 245, 0.14);
  border-radius: 8px;
  background: linear-gradient(135deg, #141414, #050505);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}

.yt-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.04), transparent 60%);
  pointer-events: none;
}

.yt-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.yt-sub {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  padding: 0 24px;
}

.yt-play {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 56px;
  height: 40px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: rgba(245, 245, 245, 0.85);
  transition: color var(--transition), transform var(--transition);
}

.yt-play:hover {
  color: var(--text);
  transform: scale(1.05);
}

.yt-play svg {
  width: 100%;
  height: 100%;
}

.yt-cta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ----- Join page ----- */
.join-page main {
  padding-bottom: 80px;
}

.join-hero {
  max-width: 640px;
  margin: clamp(32px, 6vh, 80px) auto 0;
  text-align: center;
}

.join-eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 24px;
}

.join-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 24px;
  text-wrap: balance;
}

.join-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 4px;
  text-wrap: pretty;
}

.beehiiv-embed-wrapper {
  max-width: 480px;
  width: 100%;
  margin: -40px auto 0;
}

.join-form {
  margin: 0 auto;
  border: 1px solid rgba(245, 245, 245, 0.25);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.join-form:focus-within {
  border-color: var(--text);
}

.join-form input[type="email"] {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 16px 20px;
  min-width: 0;
}

.join-form input[type="email"]::placeholder {
  color: var(--muted);
}

.join-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0 24px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.join-submit:hover {
  background: var(--muted);
  color: var(--bg);
}

.join-submit-arrow {
  font-size: 14px;
  letter-spacing: 0;
}

.join-status {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.5em;
}

.join-status[data-state="ok"] {
  color: var(--text);
}

.join-status[data-state="error"] {
  color: #ff8a7a;
}

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

/* ----- Footer (legacy, retained for safety) ----- */
.site-footer {
  display: none;
}

/* ----- Tablet / Mobile Nav ----- */
@media (max-width: 768px) {
  .container {
    padding-left: var(--container-pad-mobile);
    padding-right: var(--container-pad-mobile);
  }

  .site-header {
    padding-top: 6px;
    padding-bottom: 6px;
    position: relative;
    z-index: 51;
  }

  .site-header .container {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .header-logo img {
    height: 64px;
  }

  /* Hamburger — replaces social nav in header */
  .site-header .social-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
    grid-column: 3;
    position: relative;
    z-index: 51;
  }

  /* Full-screen nav overlay */
  .primary-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 48px;
    z-index: 50;
  }

  .primary-nav.nav-open {
    display: flex;
  }

  .primary-nav a {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: 0.06em;
  }

  /* Social icons move to footer */
  .mobile-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 20px 20px;
    border-top: 1px solid rgba(245, 245, 245, 0.1);
  }

  .mobile-footer .social-nav {
    justify-self: auto;
    grid-template-columns: repeat(6, 36px);
    gap: 0 4px;
  }

  .mobile-footer .social-nav a {
    width: 36px;
    height: 36px;
  }

  .mobile-footer .social-nav svg {
    width: 18px;
    height: 18px;
  }

  .mobile-footer .social-nav svg.x-icon {
    width: 16px;
    height: 16px;
  }

  .social-nav {
    gap: 3px 6px;
  }

  .social-nav svg {
    width: 16px;
    height: 16px;
  }

  .social-nav svg.x-icon {
    width: 14px;
    height: 14px;
  }

  .wordmark {
    width: 86%;
    min-width: 220px;
    max-width: 560px;
  }

  .home-page .wordmark {
    max-height: clamp(110px, 26vh, 240px);
  }

  .tagline {
    margin-top: 20px;
    font-size: 15px;
    max-width: 560px;
  }

  .season-heading {
    font-size: 32px;
    margin: 16px 0 24px;
  }

  .episodes-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .ep-link {
    padding: 14px 0 10px;
  }

  .ep-name {
    font-size: 17px;
  }

  .ep-date {
    font-size: 12px;
  }

  .about {
    margin-top: 72px;
    font-size: 16px;
  }

  .back-link {
    margin: 4px 0 24px;
  }

  .episode-hero {
    margin-bottom: 56px;
  }

  .portrait-frame {
    max-width: 260px;
  }

  .episode-media {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .embed-card {
    grid-template-columns: 56px 1fr auto;
    padding: 12px;
  }

  .embed-thumb {
    width: 56px;
    height: 56px;
  }

  .yt-sub {
    font-size: 15px;
  }

  .join-hero {
    margin-top: 32px;
  }

  .join-sub {
    margin-bottom: 20px;
    font-size: 15px;
  }

  .beehiiv-embed-wrapper {
    max-width: 100%;
    margin-top: -24px;
  }

  .join-form input[type="email"] {
    font-size: 14px;
    padding: 14px 18px;
  }

  .join-submit {
    padding: 0 18px;
    font-size: 11px;
  }

  .site-footer {
    margin-top: 64px;
    margin-bottom: 32px;
  }
}

/* ----- Phone (narrow) ----- */
@media (max-width: 560px) {
  :root {
    --container-pad-mobile: 16px;
  }

  /* Viewport lock — home and content pages only, not join/about/episode */
  body.home-page,
  body.content-page {
    height: 100dvh;
    overflow: hidden;
  }

  body.home-page main,
  body.content-page main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .mobile-footer {
    flex-shrink: 0;
  }

  .site-header {
    padding-top: 4px;
    padding-bottom: 4px;
    position: relative;
    z-index: 51;
  }

  .site-header .container {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  .header-logo img {
    height: 56px;
  }

  .social-nav {
    gap: 2px 4px;
    grid-template-columns: repeat(3, 30px);
  }

  .social-nav a {
    width: 30px;
    height: 30px;
  }

  .social-nav svg {
    width: 15px;
    height: 15px;
  }

  .social-nav svg.x-icon {
    width: 13px;
    height: 13px;
  }
  /* Home page — locked to viewport */
  .home-page {
    height: 100dvh;
    overflow: hidden;
  }

  .home-page .mobile-footer {
    min-height: 0;
  }

  .home-page .wordmark {
    max-height: clamp(80px, 22vh, 160px);
  }

  .hero {
    padding-top: 3vh;
    padding-bottom: 3vh;
    height: auto;
    flex: 1 1 auto;
  }

  /* Content page — locked to viewport */
  .content-page {
    height: 100dvh;
    overflow: hidden;
  }

  .content-page main {
    overflow: hidden;
    justify-content: center;
  }

  .coming-soon {
    padding: 3vh 0;
  }

  .season-heading {
    font-size: 28px;
    margin: 12px 0 20px;
  }

  /* Episode detail */
  .episode-title-lg {
    font-size: clamp(28px, 9vw, 44px);
    margin-bottom: 28px;
  }

  .portrait-frame {
    max-width: 220px;
  }

  .episode-media {
    gap: 36px;
  }

  .embed-card {
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    padding: 10px;
  }

  .embed-thumb {
    width: 48px;
    height: 48px;
  }

  .embed-title {
    font-size: 14px;
  }

  .embed-play {
    width: 32px;
    height: 32px;
  }

  /* Join */
  .join-form {
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
  }

  .join-form input[type="email"] {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(245, 245, 245, 0.18);
    text-align: center;
  }

  .join-submit {
    padding: 14px 18px;
    justify-content: center;
  }
}
