/* Sampul Nocturne, mengikuti target 17 September. Semua ornamen non-interaktif. */
.nocturne-cover {
  position: fixed;
  inset: 0;
  z-index: 20;
  min-height: 620px;
  overflow: auto;
  display: flex;
  align-items: center;
  flex-direction: column;
  isolation: isolate;
  background: #170e0c;
}
.cover-art {
  display: contents;
}
.cover-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: -3;
  pointer-events: none;
  filter: saturate(0.73) brightness(0.83);
}
.nocturne-cover::before,
.nocturne-cover::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid #b39a7255;
  pointer-events: none;
  z-index: -1;
}
.nocturne-cover::after {
  inset: 21px;
  border-color: #b39a7218;
}
.cover-back {
  position: absolute;
  top: 35px;
  left: 44px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #d4bd98;
}
.cover-edition {
  position: absolute;
  top: 36px;
  right: 44px;
  display: flex;
  gap: 25px;
  align-items: center;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #c9af85;
}
.cover-edition i {
  width: 34px;
  height: 1px;
  background: #c9af85;
}
.cover-heading {
  text-align: center;
  margin-top: clamp(83px, 9.5vh, 110px);
}
.cover-heading .eyebrow {
  color: #e2cdb0;
  font-size: 10px;
  letter-spacing: 0.34em;
}
.cover-divider {
  display: flex;
  align-items: center;
  width: 300px;
  max-width: 65vw;
  margin: 25px auto 22px;
}
.cover-divider::before,
.cover-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b99a6a);
}
.cover-divider::after {
  transform: scaleX(-1);
}
.cover-divider i {
  display: block;
  width: 7px;
  height: 7px;
  border: 1px solid #d2b175;
  transform: rotate(45deg);
  margin: 0 5px;
  box-shadow: 0 0 0 2px #b39a7212;
}
.cover-heading h1 {
  font-size: clamp(43px, 3.8vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.022em;
}
.cover-heading h1 em {
  color: #bea273;
}

/* Le bouton est l'enveloppe elle-même; le contenu visuel reste hors de l'arbre accessible. */
.envelope-stage {
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  width: clamp(345px, 29vw, 520px);
  aspect-ratio: 1.61;
  max-width: 80vw;
  margin: 30px 0 35px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  perspective: 1400px;
  touch-action: manipulation;
}
.envelope-stage:focus-visible {
  outline: 1px solid #e8c999;
  outline-offset: 14px;
}
.envelope-stage:disabled {
  cursor: default;
  opacity: 1;
}
.envelope {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  animation: envelope-breathe 7s ease-in-out infinite;
  filter: drop-shadow(-6px 25px 18px #0008);
}
.envelope-back {
  position: absolute;
  inset: 0;
  background: #431c21;
  border: 1px solid #955253;
  box-shadow: inset 0 0 20px #24090e;
}
.envelope-front {
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    linear-gradient(130deg, #5c1e2788, #43141dcc),
    url("/img/stationery/burgundy-paper-reference.webp") center/700px;
  clip-path: polygon(0 0, 50% 47%, 100% 0, 100% 100%, 0 100%);
  border-bottom: 1px solid #995556;
}
.envelope-front::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 100%, 50% 39%, 100% 100%);
  background:
    linear-gradient(135deg, #6f283288, #491523aa),
    url("/img/stationery/burgundy-paper-reference.webp") center/700px;
}
.envelope-seams {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.envelope-seams svg {
  width: 100%;
  height: 100%;
  stroke: #c780747d;
  stroke-width: 1;
}
.envelope-flap {
  position: absolute;
  inset: 0;
  z-index: 5;
  transform-origin: center top;
  backface-visibility: visible;
  filter: drop-shadow(1px 6px 4px #160705a0);
}
.flap-paper {
  display: block;
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  background:
    linear-gradient(172deg, #863e3ecc, #60202a88 55%),
    url("/img/stationery/burgundy-paper-reference.webp") center/700px;
  border-top: 2px solid #d38a7e9c;
}
.flap-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 50% 58%, 100% 0, 50% 58.4%);
  background: #cf8c6d;
}
.envelope-letter {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 7%;
  height: 86%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f0e5d3;
  color: #5b2730;
  border: 1px solid #b9a077;
  outline: 1px solid #b9a077;
  outline-offset: -12px;
  box-shadow: -6px 5px 12px #18070738;
}
.envelope-letter > span,
.envelope-letter small {
  font-size: 8px;
  letter-spacing: 0.22em;
}
.envelope-letter strong {
  font: 500 38px var(--serif);
  margin: 17px 0;
}
.envelope-letter em {
  color: #8c6a46;
}
.envelope-seal {
  position: absolute;
  left: 50%;
  top: 51%;
  width: 20%;
  aspect-ratio: 1.02;
  transform: translate(-50%, -50%) rotate(-4deg);
  z-index: 6;
  display: grid;
  place-content: center;
  border-radius: 47% 51% 46% 49%;
  background: radial-gradient(
    ellipse at 30% 19%,
    #e3cda1 0,
    #c5a873 42%,
    #947341 77%,
    #ddc28a 100%
  );
  box-shadow:
    inset 2px 3px 3px #f6e8bba8,
    inset -3px -4px 4px #553a206b,
    -3px 7px 5px #200d0e99,
    -7px 14px 14px #1807056b;
}
.envelope-seal::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 2px solid #b08d587d;
  border-radius: 50%;
  box-shadow:
    0 1px 2px #f6e0aaad,
    inset 0 2px 3px #6247224d;
}
.envelope-seal > span {
  position: relative;
  margin-top: 2px;
  font: 400 clamp(25px, 2vw, 36px) var(--serif);
  color: #604726;
  text-shadow: 0 1px #e0c593;
}
.envelope-seal em {
  color: inherit;
  font-size: 0.6em;
}
.seal-laurel {
  width: 32px;
  height: 11px;
  margin: -1px auto 0;
  stroke: #826138;
  stroke-width: 0.65;
}
.cover-handwritten {
  position: absolute;
  left: 70%;
  top: 39%;
  color: #ac885c;
  font: italic 300 clamp(20px, 2.2vw, 36px)/1.05 var(--serif);
  transform: rotate(-10deg);
  opacity: 0.84;
  pointer-events: none;
}
.cover-handwritten i {
  padding-left: 18px;
  font-weight: 300;
}
.cover-invitation {
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.cover-invitation p {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #cbb391;
}
.cover-invitation strong {
  font: 400 32px/1.2 var(--serif);
  color: #ecddc5;
  margin-top: 7px;
  max-width: 80vw;
  overflow-wrap: anywhere;
}
.cover-invitation .cover-divider {
  width: 235px;
  margin: 19px auto 22px;
}
.cover-invitation .cover-divider i {
  background: #d2b175;
}
.cover-note {
  font: italic 400 19px var(--serif);
  color: #d3c1a9;
}
#open-hint {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #ccb797;
  margin: 17px 0 20px;
}
.cover-bottom {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: auto;
  padding-bottom: 38px;
  font-size: 8px;
  letter-spacing: 0.27em;
  color: #b39771;
}
.cover-bottom::before,
.cover-bottom::after {
  content: "";
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #b3977180);
}
.cover-bottom::after {
  transform: scaleX(-1);
}
.is-opening .envelope {
  animation: none;
  transform: rotate(0);
}
.is-opening
  :is(
    .cover-heading,
    .cover-invitation,
    .cover-bottom,
    .cover-back,
    .cover-edition,
    .cover-handwritten,
    .envelope-seal
  ) {
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.letter-expansion {
  position: fixed;
  z-index: 21;
  background: #321e22;
  border: 1px solid #b39a7270;
  box-shadow: 0 0 70px #0005;
  pointer-events: none;
  transform-origin: 0 0;
}
.letter-expansion::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid #b39a723f;
}
@keyframes envelope-breathe {
  0%,
  100% {
    transform: rotate(-0.65deg) translateY(0);
  }
  50% {
    transform: rotate(0.65deg) translateY(-3px);
  }
}
@media (max-height: 800px) and (min-width: 701px) {
  .cover-heading {
    margin-top: 72px;
  }
  .cover-heading h1 {
    font-size: 48px;
  }
  .cover-heading .cover-divider {
    margin: 18px auto;
  }
  .envelope-stage {
    width: 355px;
    margin: 25px 0;
  }
  .cover-invitation strong {
    font-size: 28px;
  }
  .cover-invitation .cover-divider {
    margin: 13px auto;
  }
  .cover-note {
    font-size: 17px;
  }
  .cover-bottom {
    padding-bottom: 26px;
  }
}
@media (max-width: 700px) {
  .nocturne-cover {
    min-height: 620px;
  }
  .nocturne-cover::before {
    inset: 12px;
  }
  .nocturne-cover::after {
    inset: 15px;
  }
  .cover-background {
    object-fit: cover;
    object-position: 50% 50%;
  }
  .cover-back {
    top: 29px;
    left: 27px;
    font-size: 8px;
  }
  .cover-edition {
    top: 29px;
    right: 27px;
    font-size: 7px;
    letter-spacing: 0.04em;
    gap: 8px;
  }
  .cover-edition i {
    width: 12px;
  }
  .cover-heading {
    margin-top: clamp(90px, 13svh, 115px);
  }
  .cover-heading .eyebrow {
    font-size: 8px;
    letter-spacing: 0.23em;
  }
  .cover-heading .cover-divider {
    width: 220px;
    margin: 22px auto;
  }
  .cover-heading h1 {
    font-size: clamp(35px, 9.7vw, 46px);
  }
  .envelope-stage {
    width: 310px;
    max-width: 79vw;
    margin: 37px 0 31px;
  }
  .envelope-letter strong {
    font-size: 28px;
  }
  .envelope-letter > span,
  .envelope-letter small {
    font-size: 7px;
  }
  .envelope-seal > span {
    font-size: 25px;
  }
  .seal-laurel {
    width: 23px;
    height: 8px;
  }
  .cover-handwritten {
    display: none;
  }
  .cover-invitation p {
    font-size: 8px;
  }
  .cover-invitation strong {
    font-size: 28px;
  }
  .cover-invitation .cover-divider {
    width: 185px;
    margin: 17px auto 18px;
  }
  .cover-note {
    font-size: 16px;
  }
  #open-hint {
    font-size: 8px;
    margin: 17px 0 24px;
  }
  .cover-bottom {
    font-size: 6px;
    letter-spacing: 0.22em;
    gap: 10px;
    padding-bottom: 29px;
  }
  .cover-bottom::before,
  .cover-bottom::after {
    width: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .envelope {
    animation: none;
  }
  .is-opening
    :is(
      .cover-heading,
      .cover-invitation,
      .cover-bottom,
      .cover-back,
      .cover-edition,
      .cover-handwritten,
      .envelope-seal
    ) {
    transition: none;
  }
}
