/* ==========================================================================
   Creedal / The Future is Human — stylesheet
   Flat color fields, generous whitespace, editorial confidence.
   ========================================================================== */

:root {
  --blue: #3231e1;
  --blue-dark: #2321b8;
  --yellow: #f7ce46;
  --paper: #f7f6f1;
  --white: #ffffff;
  --ink: #191a3e;
  --ink-soft: rgba(25, 26, 62, 0.68);
  --ink-faint: rgba(25, 26, 62, 0.45);

  /* Rosary-only palette — must not leak outside #rosary. */
  --mint: #5fd99a;
  --navy: #17386b;

  --radius: 14px;
  --radius-lg: 20px;
  --content-width: 1100px;

  --font-head: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-script: "Caveat", cursive;

  --shadow-card: 0 2px 24px rgba(25, 26, 62, 0.08);
}

/* ---- Reset ---------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0;
  line-height: 1.15;
}

p {
  margin: 0;
  line-height: 1.6;
}

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

.script {
  font-family: var(--font-script);
  font-weight: 700;
  font-style: normal;
}

.script-dot {
  color: var(--yellow);
}

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

.eyebrow {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
}

.section-heading {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 12px;
}

.section-heading .script {
  font-size: 1.35em;
}

.section-lede {
  max-width: 640px;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

/* ---- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}
.btn-primary:hover { background: #ffdb6b; }

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

.btn-pill-yellow {
  background: var(--yellow);
  color: var(--ink);
  padding: 9px 20px;
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
}
.btn-pill-yellow:hover { background: #ffdb6b; }

.btn-outline-ink {
  background: transparent;
  border-color: rgba(25, 26, 62, 0.25);
  color: var(--ink);
}
.btn-outline-ink:hover {
  border-color: var(--ink);
  background: rgba(25, 26, 62, 0.04);
}

/* ---- Nav ---------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(50, 49, 225, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.35rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a:not(.btn-pill-yellow) {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.94rem;
}
.nav-links a:not(.btn-pill-yellow):hover { color: #fff; }

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle::before { margin-bottom: 6px; }
.nav-toggle::after { margin-top: 6px; }

.nav[data-open="true"] .nav-toggle::before { transform: translateY(8px) rotate(45deg); }
.nav[data-open="true"] .nav-toggle::after { transform: translateY(-8px) rotate(-45deg); }
.nav[data-open="true"] .nav-toggle span { opacity: 0; }

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

.hero {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  padding: 88px 0 64px;
}

.hero-eyebrow {
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 18px;
}

.hero-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  line-height: 1.08;
  margin: 0;
}

.hero-title .script {
  display: block;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(4.2rem, 11vw, 7.5rem);
  line-height: 0.95;
  margin-top: 0.06em;
}

.hero-sub {
  margin-top: 28px;
  max-width: 620px;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---- Player ---------------------------------------------------------- */

.player-section {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 0 0 96px;
}

.player-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
}

.player-now {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.player-now img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
}

.player-now-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.player-now-meta {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.player-btn {
  background: transparent;
  border: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.player-btn:hover { color: var(--blue); }

.play-toggle {
  width: 58px;
  height: 58px;
  background: var(--blue);
  color: #fff;
  flex-shrink: 0;
}
.play-toggle:hover { background: var(--yellow); color: var(--ink); }
.play-toggle svg { width: 22px; height: 22px; }

.skip-btn {
  width: 42px;
  height: 42px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-head);
  background: rgba(25, 26, 62, 0.06);
}
.skip-btn:hover { background: rgba(50, 49, 225, 0.12); }

.speed-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(25, 26, 62, 0.06);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
}
.speed-btn:hover { background: rgba(50, 49, 225, 0.12); }

.seek-wrap {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.time {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--ink-faint);
  min-width: 42px;
}
.time.total { text-align: right; }

input[type="range"].seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--blue) 0%,
    var(--blue) var(--seek-pct, 0%),
    rgba(25, 26, 62, 0.12) var(--seek-pct, 0%),
    rgba(25, 26, 62, 0.12) 100%
  );
  outline: none;
}
input[type="range"].seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px rgba(25, 26, 62, 0.25);
  cursor: pointer;
}
input[type="range"].seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px rgba(25, 26, 62, 0.25);
  cursor: pointer;
  border: none;
}
input[type="range"].seek::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--blue);
}

.player-error {
  margin-top: 14px;
  font-size: 0.9rem;
  color: #b3231b;
  display: none;
}
.player-error.visible { display: block; }

.episode-list {
  margin-top: 24px;
  border-top: 1px solid rgba(25, 26, 62, 0.08);
  padding-top: 12px;
  max-height: 420px;
  overflow-y: auto;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  font-family: var(--font-body);
  color: var(--ink);
}

.episode-row:hover { background: rgba(50, 49, 225, 0.06); }

.episode-row[aria-current="true"] {
  background: rgba(50, 49, 225, 0.1);
}

.episode-row .row-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(25, 26, 62, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}
.episode-row[aria-current="true"] .row-icon {
  background: var(--blue);
  color: #fff;
}
.episode-row .row-icon svg { width: 13px; height: 13px; }

.episode-row .row-title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-row .row-meta {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  display: flex;
  gap: 12px;
}

.episode-list-status {
  padding: 24px 10px;
  color: var(--ink-faint);
  font-size: 0.95rem;
}

/* ---- Featured episodes ---------------------------------------------- */

.section {
  padding: 88px 0;
}

.featured-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.featured-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.featured-card .guest {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--blue);
}

.featured-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.featured-card p.blurb {
  color: var(--ink-soft);
  font-size: 0.96rem;
  flex: 1;
}

.play-episode-btn {
  align-self: flex-start;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s ease;
}
.play-episode-btn:hover { background: var(--blue); }
.play-episode-btn svg { width: 12px; height: 12px; }

/* ---- Substack band ---------------------------------------------------- */

.substack-band {
  background: var(--yellow);
  padding: 72px 0;
}

.substack-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}

.substack-copy h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin-bottom: 14px;
}

.substack-copy p {
  color: rgba(25, 26, 62, 0.78);
  font-size: 1.05rem;
  max-width: 460px;
}

.substack-embed-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.substack-embed-card iframe {
  width: 100%;
  border: none;
  background: #fff;
}

.substack-fallback {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
}

/* ---- Rosary ---------------------------------------------------------- */

.rosary-section {
  background: var(--navy);
  color: #fff;
  padding: 96px 0;
}

.rosary-inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: start;
}

.rosary-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 96px;
}

.rosary-heading {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 16px;
}

.rosary-heading .script { color: var(--mint); }
.rosary-heading .script-dot { color: var(--mint); }

.rosary-copy {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 30px;
}

.rosary-tracks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 32px;
}

.rosary-track {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-align: left;
  font-family: var(--font-body);
}

.rosary-track:hover { background: rgba(255, 255, 255, 0.09); }

.rosary-track[aria-current="true"] {
  background: rgba(95, 217, 154, 0.16);
}

.rosary-track .row-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mint);
}
.rosary-track[aria-current="true"] .row-icon {
  background: var(--mint);
  color: var(--navy);
}
.rosary-track .row-icon svg { width: 12px; height: 12px; }

.rosary-track .row-title {
  flex: 1;
  font-size: 0.94rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rosary-track .row-meta {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.rosary-subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.rosary-subscribe .btn-ghost {
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---- Archive ---------------------------------------------------------- */

.archive-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.archive-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(25, 26, 62, 0.07);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.archive-card:hover {
  border-color: rgba(50, 49, 225, 0.3);
  transform: translateY(-2px);
}

.archive-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

.archive-card h3 {
  font-size: 1rem;
}

.archive-card p {
  font-size: 0.86rem;
  color: var(--ink-soft);
  flex: 1;
}

.archive-card .archive-link {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--blue);
}

/* ---- About ---------------------------------------------------------- */

.about-section {
  background: var(--white);
}

.about-content {
  max-width: 680px;
}

.about-content p {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.about-content p.thesis {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--ink);
  font-size: 1.2rem;
}

/* ---- Footer ---------------------------------------------------------- */

.site-footer {
  background: var(--blue);
  color: rgba(255, 255, 255, 0.85);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-inner .wordmark { font-size: 1.15rem; }

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
}
.footer-links a:hover { color: #fff; }

.footer-copyright {
  width: 100%;
  margin-top: 28px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .rosary-inner { grid-template-columns: 1fr; }
  .rosary-art { position: static; max-width: 360px; }
  .substack-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--blue-dark);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 28px;
    gap: 18px;
    display: none;
  }
  .nav[data-open="true"] .nav-links { display: flex; }
  .nav-toggle { display: flex; }

  .featured-grid { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: 1fr; }

  .player-now { grid-template-columns: 72px 1fr; }

  .section { padding: 64px 0; }
  .player-card { padding: 20px; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

.episode-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: contents;
}
.episode-rows li {
  display: contents;
}
