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

body {
  background: #000;
  color: #fff;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", Menlo, Consolas, monospace;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: page-in 0.25s ease;
}

body.leaving {
  opacity: 0;
  transition: opacity 0.2s ease;
}

@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Titre machine à écrire ---------- */

.title {
  font-size: clamp(48px, 10vw, 110px);
  font-weight: 700;
  letter-spacing: -2px;
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}

body.subpage .title {
  font-size: clamp(36px, 7vw, 80px);
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.12em;
  margin-left: 0.12em;
  background: #fff;
  animation: blink 1s steps(1) infinite;
  flex: none;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- Pilule glassmorphisme ---------- */

nav {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateX(-50%) translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.typed nav,
body.subpage nav {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

nav a {
  color: #9a9a9a;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

nav a.brand {
  color: #fff;
  font-weight: 700;
}

nav a.brand:hover {
  background: none;
}

nav .sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 6px;
}

@media (max-width: 720px) {
  nav {
    top: 16px;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    gap: 0;
  }

  nav a {
    font-size: 11px;
    padding: 8px 9px;
  }

  /* le séparateur et l'espace qu'il coûte : superflus quand chaque pixel compte */
  nav .sep {
    display: none;
  }

  /* pages centrées (accueil, contact, newsletter) : respiration latérale */
  body:not(.article) main {
    padding: 0 20px;
  }
}

/* écrans très bas (téléphone en paysage) : le footer fixe chevaucherait le contenu */
@media (max-height: 500px) {
  body:not(.article) {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 96px;
  }

  body:not(.article) footer {
    position: static;
    margin-top: 48px;
    padding-bottom: 24px;
  }
}

/* ---------- Contenu sous le titre ---------- */

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.after {
  font-size: 15px;
  color: #6a6a6a;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
  max-width: calc(100vw - 48px);
  text-align: center;
}

body.typed .after {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Pages article (index épisodes, page épisode) ---------- */

body.article {
  display: block;
}

body.article main {
  display: block;
  max-width: 760px;
  margin: 0 auto;
  padding: 140px 24px 96px;
}

body.article .title {
  font-size: clamp(28px, 5vw, 52px);
  letter-spacing: -1px;
  white-space: normal;
  margin-bottom: 8px;
}

.meta {
  font-size: 13px;
  color: #6a6a6a;
  margin-bottom: 40px;
}

.meta a {
  color: #9a9a9a;
}

/* liste d'épisodes */

.ep-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.ep-list a {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid #1c1c1c;
  text-decoration: none;
  color: inherit;
}

.ep-list a:hover .ep-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ep-num {
  font-size: 12px;
  color: #6a6a6a;
}

.ep-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 6px 0;
}

.ep-desc {
  font-size: 14px;
  color: #9a9a9a;
  line-height: 1.6;
}

/* page épisode */

.player {
  margin: 0 0 16px;
}

.player audio {
  width: 100%;
}

.platforms {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.platforms a {
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  border: 1px solid #4a4a4a;
  border-radius: 999px;
  padding: 10px 20px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.platforms a:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

article h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 48px 0 16px;
}

article p,
article li {
  font-size: 15px;
  line-height: 1.8;
  color: #c9c9c9;
}

article ul,
article ol {
  padding-left: 24px;
}

.chapters {
  list-style: none;
  padding: 0;
}

.chapters li {
  padding: 8px 0;
  border-bottom: 1px solid #1c1c1c;
}

.chapters .time {
  color: #6a6a6a;
  margin-right: 16px;
}

.transcript h3 {
  font-size: 15px;
  color: #fff;
  margin: 32px 0 8px;
}

/* ---------- Formulaire newsletter ---------- */

.nl-form {
  display: flex;
  align-items: baseline;
  gap: 0;
  border-bottom: 2px solid #fff;
  padding-bottom: 8px;
  max-width: 420px;
  width: 100%;
}

.nl-form .prompt-char {
  font-size: 18px;
  font-weight: 700;
  margin-right: 12px;
}

.nl-form input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  caret-color: #fff;
}

.nl-form input::placeholder {
  color: #4a4a4a;
}

.nl-form button {
  background: none;
  border: none;
  color: #6a6a6a;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 0 12px;
  transition: color 0.2s ease;
}

.nl-form button:hover {
  color: #fff;
}

.nl-note {
  font-size: 13px;
  color: #6a6a6a;
  margin-top: 16px;
}

.nl-ok {
  font-size: 16px;
  color: #fff;
  display: none;
}

.after a {
  color: #9a9a9a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.after a:hover {
  color: #fff;
}

.contact-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.contact-block > p > a {
  color: #fff;
}

.contact-block .platforms {
  margin-bottom: 0;
  justify-content: center;
}

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

footer {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0 16px;
  font-size: 12px;
  color: #4a4a4a;
}

footer a {
  color: #6a6a6a;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #fff;
}

body.article footer {
  position: static;
  margin-top: 64px;
  padding: 32px 24px 40px;
  border-top: 1px solid #1c1c1c;
}

/* ---------- Accessibilité : mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }

  body,
  nav,
  .after {
    animation: none;
    transition: none;
  }
}
