@font-face {
  font-family: 'Iosevka Charon';
  src: url('fonts/iosevka-charon-regular.woff2') format('woff2');
  font-style: normal; font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Iosevka Charon';
  src: url('fonts/iosevka-charon-italic.woff2') format('woff2');
  font-style: italic; font-weight: 400; font-display: swap;
}
.night-opening {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: #080a0d;
  color: #f5f0e5;
}
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(590px, 47vw, 760px);
  display: grid;
  grid-template-rows: auto 1fr;
  background: #050607;
}
.sky-art, .sky-motion, .portrait {
  position: absolute;
  pointer-events: none;
  margin: 0;
}
.sky-art {
  inset: 0;
  z-index: -3;
  container-type: size;
  overflow: hidden;
}
.sky-art::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, #080a0d 0%, transparent 23%),
    linear-gradient(90deg, rgb(2 4 7 / .85), rgb(2 4 7 / .50) 26%, transparent 48%);
}
.sky-plate {
  --hole-x: 50.95%;
  --hole-y: 49.6%;
  position: absolute;
  width: max(100%, 229.99cqh); aspect-ratio: 1902 / 827;
  left: 50%; top: 55%; transform: translate(-50%, -55%);
}
.sky-plate img, .accretion { display: block; width: 100%; height: 100%; }
.accretion { position: absolute; inset: 0; }
/* Center of the painted opening, in the original 1902 by 827 illustration. */
.sky-center { position: absolute; left: var(--hole-x); top: var(--hole-y); width: 0; height: 0; }
.word-flight {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none; overflow: hidden;
}
.word-flight span {
  position: absolute; white-space: pre; line-height: 1;
  transform-origin: center;
}
.sky-motion { inset: 0; overflow: hidden; z-index: -2; }
.sky-motion i {
  position: absolute;
  background: #f9eacb;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  box-shadow: 0 0 4px #f1dcc4;
  animation: twinkle var(--time) var(--delay) ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .09 } to { opacity: .82 } }
.sky-motion .meteor {
  position: absolute;
  width: clamp(55px, 8vw, 115px);
  height: 1px;
  background: linear-gradient(90deg, transparent, #f4dfb8 97%, white);
  opacity: 0;
  animation: meteor 1.25s ease-out both;
}
@keyframes meteor {
  0% { opacity: 0; transform: translate(0, 0) rotate(17deg) scaleX(.3) }
  18% { opacity: .8 }
  100% { opacity: 0; transform: translate(16vw, 5vw) rotate(17deg) scaleX(.8) }
}
.portrait {
  z-index: -1;
  right: -2%;
  bottom: 0;
  width: 40%;
  height: 78%;
  display: grid;
  align-items: end;
  mask-image: linear-gradient(90deg, transparent, black 16%, black 92%, transparent);
}
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 49% top;
  mask-image: linear-gradient(180deg, transparent, black 10%, black 81%, transparent);
}
.upper-reflection {
  padding-top: clamp(18px, 3vw, 42px);
  display: flex;
  justify-content: flex-end;
}
.upper-reflection .cycle {
  width: min(49%, 49ch);
  text-align: right;
  font: italic clamp(19px, 1.7vw, 26px)/1.32 'Baskervville', Georgia, serif;
  color: #eee5d6;
  text-shadow: 0 1px 10px #000;
}
.lines { display: grid; }
.lines p { grid-area: 1 / 1; align-self: center; visibility: hidden; opacity: 0; }
.lines .current { visibility: visible; opacity: 1; }
.cycle-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.advance, .motion-toggle {
  font: 13px/1.3 'Segoe UI', sans-serif;
  color: #e4d6ba;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  min-height: 32px;
}
.advance:hover, .motion-toggle:hover { text-decoration: underline; text-underline-offset: 4px; }
.night-opening button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.opening { align-self: center; padding-block: 0 52px; }
.copy { max-width: min(39%, 480px); }
.copy h1 { text-shadow: 0 2px 12px #070709; }
.copy .source { max-width: 44ch; }
.motion-toggle {
  position: absolute; bottom: 8px; right: 5.5%;
  border-bottom: 1px solid #706c62;
}
.lower-reflection {
  display: grid;
  grid-template-columns: minmax(140px, .8fr) minmax(0, 3fr);
  gap: 4%;
  padding: clamp(28px, 3.8vw, 56px) 0;
  border-top: 1px solid #4a4437;
}
.lower-reflection h2 { font: normal 16px/1.5 'Baskervville', Georgia, serif; color: var(--gold); }
.lower-reflection .cycle {
  font: 400 clamp(18px, 1.62vw, 24px)/1.48 'Iosevka Charon', 'Arial Narrow', sans-serif;
  max-width: 59ch;
}
.lower-reflection .lines { min-height: 2.5em; }
.lower-reflection .lines p { align-self: start; text-wrap: pretty; }
.night-opening.is-still .sky-motion * { animation-play-state: paused; }
@media (max-width: 740px) {
  .hero { min-height: 0; display: block; }
  .sky-art::after { background: linear-gradient(0deg, #080a0d 0%, #080a0d 30%, transparent 63%); }
  .sky-plate { width: auto; height: 61%; left: 55%; top: 6%; transform: translate(-55%, -6%); }
  .upper-reflection { min-height: 103px; padding-top: 17px; justify-content: flex-start; }
  .upper-reflection .cycle { text-align: left; width: min(100%, 46ch); font-size: 18px; }
  .portrait {
    right: -4%; top: 120px; bottom: auto; height: auto; width: 52%;
    mask-image: none;
  }
  .portrait img {
    display: block; height: auto;
    mask-image: radial-gradient(ellipse 65% 73% at 51% 46%, black 49%, transparent 95%);
  }
  .opening { padding-top: clamp(133px, 29vw, 192px); padding-bottom: 54px; }
  .copy { max-width: none; }
  .copy h1 { font-size: clamp(50px, 9vw, 69px); line-height: 1.05; }
  .copy br { display: none; }
  .intro { font-size: 17px; margin: 13px 0 17px; }
  .lower-reflection { grid-template-columns: 1fr; gap: 9px; padding-block: 24px; }
  .lower-reflection .cycle { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .sky-motion, .accretion, .word-flight { display: none; }
}
