/* =====================================================================
   VERSION ULTIME — couche de design
   Fond nuit, chapitres « papier », typo display, hero immersif,
   menu plein écran, recherche, quiz, mythes, glossaire.
   ===================================================================== */

:root {
  --night: #0c0a09;
  --night-2: #16120f;
  --night-3: #221b16;
  --cream: #f7efe4;
  --cream-soft: rgba(247, 239, 228, 0.72);
  --ember: #ff5a1f;
  --ember-2: #ff8a5c;
  --accent: #c2410c;
  --accent-soft: #fbd9c6;
  --display: "Bricolage Grotesque", "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --radius: 26px;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.55);
}

html,
body {
  overflow-x: clip;
}

html {
  scroll-padding-top: 96px;
}

body {
  background:
    radial-gradient(1200px 600px at 85% -5%, rgba(255, 90, 31, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(255, 138, 92, 0.07), transparent 60%),
    var(--night);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--ember);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--ember);
  outline-offset: 3px;
}

.top-progress {
  height: 3px;
  z-index: 200;
  background: linear-gradient(90deg, #ffb347, var(--ember), #e11d48);
  box-shadow: 0 0 14px rgba(255, 90, 31, 0.7);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 120;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(18, 14, 12, 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.topbar-inner {
  flex-direction: row !important;
  align-items: center !important;
}

.brand {
  gap: 10px;
  padding: 0 14px 0 6px;
  background: transparent;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.01em;
  width: auto !important;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ember), #e11d48);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(255, 90, 31, 0.45);
}

.topnav {
  background: transparent;
}

.topnav a {
  min-height: 38px;
  padding: 0 12px;
  color: rgba(247, 239, 228, 0.66);
  font-size: 0.88rem;
  font-weight: 700;
}

.topnav a:hover,
.topnav a.active {
  background: rgba(255, 90, 31, 0.14);
  border-color: rgba(255, 90, 31, 0.35);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.topbar-tools {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tool-btn:hover {
  background: rgba(255, 90, 31, 0.18);
  border-color: rgba(255, 90, 31, 0.5);
}

.tool-btn svg {
  width: 17px;
  height: 17px;
}

.tool-btn kbd,
.ubtn kbd {
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.72rem;
  opacity: 0.8;
}

@media (max-width: 1180px) {
  .topnav {
    display: none !important;
  }
  .topbar-inner {
    justify-content: space-between !important;
  }
}

@media (max-width: 520px) {
  .tool-btn .tool-label,
  .tool-btn kbd {
    display: none;
  }
  .brand-name {
    font-size: 0.95rem;
  }
}

/* ---------- Hero ---------- */
.uhero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: -76px;
  padding: 150px max(20px, calc((100vw - var(--page)) / 2)) 0;
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
}

.uhero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(12, 10, 9, 0.55) 0%, rgba(12, 10, 9, 0.9) 60%, var(--night) 100%),
    linear-gradient(90deg, var(--night) 0%, rgba(12, 10, 9, 0.6) 55%, rgba(12, 10, 9, 0.2) 100%),
    url("img/cantino-planisphere-1502.webp") center 30% / cover no-repeat;
  filter: saturate(0.7);
  transform: scale(1.06);
  animation: uhero-drift 30s ease-in-out infinite alternate;
}

@keyframes uhero-drift {
  to {
    transform: scale(1.14) translate(-1.5%, -1%);
  }
}

.uhero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
  min-height: min(78vh, 760px);
}

.uhero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-soft);
}

.uhero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.7);
  animation: upulse 2s infinite;
}

@keyframes upulse {
  70% {
    box-shadow: 0 0 0 10px rgba(255, 90, 31, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 31, 0);
  }
}

.uhero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.7rem, 7.4vw, 6.4rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.032em;
  color: var(--cream);
  text-wrap: balance;
}

.uhero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #ffb347, var(--ember) 45%, #e11d48);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.uhero-lead {
  max-width: 40rem;
  margin: 26px 0 0;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  color: var(--cream-soft);
}

.uhero-lead strong {
  color: var(--cream);
}

.uhero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.ubtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ubtn:hover {
  transform: translateY(-2px);
}

.ubtn-primary {
  background: linear-gradient(135deg, var(--ember), #e11d48);
  color: #fff;
  box-shadow: 0 14px 34px -10px rgba(255, 90, 31, 0.75);
}

.ubtn-ghost {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
}

.ubtn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.uhero-meta {
  margin: 22px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(247, 239, 228, 0.5);
}

.uhero-stack {
  position: relative;
  height: clamp(360px, 46vw, 540px);
}

.uhero-card {
  position: absolute;
  margin: 0;
  width: 62%;
  padding: 10px 10px 14px;
  border-radius: 14px;
  background: #f4ece0;
  box-shadow: 0 40px 60px -20px rgba(0, 0, 0, 0.8);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.uhero-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  filter: sepia(0.15) contrast(1.05);
}

.uhero-card figcaption {
  margin-top: 10px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #3a2f27;
}

.uhero-card.c1 {
  top: 0;
  right: 4%;
  transform: rotate(6deg);
}
.uhero-card.c2 {
  top: 30%;
  left: 0;
  transform: rotate(-7deg);
  z-index: 2;
}
.uhero-card.c3 {
  bottom: 0;
  right: 0;
  width: 54%;
  transform: rotate(3deg);
  z-index: 3;
}

.uhero-stack:hover .c1 {
  transform: rotate(10deg) translate(10px, -14px);
}
.uhero-stack:hover .c2 {
  transform: rotate(-11deg) translate(-14px, 0);
}
.uhero-stack:hover .c3 {
  transform: rotate(0deg) translate(8px, 12px);
}

.uhero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.ustat {
  display: grid;
  gap: 8px;
  padding: 22px 22px 24px;
  background: rgba(18, 14, 12, 0.86);
  backdrop-filter: blur(6px);
}

.ustat strong {
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ember);
  font-variant-numeric: tabular-nums;
}

.ustat span {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--cream-soft);
}

.umarquee {
  width: 100vw;
  margin: 34px 0 0 calc(-1 * max(20px, calc((100vw - var(--page)) / 2)));
  padding: 14px 0;
  border-block: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  background: rgba(255, 90, 31, 0.06);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.umarquee-track {
  display: flex;
  width: max-content;
  animation: umarquee 70s linear infinite;
}

.umarquee:hover .umarquee-track {
  animation-play-state: paused;
}

.umarquee span {
  padding: 0 28px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  color: var(--cream-soft);
}

.umarquee span::before {
  content: "✦";
  margin-right: 28px;
  color: var(--ember);
}

@keyframes umarquee {
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 960px) {
  .uhero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .uhero-stack {
    height: 300px;
    max-width: 520px;
  }
  .uhero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .uhero {
    padding-top: 120px;
  }
  .uhero-stack {
    display: none;
  }
  .ustat {
    padding: 18px 16px;
  }
  .ubtn {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Chapitres (bento) ---------- */
.uchapters {
  margin: clamp(40px, 7vw, 90px) 0 clamp(30px, 5vw, 60px);
  color: var(--cream);
}

.uchapters-head {
  max-width: 46rem;
  margin-bottom: 26px;
}

.uchapters-kicker,
.section-kicker {
  font-family: var(--display);
  letter-spacing: 0.14em !important;
}

.uchapters-kicker {
  margin: 0 0 10px;
  color: var(--ember);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.uchapters h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.uchapters-head p {
  margin: 14px 0 0;
  color: var(--cream-soft);
  line-height: 1.6;
}

.uchapters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 210px;
  gap: 12px;
}

.uchap {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: var(--night-3);
  isolation: isolate;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease;
}

.uchap img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.55) contrast(1.05);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}

.uchap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(12, 10, 9, 0.05) 20%, rgba(12, 10, 9, 0.92) 100%);
}

.uchap:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 90, 31, 0.6);
}

.uchap:hover img {
  transform: scale(1.08);
  filter: grayscale(0) contrast(1.05);
}

.uchap-xl {
  grid-column: span 2;
}

.uchap-tall {
  grid-row: span 2;
}

.uchap-n {
  position: absolute;
  top: 16px;
  left: 18px;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(12, 10, 9, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
}

.uchap-t {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.uchap-d {
  margin-top: 6px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.72);
}

.uchap-quiz {
  background: linear-gradient(135deg, var(--ember), #e11d48 70%, #7c1d6f);
}

.uchap-quiz::after {
  display: none;
}

.uchap-emoji {
  position: absolute;
  top: -10px;
  right: 10px;
  font-family: var(--display);
  font-size: 9rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
  transition: transform 0.5s ease;
}

.uchap-quiz:hover .uchap-emoji {
  transform: rotate(14deg) scale(1.08);
}

@media (max-width: 960px) {
  .uchapters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 180px;
  }
  .uchap-tall {
    grid-row: span 1;
  }
}

@media (max-width: 520px) {
  .uchapters-grid {
    grid-auto-rows: 150px;
    gap: 10px;
  }
  .uchap {
    padding: 14px;
  }
  .uchap-d {
    display: none;
  }
  .uchap-xl {
    grid-column: span 2;
  }
}

/* ---------- Chapitres « papier » ---------- */
main.shell {
  counter-reset: chap;
}

.section {
  position: relative;
  margin-bottom: 18px;
  border: 0;
  border-radius: 30px;
  background: var(--paper) !important;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7);
}

main > section.section:not([hidden]) {
  counter-increment: chap;
}

.section-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.section-head .section-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.78rem;
}

.section-head .section-kicker::before {
  content: counter(chap, decimal-leading-zero);
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--night);
  color: var(--ember);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.section-head h2 {
  font-family: var(--display) !important;
  font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 3.9rem) !important;
  line-height: 0.95 !important;
  letter-spacing: -0.03em !important;
  text-wrap: balance;
  max-width: 22ch;
}

.section h3 {
  text-wrap: balance;
}

.section p {
  text-wrap: pretty;
}

.chap-allbar {
  max-width: none;
  padding: 0;
  margin: 0 0 12px;
}

.chap-allbtn {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream-soft);
}

.chap-allbtn:hover {
  background: rgba(255, 90, 31, 0.18);
  color: #fff;
}

.chap-toggle {
  background: var(--night);
  border-color: transparent;
  color: var(--cream);
}

.chap-toggle:hover {
  background: var(--accent);
  color: #fff;
}

.button-primary {
  background: linear-gradient(135deg, var(--ember), #e11d48);
  color: #fff;
}

/* reveal */
html.js-reveal .section.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html.js-reveal .section.reveal.is-in {
  opacity: 1;
  transform: none;
}

.u-flash {
  animation: uflash 2.2s ease;
  border-radius: 12px;
}

@keyframes uflash {
  0%,
  40% {
    box-shadow: 0 0 0 4px var(--ember), 0 0 40px rgba(255, 90, 31, 0.5);
  }
  100% {
    box-shadow: 0 0 0 4px transparent;
  }
}

/* ---------- Dock & bouton haut ---------- */
.section-dock {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(18, 14, 12, 0.78);
  backdrop-filter: blur(16px);
}

.section-dock:hover {
  background: rgba(18, 14, 12, 0.94);
}

.section-dock.is-visible {
  opacity: 0.92;
}

.section-dock-label,
.section-dock-current {
  color: var(--cream);
}

.section-dock-button {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
  color: var(--cream);
}

.section-dock-button:hover:not(:disabled) {
  background: var(--ember);
  color: #fff;
}

.back-top {
  background: linear-gradient(135deg, var(--ember), #e11d48);
  box-shadow: 0 14px 30px -10px rgba(255, 90, 31, 0.8);
}

/* ---------- Menu plein écran ---------- */
.umenu {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 18px max(18px, calc((100vw - var(--page)) / 2));
  background: rgba(12, 10, 9, 0.97);
  backdrop-filter: blur(10px);
  color: var(--cream);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.umenu.is-open {
  opacity: 1;
  visibility: visible;
}

.umenu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.umenu-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
}

.umenu-list {
  margin: 0;
  padding: 16px 0 40px;
  list-style: none;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  align-content: start;
  column-gap: 40px;
}

.umenu-list li {
  break-inside: avoid;
}

.umenu-list a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--cream);
  text-decoration: none;
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  transform: translateY(14px);
  opacity: 0;
  transition: color 0.2s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
}

.umenu.is-open .umenu-list a {
  transform: none;
  opacity: 1;
}

.umenu-list a:hover,
.umenu-list a.is-current {
  color: var(--ember);
}

.umenu-list .n {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: rgba(247, 239, 228, 0.4);
  font-variant-numeric: tabular-nums;
}

.umenu-list .k {
  display: block;
  margin-top: 4px;
  font-family: "Manrope", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(247, 239, 228, 0.45);
}

/* ---------- Recherche ---------- */
.usearch {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: min(12vh, 110px) 14px 14px;
  background: rgba(8, 6, 5, 0.7);
  backdrop-filter: blur(8px);
}

.usearch.is-open {
  display: flex;
}

.usearch-box {
  width: min(680px, 100%);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: #17120f;
  color: var(--cream);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  animation: upop 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes upop {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
}

.usearch-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.usearch-field svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--ember);
}

.usearch-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
}

.usearch-field input::placeholder {
  color: rgba(247, 239, 228, 0.4);
}

.usearch-close {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: transparent;
  color: var(--cream-soft);
  font: inherit;
  font-size: 0.75rem;
  padding: 4px 8px;
  cursor: pointer;
}

.usearch-results {
  margin: 0;
  padding: 8px;
  list-style: none;
  overflow-y: auto;
}

.usearch-results li button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.usearch-results li button:hover,
.usearch-results li button.is-active {
  background: rgba(255, 90, 31, 0.14);
}

.usearch-results .r-sec {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember-2);
}

.usearch-results .r-title {
  font-weight: 800;
}

.usearch-results .r-snip {
  font-size: 0.85rem;
  color: rgba(247, 239, 228, 0.6);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.usearch-results mark {
  background: rgba(255, 90, 31, 0.35);
  color: #fff;
  border-radius: 3px;
}

.usearch-empty,
.usearch-hint {
  padding: 18px;
  color: rgba(247, 239, 228, 0.55);
  font-size: 0.9rem;
}

.usearch-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.usearch-hint button {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.usearch-hint button:hover {
  border-color: var(--ember);
}

/* ---------- Mythes ---------- */
.umyth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.umyth {
  border-radius: 22px;
  background: var(--night);
  color: var(--cream);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.umyth:hover {
  transform: translateY(-3px);
}

.umyth summary {
  display: grid;
  gap: 14px;
  padding: 24px;
  min-height: 210px;
  align-content: space-between;
  cursor: pointer;
  list-style: none;
}

.umyth summary::-webkit-details-marker {
  display: none;
}

.umyth-label {
  justify-self: start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 239, 228, 0.7);
}

.umyth-label.is-real {
  display: inline-block;
  margin-bottom: 12px;
  background: #16a34a;
  color: #fff;
}

.umyth-q {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-decoration: line-through;
  text-decoration-color: transparent;
  text-decoration-thickness: 3px;
  transition: text-decoration-color 0.4s ease;
}

.umyth[open] .umyth-q {
  text-decoration-color: var(--ember);
  color: rgba(247, 239, 228, 0.6);
}

.umyth-cta {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ember);
}

.umyth-cta::after {
  content: " ↓";
}

.umyth[open] .umyth-cta {
  display: none;
}

.umyth-a {
  padding: 0 24px 24px;
  animation: upop 0.35s ease;
}

.umyth-a p {
  margin: 0;
  line-height: 1.65;
  color: rgba(247, 239, 228, 0.86);
}

.umyth-a strong,
.umyth-a em {
  color: #fff;
}

/* ---------- Glossaire ---------- */
.uglossary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.uterm {
  padding: 20px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-strong);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

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

.uterm h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.uterm h3::before {
  content: "#";
  margin-right: 4px;
  color: var(--accent);
}

.uterm p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- Quiz ---------- */
.uquiz {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px);
  border-radius: 26px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 90, 31, 0.25), transparent 60%),
    var(--night);
  color: var(--cream);
  overflow: hidden;
}

.uquiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(247, 239, 228, 0.6);
}

.uquiz-bar {
  height: 6px;
  margin-bottom: 26px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.uquiz-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffb347, var(--ember));
  transition: width 0.4s ease;
}

.uquiz-q {
  margin: 0 0 22px;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.uquiz-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.uquiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.uquiz-opt:hover:not(:disabled) {
  border-color: var(--ember);
  background: rgba(255, 90, 31, 0.1);
  transform: translateY(-2px);
}

.uquiz-opt .l {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  font-weight: 900;
}

.uquiz-opt:disabled {
  cursor: default;
}

.uquiz-opt.is-right {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.16);
}

.uquiz-opt.is-right .l {
  background: #22c55e;
  color: #052e16;
}

.uquiz-opt.is-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
  animation: ushake 0.4s ease;
}

.uquiz-opt.is-wrong .l {
  background: #ef4444;
}

@keyframes ushake {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.uquiz-explain {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 3px solid var(--ember);
  border-radius: 0 14px 14px 0;
  background: rgba(255, 255, 255, 0.05);
  line-height: 1.6;
  color: rgba(247, 239, 228, 0.88);
  animation: upop 0.3s ease;
}

.uquiz-explain b {
  color: #fff;
}

.uquiz-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.uquiz-end {
  text-align: center;
}

.uquiz-score {
  font-family: var(--display);
  font-size: clamp(4.5rem, 14vw, 8rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
  background: linear-gradient(100deg, #ffb347, var(--ember) 45%, #e11d48);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.uquiz-verdict {
  margin: 14px auto 0;
  max-width: 34rem;
  font-size: 1.1rem;
  line-height: 1.55;
  color: rgba(247, 239, 228, 0.85);
}

.uquiz-end .uquiz-foot {
  justify-content: center;
  margin-top: 26px;
}

@media (max-width: 640px) {
  .uquiz-opts {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */
.ufooter {
  width: min(calc(100% - 32px), var(--page));
  margin: 40px auto 0;
  padding: 50px 0 110px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cream-soft);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 30px;
  align-items: end;
}

.ufooter-big {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.032em;
  color: var(--cream);
}

.ufooter-big em {
  font-style: normal;
  color: var(--ember);
}

.ufooter-side {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.ufooter-side p {
  margin: 0;
  line-height: 1.6;
  font-size: 0.92rem;
}

.ufooter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .ufooter {
    grid-template-columns: 1fr;
  }
}

/* contact + mentions */
.ucontact {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 34px;
  padding: 34px;
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  scroll-margin-top: 90px;
}
.ucontact-kicker {
  margin: 0 0 8px;
  color: var(--ember);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ucontact-title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--cream);
}
.ucontact-intro p:last-child { margin: 0; line-height: 1.6; font-size: 0.95rem; }
.ucontact-form { display: grid; gap: 14px; }
.ucontact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ucontact-form label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cream);
}
.ucontact-form input,
.ucontact-form select,
.ucontact-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
}
.ucontact-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ff5a1f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.ucontact-form select option { color: #111; background: #fff; }
.ucontact-form input::placeholder,
.ucontact-form textarea::placeholder { color: rgba(255, 255, 255, 0.35); }
.ucontact-form textarea { resize: vertical; min-height: 120px; }
.ucontact-form input:focus,
.ucontact-form select:focus,
.ucontact-form textarea:focus {
  outline: 2px solid var(--ember);
  outline-offset: 1px;
  border-color: transparent;
}
.ucontact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ucontact-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ucontact-actions button[disabled] { opacity: 0.6; cursor: wait; }
.ucontact-status { margin: 0; font-size: 0.9rem; }
.ucontact-status.is-ok { color: #86efac; }
.ucontact-status.is-error { color: #fca5a5; }
.ufooter-legal {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: var(--cream-soft);
}
.ufooter-legal p { margin: 0; }
.ufooter-legal a { color: var(--cream); }
.ufooter-version {
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-weight: 700;
}
@media (max-width: 760px) {
  .ucontact { grid-template-columns: 1fr; padding: 22px; gap: 20px; }
  .ucontact-row { grid-template-columns: 1fr; }
  .ufooter-legal {
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.9;
  }
  .ufooter-legal p:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 12px;
  }
  .ufooter-legal span[aria-hidden="true"] { display: none; }
}

/* toast */
.utoast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 400;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--night);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.utoast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Accessibilité / impression ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  html.js-reveal .section.reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  body,
  html {
    background: #fff !important;
  }
  body::before,
  .topbar,
  .umarquee,
  .uchapters,
  .section-dock,
  .back-top,
  .ufooter,
  .chap-allbar,
  .chap-toggle {
    display: none !important;
  }
  .uhero {
    color: #000;
    margin: 0;
    width: auto;
    padding: 0;
  }
  .uhero-bg,
  .uhero-stack {
    display: none;
  }
  .section {
    box-shadow: none;
    break-inside: auto;
  }
}

.lightbox {
  z-index: 260;
}

/* =====================================================================
   VERSION ULTIME + — corrections & nouveaux modules
   ===================================================================== */

/* Logo */
.brand .brand-mark,
.brand-mark {
  display: inline-grid;
  place-items: center;
  overflow: visible;
  line-height: 1;
}

/* Titres : un peu d'air */
.uchapters h2 {
  letter-spacing: -0.03em;
}

/* Barre « Tout replier » sous le hero, plus discrète */
.chap-allbar {
  margin-top: 8px;
}

/* Hero : bouton Stories */
.ubtn-story {
  padding-left: 8px;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
}

.ubtn-story:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ustory-ring {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(#ffb347, var(--ember), #e11d48, #a21caf, #ffb347);
  animation: uspin 6s linear infinite;
}

.ustory-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--night);
  animation: uspin 6s linear infinite reverse;
}

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

/* Reprendre */
.uresume {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px dashed rgba(255, 90, 31, 0.6);
  border-radius: 14px;
  background: rgba(255, 90, 31, 0.08);
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.uresume[hidden] {
  display: none;
}

.uresume:hover {
  background: rgba(255, 90, 31, 0.16);
}

.uresume-k {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember);
}

.uresume-p {
  font-size: 0.78rem;
  color: var(--cream-soft);
}

/* Progression dans le bento */
.uchapters-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--cream-soft);
}

.uchapters-progress[hidden] {
  display: none;
}

.uchapters-progress strong {
  color: var(--ember);
}

.uchapters-progress .bar {
  flex: 0 1 200px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.uchapters-progress .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffb347, var(--ember));
  transition: width 0.5s ease;
}

.uchap.is-read::before {
  content: "✓ Lu";
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

/* Sommaire : chapitres lus */
.umenu-list a.is-read .n::after {
  content: " ✓";
  color: #22c55e;
}

.umenu-list a.is-read {
  color: rgba(247, 239, 228, 0.6);
}

.umenu-list a.is-read:hover,
.umenu-list a.is-read.is-current {
  color: var(--ember);
}

/* Dock compact */
.back-top {
  display: none !important;
}

.section-dock {
  left: 50%;
  right: auto;
  bottom: 16px;
  width: min(560px, calc(100% - 24px));
  transform: translate(-50%, 12px);
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  overflow: hidden;
}

.section-dock.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.section-dock-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  font-size: 1rem;
}

.section-dock-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 999px;
  cursor: pointer;
}

.section-dock-label:hover {
  background: rgba(255, 255, 255, 0.06);
}

.section-dock-current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.udock-num {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 90, 31, 0.18);
  color: var(--ember-2);
  font-size: 0.72rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.udock-num:empty {
  display: none;
}

.udock-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.udock-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #86efac);
  transition: width 0.5s ease;
}

.udock-up {
  background: linear-gradient(135deg, var(--ember), #e11d48) !important;
  border-color: transparent !important;
}

@media (max-width: 760px) {
  .section-dock {
    bottom: 10px;
    border-radius: 999px;
    right: auto;
  }
}

/* Mobile hero : boutons secondaires côte à côte */
@media (max-width: 560px) {
  .uhero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .uhero-actions .ubtn-primary {
    grid-column: 1 / -1;
  }
  .uhero-actions .ubtn {
    width: auto;
    min-height: 50px;
    padding: 0 12px;
    font-size: 0.9rem;
  }
  .ustory-ring {
    width: 32px;
    height: 32px;
  }
  .uhero h1 {
    font-size: clamp(2.5rem, 11.5vw, 3.4rem);
  }
}

/* Mythes : partage */
.umyth-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.umyth-share:hover {
  border-color: var(--ember);
  background: rgba(255, 90, 31, 0.12);
}

.umyth-share svg {
  width: 15px;
  height: 15px;
}

/* Quiz : record */
.uquiz-record {
  display: inline-block;
  margin: 14px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}

.uquiz-record.is-muted {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream-soft);
}

/* ---------- Stories ---------- */
.ustories {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: none;
  place-items: center;
  background: rgba(6, 5, 4, 0.92);
  backdrop-filter: blur(12px);
}

.ustories.is-open {
  display: grid;
}

.ustories-frame {
  position: relative;
  width: min(440px, 100vw);
  height: min(860px, 100dvh);
  overflow: hidden;
  background: var(--night);
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  animation: upop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 480px) {
  .ustories-frame {
    height: min(820px, calc(100dvh - 40px));
    border-radius: 22px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9);
  }
}

.ustories-bars {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  gap: 4px;
}

.ustories-bars span {
  flex: 1;
  height: 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.ustories-bars i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}

.ustories-head {
  position: absolute;
  top: 22px;
  left: 12px;
  right: 8px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ustories-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

.ustories-brand .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.68rem;
}

.ustories-x {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.ustories-x:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ustories-slide,
.ustories-bg {
  position: absolute;
  inset: 0;
}

.ustories-bg {
  background-size: cover;
  background-position: center;
  animation: uken 7.5s ease-out forwards;
}

.ustories-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 22%),
    linear-gradient(180deg, transparent 30%, rgba(8, 6, 5, 0.85) 62%, rgba(8, 6, 5, 0.98) 100%);
}

@keyframes uken {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.14);
  }
}

.ustories-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 24px 24px 34px;
  animation: urise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes urise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

.ustories-k {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ember);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ustories-big {
  display: block;
  margin-top: 14px;
  font-family: var(--display);
  font-size: clamp(3.4rem, 17vw, 5.4rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  background: linear-gradient(100deg, #fff 30%, #ffb38a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ustories-t {
  display: block;
  margin-top: 10px;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ustories-d {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}

.ustories-cta {
  position: relative;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.ustories-cta .ubtn {
  min-height: 46px;
  padding: 0 18px;
  font-size: 0.9rem;
}

.ustories-nav {
  position: absolute;
  top: 70px;
  bottom: 0;
  z-index: 3;
  width: 35%;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ustories-nav.prev {
  left: 0;
}

.ustories-nav.next {
  right: 0;
  width: 65%;
}

.ustories-nav:focus-visible {
  outline-offset: -6px;
}

.ustories.is-paused .ustories-copy {
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

/* Bento : tuile stories */
.uchap-stories {
  background: linear-gradient(160deg, #1d1410, #3b1a0e);
}

.uchap-stories .ustory-ring {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 64px;
  height: 64px;
  padding: 3px;
}

.ustories-copy {
  pointer-events: none;
}

.ustories-cta {
  pointer-events: auto;
}

button.uchap {
  border: 1px solid rgba(255, 255, 255, 0.08);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

@media (max-width: 560px) {
  .ubtn-story {
    white-space: nowrap;
    font-size: 0.84rem !important;
    gap: 8px;
  }
}

.tool-btn {
  white-space: nowrap;
}

.umyth[open] summary {
  min-height: 0;
}

.ustories-big.is-long {
  font-size: clamp(2.6rem, 12vw, 3.8rem);
}

.uq-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.uq-tag.ok {
  background: #22c55e;
  color: #052e16;
}

.uq-tag.ko {
  background: #ef4444;
  color: #fff;
}

.utoast {
  bottom: 76px;
  max-width: calc(100% - 32px);
  text-align: center;
  border-radius: 18px;
}
