/* Typefaces from the print artwork (Final Arts V2). */
@font-face {
  font-family: "Lyon Slanted";
  src: url("fonts/lyon-arabic-slanted-display-light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Elegant Typewriter";
  src: url("fonts/elegant-typewriter-light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Elegant Typewriter";
  src: url("fonts/elegant-typewriter-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Elegant Typewriter";
  src: url("fonts/elegant-typewriter-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sage: #738259;
  --olive: #4b5736;
  --cream: #faf8f0;
  --cream-dim: rgba(250, 248, 240, 0.74);
  --font-names: "Lyon Slanted", Georgia, serif;
  --font-amp: "Instrument Serif", Georgia, serif;
  --font-type: "Elegant Typewriter", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--sage);
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-type);
  font-weight: 300;
  color: var(--cream);
}

.loader-screen {
  width: 100%;
  height: 100vh;
}

.loader-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  width: min(420px, 86vw);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.5rem) 0;
}

.rule {
  width: 100%;
  height: 1px;
  background-image: linear-gradient(to right, var(--cream-dim) 0 6px, transparent 6px 14px);
  background-size: 14px 1px;
  background-repeat: repeat-x;
  opacity: 0;
  transform: scaleX(0.85);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.rule--top { transition-delay: 0.15s; }
.rule--bottom { transition-delay: 0.3s; }

.loader-frame.is-ready .rule {
  opacity: 1;
  transform: scaleX(1);
}

.instrument {
  --track-h: clamp(140px, 30vw, 210px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: min(380px, 86vw);
  height: var(--track-h);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.loader-frame.is-ready .instrument {
  transform: scale(0.88);
}

.column {
  position: relative;
  flex: 1 1 0;
  height: 100%;
}

.stem,
.flare,
.thicken {
  position: absolute;
  top: 0;
  left: 50%;
  border-radius: 2px;
  transform-origin: top center;
  transform: translateX(-50%) scaleY(0);
  opacity: 0;
  animation-fill-mode: both;
  background: var(--olive);
}

.stem {
  width: 2px;
  height: 100%;
  animation: key-play 420ms cubic-bezier(0.33, 1, 0.68, 1) both;
  animation-delay: calc(var(--i) * 16ms);
}

.flare {
  width: 5px;
  height: var(--h);
  border-radius: 2px 2px 0 0;
  animation: wave-grow 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(950ms + var(--fi) * 42ms);
}

.thicken {
  top: auto;
  bottom: 0;
  width: 2.3px;
  height: var(--m);
  border-radius: 0 0 2px 2px;
  transform-origin: bottom center;
  transform: translateX(-50%) scaleY(0);
  animation: wave-grow-bottom 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(1000ms + var(--i) * 18ms);
}

@keyframes wave-grow-bottom {
  0% { opacity: 0; transform: translateX(-50%) scaleY(0); }
  62% { opacity: 1; transform: translateX(-50%) scaleY(1.07); }
  100% { opacity: 1; transform: translateX(-50%) scaleY(1); }
}

@keyframes key-play {
  0% { opacity: 0; transform: translateX(-50%) scaleY(0.3); }
  55% { opacity: 0.9; transform: translateX(-50%) scaleY(1.05); }
  100% { opacity: 0.42; transform: translateX(-50%) scaleY(1); }
}

@keyframes wave-grow {
  0% { opacity: 0; transform: translateX(-50%) scaleY(0); }
  62% { opacity: 1; transform: translateX(-50%) scaleY(1.07); }
  100% { opacity: 1; transform: translateX(-50%) scaleY(1); }
}

.reveal {
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
}

.loader-frame.is-ready .reveal {
  opacity: 1;
  transform: translateY(0);
}

.reveal__names {
  margin: 0;
  font-family: var(--font-names);
  font-weight: 300;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  letter-spacing: 0.01em;
}

.reveal__names .amp {
  font-family: var(--font-amp);
  font-style: italic;
  color: var(--olive);
  margin: 0 0.15em;
}

.reveal__date {
  margin: 0.6em 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
