/* ═══════════════════════════════════════════
   Le Cahier d'Edwin — Styles
   ═══════════════════════════════════════════ */

:root {
  --bg:          #0c0b09;
  --bg2:         #141210;
  --gold:        #c9a85c;
  --gold-light:  #e8cc8a;
  --gold-dim:    #7a6235;
  --cream:       #f5ead6;
  --text:        #e8d5b0;
  --text-dim:    #8a7660;
  --wood:        #5c3d1e;
  --wood-light:  #8b5e3c;
  --heart:       #e05c7a;
  --radius:      4px;
  --transition:  1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ───────────────────────────────────────────
   ÉCRAN D'ACCUEIL
───────────────────────────────────────────── */
#intro-screen {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: radial-gradient(ellipse at 50% 40%, #1a1408 0%, #0c0b09 70%);
  transition: opacity 1.5s ease, visibility 1.5s ease;
}
#intro-screen.fade-out { opacity: 0; visibility: hidden; }

.intro-bg-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--gold);
  border-radius: 50%;
  animation: float-particle linear infinite;
  opacity: 0;
}
@keyframes float-particle {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-20px) scale(1.5); opacity: 0; }
}

.intro-content {
  text-align: center;
  z-index: 1;
  padding: 2rem;
  max-width: 600px;
}

.intro-logo {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 20px var(--gold-dim); }
  50%       { opacity: 1;   text-shadow: 0 0 40px var(--gold), 0 0 80px var(--gold-dim); }
}

.intro-title {
  font-family: 'Lora', serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 0.04em;
  margin-bottom: 1.2rem;
  line-height: 1.2;
}

.intro-tagline {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 2rem;
}
.intro-tagline strong {
  color: var(--gold);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.intro-meta {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
}
.intro-meta .sep { color: var(--gold-dim); }

.btn-enter {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2.5rem;
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  font-family: 'Raleway', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}
.btn-enter::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(201,168,92,0.08), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
.btn-enter:hover::before { transform: translateX(100%); }
.btn-enter:hover {
  border-color: var(--gold);
  color: var(--cream);
  box-shadow: 0 0 30px rgba(201,168,92,0.15);
}
.btn-enter svg { width: 18px; height: 18px; transition: transform 0.3s; }
.btn-enter:hover svg { transform: translateX(4px); }

.intro-note {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.6;
}

/* ───────────────────────────────────────────
   EXPOSITION
───────────────────────────────────────────── */
#exhibition {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.hidden { display: none !important; }

/* Header */
.expo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem;
  background: rgba(12,11,9,0.9);
  border-bottom: 1px solid rgba(201,168,92,0.08);
  backdrop-filter: blur(8px);
  z-index: 10;
  flex-shrink: 0;
}
.expo-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
}
.expo-header-right { display: flex; gap: 0.5rem; }

.btn-nav {
  background: none;
  border: 1px solid rgba(201,168,92,0.2);
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Raleway', sans-serif;
}
.btn-nav:hover { border-color: var(--gold); color: var(--gold); }
.btn-music.active { color: var(--gold); border-color: var(--gold); }

/* Photo stage */
.photo-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 50%, #141008 0%, #080706 100%);
}

.photo-frame {
  position: relative;
  max-width: 90vw;
  max-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  display: block;
  box-shadow:
    0 0 60px rgba(0,0,0,0.8),
    0 0 120px rgba(0,0,0,0.4),
    0 2px 4px rgba(0,0,0,0.9);
  transition: opacity var(--transition);
}
.photo-img--preload {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  pointer-events: none;
}

/* Transition overlay */
.transition-overlay {
  position: absolute; inset: 0;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 5;
}
.transition-overlay.active { opacity: 1; }

/* Time messages */
.time-message {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--gold-dim);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  text-shadow: 0 0 20px rgba(0,0,0,0.9);
  white-space: nowrap;
}
.time-message.visible { opacity: 1; }

/* ───────────────────────────────────────────
   ACTION BAR
───────────────────────────────────────────── */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 0.6rem 1.5rem;
  background: rgba(12,11,9,0.95);
  border-top: 1px solid rgba(201,168,92,0.08);
  flex-shrink: 0;
}

/* Timer ring */
.timer-block {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.timer-ring {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.timer-ring__bg {
  fill: none;
  stroke: rgba(201,168,92,0.1);
  stroke-width: 2.5;
}
.timer-ring__fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 150.8;  /* 2π × 24 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s;
}
.timer-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--gold-dim);
  font-family: 'Raleway', sans-serif;
}

/* Photo counter */
.photo-counter {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  min-width: 60px;
  text-align: center;
}
.photo-counter .sep { margin: 0 0.2rem; color: var(--gold-dim); }

/* Boutons action */
.btn-action {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid rgba(201,168,92,0.15);
  color: var(--text-dim);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Raleway', sans-serif;
  transition: all 0.3s;
  border-radius: 2px;
}
.btn-action svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-action:hover { border-color: var(--gold); color: var(--gold); }

.btn-heart.liked {
  color: var(--heart);
  border-color: var(--heart);
}
.btn-heart.liked svg { fill: var(--heart); stroke: var(--heart); }
.btn-heart.pop { animation: heart-pop 0.4s ease; }
@keyframes heart-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.btn-nav-small {
  background: none;
  border: 1px solid rgba(201,168,92,0.12);
  color: var(--text-dim);
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  border-radius: 2px;
}
.btn-nav-small:hover { border-color: var(--gold); color: var(--gold); }

/* ───────────────────────────────────────────
   MODAL COMMENTAIRES
───────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,7,6,0.88);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.modal-box {
  position: relative;
  background: #141210;
  border: 1px solid rgba(201,168,92,0.2);
  width: min(560px, 94vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: 0 0 80px rgba(0,0,0,0.8);
  overflow: hidden;
}
.modal-close {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: none; border: none;
  color: var(--text-dim); font-size: 1rem;
  cursor: pointer; transition: color 0.2s;
}
.modal-close:hover { color: var(--cream); }

.modal-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--cream);
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  max-height: 40vh;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.comment-item {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(201,168,92,0.07);
}
.comment-item:last-child { border-bottom: none; }
.comment-pseudo {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.comment-text {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}
.comment-date {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}
.no-comments {
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.9rem;
  padding: 1.5rem 0;
}
.loading-text { color: var(--text-dim); font-size: 0.9rem; text-align: center; padding: 1rem 0; }

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.comment-form input,
.comment-form textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,92,0.15);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  outline: none;
  resize: none;
  transition: border-color 0.3s;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--gold-dim); }
.comment-form textarea { min-height: 80px; }

.btn-submit {
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  padding: 0.5rem 1.5rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-submit:hover {
  border-color: var(--gold);
  color: var(--cream);
  background: rgba(201,168,92,0.05);
}

/* ───────────────────────────────────────────
   PAGE BONUS
───────────────────────────────────────────── */
#bonus-page {
  position: fixed; inset: 0;
  background: var(--bg);
  overflow-y: auto;
  z-index: 50;
  padding: 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.bonus-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.btn-back {
  background: none; border: 1px solid rgba(201,168,92,0.2);
  color: var(--text-dim);
  padding: 0.4rem 1rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-back:hover { border-color: var(--gold); color: var(--gold); }

.bonus-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 2rem;
  font-weight: 400;
  color: var(--cream);
}
.bonus-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-top: 0.2rem;
}

.bonus-section { margin-bottom: 3rem; }
.bonus-section-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201,168,92,0.15);
}

/* Vidéos */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.video-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(201,168,92,0.1);
  padding: 0.8rem;
  transition: border-color 0.3s;
}
.video-card:hover { border-color: rgba(201,168,92,0.3); }
.video-player {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #000;
}
.video-label {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Audios */
.audios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.audio-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(201,168,92,0.1);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}
.audio-card:hover,
.audio-card.playing { border-color: var(--gold); background: rgba(201,168,92,0.04); }
.audio-visual {
  position: relative;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
}
.audio-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 40px;
}
.wave-bar {
  width: 3px;
  background: var(--gold-dim);
  border-radius: 2px;
  transition: all 0.3s;
}
.audio-card.playing .wave-bar {
  background: var(--gold);
  animation: wave-animate 0.8s ease-in-out infinite alternate;
}
@keyframes wave-animate {
  from { transform: scaleY(0.3); }
  to   { transform: scaleY(1.2); }
}
.audio-card.playing .wave-bar:nth-child(even) { animation-delay: 0.15s; }
.audio-card.playing .wave-bar:nth-child(3n)   { animation-delay: 0.3s; }

.audio-play-btn {
  position: absolute; inset: 0;
  background: rgba(201,168,92,0.15);
  border: none;
  color: var(--gold);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.audio-card:hover .audio-play-btn { opacity: 1; }
.audio-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--cream);
}

/* ───────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 600px) {
  .action-bar { gap: 0.6rem; padding: 0.5rem; }
  .btn-action { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
  .btn-action svg { width: 16px; height: 16px; }
  .timer-block { width: 36px; height: 36px; }
  .expo-header { padding: 0.5rem 0.8rem; }
}
