#opening-screen {
  --opening-width: clamp(156px, 22vw, 280px);
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(20px, 3vh, 30px);
  overflow: hidden;
  color: var(--moss);
  background: var(--brand-ivory);
  opacity: 1;
  transition: opacity 240ms ease-out;
}

#opening-screen[hidden] { display: none; }

.opening-imprint {
  position: relative;
  width: var(--opening-width);
}

.opening-imprint svg {
  display: block;
  width: 100%;
  height: auto;
}

.opening-nib {
  stroke-dasharray: 1 1.2;
  stroke-dashoffset: 1.08;
  animation: opening-write var(--duration) var(--ease, ease-in-out) var(--delay) forwards;
}
.opening-nib--n { --duration: 660ms; --delay: 15ms; }
.opening-nib--o { --duration: 285ms; --delay: 705ms; }
.opening-nib--u { --duration: 345ms; --delay: 970ms; }
.opening-nib--f { --duration: 365ms; --delay: 1290ms; }
.opening-nib--cross { --duration: 150ms; --delay: 1660ms; --ease: ease-out; }

@keyframes opening-write {
  to { stroke-dashoffset: 0; }
}

/* Join the footer's pen stroke to the f in the cropped wordmark viewBox. */
.opening-imprint::after {
  content: "";
  position: absolute;
  left: 88.15%;
  top: 43.17%;
  width: calc(50vw - var(--opening-width) * .3815 + 2px);
  height: 16.24%;
  box-sizing: border-box;
  border: 0 solid transparent;
  border-left-width: calc(var(--opening-width) * 92 / 650);
  border-image: url("/brand/nouf-script-swash.svg") 0 0 0 92 fill / 0 0 0 1 stretch;
  animation: opening-flourish 360ms cubic-bezier(.2,.65,.28,1) 1780ms both;
}

@keyframes opening-flourish {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}

#opening-screen p {
  margin: 0;
  color: var(--muted);
  font: 400 clamp(13px, 1vw, 15px) / 1.6 var(--body);
}
#opening-screen:not([lang="en"]) [lang="en"],
#opening-screen[lang="en"] [lang="ar"] { display: none; }
html[data-opening="leaving"] #opening-screen { opacity: 0; }

@media (prefers-reduced-motion: reduce), print {
  #opening-screen { display: none; }
}
