/* ============================================
   MANDAO — Registre de l'Abysse
   Système de design : abyssal & organique
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

/* Zen Antique n'est pas toujours dispo sur toutes les langues latines avec de bons diacritiques,
   on charge une alternative à empreinte irrégulière compatible FR */
@import url('https://fonts.googleapis.com/css2?family=Zen+Antique&display=swap');

:root {
  --bg-void: #0a0c08;
  --bg-surface: #161810;
  --bg-surface-raised: #1e2117;
  --lichen: #7c8c6b;
  --lichen-dim: #4d5941;
  --offering: #5a2320;
  --offering-bright: #7a2f2a;
  --bone: #c9c3b4;
  --bone-dim: #6b6558;
  --bone-faint: #3a382f;

  --font-display: 'Zen Antique', serif;
  --font-body: 'Cormorant Garamond', serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-organic: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-void);
}

@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;
  }
}

body {
  background: var(--bg-void);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
  transition: background-color 1.6s ease, color 1.6s ease;
}

/* ============ Mensonge (rite caché : cliquer l'œil) ============ */

body.mensonge {
  --bg-void: #0d0505;
  --bg-surface: #1c0a09;
  --bg-surface-raised: #260e0c;
  --lichen: #b3433a;
  --lichen-dim: #6b2620;
  --offering: #7a1210;
  --offering-bright: #e0392c;
  --bone: #d6c2bd;
  --bone-dim: #8a6b66;
  --bone-faint: #3d2523;
}

body.mensonge .page-content p,
body.mensonge .page-content h1,
body.mensonge .page-content h2,
body.mensonge .page-content .lede,
body.mensonge .page-content .eyebrow,
body.mensonge .page-content li {
  text-decoration: line-through;
  text-decoration-color: var(--offering-bright);
  text-decoration-thickness: 2px;
  transition: text-decoration-color 1.6s ease;
}

@keyframes mensonge-jitter {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-1px) rotate(-0.3deg); }
  75% { transform: translateX(1px) rotate(0.3deg); }
}

body.mensonge .page-content h1,
body.mensonge .page-content h2 {
  animation: mensonge-jitter 0.15s steps(2) infinite;
}

.mensonge-overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s ease;
  background-image:
    radial-gradient(ellipse at center, transparent 35%, rgba(10, 5, 5, 0.7) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300' viewBox='0 0 400 300'%3E%3Cpath d='M20 10 L120 90 L80 140 L200 210' stroke='%23e0392c' stroke-width='2' fill='none' opacity='0.35'/%3E%3Cpath d='M350 20 L260 100 L300 160 L220 260' stroke='%23e0392c' stroke-width='1.6' fill='none' opacity='0.3'/%3E%3Cpath d='M40 250 L140 190 L110 130 L190 60' stroke='%237a1210' stroke-width='2.4' fill='none' opacity='0.4'/%3E%3Cpath d='M300 280 L340 200 L280 150 L330 80' stroke='%237a1210' stroke-width='2' fill='none' opacity='0.35'/%3E%3Cpath d='M0 150 L60 160 L40 200 L100 210' stroke='%23e0392c' stroke-width='1.2' fill='none' opacity='0.25'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  mix-blend-mode: overlay;
}

body.mensonge .mensonge-overlay { opacity: 0.85; }

@media (prefers-reduced-motion: reduce) {
  body.mensonge .page-content h1,
  body.mensonge .page-content h2 {
    animation: none;
  }
}

.mensonge-shard {
  display: block;
  color: var(--offering-bright);
  font-family: var(--font-body);
  font-weight: 700;
  font-style: italic;
  font-size: 1.3em;
  line-height: 1.35;
  text-decoration: none !important;
  margin: 1.6rem 0;
  animation: mensonge-jitter 0.15s steps(2) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .mensonge-shard { animation: none; }
}

/* ============ Brisure (transition rituelle : bris puis reformation) ============ */

.shatter-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
}

body.shatter-active .shatter-overlay { opacity: 1; }

.shatter-backdrop {
  position: absolute;
  inset: 0;
  background: #050301;
  opacity: 0;
}

body.shatter-active .shatter-backdrop {
  animation: shatter-backdrop-fade 7s ease-in-out;
}

@keyframes shatter-backdrop-fade {
  0% { opacity: 0; }
  9% { opacity: 1; }
  62% { opacity: 1; }
  88% { opacity: 0; }
  100% { opacity: 0; }
}

.shatter-cracks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.shatter-cracks path {
  fill: none;
  stroke: var(--bone);
  stroke-width: 0.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 3px var(--offering-bright));
}

body.shatter-active .shatter-cracks {
  animation: shatter-cracks-fade 7s ease-in-out;
}

body.shatter-active .shatter-cracks path {
  animation: shatter-cracks-draw 1.7s ease-out forwards;
}

@keyframes shatter-cracks-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes shatter-cracks-fade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  58% { opacity: 1; }
  88% { opacity: 0; }
  100% { opacity: 0; }
}

.shatter-shard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, rgba(40,42,36,0.92), rgba(60,20,16,0.85));
  opacity: 0;
  transform: translate(0, 0) rotate(0deg) scale(1);
  will-change: opacity, transform;
  --fx: 0vw;
  --fy: 0vh;
  --fr: 0deg;
  --fs: 0.82;
}

/* Éclats proches du point d'impact : petits, plus clairs (reflet du choc) */
.shatter-shard[class*="shard-in-"] {
  background: linear-gradient(145deg, rgba(70,74,60,0.92), rgba(90,28,22,0.85));
  box-shadow: inset 0 0 22px rgba(255,255,255,0.1);
}

.shatter-shard[class*="shard-out-"] {
  box-shadow: inset 0 0 16px rgba(224,57,44,0.16);
}

/* Fine ligne de séparation façon éclat de verre, tracée le long du contour
   même du clip-path grâce à un filtre drop-shadow répété sur plusieurs angles */
.shatter-shard {
  filter:
    drop-shadow(0.5px 0 0 rgba(201,195,180,0.28))
    drop-shadow(-0.5px 0 0 rgba(201,195,180,0.28))
    drop-shadow(0 0.5px 0 rgba(201,195,180,0.28))
    drop-shadow(0 -0.5px 0 rgba(201,195,180,0.28));
}

body.shatter-active .shatter-shard {
  animation: shatter-piece 7s cubic-bezier(0.6, 0, 0.35, 1) both;
}

body.shatter-reverse .shatter-shard,
body.shatter-reverse .shatter-flash {
  animation-direction: reverse;
}

/* Fragmentation en éventail depuis le centre exact de l'écran (50%, 50%) :
   un anneau intérieur (8 petits triangles) et un anneau extérieur (8
   quadrilatères/pentagones plus larges) qui s'emboîtent exactement, sans trou
   ni chevauchement, jusqu'aux quatre coins de l'écran. */
.shard-in-1  { clip-path: polygon(50% 50%, 38% 30%, 62% 30%); animation-delay: 0.02s; --fx: 0vw;    --fy: -30vh; --fr: 10deg; }
.shard-out-1 { clip-path: polygon(20% 0%, 80% 0%, 62% 30%, 38% 30%); animation-delay: 0.06s; --fx: 0vw;    --fy: -34vh; --fr: 8deg; }

.shard-in-2  { clip-path: polygon(50% 50%, 62% 30%, 71% 40%); animation-delay: 0.01s; --fx: 26vw;  --fy: -22vh; --fr: 22deg; }
.shard-out-2 { clip-path: polygon(80% 0%, 100% 0%, 100% 25%, 71% 40%, 62% 30%); animation-delay: 0.05s; --fx: 28vw;  --fy: -24vh; --fr: 20deg; }

.shard-in-3  { clip-path: polygon(50% 50%, 71% 40%, 71% 60%); animation-delay: 0.03s; --fx: 34vw;  --fy: 0vh;   --fr: -12deg; }
.shard-out-3 { clip-path: polygon(100% 25%, 100% 75%, 71% 60%, 71% 40%); animation-delay: 0.09s; --fx: 38vw;  --fy: 0vh;   --fr: -14deg; }

.shard-in-4  { clip-path: polygon(50% 50%, 71% 60%, 62% 70%); animation-delay: 0.02s; --fx: 26vw;  --fy: 28vh;  --fr: 16deg; }
.shard-out-4 { clip-path: polygon(100% 75%, 100% 100%, 80% 100%, 62% 70%, 71% 60%); animation-delay: 0.07s; --fx: 28vw;  --fy: 30vh;  --fr: 18deg; }

.shard-in-5  { clip-path: polygon(50% 50%, 62% 70%, 38% 70%); animation-delay: 0.04s; --fx: 0vw;   --fy: 32vh;  --fr: -8deg; }
.shard-out-5 { clip-path: polygon(80% 100%, 20% 100%, 38% 70%, 62% 70%); animation-delay: 0.1s; --fx: 0vw;   --fy: 36vh;  --fr: -10deg; }

.shard-in-6  { clip-path: polygon(50% 50%, 38% 70%, 29% 60%); animation-delay: 0.01s; --fx: -26vw; --fy: 28vh;  --fr: -20deg; }
.shard-out-6 { clip-path: polygon(20% 100%, 0% 100%, 0% 75%, 29% 60%, 38% 70%); animation-delay: 0.08s; --fx: -28vw; --fy: 30vh;  --fr: -22deg; }

.shard-in-7  { clip-path: polygon(50% 50%, 29% 60%, 29% 40%); animation-delay: 0.03s; --fx: -34vw; --fy: 0vh;   --fr: 14deg; }
.shard-out-7 { clip-path: polygon(0% 75%, 0% 25%, 29% 40%, 29% 60%); animation-delay: 0.11s; --fx: -38vw; --fy: 0vh;   --fr: 16deg; }

.shard-in-8  { clip-path: polygon(50% 50%, 29% 40%, 38% 30%); animation-delay: 0.02s; --fx: -26vw; --fy: -28vh; --fr: -16deg; }
.shard-out-8 { clip-path: polygon(0% 25%, 0% 0%, 20% 0%, 38% 30%, 29% 40%); animation-delay: 0.06s; --fx: -28vw; --fy: -30vh; --fr: -18deg; }

@keyframes shatter-piece {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(1); }
  10% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1.015); }
  30% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(var(--fs)); }
}

.shatter-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,238,228,0.85), rgba(224,57,44,0.32) 45%, transparent 72%);
  opacity: 0;
  mix-blend-mode: screen;
}

body.shatter-active .shatter-flash {
  animation: shatter-flash-pulse 7s ease-in-out;
}

@keyframes shatter-flash-pulse {
  0%, 8% { opacity: 0; }
  11% { opacity: 0.9; }
  22% { opacity: 0; }
  100% { opacity: 0; }
}

/* Au moment de l'impact, la fracture prend brièvement la forme de l'œil
   qu'on vient de cliquer, avant de céder aux éclats qui se dispersent. */
.shatter-eye-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(62vw, 700px);
  height: auto;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
}

.shatter-eye-mark path {
  fill: none;
  stroke: var(--offering-bright);
  stroke-width: 3;
  filter: drop-shadow(0 0 14px var(--offering-bright)) drop-shadow(0 0 34px rgba(224,57,44,0.55));
}

body.shatter-active .shatter-eye-mark {
  animation: shatter-eye-mark-pulse 7s ease-out;
}

body.shatter-reverse .shatter-eye-mark {
  animation-direction: reverse;
}

@keyframes shatter-eye-mark-pulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.78); }
  9% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.04); }
  20% { opacity: 0; transform: translate(-50%, -50%) scale(1.28); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.28); }
}

@keyframes shatter-shake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-3px, 2px); }
  20% { transform: translate(4px, -3px); }
  30% { transform: translate(-4px, 3px); }
  40% { transform: translate(3px, -2px); }
  50% { transform: translate(-2px, 2px); }
  60% { transform: translate(2px, -1px); }
  70%, 100% { transform: translate(0, 0); }
}

body.shatter-active .page-content {
  animation: shatter-shake 0.5s ease-in-out 3;
}

/* Le rituel (bris + reformation) est déclenché volontairement par un clic ;
   comme le suivi de l'œil, il doit rester perceptible même si le système
   préfère un mouvement réduit, la règle globale ci-dessous est donc contournée
   spécifiquement pour ces animations (spécificité supérieure au sélecteur *). */
@media (prefers-reduced-motion: reduce) {
  body.shatter-active .shatter-backdrop {
    animation-duration: 7s !important;
    animation-iteration-count: 1 !important;
  }
  body.shatter-active .shatter-flash {
    animation-duration: 7s !important;
    animation-iteration-count: 1 !important;
  }
  body.shatter-active .shatter-eye-mark {
    animation-duration: 7s !important;
    animation-iteration-count: 1 !important;
  }
  body.shatter-active .shatter-cracks {
    animation-duration: 7s !important;
    animation-iteration-count: 1 !important;
  }
  body.shatter-active .shatter-cracks path {
    animation-duration: 1.7s !important;
    animation-iteration-count: 1 !important;
  }
  body.shatter-active .shatter-shard {
    animation-duration: 7s !important;
    animation-iteration-count: 1 !important;
  }
  body.shatter-active .page-content {
    animation-duration: 0.5s !important;
    animation-iteration-count: 3 !important;
  }
}

/* Texture de fond : grain subtil + vignette organique */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124,140,107,0.05), transparent 55%),
    radial-gradient(ellipse at 20% 90%, rgba(90,35,32,0.06), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(0,0,0,0.6), transparent 40%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ============ Œil de l'Abysse (fond, suit le curseur) ============ */

.abyss-eye {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem 0;
  cursor: pointer;
  opacity: 0.55;
  animation: eye-breathe 7s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

.abyss-eye:hover { opacity: 0.75; }

.abyss-eye .eye-lid-top,
.abyss-eye .eye-lid-bottom {
  fill: var(--bg-void);
  opacity: 0;
  transition: transform 1.4s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.6s ease, fill 1.6s ease;
}

.abyss-eye .eye-lid-top { transform: translateY(-40px); }
.abyss-eye .eye-lid-bottom { transform: translateY(40px); }

body.mensonge .abyss-eye .eye-lid-top,
body.mensonge .abyss-eye .eye-lid-bottom {
  opacity: 1;
  transform: translateY(0);
}

.abyss-eye svg {
  width: min(60vw, 680px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 28px rgba(124, 140, 107, 0.35));
}

.abyss-eye .eye-lid {
  fill: rgba(30, 33, 23, 0.75);
  stroke: var(--lichen);
  stroke-width: 1.4;
}

.abyss-eye .eye-iris {
  transition: r 0.3s var(--ease-organic);
}

.abyss-eye .eye-pupil {
  fill: var(--bg-void);
}

.abyss-eye .eye-glint {
  fill: var(--bone);
  opacity: 0.7;
}

@keyframes eye-breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
  .abyss-eye { animation: none; }
}

@media (max-width: 640px) {
  .abyss-eye { opacity: 0.35; }
}

/* ============ Ornements latéraux (racines/lichen) ============ */

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

.side-ornaments::before,
.side-ornaments::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(90px, 9vw, 230px);
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='420' viewBox='0 0 200 420'%3E%3Ccircle cx='38' cy='55' r='16' fill='%234d5941' opacity='0.16'/%3E%3Ccircle cx='96' cy='222' r='22' fill='%234d5941' opacity='0.14'/%3E%3Ccircle cx='42' cy='332' r='14' fill='%237c8c6b' opacity='0.14'/%3E%3Cpath d='M30 0 C 90 40, 10 80, 70 130 C 120 170, 20 210, 80 260 C 130 300, 15 340, 60 380 C 90 400, 25 415, 30 420' stroke='%234d5941' stroke-width='1.5' fill='none'/%3E%3Cpath d='M70 130 C 100 118, 132 122, 156 102' stroke='%234d5941' stroke-width='0.9' fill='none'/%3E%3Cpath d='M156 102 C 168 96, 178 98, 188 88' stroke='%234d5941' stroke-width='0.5' fill='none'/%3E%3Cpath d='M80 260 C 50 252, 18 256, -6 238' stroke='%234d5941' stroke-width='0.9' fill='none'/%3E%3Cpath d='M60 380 C 92 372, 122 376, 146 356' stroke='%234d5941' stroke-width='0.9' fill='none'/%3E%3Cpath d='M70 130 C 66 152, 76 170, 66 192' stroke='%237c8c6b' stroke-width='0.5' fill='none' opacity='0.7'/%3E%3Ccircle cx='156' cy='100' r='3.4' fill='%237c8c6b'/%3E%3Ccircle cx='189' cy='87' r='1.8' fill='%237c8c6b' opacity='0.7'/%3E%3Ccircle cx='-6' cy='236' r='2.8' fill='%237a2f2a'/%3E%3Ccircle cx='146' cy='354' r='3' fill='%237c8c6b'/%3E%3Ccircle cx='18' cy='150' r='1.6' fill='%23c9c3b4' opacity='0.35'/%3E%3Ccircle cx='105' cy='300' r='1.6' fill='%23c9c3b4' opacity='0.3'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-position: left top;
  background-size: 200px 420px;
}

.side-ornaments::before { left: 0; }
.side-ornaments::after { right: 0; transform: scaleX(-1); }

@media (max-width: 1400px) {
  .side-ornaments::before,
  .side-ornaments::after {
    display: none;
  }
}

.page-content { position: relative; z-index: 3; }

/* ============ Contrôle de la musique (icône + curseur de volume) ============ */

.music-control {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--bone-faint);
  background: rgba(10,12,8,0.72);
  backdrop-filter: blur(4px);
  transition: border-color 0.3s var(--ease-organic), background 0.3s var(--ease-organic);
}
.music-control:hover { border-color: var(--lichen-dim); }

.music-icon {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  color: var(--bone-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.3s var(--ease-organic);
}
.music-icon:hover { color: var(--lichen); }
.music-icon svg { width: 19px; height: 19px; }
.music-icon .icon-off { display: none; }
.music-icon.muted .icon-on { display: none; }
.music-icon.muted .icon-off { display: block; }

.music-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 84px;
  height: 3px;
  background: var(--bone-faint);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.music-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lichen);
  cursor: pointer;
}
.music-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--lichen);
  cursor: pointer;
}
.music-slider::-moz-range-progress {
  background: var(--lichen-dim);
  height: 3px;
  border-radius: 999px;
}

@media (max-width: 640px) {
  .music-control { right: 1rem; bottom: 1rem; padding: 0.45rem 0.75rem; gap: 0.55rem; }
  .music-slider { width: 64px; }
}

::selection { background: var(--lichen-dim); color: var(--bone); }

/* ============ Typography ============ */

h1, h2, h3, .eyebrow {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(2.5rem, 7vw, 5rem); line-height: 1.1; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.25; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--lichen);
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--lichen-dim);
  display: inline-block;
}

p { color: var(--bone-dim); font-size: 1.15rem; }
p + p { margin-top: 1.1em; }

.lede {
  font-size: 1.4rem;
  color: var(--bone);
  font-style: italic;
  font-weight: 500;
}

a { color: var(--lichen); text-decoration: none; }

/* ============ Layout ============ */

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.75rem;
}

.wrap-wide {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.75rem;
}

section { position: relative; padding: 7rem 0; }

/* ============ Nav ============ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 2.2rem;
  background: linear-gradient(to bottom, rgba(10,12,8,0.9), transparent);
  backdrop-filter: blur(2px);
}

.nav-mark {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  color: var(--bone);
}
.nav-mark span { color: var(--lichen); }

.nav-links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--bone-dim);
  transition: color 0.3s var(--ease-organic);
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--lichen); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0; right: 0;
  height: 1px;
  background: var(--lichen-dim);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  width: 22px; height: 1px;
  background: var(--bone);
}

@media (max-width: 780px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 68vw;
    max-width: 300px;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-surface);
    border-left: 1px solid var(--bone-faint);
    transform: translateX(100%);
    transition: transform 0.45s var(--ease-organic);
    gap: 2rem;
    padding-left: 2.5rem;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
}

/* ============ Reveal on scroll ============ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(3px);
  transition: opacity 1.1s var(--ease-organic), transform 1.1s var(--ease-organic), filter 1.1s var(--ease-organic);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }

/* ============ Divider (racine/nervure) ============ */

.root-divider {
  display: block;
  width: 100%;
  height: 64px;
  margin: 0 auto;
  opacity: 0.55;
}
.root-divider path {
  stroke: var(--lichen-dim);
  stroke-width: 1;
  fill: none;
}

/* ============ Buttons / links ============ */

.threshold-link {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  border: 1px solid var(--bone-faint);
  padding: 0.9rem 1.6rem;
  transition: all 0.4s var(--ease-organic);
  background: rgba(124,140,107,0.03);
}
.threshold-link:hover {
  border-color: var(--lichen-dim);
  color: var(--lichen);
  background: rgba(124,140,107,0.07);
  letter-spacing: 0.22em;
}

/* ============ Hero ============ */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 2rem;
}

.hero-symbol {
  width: 70px;
  height: 70px;
  margin-bottom: 2.2rem;
  opacity: 0.8;
}

.hero h1 {
  color: var(--bone);
}
.hero h1 em {
  font-style: normal;
  color: var(--lichen);
}

.hero .lede {
  max-width: 520px;
  margin-top: 1.5rem;
  color: var(--bone-dim);
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.scroll-cue::after {
  content: '';
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--lichen-dim), transparent);
  animation: driftDown 2.2s var(--ease-organic) infinite;
}
@keyframes driftDown {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ============ Whisper text (murmures) ============ */

.whisper {
  color: var(--bone-dim);
  font-style: italic;
  font-size: 1.05rem;
  opacity: 0.7;
}

/* ============ Cards ============ */

.card-grid {
  display: grid;
  gap: 1.5rem;
}

.dossier-card {
  border: 1px solid var(--bone-faint);
  background: linear-gradient(160deg, rgba(124,140,107,0.04), transparent 60%);
  padding: 2.4rem;
  position: relative;
  transition: border-color 0.4s var(--ease-organic), background 0.4s var(--ease-organic);
}
.dossier-card:hover {
  border-color: var(--lichen-dim);
  background: linear-gradient(160deg, rgba(124,140,107,0.08), transparent 60%);
}

.dossier-card .role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--offering-bright);
}

.dossier-card h3 { margin-top: 0.4rem; color: var(--bone); }
.dossier-card .alias { color: var(--bone-dim); font-style: italic; font-size: 1rem; }

.dossier-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s var(--ease-organic);
}
.dossier-card.open .dossier-body { max-height: 3200px; }

.dossier-toggle {
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lichen);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dossier-toggle .plus { transition: transform 0.4s var(--ease-organic); display: inline-block; }
.dossier-card.open .dossier-toggle .plus { transform: rotate(45deg); }

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

.trait-list {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.trait-list li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--bone-dim);
  font-size: 1.05rem;
}
.trait-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--lichen);
  font-size: 1.4rem;
  line-height: 0.7;
}

/* ============ Objectives / doctrine blocks ============ */

.ritual-block {
  border-left: 1px solid var(--offering);
  padding-left: 1.8rem;
  margin: 2.5rem 0;
}
.ritual-block h3 { color: var(--bone); margin-bottom: 0.6rem; }

.phase-nav {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.phase-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  background: none;
  border: 1px solid var(--bone-faint);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-organic);
}
.phase-btn.active, .phase-btn:hover {
  color: var(--lichen);
  border-color: var(--lichen-dim);
}
.phase-panel { display: none; }
.phase-panel.active { display: block; }

/* ============ HRP block ============ */

.hrp-block {
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px dashed var(--bone-faint);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--bone-dim);
  line-height: 1.9;
}
.hrp-block .eyebrow { margin-bottom: 0.8rem; }

/* ============ Footer ============ */

footer {
  text-align: center;
  padding: 5rem 2rem 3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

/* ============ Placeholder card ============ */

.dossier-card.placeholder {
  border-style: dashed;
  opacity: 0.55;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
}
.dossier-card.placeholder .eyebrow { justify-content: center; }
.dossier-card.placeholder .eyebrow::before { display: none; }

/* ============ Responsive ============ */

@media (max-width: 640px) {
  body { font-size: 17px; }
  section { padding: 4.5rem 0; }
  .dossier-card { padding: 1.8rem; }
}
