:root {
  color-scheme: light;
  --ink: #2f3f4e;
  --muted: #3e5261;
  --gold: #8d693c;
  --ivory: #fff7e7;
  --paper: #e7d1a7;
  --reading-width: min(660px, calc(100vw - 56px));
  background: #e0e8ed;
  color: var(--ink);
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
}

.landscape {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(240 244 241 / 13%), transparent 61%),
    url("/static/acropolis-wide.webp") center 48% / cover no-repeat,
    radial-gradient(ellipse at 50% 20%, #f8efe1, #b6c9d8 80%);
  pointer-events: none;
}

main {
  min-height: 100svh;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 0 0 clamp(44px, 12vh, 120px);
}

.masthead {
  width: min(890px, calc(100vw - 34px));
  padding: max(48px, calc(env(safe-area-inset-top) + 34px)) 0 0;
  text-align: center;
}

.brand {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  color: #654926;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-transform: uppercase;
}

.brand span {
  width: clamp(25px, 5vw, 56px);
  height: 1px;
  background: linear-gradient(90deg, transparent, #a57c49);
}

.brand span:last-child { transform: rotate(180deg); }

h1 {
  margin: clamp(22px, 5vh, 56px) 0 0;
  font-size: clamp(2.35rem, 7.1vw, 5.1rem);
  font-weight: 400;
  letter-spacing: -0.044em;
  line-height: 1.02;
  text-wrap: balance;
  text-shadow: 0 2px 20px #fff7df, 0 1px 2px #fffefa;
}

#instructions {
  margin: 21px auto 0;
  font-family: system-ui, sans-serif;
  color: var(--muted);
  font-size: 0.85rem;
  text-shadow: 0 1px 10px #fffefa;
}

.sealed {
  position: relative;
  isolation: isolate;
  width: min(370px, calc(100vw - 48px));
  margin: clamp(48px, 13vh, 140px) 0 0;
  padding: 39px 28px 32px;
  background:
    radial-gradient(ellipse at 40% 0, #fffbef 0%, transparent 70%),
    linear-gradient(100deg, #eee0c2, #fff9e9 19%, #f7ecd5 79%, #e5d3ad);
  border: 1px solid #a5814f80;
  border-radius: 3px 3px 6px 6px;
  box-shadow: 0 18px 52px #354a5f35, inset 0 0 22px #e0c19170;
  color: #3c392f;
  text-align: center;
}

.sealed::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid #a6814b55;
  pointer-events: none;
}

.sealed p {
  margin: 20px auto 0;
  font-size: 1.05rem;
  line-height: 1.55;
  text-wrap: balance;
}

.seal {
  transform: rotate(-9deg);
  display: grid;
  place-items: center;
  margin: 0 auto;
  width: 45px;
  height: 45px;
  border-radius: 48% 52% 52% 45%;
  background: radial-gradient(circle at 40% 35%, #bd8f4d, #916232 64%, #794722);
  box-shadow: 0 2px 4px #78472550, inset 0 1px 2px #e5ba7790;
}

.seal span {
  width: 25px;
  height: 25px;
  border: 1px solid #eed6a2c0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.seal span::after {
  content: "";
  width: 9px;
  height: 9px;
  border: 1px solid #eed6a2df;
  transform: rotate(45deg);
}

.has-letter main { padding-bottom: 28vh; }

.has-letter .masthead {
  min-height: 69svh;
  padding-top: max(49px, calc(env(safe-area-inset-top) + 33px), 14svh);
}

.scroll {
  --revealed: 0px;
  position: relative;
  width: var(--reading-width);
  margin: 0;
}

.sheet {
  background: var(--ivory);
  clip-path: inset(0 0 max(0px, calc(100% - var(--revealed))) 0);
  border-inline: 1px solid #8b653b60;
}

.sheet img {
  display: block;
  width: 100%;
  height: auto;
}

.roller {
  position: absolute;
  z-index: 1;
  left: -9px;
  right: -9px;
  height: 21px;
  border: 1px solid #8060358c;
  border-radius: 15px;
  background:
    linear-gradient(to bottom, #c4a779, #f5e1b5 29%, #d8bc86 63%, #aa8050),
    var(--paper);
  box-shadow: 0 3px 12px #443b2c55, inset 0 1px #ffe9bd;
  pointer-events: none;
}

.roller::before,
.roller::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 13px;
  border-radius: 12px;
  border: 1px solid #664621aa;
  background: linear-gradient(#bd9c63, #f5db9d 28%, #a77b45 69%, #7c5731);
}

.roller::before { left: -5px; }
.roller::after { right: -5px; }
.top-roller { top: -10px; }
.moving-roller { top: calc(var(--revealed) - 10px); }

.noscript {
  text-align: center;
  margin: 0 auto 2rem;
  padding-inline: 12px;
}

@media (max-width: 640px), (orientation: portrait) {
  :root { --reading-width: min(570px, calc(100vw - 34px)); }
  .landscape {
    background-image:
      linear-gradient(180deg, rgb(244 245 238 / 14%), transparent 58%),
      url("/static/acropolis-portrait.webp"),
      radial-gradient(ellipse at 50% 20%, #f8efe1, #b6c9d8 80%);
    background-position: center;
  }
  .has-letter .masthead { min-height: 66svh; }
  .roller { left: -6px; right: -6px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .has-letter .masthead { min-height: 0; padding-bottom: 46px; }
  .sheet { clip-path: none; }
  .moving-roller { top: auto; bottom: -10px; }
  .has-letter main { padding-bottom: 64px; }
}
