@font-face {
  font-family: 'Instrument Serif';
  src: url('./type/instrument-serif.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --paper: #fffdf5;
  --frame: clamp(12px, 2.15vw, 32px);
  background: #183f33;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.entrance {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: clamp(38px, 7vh, 90px) 15px;
  background: radial-gradient(ellipse at 49% 42%, #356650 0%, #295640 32%, #1e4938 62%, #133a2f 100%);
}
.entrance::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url('./art/grain.png') repeat;
  opacity: .095;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.rule {
  position: absolute;
  inset: var(--frame);
  border: 1px solid rgba(217, 229, 189, .22);
  pointer-events: none;
}
.composition {
  width: min(100%, 58rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.books {
  position: relative;
  width: min(38rem, 92vw, 66vh);
  width: min(38rem, 92vw, 66svh);
  aspect-ratio: 720 / 470;
  isolation: isolate;
  pointer-events: none;
  user-select: none;
}
.book, .floor {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
h1 {
  position: relative;
  margin: clamp(0px, .6vh, 8px) 0 0;
  color: white;
  font: 400 clamp(4.2rem, min(12.6vw, 14.8vh), 9.25rem)/.91 'Instrument Serif', Georgia, serif;
  letter-spacing: -.054em;
  text-align: center;
}
.start {
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  min-width: 136px;
  padding: .7rem 2.35rem;
  margin-top: clamp(27px, 4.5vh, 49px);
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 999px;
  color: #173d2d;
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: .005em;
  text-decoration: none;
  box-shadow: 0 2px 3px rgb(7 31 18 / .12);
  transition: background 160ms, transform 160ms;
}
.start:focus-visible { outline: 2px solid white; outline-offset: 6px; }
@media (hover: hover) { .start:hover { background: #f1edda; transform: translateY(-2px); } }
.start:active { transform: translateY(1px); }
@media (prefers-reduced-motion: no-preference) {
  .blue { transform-origin: 54% 90%; animation: book-drop .73s both; --launch: -10deg; --angle: 3deg; }
  .red { transform-origin: 52% 74%; animation: book-drop .72s .59s both; --launch: 16deg; --angle: -6deg; }
  .yellow { transform-origin: 51% 36%; animation: book-drop .67s 1.17s both; --launch: -12deg; --angle: 4deg; }
  .floor { animation: cast-shadow .62s both; }
  h1 { transform-origin: 50% 85%; animation: word-drop .64s 1.77s both; }
  @keyframes book-drop {
    0% { opacity: 0; transform: translate3d(0,-110vh,0) rotate(var(--launch)); animation-timing-function: cubic-bezier(.54,.02,.87,.6); }
    9% { opacity: 1; }
    60% { transform: translate3d(0,1%,0) rotate(var(--angle)); animation-timing-function: ease-out; }
    75% { transform: translate3d(0,-3%,0) rotate(calc(var(--angle) * -.35)); animation-timing-function: ease-in; }
    89% { transform: translate3d(0,.4%,0) rotate(calc(var(--angle) * .15)); }
    100% { opacity: 1; transform: none; }
  }
  @keyframes word-drop {
    0% { opacity: 0; transform: translateY(-52vh) rotate(-3deg); animation-timing-function: cubic-bezier(.55,.08,.85,.65); }
    22% { opacity: 1; }
    65% { transform: translateY(5px) rotate(.8deg); animation-timing-function: ease-out; }
    83% { transform: translateY(-4px) rotate(-.3deg); }
    100% { opacity: 1; transform: none; }
  }
  @keyframes cast-shadow { from { opacity: 0; } 58% { opacity: .05; } to { opacity: 1; } }
}
@media (max-height: 540px) and (min-width: 600px) {
  .entrance { padding-block: 32px; }
  .books { width: min(48vh, 30rem); }
  h1 { font-size: clamp(3.4rem, 14vh, 5rem); }
  .start { min-height: 44px; margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .start { transition: none; }
}
