:root {
  --paper: #faf7f2;
  --paper-raised: #ffffff;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --ink-faint: #8a8380;
  --accent: #b45309;
  --accent-strong: #92400e;
  --accent-ink: #fffdf9;
  --accent-soft: #fef3c7;
  --accent-mark: #fde68a;
  --border: #e9e1d6;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06), 0 8px 24px rgba(28, 25, 23, 0.06);
  --shadow-lift: 0 2px 4px rgba(28, 25, 23, 0.08), 0 12px 32px rgba(180, 83, 9, 0.18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px;
  --header-h: 3.5rem;
  --focus-ring: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131110;
    --paper-raised: #1e1b17;
    --ink: #ede6dd;
    --ink-soft: #b8afa6;
    --ink-faint: #8a8178;
    --accent: #f5a524;
    --accent-strong: #f5a524;
    --accent-ink: #1c1917;
    --accent-soft: #2d2410;
    --accent-mark: #6b5210;
    --border: #2e2822;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(245, 165, 36, 0.16);
  }
}

* {
  box-sizing: border-box;
}

/* Garde-fou : l'attribut hidden gagne toujours sur les display CSS
   (ex. .generation-steps en flex restait visible malgré hidden). */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

::selection {
  background: var(--accent-mark);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

.ic {
  flex: none;
  vertical-align: -3px;
}

/* Fine barre de progression lecture (autoportante, zéro texte) */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 30;
  background: transparent;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: width 0.1s linear;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-text span {
  color: var(--accent);
}

/* Logo SipRead : livre ouvert + tasse posée dans le pli, vapeur au-dessus.
   Le livre est à l'encre, le café et la vapeur reprennent l'accent. */
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--ink);
  flex: none;
}

.logo-mark svg {
  width: 1.35rem;
  height: 1.35rem;
}

.logo-book {
  stroke: currentColor;
  stroke-width: 2;
  fill: var(--paper-raised);
}

.logo-steam {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
}

.logo-coffee {
  fill: var(--accent);
  stroke: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Pastille streak : flamme SVG + nombre, lien vers /archive */
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  text-decoration: none;
  min-height: 32px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.streak-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.streak-pill .ic {
  color: var(--accent);
}

.site-nav a {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--ink);
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  background: var(--paper-raised);
  cursor: pointer;
}

.lang-option {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  color: var(--ink-faint);
  transition: all 0.15s ease;
}

.lang-option.active {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Header mobile : le desktop (≥42rem) est intact, on ne fait
   qu'éviter l'écrasement des liens sur petit écran (mots collés/coupés). */
@media (max-width: 560px) {
  .header-inner {
    height: auto;
    min-height: 3.5rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .wordmark {
    font-size: 1.02rem;
  }

  .logo-mark {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 0.55rem;
  }

  .logo-mark svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .site-nav {
    gap: 0.85rem;
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }

  .site-nav a {
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .lang-option {
    font-size: 0.68rem;
    padding: 0.18rem 0.5rem;
  }
}

/* ---------- Lecture ---------- */

.lang-block[hidden] {
  display: none !important;
}

main.container {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.reading-meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.meta-author {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent);
}

.reading-info {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.reading-actions {
  margin-top: 1rem;
}

.reading-actions--top {
  margin-bottom: 0.25rem;
}

/* Bouton Nouvelle lecture : ambre primaire + variante ghost haute */
.btn-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border: 1px solid transparent;
  padding: 0.8rem 1.7rem;
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  min-height: 48px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-new:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-new:active {
  transform: scale(0.98);
}

.btn-new--ghost {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  min-height: 36px;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: none;
}

.btn-new--ghost:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-new--large {
  font-size: 1.02rem;
  padding: 0.9rem 2rem;
}

.new-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.new-link:hover {
  text-decoration: underline;
}

/* Carte citation */

.highlight-card {
  position: relative;
  overflow: hidden;
  margin: 1.75rem 0;
  padding: 1.6rem 1.75rem 1.4rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
}

.highlight-card::before {
  content: "“";
  position: absolute;
  top: -0.9rem;
  left: 0.6rem;
  font-size: 5rem;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 22%, transparent);
  pointer-events: none;
}

.highlight-card blockquote {
  position: relative;
  margin: 0;
  font-size: 1.28rem;
  font-style: italic;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.highlight-card figcaption {
  margin-top: 1rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  min-height: 36px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--accent);
  color: var(--paper);
}

.copy-btn.copied {
  background: var(--accent);
  color: var(--paper);
}

/* Texte */

.reading-text {
  margin-top: 2rem;
  font-size: 1.19rem;
  line-height: 1.78;
  letter-spacing: -0.005em;
}

.reading-text p {
  margin: 0 0 1.4rem;
  text-wrap: pretty;
}

.reading-text mark {
  background: var(--accent-mark);
  color: var(--ink);
  padding: 0.1em 0.15em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

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

.page-title {
  font-size: 1.6rem;
  margin: 0 0 1.5rem;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-item a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--paper-raised);
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 0.75rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.archive-item a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.archive-item .ic {
  margin-left: auto;
  color: var(--ink-faint);
  flex: none;
}

.archive-item a:hover .ic {
  color: var(--accent);
  transform: translateX(2px);
}

.archive-dot {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.archive-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.archive-item--today {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.archive-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  vertical-align: 1px;
}

.archive-date {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.archive-title {
  font-size: 1.05rem;
}

.archive-origin {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--accent);
}

/* ---------- États vides / erreurs ---------- */

.welcome-state {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  text-align: center;
}

.welcome-state .eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-state h1 {
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.welcome-copy {
  max-width: 29rem;
  margin: 1.25rem auto 1.75rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.65;
}

.welcome-hint {
  margin: 0.85rem 0 0;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.75rem;
}

.generation-inline-error {
  max-width: 26rem;
  margin: 1rem auto 0;
  color: #b91c1c;
  font-family: var(--sans);
  font-size: 0.82rem;
}

.generate-reading-btn[disabled] {
  cursor: wait;
  opacity: 0.75;
}

.book-animation {
  position: relative;
  width: 11rem;
  height: 11.5rem;
  margin: 0 auto 1.5rem;
  perspective: 700px;
}

/* Le livre flotte (enfant) pendant que .book-sipper (parent) se penche
   vers la tasse au moment de la gorgée : les deux transforms se composent. */
.book-sipper {
  position: absolute;
  top: 3.9rem;
  left: 50%;
  width: 5.2rem;
  height: 6.4rem;
  margin-left: -2.6rem;
  transform-origin: 30% 85%;
  animation: sip-lean 7s ease-in-out infinite;
}

.book {
  position: absolute;
  inset: 0;
  transform: rotate(-7deg);
  transform-style: preserve-3d;
  animation: book-float 4s ease-in-out infinite;
}

@keyframes sip-lean {
  0%, 55%, 100% { transform: rotate(0) translate(0, 0); }
  66%, 80% { transform: rotate(8deg) translate(0.25rem, 0.1rem); }
}

.book-cover {
  position: absolute;
  z-index: 3;
  inset: 0 0 0 0.45rem;
  border-radius: 2px 8px 8px 2px;
  background: linear-gradient(135deg, var(--accent), #92400e);
  box-shadow: 0.3rem 0.35rem 0 rgba(120, 53, 15, 0.22), 0.55rem 0.7rem 1.2rem rgba(28, 25, 23, 0.16);
  color: #fff7ed;
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.book-cover::after {
  position: absolute;
  inset: 0.45rem;
  border: 1px solid rgba(255, 247, 237, 0.35);
  border-radius: 1px 5px 5px 1px;
  content: '';
}

.book-face {
  position: absolute;
  inset: 0;
}

.eye {
  position: absolute;
  top: 1.7rem;
  width: 0.72rem;
  height: 0.9rem;
  background: #fffdf9;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  animation: blink 5.2s infinite;
}

.eye-left {
  left: 1.15rem;
}

.eye-right {
  right: 1.15rem;
}

.pupil {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 0.3rem;
  height: 0.36rem;
  margin: -0.18rem 0 0 -0.15rem;
  background: #1c1917;
  border-radius: 50%;
  animation: look 7s ease-in-out infinite;
}

.pupil::after {
  content: '';
  position: absolute;
  left: 15%;
  top: 12%;
  width: 0.1rem;
  height: 0.1rem;
  background: #fff;
  border-radius: 50%;
}

.cheek {
  position: absolute;
  top: 2.75rem;
  width: 0.42rem;
  height: 0.3rem;
  border-radius: 50%;
  background: #fda4af;
  opacity: 0.55;
  animation: cheek-sip 7s ease-in-out infinite;
}

@keyframes cheek-sip {
  0%, 55%, 100% { opacity: 0.55; }
  66%, 80% { opacity: 0.9; }
}

.cheek-left {
  left: 0.8rem;
}

.cheek-right {
  right: 0.8rem;
}

.smile {
  position: absolute;
  top: 2.85rem;
  left: 50%;
  width: 1.05rem;
  height: 0.55rem;
  margin-left: -0.525rem;
  border-bottom: 2.5px solid #fff7ed;
  border-radius: 0 0 1rem 1rem;
  animation: smile-sip 7s ease-in-out infinite;
}

/* La bouche s'élargit pendant la gorgée : le livre savoure. */
@keyframes smile-sip {
  0%, 55%, 100% { width: 1.05rem; margin-left: -0.525rem; }
  66%, 80% { width: 1.3rem; margin-left: -0.65rem; }
}

.book-mark {
  position: absolute;
  z-index: 4;
  top: -0.05rem;
  right: 0.7rem;
  width: 0.55rem;
  height: 1.7rem;
  background: #991b1b;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

.spark {
  position: absolute;
  color: var(--accent);
  font-size: 0.75rem;
  animation: twinkle 2.6s ease-in-out infinite;
}

.spark-1 {
  top: 3.2rem;
  left: 0.4rem;
}

.spark-2 {
  top: 4.6rem;
  right: 0.1rem;
  animation-delay: 0.9s;
}

.spark-3 {
  top: 6.4rem;
  left: 1rem;
  font-size: 0.6rem;
  animation-delay: 1.7s;
}

.speech-bubble {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  max-width: 11.5rem;
  background: #fffdf9;
  border: 2.5px solid #1c1917;
  border-radius: 1.2rem;
  padding: 0.55rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  color: #1c1917;
  box-shadow: 3px 3px 0 rgba(28, 25, 23, 0.9);
  transform: rotate(-2deg);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  margin-left: -7px;
  width: 12px;
  height: 12px;
  background: #fffdf9;
  border-right: 2.5px solid #1c1917;
  border-bottom: 2.5px solid #1c1917;
  transform: rotate(45deg);
}

.speech-bubble.speech-pop {
  animation: speech-pop 0.4s ease;
}

@keyframes speech-pop {
  0% { transform: rotate(-2deg) scale(0.85); opacity: 0.3; }
  60% { transform: rotate(-2deg) scale(1.06); opacity: 1; }
  100% { transform: rotate(-2deg) scale(1); opacity: 1; }
}

/* Desktop : bulle BD accrochée en haut à droite du livre (dialogue classique).
   Mobile : centrée au-dessus (pas de débordement d'écran). */
@media (min-width: 561px) {
  .book-animation {
    width: 19rem;
  }

  .speech-bubble {
    left: auto;
    right: 0;
    margin: 0;
    max-width: 9.5rem;
    top: 0.4rem;
  }

  .speech-bubble::after {
    left: 1.4rem;
    margin-left: 0;
  }
}

@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  95.5% { transform: scaleY(0.06); }
}

@keyframes look {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2.5px, 1px); }
  50% { transform: translate(2.5px, 0); }
  75% { transform: translate(0, -1px); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(20deg); }
}

.book-pages {
  position: absolute;
  top: 0.28rem;
  width: 2.75rem;
  height: 5.85rem;
  background: #fffdf9;
  box-shadow: inset 0 0 0 1px #e7e0d8;
}

.book-pages-left {
  left: 0;
  border-radius: 5px 0 0 4px;
  transform: skewY(-4deg);
}

.book-pages-right {
  right: -0.05rem;
  border-radius: 0 6px 5px 0;
  transform: skewY(4deg);
}

.book-shadow {
  position: absolute;
  right: 0.7rem;
  bottom: 0.15rem;
  left: 0.7rem;
  height: 0.8rem;
  border-radius: 50%;
  background: rgba(28, 25, 23, 0.15);
  filter: blur(8px);
  animation: shadow-pulse 4s ease-in-out infinite;
}

/* ---------- Tasse de café du livre ---------- */

.coffee-cup {
  position: absolute;
  left: calc(50% + 1.7rem);
  bottom: 0.55rem;
  width: 2.9rem;
  height: 3.4rem;
  z-index: 3;
}

/* La tasse décolle de sa soucoupe pour rejoindre la bouche du livre,
   synchronisée avec sip-lean / smile-sip (même cycle de 7 s). */
.cup-lift {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.45rem;
  animation: sip-cup 7s ease-in-out infinite;
}

@keyframes sip-cup {
  0%, 55%, 100% { transform: translate(0, 0) rotate(0); }
  66%, 80% { transform: translate(-2.6rem, -1.7rem) rotate(-16deg); }
}

.cup-steam {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  height: 1rem;
  margin-bottom: 0.1rem;
}

.cup-steam span {
  width: 3px;
  height: 0.9rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink-faint) 70%, transparent);
  opacity: 0;
  animation: steam-rise 2.6s ease-in-out infinite;
}

.cup-steam span:nth-child(2) {
  animation-delay: 0.55s;
}

.cup-steam span:nth-child(3) {
  animation-delay: 1.1s;
}

@keyframes steam-rise {
  0% { transform: translateY(0.35rem) scaleY(0.6); opacity: 0; }
  40% { opacity: 0.9; }
  100% { transform: translateY(-0.35rem) scaleY(1.1); opacity: 0; }
}

.cup-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.cup-body {
  position: relative;
  width: 1.9rem;
  height: 1.65rem;
  background: linear-gradient(180deg, #fffdf9, #f3e9db);
  border: 2.5px solid #1c1917;
  border-radius: 0.15rem 0.15rem 0.7rem 0.7rem;
  overflow: hidden;
}

.cup-body::after {
  content: '';
  position: absolute;
  left: 0.3rem;
  top: 0.7rem;
  bottom: 0.3rem;
  width: 0.22rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.7);
}

.cup-coffee {
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  right: 0.12rem;
  height: 0.5rem;
  background: radial-gradient(ellipse at 35% 30%, #b45309, #78350f 75%);
  border-radius: 50%;
  transform-origin: center;
  animation: coffee-level 7s ease-in-out infinite;
}

/* Le café reste à niveau pendant que la tasse se penche pour verser. */
@keyframes coffee-level {
  0%, 55%, 100% { transform: rotate(0) scaleX(1); }
  66%, 80% { transform: rotate(14deg) scaleX(1.05); }
}

.cup-handle {
  width: 0.7rem;
  height: 1rem;
  margin-top: 0.15rem;
  margin-left: -2px;
  border: 2.5px solid #1c1917;
  border-left: none;
  border-radius: 0 0.6rem 0.6rem 0;
}

.cup-saucer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.45rem;
  background: #fffdf9;
  border: 2.5px solid #1c1917;
  border-radius: 50%;
}

.book-animation.is-opening .book-cover {
  animation: book-open 0.9s ease forwards;
}

@keyframes book-float {
  0%, 100% { transform: translate(0, 0) rotate(-7deg); }
  50% { transform: translate(0, -0.45rem) rotate(-4deg); }
}

@keyframes shadow-pulse {
  0%, 100% { transform: scaleX(1); opacity: 0.7; }
  50% { transform: scaleX(0.8); opacity: 0.45; }
}

@keyframes book-open {
  from { transform: rotateY(0); }
  to { transform: rotateY(-58deg); }
}

@media (prefers-reduced-motion: reduce) {
  .book,
  .book-sipper,
  .book-shadow,
  .eye,
  .pupil,
  .spark,
  .speech-bubble,
  .smile,
  .cheek,
  .cup-lift,
  .cup-steam span,
  .cup-coffee {
    animation: none !important;
  }
}

.empty-state {
  text-align: center;
  padding: 4rem 0;
}

.generating-state {
  text-align: center;
  padding: 5rem 0;
}

.generating-state h1 {
  font-size: 1.8rem;
  margin: 0.35rem 0 0.6rem;
}

.generating-state p {
  color: var(--ink-soft);
  max-width: 28rem;
  margin: 0 auto 1.5rem;
}

.generating-state .eyebrow {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.generation-spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.generation-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--ink-soft);
  max-width: 28rem;
  margin: 0 auto 2rem;
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Compat : l'ancien primaire noir devient l'ambre (nouveau .btn-new). */
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  box-shadow: var(--shadow-lift);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* ---------- Pages publiques ---------- */

.eyebrow {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

a.lang-toggle {
  text-decoration: none;
}

.author-bio {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 2rem;
  max-width: 36rem;
}

.archive-empty {
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Lecture : partage, streak ---------- */

.streak-badge {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.archive-streak {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 1.25rem 0 0;
  font-family: var(--sans);
}

.share-label {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-right: 0.15rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  min-height: 36px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.share-x {
  font-weight: 800;
  letter-spacing: -0.02em;
}

a.share-btn:hover,
button.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Écran d'attente ---------- */

.generation-eta {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.generation-live {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.loading-dots span {
  display: inline-block;
  animation: dot-blink 1.2s infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.waiting-kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
}

.new-reading-cta {
  text-align: center;
  margin: 2.75rem 0 1rem;
}

/* Landing : teaser publique + récents */
.landing-daily {
  display: block;
  max-width: 30rem;
  margin: 2.25rem auto 0;
  padding: 1.25rem 1.5rem;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.landing-daily:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.landing-daily-kicker {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.landing-daily-quote {
  display: block;
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.6;
}

.landing-daily-meta {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.landing-recent {
  max-width: 30rem;
  margin: 2rem auto 0;
  text-align: left;
}

.landing-recent-title {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 0 0 0.6rem;
}

.landing-recent ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.landing-recent li a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--paper-raised);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.landing-recent li a:hover {
  border-color: var(--accent);
}

.landing-recent-day {
  font-family: var(--sans);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.landing-recent-work {
  font-size: 0.95rem;
}

.landing-recent-more {
  margin: 0.75rem 0 0;
  font-family: var(--sans);
  font-size: 0.82rem;
}

.landing-recent-more a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.landing-recent-more a:hover {
  text-decoration: underline;
}

.generation-steps {
  list-style: none;
  margin: 0 auto 1.75rem;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.72rem;
}

.generation-steps li {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-faint);
  transition: all 0.3s ease;
}

.generation-steps li.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.waiting-quote {
  max-width: 26rem;
  margin: 0 auto 1.75rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--paper-raised);
}

.waiting-quote blockquote {
  margin: 0;
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.6;
}

.waiting-quote figcaption {
  margin-top: 0.6rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.waiting-fait-label {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.waiting-quote.quote-fade {
  animation: quote-fade 0.6s ease;
}

@keyframes quote-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.generation-status {
  font-size: 0.9rem;
}

.welcome-state .waiting-quote {
  margin-top: 1.75rem;
  margin-bottom: 0;
}
