:root {
  --navy: #2a3952;
  --navy-deep: #1a2333;
  --navy-light: #33455f;
  --gold: #b09b79;
  --gold-soft: rgba(176, 155, 121, .34);
  --frame: 26px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--navy-deep);
  color: var(--gold);
  font-family: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- fond ---------- */

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 42%, #3a4d69 0%, #2f4059 34%, #24314a 66%, #18202e 100%);
  z-index: 0;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(75% 60% at 50% 45%, transparent 40%, rgba(10, 15, 25, .55) 100%);
}

/* ---------- filet doré ---------- */

.frame {
  position: fixed;
  inset: var(--frame);
  border: 1px solid var(--gold-soft);
  z-index: 3;
  pointer-events: none;
}

.frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(176, 155, 121, .12);
}

.frame::after {
  content: "";
  position: absolute;
  inset: -1px;
  box-shadow: inset 0 0 60px rgba(176, 155, 121, .05);
}

/* ---------- grain ---------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: .055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- scène ---------- */

.scene {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}

.logo {
  width: min(64vh, 64vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 26px 60px rgba(8, 13, 22, .55));
  animation: logo-in 1.5s cubic-bezier(.16, .84, .3, 1) both;
}

@keyframes logo-in {
  from { opacity: 0; transform: scale(.965); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- calque des oiseaux ---------- */

.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

/* bascule franche entre pie posee et pie en vol : un fondu montrerait
   les deux dessins superposes */
.bird .flying { display: none; }
.bird.is-flying .perched { display: none; }
.bird.is-flying .flying { display: inline; }

.bird { filter: url(#birdshadow); }

/* ---------- indication ---------- */

.hint {
  position: fixed;
  left: 50%;
  bottom: calc(var(--frame) + 22px);
  transform: translateX(-50%);
  margin: 0;
  z-index: 5;
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(176, 155, 121, .5);
  pointer-events: none;
  transition: opacity 1.1s ease;
  animation: hint-in 2.4s 1.1s both;
}

.hint.is-gone { opacity: 0; }

@keyframes hint-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 640px) {
  :root { --frame: 14px; }
  .logo { width: min(78vh, 84vw); }
  .hint { font-size: 10px; letter-spacing: .26em; }
}

/* pas de survol au doigt : l'indication n'a pas de sens */
@media (hover: none) {
  .hint { display: none; }
}

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

/* ---------- apparition ---------- */

/* Etat initial ; le fondu est pilote par birds.js (opacity inline). */
#birds { opacity: 0; }
