/* ============================================================
   LE MYTHE DE LA CAVERNE — Feuille de styles
   Thème : Grèce antique · marbre · parchemin · lumière de torche
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=Cinzel+Decorative:wght@400;700&family=Cinzel:wght@400;600;900&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --marble-light:  #f4ede0;
  --marble-mid:    #e8dcc8;
  --marble-dark:   #c8b898;
  --stone:         #3a3020;
  --stone-mid:     #5a4e38;
  --stone-light:   #8a7a60;
  --gold:          #c8952a;
  --gold-bright:   #e8b840;
  --gold-pale:     #f0d898;
  --torch-orange:  #e05820;
  --torch-yellow:  #f8c840;
  --shadow-dark:   rgba(20,14,8,.82);
  --shadow-mid:    rgba(20,14,8,.45);
  --ink:           #1c160c;
  --ink-mid:       #3a3020;
  --text-body:     #2e2518;
  --text-muted:    #7a6850;
  --border-gold:   rgba(200,149,42,.35);
  --glow-torch:    0 0 40px rgba(224,88,32,.25), 0 0 80px rgba(248,200,64,.12);
  --font-title:    'Cinzel Decorative', serif;
  --font-heading:  'Cinzel', serif;
  --font-body:     'Cormorant Garamond', Georgia, serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Corps ───────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: 1.13rem;
  font-weight: 400;
  line-height: 1.85;
  color: var(--text-body);
  background-color: #1c160c;
  background-image:
    radial-gradient(ellipse 100% 60% at 50% 0%,   rgba(224,88,32,.18) 0%, transparent 65%),
    radial-gradient(ellipse  60% 40% at 80% 100%,  rgba(200,149,42,.10) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
  min-height: 100vh;
  padding: 28px 18px 0;
  overflow-x: hidden;
}

/* ── Flamme torche (canvas de fond) ─────────────────────── */
#torch-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .38;
}

/* ── Ombres-silhouettes sur le mur (décor caverne) ───────── */
#cave-shadows {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 160px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.shadow-figure {
  position: absolute;
  bottom: 0;
  background: var(--shadow-dark);
  border-radius: 60% 60% 0 0 / 80% 80% 0 0;
  filter: blur(4px);
  opacity: .55;
  animation: shadowWalk linear infinite;
}

@keyframes shadowWalk {
  0%   { transform: translateX(0)   scaleY(1); }
  50%  { transform: translateX(18px) scaleY(1.06); }
  100% { transform: translateX(0)   scaleY(1); }
}

/* ── Conteneur principal ─────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  background: var(--marble-light);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='turbulence' baseFrequency='.012 .008' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 .94  0 0 0 0 .89  0 0 0 0 .80  0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='600' height='600' filter='url(%23m)'/%3E%3C/svg%3E");
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -4px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(200,149,42,.3);
  overflow: hidden;
}

/* ── En-tête ──────────────────────────────────────────────── */
header {
  background:
    linear-gradient(180deg, #0e0a04 0%, #1e1608 55%, #2a1e0e 100%);
  color: var(--gold-pale);
  padding: 72px 48px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--gold);
}

/* Colonnes latérales décoratives */
header::before,
header::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 52px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(200,149,42,.22) 0px, rgba(200,149,42,.22) 1px,
      transparent 1px, transparent 28px
    ),
    linear-gradient(90deg, rgba(200,149,42,.18) 0%, rgba(200,149,42,.06) 40%, rgba(200,149,42,.06) 60%, rgba(200,149,42,.18) 100%);
  border-left:  1px solid rgba(200,149,42,.25);
  border-right: 1px solid rgba(200,149,42,.25);
}
header::before { left: 0; }
header::after  { right: 0; border-left: 1px solid rgba(200,149,42,.25); }

/* Frise grecque en haut et en bas */
.greek-border {
  display: block;
  width: 100%;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='18'%3E%3Cpath d='M0,0 L0,10 L10,10 L10,18 L20,18 L20,8 L30,8 L30,0 L40,0 L40,10 L10,10' stroke='%23c8952a' stroke-width='1.5' fill='none' opacity='.55'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  opacity: .6;
  margin: 0 52px;
}
.greek-border.bottom { transform: scaleY(-1); }

/* Flamme SVG animée */
.flame-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.flame-icon svg {
  width: 48px; height: 64px;
  filter: drop-shadow(0 0 14px rgba(224,88,32,.8));
  animation: flameFlicker 1.8s ease-in-out infinite;
}
@keyframes flameFlicker {
  0%,100% { transform: scaleX(1)   scaleY(1)   rotate(-.5deg); }
  25%      { transform: scaleX(.96) scaleY(1.04) rotate(.8deg); }
  50%      { transform: scaleX(1.04) scaleY(.97) rotate(-.3deg); }
  75%      { transform: scaleX(.97) scaleY(1.03) rotate(.6deg); }
}

h1 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--gold-bright);
  text-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 40px rgba(232,184,64,.4);
  margin-bottom: 14px;
  line-height: 1.25;
  animation: goldReveal 1.1s cubic-bezier(.22,1,.36,1) both;
}
@keyframes goldReveal {
  from { opacity:0; letter-spacing:.18em; }
  to   { opacity:1; }
}

.subtitle {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-style: italic;
  letter-spacing: .18em;
  color: var(--marble-dark);
  opacity: .85;
  margin-top: 8px;
  animation: fadeUp .7s .5s ease both;
}

@keyframes fadeUp {
  from { opacity:0; transform: translateY(12px); }
  to   { opacity:1; transform: none; }
}

/* ── .author-info ────────────────────────────────────────── */
.author-info {
  background: linear-gradient(135deg, #faf5e8 0%, #f2ead8 100%);
  padding: 22px 28px;
  border-radius: 3px;
  margin: 36px 0 28px;
  border-left: 4px solid var(--gold);
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
  font-size: 1rem;
  color: var(--stone-mid);
  font-style: italic;
}
.author-info strong {
  font-family: var(--font-heading);
  font-style: normal;
  font-size: 1.05rem;
  color: var(--stone);
  letter-spacing: .04em;
}

/* ── Contenu ─────────────────────────────────────────────── */
.content {
  padding: 52px 56px 56px;
}
@media (max-width: 680px) {
  .content { padding: 32px 22px 40px; }
  header   { padding: 48px 24px 40px; }
  .greek-border { margin: 0 24px; }
}

/* ── Titres ──────────────────────────────────────────────── */
h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--stone);
  margin: 52px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--marble-dark);
  position: relative;
}
h2::before {
  content: '·';
  color: var(--gold);
  margin-right: 10px;
  font-size: 1.4em;
  line-height: 0;
  vertical-align: middle;
}
h2::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--stone-mid);
  margin: 34px 0 14px;
}

/* ── Paragraphes ─────────────────────────────────────────── */
p {
  margin-bottom: 18px;
  text-align: justify;
  font-size: 1.1rem;
  color: var(--text-body);
}
p:last-child { margin-bottom: 0; }
em { font-style: italic; color: var(--stone-mid); }
strong { font-weight: 600; color: var(--stone); }

/* ── Citation ────────────────────────────────────────────── */
.quote {
  background: linear-gradient(135deg, #f5edda 0%, #ede0c4 100%);
  border-left: 4px solid var(--gold);
  padding: 28px 36px 24px 52px;
  margin: 32px 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--stone);
  border-radius: 0 6px 6px 0;
  position: relative;
  box-shadow: 2px 4px 18px rgba(0,0,0,.09);
}
.quote::before {
  content: '\201C';
  font-family: 'Cormorant Garamond', serif;
  font-size: 4.5rem;
  color: var(--gold);
  opacity: .4;
  position: absolute;
  top: 4px; left: 14px;
  line-height: 1;
}

/* ── Highlight ───────────────────────────────────────────── */
.highlight {
  background: linear-gradient(135deg, #fdf8ec 0%, #f7efda 100%);
  border: 1px solid var(--border-gold);
  border-top: 3px solid var(--gold);
  padding: 22px 28px;
  border-radius: 0 0 6px 6px;
  margin: 28px 0;
  box-shadow: 0 3px 14px rgba(0,0,0,.07);
  font-size: 1.05rem;
  color: var(--stone);
}

/* ── Interprétation ──────────────────────────────────────── */
.interpretation {
  background: linear-gradient(135deg, #1e1608 0%, #2a1e0e 100%);
  border: 1px solid rgba(200,149,42,.3);
  border-left: 4px solid var(--gold);
  padding: 24px 28px;
  border-radius: 0 6px 6px 0;
  margin: 24px 0;
  color: var(--gold-pale);
  box-shadow: var(--glow-torch);
}
.interpretation h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: .1em;
  color: var(--gold-bright);
  margin-bottom: 10px;
}
.interpretation p {
  color: var(--marble-dark);
  font-size: 1rem;
  text-align: left;
}

/* ── Numéro de section ───────────────────────────────────── */
.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--stone);
  color: var(--gold-pale);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 600;
  margin-right: 10px;
  letter-spacing: .04em;
  flex-shrink: 0;
  border: 1px solid rgba(200,149,42,.4);
  vertical-align: middle;
}

/* ── Étapes de la caverne ────────────────────────────────── */
.cave-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin: 30px 0;
}
.stage {
  background: linear-gradient(160deg, #1e1608 0%, #2e2010 100%);
  color: var(--gold-pale);
  padding: 24px 18px 20px;
  border-radius: 4px;
  text-align: center;
  border: 1px solid rgba(200,149,42,.3);
  box-shadow: 0 4px 20px rgba(0,0,0,.3), var(--glow-torch);
  cursor: default;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1),
              box-shadow .28s, border-color .28s;
  position: relative;
  overflow: hidden;
}
.stage::before {          /* halo de lumière en haut */
  content: '';
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 60px;
  background: radial-gradient(circle, rgba(248,200,64,.25), transparent 70%);
  pointer-events: none;
}
.stage:hover {
  transform: translateY(-6px);
  border-color: rgba(200,149,42,.7);
  box-shadow: 0 10px 32px rgba(0,0,0,.4), 0 0 40px rgba(224,88,32,.3);
}
.stage-number {
  font-size: 2.2rem;
  margin-bottom: 10px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(248,200,64,.5));
}
.stage strong {
  font-family: var(--font-heading);
  font-size: .92rem;
  letter-spacing: .08em;
  color: var(--gold-bright);
  display: block;
  margin-bottom: 6px;
}
.stage br { display: block; margin-bottom: 2px; }

/* ── Listes ──────────────────────────────────────────────── */
ul {
  list-style: none;
  margin: 18px 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
ul li {
  padding-left: 26px;
  position: relative;
  font-size: 1.07rem;
  color: var(--text-body);
  transition: color .2s;
}
ul li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: .55rem;
  top: .55em;
}
ul li:hover { color: var(--stone); }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: linear-gradient(180deg, #0e0a04 0%, #1c140a 100%);
  color: var(--marble-dark);
  text-align: center;
  padding: 40px 28px 36px;
  font-size: .95rem;
  font-family: var(--font-heading);
  letter-spacing: .06em;
  border-top: 2px solid var(--gold);
  position: relative;
}
footer::before {          /* frise en bas */
  content: '';
  display: block;
  width: 100%; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='18'%3E%3Cpath d='M0,18 L0,8 L10,8 L10,0 L20,0 L20,10 L30,10 L30,18 L40,18 L40,8 L10,8' stroke='%23c8952a' stroke-width='1.5' fill='none' opacity='.45'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  margin-bottom: 28px;
}
footer strong { color: var(--gold-pale); font-size: 1.05rem; }
footer p + p  { margin-top: 8px; }
footer em {
  display: block;
  margin-top: 22px;
  font-style: italic;
  opacity: .6;
  font-family: var(--font-body);
  letter-spacing: 0;
  font-size: 1.05rem;
}

/* ── Barre de progression lecture ───────────────────────── */
#read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--torch-orange), var(--gold-bright));
  z-index: 9999;
  width: 0%;
  transition: width .1s linear;
  box-shadow: 0 0 10px rgba(224,88,32,.6);
}
