/* ── NOIR ÉTERNEL — Design System ── */

/* ── Tokens ── */
:root {
  --black: #000;
  --bg: #0a0a0a;
  --ivory: #f0ece4;
  --ivory-mid: rgba(240, 236, 228, 0.6);
  --ivory-low: rgba(240, 236, 228, 0.25);
  --gold: #c9a96e;
  --gold-dim: rgba(201, 169, 110, 0.4);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.06);
  --font-display: 'Cinzel', serif;
  --font-body: 'Outfit', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  background: var(--black);
  color: var(--ivory);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--gold); color: var(--black); }

/* ── Loader ── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
#loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-inner { text-align: center; }
.loader-brand {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--ivory);
  perspective: 600px;
}
.fold-letter {
  display: inline-block;
  transform-origin: bottom center;
  transform: rotateX(90deg);
  opacity: 0;
  animation: foldIn 0.25s var(--ease) forwards;
}
.fold-letter:nth-child(1)  { animation-delay: 0.01s; }
.fold-letter:nth-child(2)  { animation-delay: 0.025s; }
.fold-letter:nth-child(3)  { animation-delay: 0.04s; }
.fold-letter:nth-child(4)  { animation-delay: 0.055s; }
.fold-letter:nth-child(5)  { animation-delay: 0.075s; }
.fold-letter:nth-child(6)  { animation-delay: 0.09s; }
.fold-letter:nth-child(7)  { animation-delay: 0.10s; }
.fold-letter:nth-child(8)  { animation-delay: 0.11s; }
.fold-letter:nth-child(9)  { animation-delay: 0.12s; }
.fold-letter:nth-child(10) { animation-delay: 0.13s; }
.fold-letter:nth-child(11) { animation-delay: 0.14s; }
.fold-letter:nth-child(12) { animation-delay: 0.15s; }

@keyframes foldIn {
  0%   { transform: rotateX(90deg) translateY(20px); opacity: 0; }
  60%  { transform: rotateX(-10deg) translateY(-2px); opacity: 1; }
  100% { transform: rotateX(0deg) translateY(0); opacity: 1; }
}

/* ── Beams Container ── */
#beams {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: lighten;
}

/* ── Navigation ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 3.5rem;
  transition: padding 0.5s var(--ease);
}
#nav.scrolled { padding: 0.8rem 3.5rem; }

.nav-left { display: flex; align-items: center; gap: 1.2rem; }
.nav-brand {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--ivory);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.3s var(--ease);
}
.nav-brand:hover { opacity: 1; }
.nav-tagline {
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.28);
  padding-left: 1.2rem;
  border-left: 1px solid rgba(255,255,255,0.08);
}

/* Nav card (glassmorphism pill) */
.nav-card {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(12, 12, 12, 0.6);
  backdrop-filter: blur(30px) saturate(1.3);
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 0.4rem 0.5rem;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}
.nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.08);
  margin: 0 0.15rem;
  flex-shrink: 0;
}

/* Nav items & links */
.nav-item { position: relative; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.25s var(--ease);
  text-decoration: none;
}
.nav-link:hover,
.nav-item:hover > .nav-link {
  color: var(--ivory);
  background: rgba(255,255,255,0.06);
}
.nav-link-simple {
  color: rgba(255,255,255,0.55);
}
.nav-link-simple:hover {
  color: var(--ivory);
  background: transparent;
}

/* Chevron */
.nav-chevron {
  transition: transform 0.25s var(--ease);
  opacity: 0.4;
}
.nav-item:hover .nav-chevron {
  transform: rotate(180deg);
  opacity: 0.8;
}

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.8rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  min-width: 320px;
  background: rgba(14, 14, 14, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 0.5rem;
  transition: all 0.3s var(--ease-out);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.nav-item:hover > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Hover bridge */
.nav-item::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  height: 1rem;
  display: none;
}
.nav-item:hover::after { display: block; }

/* Dropdown cards */
.dropdown-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ivory);
  transition: background 0.2s var(--ease);
}
.dropdown-card:hover { background: rgba(255,255,255,0.05); }
.dropdown-card-wide {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px 12px 0 0;
  padding-bottom: 1rem;
  margin-bottom: 0.2rem;
}
.dropdown-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--gold);
  flex-shrink: 0;
}
.dropdown-text { flex: 1; min-width: 0; }
.dropdown-title {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ivory);
  margin-bottom: 0.15rem;
}
.dropdown-desc {
  font-size: 0.65rem;
  font-weight: 300;
  color: rgba(255,255,255,0.35);
}
.dropdown-arrow {
  margin-left: auto;
  opacity: 0.3;
  transition: opacity 0.2s;
  flex-shrink: 0;
  color: var(--ivory);
}
.dropdown-card:hover .dropdown-arrow { opacity: 0.8; }

/* ── Canvas ── */
#canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: var(--black);
  opacity: 0.55;
}

/* ── Sections ── */
#sections { position: relative; z-index: 3; pointer-events: none; }
.scene { position: relative; }
.scene-content {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8vw;
  pointer-events: auto;
}

/* ── Text System ── */
.text-wrap { max-width: 640px; }
.text-center { text-align: center; margin: 0 auto; }
.text-right { text-align: left; margin-left: auto; margin-right: -3vw; max-width: 480px; }

.text-wrap > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.text-wrap.visible > * {
  opacity: 1;
  transform: translateY(0);
}
.text-wrap > *:nth-child(2) { transition-delay: 0.1s; }
.text-wrap > *:nth-child(3) { transition-delay: 0.2s; }
.text-wrap > *:nth-child(4) { transition-delay: 0.3s; }
.text-wrap > *:nth-child(5) { transition-delay: 0.4s; }
.text-wrap.visible {
  text-shadow: 0 2px 40px rgba(0,0,0,0.95), 0 0 100px rgba(0,0,0,0.6);
}

/* Typography */
.eyebrow {
  font-family: var(--font-body);
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.display {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
}
.tagline {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 200;
  letter-spacing: 0.12em;
  color: var(--ivory-mid);
}
.chapter {
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--gold-dim);
  letter-spacing: 0.5em;
  margin-bottom: 1.5rem;
}
.chapter::before { content: '— '; }
.heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
}
.body {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ivory-mid);
  max-width: 420px;
}
.text-center .body { margin: 0 auto; }

/* ── Scene 2 — Split Layout ── */
.scene-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4vw;
  width: 100%;
}

/* Creative left */
.creative-left {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.note-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  opacity: 0;
  transform: translateX(-40px);
}
.note-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold-dim);
  flex-shrink: 0;
}
.note-bar {
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  flex-shrink: 0;
}
.note-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ivory-low);
  white-space: nowrap;
}
.note-accent {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold-dim);
  letter-spacing: 0.08em;
  padding-left: 1rem;
  transform: scale(0.5);
  opacity: 0;
}

/* ── Scene 3 — U-Shape ── */
.u-shape-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.u-shape {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  max-width: 900px;
  width: 100%;
  gap: 1.5rem 3rem;
}
.u-top-left    { grid-row: 1; grid-column: 1; text-align: left; }
.u-top-right   { grid-row: 1; grid-column: 2; text-align: right; }
.u-body        { grid-row: 2; grid-column: 1; }
.u-mid-right   { grid-row: 2; grid-column: 2; text-align: right; align-self: center; }
.u-bot-left    { grid-row: 3; grid-column: 1; text-align: left; }
.u-bot-right   { grid-row: 3; grid-column: 2; text-align: right; }

.u-word {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.04em;
  opacity: 0;
}
.u-gold { color: var(--gold); }
.u-body {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ivory-mid);
  opacity: 0;
}

/* ── Footer ── */
#footer {
  position: relative;
  z-index: 10;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  padding: 4rem 3rem;
}
#footer::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5));
  pointer-events: none;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--ivory);
  margin-bottom: 0.5rem;
}
.footer-copy {
  font-size: 0.65rem;
  color: var(--ivory-low);
}
.footer-right { display: flex; gap: 2rem; }
.footer-link {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ivory-low);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.footer-link:hover { color: var(--ivory); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-card, .nav-tagline { display: none; }
  .creative-left { display: none; }
  .scene-content { padding: 0 5vw; }
  .text-wrap { max-width: 100%; }
  .text-right { margin-right: 0; margin-left: 0; max-width: 100%; }
  .display { font-size: clamp(2.5rem, 10vw, 4rem); }
  .heading { font-size: clamp(1.8rem, 7vw, 2.5rem); }
  .body { font-size: 0.8rem; }
  .scene-split { flex-direction: column; }
  .u-shape { max-width: 100%; }
  .u-word { font-size: clamp(1.5rem, 8vw, 2.5rem); }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  #footer { padding: 3rem 1.5rem; }
}
