:root {
  --gold: #C8A35D;
  --gold-soft: #E6D3A0;
  --gold-deep: #8F6F35;
  --gold-line: rgba(200, 163, 93, 0.7);
  --text: #F3F0E8;
  --muted: rgba(243, 240, 232, 0.72);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

.landing-body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #000;
  color: var(--text);
  font-family: "Noto Sans", sans-serif;
  overflow-x: hidden;
}

/* Interface visible par défaut — JS ne doit jamais la laisser invisible */
[data-landing] {
  opacity: 1;
  visibility: visible;
}

body.js-anim [data-landing] {
  will-change: opacity, transform;
}

/* ===== LOADER PUBLIC ===== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at center, rgba(20, 16, 10, 0.5), #050505 70%),
    #050505;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  text-align: center;
  padding: 1.5rem;
}

.loader-seal {
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 18px rgba(200, 163, 93, 0.35));
}

.div-logo {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.div-logo--xl {
  width: 6.2rem;
  height: 6.2rem;
  margin: 0 auto;
}

.div-logo--hero {
  width: 9.25rem;
  height: 9.25rem;
}

.loader-ring {
  transform-origin: 60px 60px;
  animation: loader-spin 1.4s linear infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.loader-title {
  margin: 0;
  font-family: "Cinzel", serif;
  letter-spacing: 0.28em;
  color: var(--gold-soft);
  font-size: 1.05rem;
}

.loader-sub {
  margin: 0.55rem 0 1.2rem;
  color: rgba(243, 240, 232, 0.55);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.loader-bar {
  width: min(240px, 70vw);
  height: 2px;
  margin: 0 auto;
  background: rgba(200, 163, 93, 0.15);
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  box-shadow: 0 0 12px rgba(200, 163, 93, 0.45);
  transition: width 0.15s linear;
}

.loader-pct {
  margin: 0.7rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--gold);
}

.top-public {
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  color: rgba(243, 240, 232, 0.75);
}

.landing {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.landing-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("../img/landing-bg.jpg") center center / cover no-repeat;
  transform: scale(1.02);
}

.landing-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 55% at 50% 42%, rgba(0,0,0,0.05), rgba(0,0,0,0.45) 75%, rgba(0,0,0,0.7) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 18%, transparent 72%, rgba(0,0,0,0.55) 100%);
}

.petals {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -40px;
  width: 8px;
  height: 10px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 228, 236, 0.45), rgba(255, 183, 197, 0.28) 55%, rgba(232, 137, 156, 0.15));
  border-radius: 70% 10% 70% 10%;
  opacity: 0.2;
  animation: petal-fall linear infinite;
  filter: blur(0.35px);
}

@keyframes petal-fall {
  0% { transform: translate3d(0,-8vh,0) rotate(0deg); opacity: 0; }
  12% { opacity: 0.22; }
  85% { opacity: 0.1; }
  100% { transform: translate3d(48px,110vh,0) rotate(420deg); opacity: 0; }
}

/* Cadre double trait */
.landing-frame {
  position: absolute;
  inset: 16px;
  z-index: 4;
  pointer-events: none;
}

.frame-line {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(200,163,93,0.55), transparent);
}

.frame-line.top,
.frame-line.bottom {
  left: 18px;
  right: 18px;
  height: 1px;
  box-shadow: 0 3px 0 rgba(200,163,93,0.22);
}

.frame-line.top { top: 0; }
.frame-line.bottom { bottom: 0; box-shadow: 0 -3px 0 rgba(200,163,93,0.22); }

.frame-line.left,
.frame-line.right {
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(200,163,93,0.55), transparent);
  box-shadow: 3px 0 0 rgba(200,163,93,0.22);
}

.frame-line.left { left: 0; }
.frame-line.right { right: 0; box-shadow: -3px 0 0 rgba(200,163,93,0.22); }

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--gold);
}

.corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* Rails latéraux */
.side-rail {
  position: absolute;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.side-rail.left { left: 30px; }
.side-rail.right { right: 30px; }

.side-kanji {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.72rem;
  letter-spacing: 0.38em;
  color: var(--gold-soft);
}

.side-seal {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: #7a1515;
  color: #f2d4a8;
  font-size: 0.62rem;
  border: 1px solid rgba(200,163,93,0.35);
  box-shadow: 0 0 10px rgba(122,21,21,0.35);
}

.landing-top,
.landing-hero,
.landing-foot {
  position: relative;
  z-index: 6;
}

.landing-hero {
  z-index: 7;
}

.landing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.55rem 2.3rem 0;
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.top-brand strong {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.3em;
  font-weight: 500;
}

.top-brand small {
  display: block;
  margin-top: 0.15rem;
  color: var(--gold);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

.top-secure {
  color: rgba(243,240,232,0.82);
  text-decoration: none;
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  transition: color 0.2s;
}

.top-secure:hover { color: var(--gold); }
.top-secure span { opacity: 0.7; }

/* Hero */
.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 1.4rem 1.4rem;
  position: relative;
}

.hero-rings {
  position: absolute;
  width: min(480px, 78vw);
  height: min(480px, 78vw);
  border-radius: 50%;
  border: 1px solid rgba(200,163,93,0.14);
  box-shadow: 0 0 0 58px rgba(200,163,93,0.03);
  pointer-events: none;
}

.hero-seal {
  position: relative;
  margin-bottom: 0.35rem;
  animation: seal-glow 3.2s ease-in-out infinite;
}

@keyframes seal-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(200,163,93,0.22)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 22px rgba(232,213,163,0.4)); transform: scale(1.02); }
}

.ring-spin {
  transform-origin: 100px 100px;
  animation: ring-rotate 18s linear infinite;
}

@keyframes ring-rotate { to { transform: rotate(360deg); } }

.eyebrow {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.44em;
  color: rgba(243,240,232,0.88);
}

.landing-hero h1 {
  margin: 0;
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(2.35rem, 6.5vw, 4.4rem);
  letter-spacing: 0.12em;
  line-height: 1.05;
  color: #F5F2EA;
  text-shadow: 0 2px 28px rgba(0,0,0,0.65);
}

.landing-hero h1 sup {
  font-size: 0.42em;
  letter-spacing: 0.08em;
  vertical-align: super;
  margin-left: 0.08em;
}

.gotei-line {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0.75rem 0 0.45rem;
}

.gotei-line .rule {
  width: 58px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}

.gotei-line .rule::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: translateY(-50%) rotate(45deg);
}

.gotei-line .rule:first-child::after { right: -3px; }
.gotei-line .rule:last-child::after { left: -3px; }

.gotei-line strong {
  font-family: "Cinzel", serif;
  color: var(--gold);
  letter-spacing: 0.32em;
  font-size: 0.92rem;
  font-weight: 500;
}

.ornament {
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 0.55rem;
  opacity: 0.9;
}

.motto {
  margin: 0 0 0.85rem;
  color: var(--gold);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  font-weight: 500;
}

.lead {
  margin: 0 auto 1.45rem;
  max-width: 440px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  font-weight: 300;
}

/* ========== BOUTON ENTRER — double contour or ========== */
.enter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem 1rem;
  width: min(920px, 94vw);
  margin-top: 0.35rem;
}

.enter-btn {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  min-width: min(340px, 88vw);
  flex: 1 1 280px;
  max-width: 430px;
  transition: transform 0.25s ease;
}

.enter-btn-alt .enter-inner {
  background: rgba(0, 0, 0, 0.42);
}

.enter-btn-alt .enter-title {
  letter-spacing: 0.28em;
}

.enter-btn:hover {
  transform: translateY(-2px);
}

.enter-border {
  display: block;
  padding: 3px;
  border: 1px solid rgba(210, 175, 105, 0.92);
  background: transparent;
  box-shadow:
    0 0 0 1px rgba(200, 163, 93, 0.2),
    0 0 22px rgba(200, 163, 93, 0.14),
    0 14px 36px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.25s, border-color 0.25s;
}

.enter-btn:hover .enter-border {
  border-color: rgba(240, 223, 168, 0.95);
  box-shadow:
    0 0 0 1px rgba(230, 211, 160, 0.35),
    0 0 32px rgba(200, 163, 93, 0.28),
    0 16px 40px rgba(0, 0, 0, 0.4);
}

.enter-inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.95rem 1.25rem 0.95rem 1.45rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(200, 163, 93, 0.55);
  backdrop-filter: blur(4px);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  box-shadow: inset 0 0 20px rgba(200, 163, 93, 0.04);
}

.enter-btn:hover .enter-inner {
  background: rgba(200, 163, 93, 0.1);
  border-color: rgba(230, 211, 160, 0.75);
  box-shadow: inset 0 0 24px rgba(200, 163, 93, 0.08);
}

.enter-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1;
}

.enter-title {
  font-family: "Cinzel", serif;
  font-size: 1.28rem;
  letter-spacing: 0.34em;
  font-weight: 600;
  color: var(--gold-soft);
  text-shadow: 0 0 18px rgba(200, 163, 93, 0.25);
}

.enter-sub {
  margin-top: 0.22rem;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: rgba(243, 240, 232, 0.62);
}

.enter-arrow {
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.25s;
  text-shadow: 0 0 12px rgba(200, 163, 93, 0.35);
}

.enter-btn:hover .enter-arrow {
  transform: translateX(5px);
}

/* Footer */
.landing-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1rem;
  padding: 0 2.3rem 1.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: rgba(243,240,232,0.68);
}

.foot-left,
.foot-right,
.foot-center {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.foot-left { justify-content: flex-start; }
.foot-right { justify-content: flex-end; }
.foot-center {
  flex-direction: column;
  gap: 0.15rem;
  color: var(--gold);
}

.foot-flower { font-size: 0.8rem; }

/* Gate */
.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  display: none;
}

.gate.active {
  display: block;
  pointer-events: none; /* ne bloque jamais les clics de l'UI */
}

.gate-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  background: linear-gradient(180deg, rgba(18,14,8,0.97), rgba(8,7,6,0.98));
  border: 1px solid rgba(200,163,93,0.35);
  display: grid;
  place-items: center;
}

.gate-panel.left { left: 0; transform: translateX(-105%); }
.gate-panel.right { right: 0; transform: translateX(105%); }

.gate-crest {
  font-family: "Cinzel", serif;
  font-size: clamp(3rem, 8vw, 5rem);
  color: rgba(200,163,93,0.35);
  letter-spacing: 0.1em;
}

.gate-crest img {
  width: clamp(4rem, 10vw, 6.5rem);
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 16px rgba(200,163,93,0.25));
}

.gate-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(232,213,163,0.5), transparent 55%);
  pointer-events: none;
}

body.is-transitioning {
  cursor: progress;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .side-rail.left { left: 18px; }
  .side-rail.right { right: 18px; }
  .landing-frame { inset: 16px; }
  .div-logo--hero {
    width: 7.5rem;
    height: 7.5rem;
  }
}

@media (max-width: 860px) {
  .landing-body {
    min-height: 100dvh;
  }

  .side-rail { display: none; }

  .landing-frame {
    inset: 10px;
    inset: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .landing-top,
  .landing-foot {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .landing-top {
    padding-top: max(1rem, env(safe-area-inset-top));
  }

  .landing-foot {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.55rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .foot-left,
  .foot-right { justify-content: center; }

  .top-brand small { display: none; }

  .hero-seal svg { width: 108px; height: 108px; }

  .div-logo--hero {
    width: 6.4rem;
    height: 6.4rem;
  }

  .landing-hero {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .enter-row {
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .enter-btn {
    width: min(100%, 22rem);
    max-width: none;
  }
}

@media (max-width: 520px) {
  .landing-frame { inset: 6px; }

  .landing-hero h1 {
    letter-spacing: 0.06em;
    font-size: clamp(1.65rem, 9vw, 2.2rem);
  }

  .motto {
    letter-spacing: 0.12em;
    font-size: 0.58rem;
  }

  .enter-title {
    font-size: 1.08rem;
    letter-spacing: 0.2em;
  }

  .enter-inner { padding: 0.85rem 1rem; }

  .div-logo--hero {
    width: 5.4rem;
    height: 5.4rem;
  }

  .loader-inner { padding: 1rem; }

  .div-logo--xl {
    width: 4.8rem;
    height: 4.8rem;
  }
}

@media (max-width: 380px) {
  .landing-top,
  .landing-foot {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .enter-title {
    font-size: 0.95rem;
    letter-spacing: 0.14em;
  }
}
