/* ════════════════════════════════════════════════════════════
   BIBLION — L'Édition de Minuit
   Une page de beau livre : papier, encre, un filet d'or.
   La nuit n'apparaît que dans des « planches » (bandes minuit
   et gravures encadrées) — rares, donc précieuses.

   Code couleur strict (5 valeurs) :
   papier #F6F2E9 · encre #191817 · or #9A7B2D (nuit : #E9B94F)
   minuit #0A0F1E · filet #D9D2C2
   ════════════════════════════════════════════════════════════ */

/* ═══ FONTES — auto-hébergées (CSP : font-src 'self') ═══ */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-var.woff2") format("woff2-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-italic-var.woff2") format("woff2-variations");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ════════════════════════════════════════════════════════════
   TOKENS
   Palette brute + rôles sémantiques. Par défaut : le papier.
   Les zones de nuit (.plate-band, footer, modal) re-scopent
   les mêmes rôles — tous les composants suivent sans exception.
   ════════════════════════════════════════════════════════════ */
:root {
  /* palette brute */
  --paper: #F6F2E9;
  --paper-raised: #FDFBF4;
  --ink: #191817;
  --ink-soft: #4A463F;
  --ink-dim: #837C6E;
  --gold: #9A7B2D;
  --gold-night: #E9B94F;
  --midnight: #0A0F1E;
  --midnight-deep: #060A15;
  --hairline: #D9D2C2;

  /* rôles — contexte papier */
  --bg-base: var(--paper);
  --bg-surface: var(--paper-raised);
  --bg-raised: #EFE9DC;
  --bg-glass: rgba(246, 242, 233, 0.86);
  --accent: var(--gold);
  --accent-soft: rgba(154, 123, 45, 0.09);
  --accent-glow: rgba(154, 123, 45, 0.20);
  --accent-strong: var(--ink);
  --text-primary: var(--ink);
  --text-muted: var(--ink-soft);
  --text-dim: var(--ink-dim);
  --border: rgba(25, 24, 23, 0.14);
  --border-default: rgba(25, 24, 23, 0.14);
  --border-accent: rgba(154, 123, 45, 0.42);
  --card-bg: var(--paper-raised);
  --danger: #B3403C;
  --success: #3E7A4C;

  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-sans: var(--font-ui);

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soar: cubic-bezier(0.33, 0, 0.15, 1);
  --duration: 0.25s;

  --shadow-plate: 0 24px 60px rgba(25, 24, 23, 0.14);
  --shadow-card: 0 12px 36px rgba(6, 10, 21, 0.4);
  --shadow-deep: 0 26px 90px rgba(0, 0, 0, 0.52);
}

/* Zones de nuit : mêmes rôles, valeurs minuit.
   Tout composant écrit avec les variables s'adapte seul. */
.plate-band,
.footer,
.auth-modal-overlay,
.session-warning {
  --bg-base: var(--midnight);
  --bg-surface: #101828;
  --bg-raised: #16203468;
  --bg-glass: rgba(10, 15, 30, 0.86);
  --accent: var(--gold-night);
  --accent-soft: rgba(233, 185, 79, 0.12);
  --accent-glow: rgba(233, 185, 79, 0.20);
  --accent-strong: #F5F2E9;
  --text-primary: #F5F2E9;
  --text-muted: #C9C2B2;
  --text-dim: #8D8776;
  --border: rgba(255, 255, 255, 0.13);
  --border-default: rgba(255, 255, 255, 0.13);
  --border-accent: rgba(233, 185, 79, 0.35);
  --card-bg: rgba(13, 19, 34, 0.72);
  color: var(--text-primary);   /* sans quoi l'encre du body hérite */
}

/* ═══ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  color: var(--text-primary);
  background: var(--paper);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
ul { list-style: none; }
img, video { display: block; max-width: 100%; }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { position: relative; }
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ════════════════════════════════════════════════════════════
   NAVBAR — encre sur papier, verre ivoire après scroll
   ════════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease),
              background var(--duration) var(--ease),
              backdrop-filter var(--duration) var(--ease);
}
.navbar.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--hairline);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; }
.navbar-brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.navbar-brand-name {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.navbar-brand-name .b-gold { color: var(--accent); }
.navbar-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.nav-link:hover { color: var(--text-primary); background: rgba(25, 24, 23, 0.05); }
.nav-link--subtle { color: var(--text-primary); font-weight: 600; }
.nav-link--accent {
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--border-accent);
  background: transparent;
}
.nav-link--accent:hover { background: var(--accent-soft); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.25s var(--ease), opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sélecteur de langue */
.lang-selector { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px; font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.lang-btn:hover { border-color: var(--border-accent); color: var(--text-primary); }
.lang-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; flex-shrink: 0; }
.lang-chevron { width: 10px !important; stroke-width: 2 !important; transition: transform 0.2s; }
.lang-selector.open .lang-chevron { transform: rotate(180deg); }
.lang-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(25, 24, 23, 0.18);
  overflow: hidden; z-index: 300;
  display: none; min-width: 148px;
}
.lang-selector.open .lang-dropdown { display: block; }
.lang-opt {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: none; border: none;
  color: var(--text-muted); font-size: 13px; font-family: var(--font-sans);
  cursor: pointer; text-align: left; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.lang-opt:hover { background: var(--accent-soft); color: var(--text-primary); }
.lang-opt.active { color: var(--accent); font-weight: 600; }

/* ════════════════════════════════════════════════════════════
   BOUTONS — l'or est le seul événement de couleur
   ════════════════════════════════════════════════════════════ */
.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(180deg, #C89B3C, #9A7B2D);
  color: #FDFBF4;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--accent-glow);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.btn-ghost:hover { border-color: var(--border-accent); background: var(--accent-soft); }
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(180deg, #C89B3C, #9A7B2D);
  color: #FDFBF4;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--accent-glow); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.ghost-btn:hover { border-color: var(--border-accent); background: var(--accent-soft); }

/* ════════════════════════════════════════════════════════════
   PLANCHES — les images comme gravures de beau livre :
   marie-louise papier, filet extérieur, filet intérieur.
   ════════════════════════════════════════════════════════════ */
.plate {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  padding: clamp(10px, 1.3vw, 16px);
  box-shadow: var(--shadow-plate);
}
.plate-art {
  overflow: hidden;
  border: 1px solid rgba(25, 24, 23, 0.22);
}
.plate-art img {
  width: 100%;
  will-change: transform;
}
/* la résidente vit DANS la gravure */
.plate-owl {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}
.plate--hero .plate-owl {
  right: 9%;
  bottom: 10%;
  width: 26%;
}
.plate--alcove .plate-owl {
  right: 12%;
  bottom: 8%;
  width: 20%;
}

/* ════════════════════════════════════════════════════════════
   BANDES MINUIT — les zones immersives, rares et franches.
   Bord net souligné d'un filet d'or : un plat de reliure,
   pas un fondu.
   ════════════════════════════════════════════════════════════ */
.plate-band {
  position: relative;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(233, 185, 79, 0.05), transparent 55%),
    linear-gradient(180deg, var(--midnight) 0%, var(--midnight-deep) 100%);
  border-top: 1px solid rgba(233, 185, 79, 0.30);
  border-bottom: 1px solid rgba(233, 185, 79, 0.30);
  color: var(--text-primary);
}
/* grain discret réservé aux planches de nuit */
.plate-band::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("/assets/img/grain.webp") repeat;
  background-size: 512px;
  opacity: 0.04;
}
.plate-band > * { position: relative; z-index: 1; }

/* Dans une bande, la planche est sombre : marie-louise minuit */
.plate-band .plate {
  background: rgba(16, 24, 40, 0.55);
  border-color: rgba(233, 185, 79, 0.28);
  box-shadow: var(--shadow-card);
}
.plate-band .plate > img:first-child {
  border-color: rgba(233, 185, 79, 0.18);
}

/* ════════════════════════════════════════════════════════════
   HERO — papier, typographie, une planche
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 158px 0 72px;
  min-height: 94svh;
  display: flex;
  align-items: center;
}
.hero .container { width: 100%; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}
.hero-content { max-width: 560px; }
.hero-line {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.06;
  font-weight: 560;
  letter-spacing: -0.015em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(22px);
  animation: rise-in 0.8s var(--ease) forwards;
}
.hero-line:nth-child(1) { animation-delay: 0.1s; }
.hero-line:nth-child(2) { animation-delay: 0.24s; }
.hero-line:nth-child(3) { animation-delay: 0.38s; }
.hero-line--accent {
  color: var(--gold);
  font-style: italic;
  font-weight: 480;
}
@keyframes rise-in {
  to { opacity: 1; transform: translateY(0); }
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  margin: 22px 0 26px;
  max-width: 42ch;
  line-height: 1.65;
  opacity: 0;
  animation: rise-in 0.7s var(--ease) 0.5s forwards;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-accent);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 30px;
  opacity: 0;
  animation: rise-in 0.7s var(--ease) 0.6s forwards;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  animation: rise-in 0.7s var(--ease) 0.7s forwards;
}
.hero-reassurance {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  opacity: 0;
  animation: rise-in 0.7s var(--ease) 0.8s forwards;
}

.hero-plate {
  opacity: 0;
  animation: rise-in 0.9s var(--ease) 0.55s forwards;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  animation: rise-in 0.9s var(--ease) 1.4s forwards;
  transition: color 0.25s var(--ease);
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue svg {
  width: 16px; height: 16px;
  animation: cue-drift 2.2s var(--ease-soar) infinite;
}
@keyframes cue-drift {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  55%      { transform: translateY(5px); opacity: 1; }
}

/* ════════════════════════════════════════════════════════════
   RESPIRATIONS — une ligne d'encre sur le papier
   ════════════════════════════════════════════════════════════ */
.journey {
  padding: 13vh 24px;
  text-align: center;
}
.journey-line {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 440;
  font-size: clamp(24px, 3.3vw, 38px);
  line-height: 1.35;
  color: var(--text-primary);
  max-width: 26ch;
  margin: 0 auto;
}
.journey[data-anim] {
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-soar), transform 0.9s var(--ease-soar);
}

/* légende d'ouverture de l'alcôve (dans la bande minuit) */
.journey-line.beta-lead {
  margin-top: 8px;
  margin-bottom: 44px;
}

/* ════════════════════════════════════════════════════════════
   SQUELETTE DE SECTION + RÉVÉLATIONS
   (index.js ajoute .visible via IntersectionObserver)
   ════════════════════════════════════════════════════════════ */
[data-anim] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
[data-anim].visible {
  opacity: 1;
  transform: translateY(0);
}

.section { padding: 110px 0; position: relative; }
.section-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 560;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.16;
  letter-spacing: -0.01em;
}
.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 17px;
  max-width: 52ch;
  margin: 0 auto 56px;
  line-height: 1.65;
}

/* ════════════════════════════════════════════════════════════
   MENUS DÉPLIANTS
   ════════════════════════════════════════════════════════════ */
.fold {
  max-width: 620px;
  margin: 28px auto 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px 8px;
}
.fold summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: "+";
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 16px;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}
.fold[open] summary::after { transform: rotate(45deg); }
.fold summary:hover { color: var(--text-primary); }
.fold ul {
  padding: 4px 12px 16px;
  display: grid;
  gap: 8px;
}
.fold li {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════
   ACCESSIBILITÉ — mouvement réduit
   ════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-line, .hero-sub, .hero-badge, .hero-actions,
  .hero-reassurance, .hero-plate, .scroll-cue {
    opacity: 1;
    transform: none;
    animation: none;
  }
  [data-anim] { opacity: 1; transform: none; transition: none; }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.02fr 0.98fr; }
}
@media (max-width: 899px) {
  .hero { padding-top: 128px; padding-bottom: 80px; }
  .hero-plate { max-width: 560px; }
  .scroll-cue {
    position: static;
    transform: none;
    display: flex;
    justify-content: center;
    margin-top: 40px;
  }
}
@media (max-width: 768px) {
  .section { padding: 84px 0; }
  .journey { padding: 10vh 24px; }
  .navbar-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 18px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline);
  }
  .navbar-links.open { display: flex; }
  .nav-hamburger { display: flex; }
}
