@font-face {
  font-family: "Instrument Serif";
  src: url("type/InstrumentSerif-Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --paper: light-dark(#f4eee2, #202429);
  --ink: light-dark(#302b22, #f7e9ce);
  --body-ink: light-dark(#483d32, #e2d6c0);
  --muted: light-dark(#6b5a49, #c2b6a4);
  --accent: light-dark(#85502d, #edbe79);
  --rule: light-dark(#cfc2ac, #55524b);
  --focus: light-dark(#764019, #ffcf85);
  --gutter: clamp(34px, 7.1vw, 134px);
  --script: "Kaiti SC", "STKaiti", "KaiTi", var(--serif);
  --inscription: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  background: var(--paper);
  color: var(--ink);
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }
body { background: var(--paper); }
.cover {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: max-content 1fr;
  min-height: var(--cover-height);
  background: var(--paper);
}
.photograph,.wash { position: absolute; inset: 0; }
.photograph { z-index: -2; overflow: hidden; container-type: size; }
.film { position: absolute; inset: 0; }
.film > img,.motion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--aim-x,50%) var(--aim-y,50%); }
@supports (width: 1cqh) {
  .film {
    inset: auto; top: var(--aim-y,50%); left: var(--aim-x,50%);
    width: max(100cqw, calc(100cqh * 1.77683316));
    aspect-ratio: 1672 / 941;
    transform: translate(calc(0% - var(--aim-x,50%)), calc(0% - var(--aim-y,50%)));
  }
}
.evening { opacity: 0; transition: opacity 820ms ease-in-out; }
:root[data-theme=dark] .evening { opacity: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .evening { opacity: 1; } }
.motion { pointer-events: none; opacity: 0; }
.motion[data-window-ready] { opacity: 1; }
.wash { z-index: -1; pointer-events: none; background: var(--wash,none); }
.cover-header {
  padding: clamp(14px,2.9vh,34px) var(--gutter) 0;
  display: flex; align-items: center; gap: clamp(22px,2.7vw,48px);
  pointer-events: none;
}
.cover-header > * { pointer-events: auto; }
.home-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 650 23px/1 var(--sans); letter-spacing: -.065em;
}
.home-link span { font-weight: 420; }
.home-link .icon { width: 16px; height: 16px; margin-right: 8px; transition: transform .22s; }
.home-link:hover .icon { transform: translateX(-3px); }
.light-switch {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid light-dark(#fff7dfaf,#ffe9b578);
  border-radius: 28px; min-height: 42px; padding: 0 14px;
  color: light-dark(#403628,#ffe9c5); background: light-dark(#fff2ddef,#282c30ed);
  box-shadow: 0 2px 12px #241c0f1c; backdrop-filter: blur(8px);
  font: 550 12px/1 var(--sans);
}
.light-switch:hover { background: light-dark(#fff7e5,#3b3b38); }
.light-switch .icon { width: 17px; height: 17px; }
.cover-copy {
  width: min(36.8vw, 630px);
  align-self: center; margin-left: var(--gutter);
  padding: clamp(24px,4.4vh,56px) 0 clamp(50px,10vh,120px);
}
.cover h1 { color: var(--ink); font: 550 clamp(54px,5.9vw,104px)/1.15 var(--serif); letter-spacing: -.058em; }
.cover .intro { color: var(--body-ink); font: 450 clamp(15px,1.15vw,19px)/1.95 var(--sans); }
.turn-link {
  display: inline-flex; align-items: center; gap: 18px; position: relative;
  min-height: 44px; padding: 3px 0 5px;
  font: 650 clamp(20px,1.72vw,28px)/1.3 var(--serif);
}
.turn-link::after {
  content: ""; position: absolute; bottom: 1px; left: 0; right: 0; height: 4px;
  border-top: 1.5px solid var(--accent); border-radius: 55% 35% 0 0;
  transform: rotate(-1.1deg);
}
.turn-link .icon { width: .83em; height: .83em; stroke-width: 1.65; transition: transform .22s; }
.turn-link:hover,.turn-link:focus-visible { color: var(--accent); }
.turn-link:hover .icon { transform: translateX(3px); }
.photo-link {
  position: absolute; display: grid; place-content: start center;
  color: #3a3328; border: 0; padding: 0; background: transparent; cursor: pointer;
}
.photo-link:focus-visible { border-radius: 12px; }
.photo-link span {
  opacity: 0; white-space: nowrap; transform: translateY(-8px);
  background: #fcf1deef; border-radius: 20px; padding: 6px 11px;
  box-shadow: 0 2px 9px #241a121c; font: 12px/1.25 var(--sans);
  transition: opacity .18s, transform .18s;
}
.photo-link:hover span,.photo-link:focus-visible span { opacity: 1; transform: translateY(-16px); }
.foot-sign { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; font: 12px/1.5 var(--mono); color: var(--muted); }
.foot-sign:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.cover[data-no-art] { --photo-height: 72px; }
.cover[data-no-art] .home-link { color: var(--ink); text-shadow: none; }
@media (min-width: 721px) and (max-width: 1010px) {
  :root { --gutter: 5vw; }
  .cover-copy { width: 40vw; }
  .cover h1 { font-size: clamp(45px,6.6vw,68px); }
  .cover .intro { font-size: 14px; }
}
@media (max-width: 720px), (max-aspect-ratio: 4/5) and (max-width: 1000px) {
  :root { --gutter: clamp(22px,6.6vw,46px); }
  .cover { min-height: 0; display: block; padding-top: var(--photo-height); }
  .photograph,.wash { inset: 0 0 auto; height: var(--photo-height); }
  .wash { background: radial-gradient(ellipse 175px 72px at 22px 22px,rgba(32,25,17,.32),transparent), linear-gradient(to bottom,rgba(30,24,15,.26),transparent 22%,transparent 77%,var(--paper)); }
  .cover-header { position: absolute; inset: 0 0 auto; padding: 12px max(16px,env(safe-area-inset-right)) 0 var(--gutter); z-index: 1; }
  .home-link { color: #fff8ea; text-shadow: 0 1px 8px #24190ea0; font-size: 21px; }
  .light-switch { min-height: 39px; font-size: 11px; padding-inline: 12px; }
  .cover-copy { width: auto; margin: 0; padding: 4px var(--gutter) 26px; }
  .cover h1 { font-size: clamp(46px,10.9vw,68px); }
  .cover .intro { font-size: clamp(14px,3.65vw,17px); line-height: 1.85; }
  .turn-link { min-height: 42px; font-size: 21px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { .motion { display:none; } }
