:root {
  --dragon:          #46345E;
  --dragon-dark:     #2a1c3a;
  --dragon-mid:      #5c4478;
  --flower-deep:     #DF6E7D;
  --flower-light:    #F49FAA;
  --leaf:            #86AB84;
  --leaf-dark:       #648c62;
  --bg-mist:         #B7C4D7;
  --bg-lavender:     #BDB3C9;
  --bg-mauve:        #B5ABC8;
  --bg-slate:        #ACB4CA;
  --butterfly:       #46AADD;
  --butterfly-light: #BDDBEE;
  --page-dark:       #0f0b18;
  --text-light:      #e8dff0;
  --text-muted:      #9a88b0;
  --text-parchment:  #1e1030;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--page-dark);
  color: var(--text-light);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 19px;
  line-height: 1.78;
  overflow-x: hidden;
  transition: background-color 0.45s ease, color 0.35s ease;
}

/* ─── NAVIGATION ─────────────────────────────────────────────── */

#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.1rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.45s, box-shadow 0.45s;
}

#nav.scrolled {
  background: rgba(15, 11, 24, 0.93);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(70, 52, 94, 0.35);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo-img {
  height: 34px;
  width: auto;
  opacity: 0;
  transition: opacity 0.5s;
}

#nav.scrolled .nav-logo-img { opacity: 1; }

.nav-wordmark {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1rem;
  color: var(--text-light);
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.5s;
}

#nav.scrolled .nav-wordmark { opacity: 1; }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--flower-deep);
  transition: width 0.35s;
}

.nav-links a:hover { color: var(--flower-light); }
.nav-links a:hover::after { width: 100%; }

/* ─── HÉROS ──────────────────────────────────────────────────── */

#accueil {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

#accueil::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(70,52,94,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 85%, rgba(70,170,221,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 85% 15%, rgba(223,110,125,0.06) 0%, transparent 60%);
  pointer-events: none;
}

#noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

#particles {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.hero-logo {
  width: min(220px, 38vw);
  height: auto;
  filter: drop-shadow(0 0 50px rgba(70,52,94,0.9));
  animation: float 7s ease-in-out infinite;
  cursor: pointer;
  transition: filter 0.3s ease;
}

.hero-logo:hover {
  filter: drop-shadow(0 0 65px rgba(70,52,94,1)) drop-shadow(0 0 20px rgba(223,110,125,0.4));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-weight: 900;
  color: var(--text-light);
  letter-spacing: 0.07em;
  line-height: 1;
  text-shadow:
    0 0 50px rgba(70,52,94,0.95),
    0 0 110px rgba(70,52,94,0.4);
}

.hero-rule {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  width: 380px;
  max-width: 80vw;
}

.hero-rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--flower-deep));
}
.hero-rule-line.r { background: linear-gradient(to left, transparent, var(--flower-deep)); }

.hero-rule-gem {
  width: 7px; height: 7px;
  background: var(--flower-deep);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--flower-deep);
}

.hero-tagline {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  max-width: 480px;
}

.scroll-cue {
  position: absolute;
  bottom: 2.2rem; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  animation: breathe 2.8s ease-in-out infinite;
}

.scroll-cue-bar {
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, var(--flower-deep), transparent);
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}

/* ─── SÉPARATEUR ─────────────────────────────────────────────── */

.sep {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 4rem;
  gap: 1.5rem;
}

.sep-line {
  flex: 1;
  max-width: 260px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(70,52,94,0.45));
}
.sep-line.r { background: linear-gradient(to left, transparent, rgba(70,52,94,0.45)); }

.sep-star {
  fill: var(--leaf);
  opacity: 0.7;
}

/* ─── SECTIONS COMMUNES ──────────────────────────────────────── */

.section-wrap { width: 100%; }
.section-wrap.tinted {
  background: linear-gradient(160deg, rgba(70,52,94,0.12) 0%, rgba(15,11,24,0) 100%);
  border-top:    1px solid rgba(70,52,94,0.18);
  border-bottom: 1px solid rgba(70,52,94,0.18);
}

section:not(#accueil) {
  padding: 6.5rem 4rem;
  max-width: 1180px;
  margin: 0 auto;
}

.s-header {
  text-align: center;
  margin-bottom: 4rem;
}

.s-label {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--flower-deep);
  margin-bottom: 0.9rem;
}

.s-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.2;
  text-shadow: 0 0 40px rgba(70,52,94,0.5);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.orn-line {
  width: 60px; height: 1px;
  background: linear-gradient(to right, transparent, var(--dragon-mid));
}
.orn-line.r { background: linear-gradient(to left, transparent, var(--dragon-mid)); }

.orn-dia {
  width: 6px; height: 6px;
  background: var(--leaf);
  transform: rotate(45deg);
}

/* ─── MONDE ──────────────────────────────────────────────────── */

.monde-intro {
  max-width: 680px;
  margin: 0 auto 4rem;
  text-align: center;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}

.f-card {
  background: linear-gradient(145deg, rgba(70,52,94,0.28), rgba(70,52,94,0.08));
  border: 1px solid rgba(70,52,94,0.38);
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
}

.f-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(to right, transparent, var(--flower-deep), transparent);
}

.f-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 45px rgba(0,0,0,0.45);
  border-color: rgba(223,110,125,0.38);
}

.f-icon {
  width: 52px; height: 52px;
  margin: 0 auto 1.4rem;
}

.f-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.7rem;
}

.f-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── LORE ───────────────────────────────────────────────────── */

.lore-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 2.5rem;
}

.tab-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(70,52,94,0.5);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn:hover {
  border-color: rgba(134,171,132,0.5);
  color: var(--leaf);
}

.tab-btn.active {
  background: var(--dragon);
  border-color: var(--dragon-mid);
  color: var(--text-light);
}

.lore-panel { display: none; }
.lore-panel.active {
  display: block;
  animation: fadeUp 0.4s ease;
}

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

.parchment {
  background: linear-gradient(150deg, var(--bg-lavender), var(--bg-mauve));
  border: 1px solid rgba(134,171,132,0.32);
  color: var(--text-parchment);
  padding: 3.5rem 4.5rem;
  position: relative;
}

.parchment::before,
.parchment::after {
  content: '';
  position: absolute;
  left: 0; right: 0; height: 5px;
  background: linear-gradient(to right, var(--leaf-dark), var(--leaf) 40%, var(--leaf-dark));
}
.parchment::before { top: 0; }
.parchment::after  { bottom: 0; }

.parchment h3 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dragon);
  text-align: center;
  margin-bottom: 2rem;
}

.lore-body { font-size: 1.02rem; line-height: 1.88; }

.lore-body p + p { margin-top: 1.2rem; }

.lore-body h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  letter-spacing: 0.09em;
  color: var(--dragon);
  margin: 2rem 0 0.7rem;
}

/* ─── REJOINDRE ──────────────────────────────────────────────── */

.join-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
}

.dl-area { text-align: center; }

.dl-area p {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-light);
  padding: 1.1rem 3rem;
  background: linear-gradient(135deg, var(--dragon-dark), var(--dragon));
  border: 1px solid rgba(134,171,132,0.4);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.35s, border-color 0.35s;
}

.btn-dl::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--dragon), var(--dragon-mid));
  opacity: 0;
  transition: opacity 0.4s;
}

.btn-dl:hover::before { opacity: 1; }
.btn-dl:hover {
  box-shadow: 0 0 35px rgba(70,52,94,0.65);
  border-color: rgba(134,171,132,0.7);
}

.btn-dl svg,
.btn-dl span { position: relative; z-index: 1; }

.btn-dl svg { width: 18px; height: 18px; }

.social-area { text-align: center; width: 100%; }

.social-cap {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.75rem 1.7rem;
  border: 1px solid rgba(70,52,94,0.42);
  transition: all 0.3s;
}

.social-link:hover {
  color: var(--butterfly-light);
  border-color: var(--butterfly);
  background: rgba(70,170,221,0.07);
  box-shadow: 0 0 22px rgba(70,170,221,0.14);
}

.social-link svg { width: 17px; height: 17px; fill: currentColor; }

/* ─── FOOTER ─────────────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid rgba(70,52,94,0.2);
}

.footer-logo {
  height: 48px;
  width: auto;
  opacity: 0.55;
  margin-bottom: 0.9rem;
}

.footer-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.footer-copy {
  font-size: 0.82rem;
  font-style: italic;
  color: rgba(154,136,176,0.45);
}

/* ─── SCROLL REVEAL ──────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.vis { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.22s; }
.d3 { transition-delay: 0.34s; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  #nav { padding: 1rem 1.8rem; }
  .nav-links { gap: 1.4rem; }
  section:not(#accueil) { padding: 5rem 2rem; }
  .feature-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .parchment { padding: 2.5rem 2rem; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .sep { padding: 1.5rem 2rem; }
}

/* ─── LIGHT MODE ─────────────────────────────────────────────── */

body.light {
  background-color: #B7C4D7;
  color: #1e1030;
}

body.light #nav.scrolled {
  background: rgba(183, 196, 215, 0.94);
  box-shadow: 0 1px 0 rgba(70, 52, 94, 0.18);
}

body.light .nav-wordmark { color: #1e1030; }
body.light .nav-links a  { color: #46345E; }
body.light .nav-links a:hover { color: #DF6E7D; }
body.light .nav-links a::after { background: #DF6E7D; }

body.light #accueil::before {
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(183,196,215,0.65) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 85%, rgba(70,170,221,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 85% 15%, rgba(223,110,125,0.08) 0%, transparent 60%);
}

body.light .hero-logo {
  filter: drop-shadow(0 0 40px rgba(70,52,94,0.35));
}

body.light .hero-logo:hover {
  filter: drop-shadow(0 0 55px rgba(70,52,94,0.55)) drop-shadow(0 0 18px rgba(223,110,125,0.3));
}

body.light .hero-title {
  color: #1e1030;
  text-shadow:
    0 0 40px rgba(183,196,215,0.9),
    0 0 80px rgba(70,52,94,0.15);
}

body.light .hero-rule-line {
  background: linear-gradient(to right, transparent, #DF6E7D);
}
body.light .hero-rule-line.r {
  background: linear-gradient(to left, transparent, #DF6E7D);
}

body.light .hero-tagline { color: #46345E; }

body.light .scroll-cue   { color: #5c4478; }

body.light .sep-line {
  background: linear-gradient(to right, transparent, rgba(70,52,94,0.28));
}
body.light .sep-line.r {
  background: linear-gradient(to left, transparent, rgba(70,52,94,0.28));
}

body.light .section-wrap.tinted {
  background: linear-gradient(160deg, rgba(70,52,94,0.07) 0%, rgba(183,196,215,0) 100%);
  border-color: rgba(70,52,94,0.14);
}

body.light .s-title {
  color: #1e1030;
  text-shadow: 0 0 30px rgba(183,196,215,0.7);
}

body.light .monde-intro { color: #46345E; }

body.light .f-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.55), rgba(255,255,255,0.28));
  border-color: rgba(70,52,94,0.18);
}

body.light .f-card:hover {
  border-color: rgba(223,110,125,0.38);
  box-shadow: 0 22px 45px rgba(70,52,94,0.1);
}

body.light .f-card h3 { color: #1e1030; }
body.light .f-card p  { color: #46345E; }

body.light .tab-btn {
  border-color: rgba(70,52,94,0.28);
  color: #46345E;
}

body.light .tab-btn:hover {
  border-color: rgba(100,140,98,0.55);
  color: #648c62;
}

body.light .tab-btn.active {
  background: #46345E;
  border-color: #5c4478;
  color: #e8dff0;
}

body.light .parchment {
  background: linear-gradient(150deg, #ddd6ec, #d4cfe6);
  border-color: rgba(134,171,132,0.35);
}

body.light .btn-dl { color: #e8dff0; }

body.light .dl-area p   { color: #46345E; }
body.light .social-cap  { color: #46345E; }

body.light .social-link {
  border-color: rgba(70,52,94,0.28);
  color: #46345E;
}

body.light .social-link:hover {
  color: #2a1c3a;
  border-color: #46AADD;
  background: rgba(70,170,221,0.1);
  box-shadow: 0 0 20px rgba(70,170,221,0.12);
}

body.light footer {
  border-color: rgba(70,52,94,0.14);
}

body.light .footer-name { color: #46345E; }
body.light .footer-copy { color: rgba(70,52,94,0.38); }
