:root {
  --gutter: clamp(20px, 5vw, 80px);
  --measure: 1216px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 22px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.5 var(--serif);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure, blockquote, ol, ul { margin: 0; }
h1, h2, h3 { font-weight: 400; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
summary { cursor: pointer; }
svg, img { display: block; }
::selection { color: #fff; background: #252525; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.shell {
  width: min(var(--measure), calc(100% - var(--gutter) - var(--gutter)));
  margin-inline: auto;
}
.skip-link:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip-link:focus-visible {
  position: absolute;
  z-index: 32;
  top: 10px;
  left: var(--gutter);
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
}
/* The opening frames the photographed page and its original ink. */
.opening {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #afb3af;
  place-items: center;
}
.opening-texture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.opening-sheet {
  --photo-width: 2013;
  --photo-height: 1496;
  --crop-left: 35;
  --crop-top: 45;
  --crop-width: 1845;
  --crop-height: 1310;
  --page-top-right: 98.1%;
  --page-bottom-right: 99%;
  --page-lower-right: 99.5%;
  --page-lower-left: 97.7%;
  position: relative;
  width: min(92%, 1240px, 118vh);
  width: min(92%, 1240px, 118dvh);
  aspect-ratio: var(--crop-width) / var(--crop-height);
}
.opening-crop, .opening-photo { position: absolute; }
.opening-crop {
  inset: 0;
  overflow: hidden;
  background: #f5f5f5;
  clip-path: polygon(0 0, var(--page-top-right) 0,
    var(--page-bottom-right) var(--page-lower-right), 0 var(--page-lower-left));
  mask-image: linear-gradient(90deg, transparent, #000 2.8%, #000 96.2%, transparent),
    linear-gradient(180deg, transparent, #000 3.8%, #000 96.2%, transparent);
  mask-composite: intersect;
}
.opening-photo {
  left: calc(-100% * var(--crop-left) / var(--crop-width));
  top: calc(-100% * var(--crop-top) / var(--crop-height));
  width: calc(100% * var(--photo-width) / var(--crop-width));
  height: calc(100% * var(--photo-height) / var(--crop-height));
}
.opening-burn { filter: drop-shadow(0 3px 4px rgb(0 0 0 / .13)); }
.profile-page {
  --paper: #1c1e20;
  --ink: #fff;
  --display: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--paper);
  font: 400 1.025rem/1.68 var(--display);
  scroll-margin-top: -22px;
  outline: none;
}
.opening-burn { display: none; }
.opening-ready:not(.opening-complete) {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pinch-zoom;
}
.opening-ready:not(.opening-complete) body {
  height: 100dvh;
  overflow: clip;
  touch-action: pinch-zoom;
}
.opening-ready .opening {
  height: 0;
  background: transparent;
  pointer-events: none;
}
.opening-ready :is(.opening-texture, .opening-sheet, .opening-burn) {
  position: fixed;
  z-index: 25;
}
.opening-ready .opening-texture { height: 100dvh; }
.opening-ready .opening-sheet { z-index: 26; }
.opening-ready .opening-sheet {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}
.opening-ready .opening-burn {
  inset: 0;
  width: 100%;
  height: 100dvh;
}
.opening-ready .profile-page { opacity: var(--profile-opacity, 0); }
.opening-ready:not(.opening-complete) .profile-page { pointer-events: none; }
.opening-ready .opening[data-frame] :is(.opening-sheet, .opening-texture) { visibility: hidden; }
.opening-ready .opening:is([data-frame="burn"], [data-frame="ash"]) .opening-burn {
  display: block;
}

.profile-photo {
  position: absolute;
  z-index: -1;
  inset: 0;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.profile-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 4% 100%, rgb(13 15 17 / .73) 0%,
    rgb(13 15 17 / .53) 25%, transparent 66%);
}
.profile-document {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: clamp(42px, 9vh, 108px);
  outline: none;
}
.site-header { margin-bottom: clamp(22px, 3vw, 35px); }
.site-header h1 {
  font: 530 clamp(2.85rem, 5.9vw, 5.7rem)/.98 var(--display);
  letter-spacing: -.045em;
}
.site-header, .profile-intro { text-shadow: 0 1px 12px rgb(0 0 0 / .38); }
.profile-intro h2 {
  margin-bottom: 8px;
  font: 400 .76rem/1.55 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.profile-intro p { font-size: clamp(1rem, 1.65vw, 1.24rem); line-height: 1.5; }
@media (max-width: 690px) {
  .profile-photo img { object-position: 48% 50%; }
  .profile-photo::after {
    background: linear-gradient(0deg, rgb(13 15 17 / .72), rgb(13 15 17 / .36) 25%, transparent 55%);
  }
  .profile-document { padding-bottom: max(42px, 8vh, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
