/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=MedievalSharp&display=swap');

@font-face {
  font-family: 'Furia';
  src: url('../fonts/furia-iii.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===== VARIABLES ===== */
:root {
  --parchment:    #f5ead0;
  --parchment-dk: #e8d9b5;
  --wood:         #6b4226;
  --wood-light:   #8b6340;
  --wood-dark:    #4a2c14;
  --gold:         #a78a7f;
  --gold-dim:     #b88989;
  --green-moss:   #6b7c5e;
  --green-dark:   #4a5a3a;
  --cream:        #fdf6e3;
  --ink:          #2c1810;
  --ink-soft:     #4a3728;
  --sepia:        #8b7355;
  --wax:          #8b2500;
  --mist:         rgba(201, 168, 76, 0.15);
  --glow:         rgba(201, 168, 76, 0.4);

  --font-display: 'Furia', serif;
  --font-title:   'Cinzel', serif;
  --font-body:    'Crimson Text', serif;
  --font-accent:  'MedievalSharp', cursive;

  --section-padding: 6rem 2rem;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: var(--font-body);
  color: #160401;
  background: #160401;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Parchment texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(139, 115, 85, 0.02) 3px,
      rgba(139, 115, 85, 0.02) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 5px,
      rgba(139, 115, 85, 0.015) 5px,
      rgba(139, 115, 85, 0.015) 6px
    );
  pointer-events: none;
  z-index: 9999;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--parchment-dk);
}
::-webkit-scrollbar-thumb {
  background: var(--wood-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--wood);
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  background: #38040e;
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #735751;
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

.nav.visible {
  transform: translateY(0);
}

.nav a {
  font-family: var(--font-title);
  font-size: 0.7rem;
  color: var(--parchment);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  transition: color 0.3s, background 0.3s;
}

.nav a:hover,
.nav a.active {
  color: #a78a7f;
  background: rgba(201, 168, 76, 0.1);
}

/* ===== COMMON ===== */
.section {
  padding: var(--section-padding);
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.section-divider::before,
.section-divider::after {
  content: '';
  height: 1px;
  width: 80px;
  background: linear-gradient(90deg, transparent, #a78a7f, transparent);
}

.section-divider .ornament {
  font-size: 1.2rem;
  color: var(--gold-dim);
  opacity: 0.7;
}

.section-divider .divider-img {
  width: 200px;
  height: auto;
  object-fit: contain;
}

h2 {
  font-family: var(--font-body);
  font-size: 2rem;
  color: #a78a7f;
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: #a78a7f;
  margin: 0.8rem auto 0;
}

h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--wood);
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

blockquote {
  border-left: 3px solid var(--gold-dim);
  padding: 0.5rem 1rem;
  margin: 0.8rem 0;
  font-style: italic;
  color: var(--ink-soft);
  background: rgba(201, 168, 76, 0.06);
  border-radius: 0 4px 4px 0;
}

/* ===== ANIMATED ELEMENTS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== HERO ===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  background: #120000;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -20% 0;
  background: url('../img/mapmonde.png') center/cover no-repeat;
  opacity: 0.19;
  z-index: 0;
  will-change: transform;
}

/* Corner ornaments */
.hero::before,
.hero::after {
  content: '◆';
  position: absolute;
  font-size: 1.5rem;
  color: #735751;
  opacity: 0.3;
}

.hero::before {
  top: 2rem;
  left: 2rem;
}

.hero::after {
  bottom: 2rem;
  right: 2rem;
}

.hero-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero-corners::before,
.hero-corners::after {
  content: '◆';
  position: absolute;
  font-size: 1.5rem;
  color: #720026;
  opacity: 0.3;
}

.hero-corners::before {
  top: 2rem;
  right: 2rem;
}

.hero-corners::after {
  bottom: 2rem;
  left: 2rem;
}

.hero > *:not(.hero-bg):not(.hero-corners) {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-body);
  font-size: 2.8rem;
  font-weight: 700;
  color: #a78a7f;
  letter-spacing: 2px;
  margin-bottom: 0.4rem;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.1rem;
  color: #c9b89a;
  margin-bottom: 2rem;
  letter-spacing: 1px;
}

.hero-text {
  max-width: 1000px;
  font-size: 1.05rem;
  color: #e7d7c1;
  line-height: 1.9;
}

.hero-text p:last-child {
  margin-bottom: 0;
}

/* Zorbin transition block */
.zorbin-call {
  padding: 2rem;
  max-width: 600px;
  text-align: center;
  position: relative;
}

.zorbin-call p {
  font-style: italic;
  color: #e7d7c1;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

/* ===== CHRONICLE BUTTON (Serif Magazine style) ===== */
.btn-chronicle {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 0 10px;
  background: transparent;
  color: #a78a7f;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-bottom: 1.5px solid #735751;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
  text-decoration: none;
  position: relative;
}

.btn-chronicle::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 0;
  right: 100%;
  height: 1.5px;
  background: #735751;
  transition: right 0.4s cubic-bezier(0.77, 0, 0.18, 1);
}

.btn-chronicle:hover::after {
  right: 0;
}

.btn-chronicle:hover {
  color: #a78a7f;
  border-color: transparent;
}

.btn-chronicle .btn-arrow {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--sepia);
  align-self: center;
  transition: color 0.3s;
}

.btn-chronicle:hover .btn-arrow {
  color: var(--gold);
}

/* ===== PANEL / ENCART ===== */
.panel {
  background:
    linear-gradient(145deg, #3f0418 0%, #370617 100%);
  border: 1px solid rgba(107, 66, 38, 0.15);
  border-radius: 8px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  box-shadow:
    0 2px 12px rgba(44, 24, 16, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Subtle wood-frame top accent */
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #641220, transparent);
  border-radius: 0 0 3px 3px;
  opacity: 0.4;
}

/* Floral corner ornaments */
.panel-floral-tl,
.panel-floral-br {
  position: absolute;
  width: 120px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

.panel-floral-tl {
  top: 5px;
  left: 5px;
}

.panel-floral-br {
  bottom: 5px;
  right: 5px;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--wood-dark);
  text-align: center;
  margin-bottom: 1.5rem;
}

.panel-text {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  color: #e7d7c1;
  font-size: 1rem;
}

/* ===== ROLES GRID ===== */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

/* ── Role card 3D flip ── */
.role-card-container {
  perspective: 800px;
}

.role-card {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  cursor: default;
}

.role-card-container:hover .role-card {
  transform: rotateY(180deg);
}

.role-card-front,
.role-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(107, 66, 38, 0.12);
  background: linear-gradient(160deg, #432d34, #370617);
}

.role-card-front {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.role-card-container:hover .role-card-front {
  border-color: var(--gold);
}

.role-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-color: var(--gold);
  box-shadow:
    0 6px 20px rgba(44, 24, 16, 0.1),
    0 0 18px rgba(231, 215, 193, 0.18),
    inset 0 0 12px rgba(231, 215, 193, 0.06);
}

.role-card-back h3 {
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.role-mood {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  color: #e7d7c1;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.role-stats {
  width: 85%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.82rem;
}

.role-stats td {
  padding: 0.3rem 0.5rem;
  color: #e7d7c1;
}

.role-stats td:first-child {
  text-align: left;
  opacity: 0.8;
}

.role-stats td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--gold);
}

.role-stat-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 2px;
}

.role-icon {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  margin: 0 auto 0.8rem;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 2px 4px rgba(44, 24, 16, 0.15));
  transition: filter 0.4s ease;
}

.role-card-container:hover .role-icon {
  filter: drop-shadow(0 0 10px rgba(231, 215, 193, 0.5)) drop-shadow(0 0 20px rgba(231, 215, 193, 0.25));
}

/* Section header images */
.section-img {
  display: block;
  width: 192px;
  height: 192px;
  margin: 0 auto 1.5rem;
  object-fit: contain;
  text-align: center;
  filter: drop-shadow(0 2px 6px rgba(44, 24, 16, 0.12));
}

/* Hero key image */
.hero-key-img {
  display: block;
  width: 192px;
  height: 192px;
  margin: 0 auto 2rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(44, 24, 16, 0.12));
}

.role-card-front h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: #a78a7f;
}

.role-card-front .role-desc {
  font-size: 0.88rem;
  color: #e7d7c1;
  font-style: italic;
  margin: 0;
}

/* ===== CARTOGRAPHE ===== */
.cartographe {
  text-align: center;
}

.cartographe-text {
  max-width: 750px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
  color: #e7d7c1;
  line-height: 1.9;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 0 10px;
  background: transparent;
  color: #a78a7f;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-bottom: 1.5px solid #735751;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
  text-decoration: none;
  position: relative;
}

.btn::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 0;
  right: 100%;
  height: 1.5px;
  background: #735751;
  transition: right 0.4s cubic-bezier(0.77, 0, 0.18, 1);
}

.btn:hover::after {
  right: 0;
}

.btn:hover {
  color: #735751;
  border-color: transparent;
}

.btn .btn-arrow {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--sepia);
  align-self: center;
  transition: color 0.3s;
}

.btn:hover .btn-arrow {
  color: var(--gold);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.7rem;
  color: #640d14;
  border-top: 1px solid #38040e;
}

.footer a {
  color: #735751;
  text-decoration: none;
}

.footer a:hover {
  color: var(--gold);
}

/* ── Onboarding steps (decouverte) ── */
.onboarding-steps {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.onboarding-step {
  flex: 1;
  min-width: 220px;
  max-width: 280px;
  text-align: center;
  padding: 1.5rem;
  background: rgba(60, 30, 40, 0.3);
  border: 1px solid rgba(167, 138, 127, 0.15);
  border-radius: 10px;
  transition: border-color 0.3s, transform 0.3s;
}

.onboarding-step:hover {
  border-color: rgba(167, 138, 127, 0.35);
  transform: translateY(-3px);
}

.onboarding-step .step-number {
  font-family: 'MedievalSharp', cursive;
  font-size: 2rem;
  color: #a78a7f;
  margin-bottom: 0.6rem;
}

.onboarding-step h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  color: #e8dcc8;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.onboarding-step p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #a89080;
  line-height: 1.5;
}

/* ── Legacy block (ce que vous laissez) ── */
.legacy-block {
  background: rgba(60, 30, 40, 0.25);
  border: 1px solid rgba(167, 138, 127, 0.12);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.legacy-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: #a78a7f;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.legacy-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}

.legacy-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'MedievalSharp', cursive;
  font-size: 0.9rem;
  color: #c9b89a;
}

.legacy-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.legacy-example {
  display: flex;
  justify-content: center;
}

.legacy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: rgba(60, 30, 40, 0.4);
  border: 1px solid rgba(167, 138, 127, 0.2);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.3s, transform 0.3s;
  min-width: 200px;
}

.legacy-card:hover {
  border-color: rgba(167, 138, 127, 0.45);
  transform: translateY(-2px);
}

.legacy-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 168, 100, 0.5);
  box-shadow: 0 0 12px rgba(212, 168, 100, 0.4), 0 0 30px rgba(212, 168, 100, 0.2), 0 0 50px rgba(212, 168, 100, 0.1);
  animation: legacyGlow 3s ease-in-out infinite;
}

@keyframes legacyGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(212, 168, 100, 0.4), 0 0 30px rgba(212, 168, 100, 0.2), 0 0 50px rgba(212, 168, 100, 0.1); }
  50% { box-shadow: 0 0 18px rgba(212, 168, 100, 0.6), 0 0 40px rgba(212, 168, 100, 0.3), 0 0 60px rgba(212, 168, 100, 0.15); }
}

.legacy-card-role-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legacy-card-role-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.legacy-card-name {
  font-family: 'MedievalSharp', cursive;
  font-size: 1.1rem;
  color: #e8dcc8;
}

.legacy-card-role {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #a78a7f;
  font-style: italic;
}

.legacy-card-stats {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.legacy-card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.legacy-card-stat-val {
  font-family: 'MedievalSharp', cursive;
  font-size: 1rem;
  color: #e8dcc8;
}

.legacy-card-stat-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: #a89080;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legacy-card-hint {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: #689096;
  font-style: italic;
  margin-top: 4px;
}

/* ── Activity feed (decouverte) — bandeau défilant ── */
.activity-feed {
  overflow: hidden;
  position: relative;
  width: 100%;
  padding: 10px 0;
  border-top: 1px solid rgba(167, 138, 127, 0.12);
  border-bottom: 1px solid rgba(167, 138, 127, 0.12);
}

.activity-feed-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: feedScroll 80s linear infinite;
  width: max-content;
}

@keyframes feedScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.activity-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'MedievalSharp', cursive;
  font-size: 0.9rem;
  color: #c9b89a;
  flex-shrink: 0;
}

.activity-separator {
  color: rgba(167, 138, 127, 0.3);
  flex-shrink: 0;
}

.activity-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tooltip-word {
  border-bottom: 1px dotted #a78a7f;
  cursor: help;
  position: relative;
}

.tooltip-word::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 17, 24, 0.95);
  border: 1px solid rgba(167, 138, 127, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-style: italic;
  color: #c9b89a;
  white-space: normal;
  width: 280px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
  margin-bottom: 6px;
}

.tooltip-word:hover::after {
  opacity: 1;
}

.activity-picto {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .section {
    padding: 4rem 1.5rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .panel {
    padding: 1.8rem;
  }

  .roles-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
  }

  .nav a {
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .btn-chronicle {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }

  .btn-group {
    flex-direction: column;
    align-items: center;
  }
}
