/* The static and moving wordmarks share their outlines, spacing, and viewBox. */
.hero {
  display: grid;
  grid-template-rows: 1fr;
  min-height: min(calc(100svh - var(--head)), clamp(640px, 54vw, 820px));
}
.cover-body {
  container-type: inline-size;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  column-gap: clamp(30px, 3.2vw, 58px);
  padding-block: clamp(48px, 6.9vw, 118px) clamp(64px, 6.7vw, 110px);
}
.cover-meta {
  min-width: 0;
}
.byline {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.1vw, 20px);
  margin-bottom: clamp(22px, 2vw, 34px);
}
.signature {
  display: block;
  width: clamp(136px, 13.1vw, 207px);
  height: auto;
  flex: none;
  fill: var(--bone);
}
.byline-role {
  --role-inset: clamp(12px, 1.1vw, 20px);
  position: relative;
  border-left: 1px solid transparent;
  padding-left: var(--role-inset);
  font: 470 clamp(13px, 1vw, 16px) / 1.32 var(--sans);
  color: var(--body);
}
.byline-rule {
  position: absolute;
  inset: 0 auto 0 -1px;
  width: 1px;
  background: #88836e;
  transform-origin: bottom;
}
.role-label { display: block; }
.cover-role {
  margin: 0;
  font: 490 clamp(42px, 4.48vw, 76px) / 1.035 var(--display);
  letter-spacing: -0.052em;
  color: var(--bone);
}
.cover-role:focus {
  outline: 0;
}
.role-line {
  display: block;
  overflow: clip;
  padding: 0.07em 0.1em 0.1em 0.025em;
  margin: -0.07em -0.1em -0.1em -0.025em;
}
.role-line > span {
  display: block;
}
.cover-note {
  max-width: 35ch;
  margin-top: clamp(22px, 2.1vw, 35px);
  font: 445 clamp(17px, 1.36vw, 22px) / 1.46 var(--sans);
  color: var(--body);
  text-wrap: pretty;
}
.work-folio {
  min-width: 0;
  isolation: isolate;
}
.folio-rest {
  position: relative;
  padding: 12px 2% 4px 0;
  perspective: 1600px;
  perspective-origin: 45% 50%;
}
.folio-shadow {
  display: block;
  pointer-events: none;
  position: absolute;
  inset: 46% 2% -5% 8%;
  transform: rotate(-5deg) skew(-7deg);
  background: #080807;
  filter: blur(18px);
  opacity: 0.83;
}
.folio-object {
  /* Adjacent sheets use opposite edges as their hinge. Their meeting points
     stay joined through the opening and whenever the available width changes. */
  --hinge: 8deg;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  transform: rotateZ(-5deg) rotateY(-9deg) rotateX(7deg);
  transform-origin: 50% 58%;
}
.folio-leaf {
  position: relative;
  display: block;
  min-width: 0;
  height: clamp(306px, 28.5vw, 455px);
  color: var(--ink);
  transform-origin: left center;
  transform: skewY(calc(0deg - var(--hinge)));
  -webkit-tap-highlight-color: transparent;
}
.folio-leaf:nth-child(even) {
  transform-origin: right center;
  transform: skewY(var(--hinge));
}
.leaf-apkudo {
  --sheet: #d89a73;
  --ink: #36251e;
  --light: #ffdfa73b;
  --shade: #522d1f1c;
}
.leaf-xoi {
  --sheet: #c2c6a6;
  --ink: #283127;
  --light: #fff4cd12;
  --shade: #29302424;
}
.leaf-paper {
  position: absolute;
  /* A fraction of bleed under each seam avoids hairline gaps at odd zoom levels. */
  inset: 0 -0.45px 0 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    linear-gradient(98deg, var(--shade), transparent 23%, var(--light)),
    var(--sheet);
  box-shadow:
    0 1px 0 #8c816f,
    0 2px 0 #3c352c,
    0 3px 0 #918270,
    0 4px 0 #332f28;
}
.leaf-paper::before,
.leaf-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.leaf-paper::before {
  background-image: url(assets/folio-paper.png);
  opacity: 0.65;
  mix-blend-mode: multiply;
}
.leaf-paper::after {
  border-top: 1px solid #fff5d24f;
  border-bottom: 1px solid #473e331f;
  box-shadow:
    inset 1px 0 1px #f3e6c952,
    inset -1px 0 1px #392d2c4d;
}
.leaf-name {
  position: relative;
  z-index: 1;
  margin: clamp(17px, 1.55vw, 28px) clamp(13px, 1.32vw, 24px) 0;
  font: 540 clamp(30px, 3.05vw, 54px) / 1.02 var(--display);
  letter-spacing: -0.055em;
}
.leaf-print {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.leaf-foot {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  min-height: 4.2em;
  padding: clamp(11px, 1vw, 17px) 0 1.2em;
  margin-inline: clamp(13px, 1.32vw, 24px);
  border-top: 1px solid currentColor;
  font: 520 clamp(13px, 1.02vw, 17px) / 1.2 var(--sans);
  letter-spacing: -0.015em;
}
.leaf-foot > span {
  align-self: start;
  max-width: 19ch;
}
.leaf-arrow {
  flex: none;
  width: clamp(15px, 1.3vw, 21px);
  height: auto;
  margin-bottom: 0.1em;
}
.folio-leaf:focus-visible {
  z-index: 4;
  outline: 3px solid var(--bone);
  outline-offset: 4px;
}
@media (hover: hover) and (pointer: fine) {
  .leaf-arrow {
    transition: transform 0.26s var(--ease);
  }
  .folio-leaf:is(:hover, :focus-visible) .leaf-arrow {
    transform: translateX(3px);
  }
  .folio-leaf:is(:hover, :focus-visible) .leaf-name {
    text-decoration: underline;
    text-underline-offset: 0.12em;
    text-decoration-thickness: 0.045em;
  }
}

/* The name occupies the headline's line of sight on both covers. The heading
   reserves its final space throughout the title card, including after a rewrap. */
.cover-heading {
  position: relative;
}
.name-art {
  display: none;
  position: absolute;
  z-index: 5;
  left: 0;
  top: 50%;
  width: 100cqi;
  transform: translateY(-50%);
  color: var(--bone);
  fill: currentColor;
  pointer-events: none;
}
.intro-active .name-art {
  display: block;
}
/* Register the opening to the cover while the type beneath it is loading. */
.fold-opening .name-art {
  top: var(--opening-center);
}
.name-layout,
.folding-type {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.name-stack,
.folding-type,
.open-names {
  display: none;
}
.folding-type {
  position: absolute;
  inset: 0;
  height: 100%;
  pointer-events: none;
}
.intro-active.fold-opening .folded-initials {
  visibility: hidden;
}
.intro-active.fold-opening .folding-type {
  display: block;
}
.letter-edge { --relief: 7px; fill: #b28361; }
.letter-middle { --relief: 5.2px; fill: #493c32; }
.letter-lip { --relief: 2.5px; fill: #ba9879; }
.fold-opening .folding-type :is(.letter-edge, .letter-middle, .letter-lip) {
  transform: translate(var(--relief), var(--relief));
  animation: raise-letter 1270ms cubic-bezier(.35, 0, .24, 1) both;
}
@keyframes raise-letter {
  0%, 12% { transform: translate(0, 0); }
  100% { transform: translate(var(--relief), var(--relief)); }
}
.signature :is(.letter-edge, .letter-middle, .letter-lip) { display: none; }
.cover-pullback .signature :is(.letter-edge, .letter-middle, .letter-lip) {
  display: inline;
  animation: press-letter 540ms cubic-bezier(.42, .04, .33, 1) both;
}
@keyframes press-letter {
  /* Let the pressed edges disappear behind the face before reading size. */
  from { transform: translate(var(--relief), var(--relief)); opacity: 1; }
  50% { opacity: 1; }
  to { transform: translate(0, 0); opacity: 0; }
}
.cover-ready .mast .identity {
  transition: opacity 170ms ease-out, visibility 0s;
}
.cover-ready:not(.past-cover) .mast .identity:not(:focus-within) {
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease-out, visibility 0s 140ms;
}

/* Keep the reading order accessible during the optical handoff. Focus or
   a navigation gesture immediately exposes the complete printed page. */
.intro-active :is(.signature, .byline-role, .cover-role, .cover-note, .mast .navigation, .work-folio, .chapter) {
  opacity: 0;
  pointer-events: none;
}
@media screen and (prefers-reduced-motion: no-preference) {
  .intro-active.cover-pullback :is(.signature, .byline-role, .cover-role, .cover-note, .mast .navigation, .work-folio),
  .intro-active.cover-pullback #career { opacity: 1; }
  .intro-active.cover-pullback :is(.work-folio, .mast .navigation) { pointer-events: auto; }
  .cover-pullback :is(.cover-meta, .folio-rest, .mast-inner) { transform-origin: 0 0; }
  /* Keep the ink on the same raster surface through the last fraction of
     a pixel. Release it once the signature is behind the mast. */
  .fold-opening .cover-meta,
  .cover-ready:not(.past-cover) .cover-meta:has(.signature .letter-face) { will-change: transform; }
  .cover-pullback .signature { overflow: visible; }
  .cover-pullback :is(.hero, .mast) { overflow: clip; }
  .cover-measuring :is(.cover-meta, .cover-copy, .folio-rest, .mast-inner, #career) {
    transform: none !important;
  }
}
@media (max-width: 700px) {
  .suite-plate {
    margin-inline: -10px;
  }
}
@media (min-width: 801px) and (max-width: 1100px) {
  .cover-body {
    column-gap: 23px;
    grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  }
  .cover-role {
    font-size: 4.63vw;
  }
  .cover-note {
    font-size: 16px;
    max-width: 34ch;
  }
  .leaf-foot {
    margin-inline: 12px;
    font-size: 12.5px;
    gap: 3px;
  }
  .leaf-name {
    margin-inline: 13px;
  }
}
@media (max-width: 800px) {
  .hero {
    min-height: 0;
  }
  .cover-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: 22px clamp(42px, 7vw, 64px);
  }
  .cover-meta {
    max-width: 580px;
  }
  .byline {
    gap: 13px;
    margin-bottom: 20px;
  }
  .signature {
    width: clamp(139px, 34vw, 180px);
  }
  .byline-role {
    --role-inset: 13px;
    font-size: 12px;
  }
  .cover-role {
    font-size: clamp(38px, 10.8vw, 67px);
    line-height: 1.005;
  }
  .cover-role .role-line {
    display: inline;
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .cover-role .role-line > span {
    display: inline-block;
  }
  .role-line + .role-line::before {
    content: " ";
  }
  .cover-note {
    max-width: 44ch;
    margin-top: 17px;
    font-size: 16px;
    line-height: 1.45;
  }
  .work-folio {
    margin: 34px 1px 7px;
  }
  .folio-rest {
    padding: 0;
    perspective: none;
  }
  .folio-shadow {
    inset: 12% 1% -4% 4%;
    transform: rotate(-1deg);
    filter: blur(9px);
    opacity: 0.57;
  }
  .folio-object {
    display: block;
    transform: rotate(-1.35deg);
  }
  .folio-leaf,
  .folio-leaf:nth-child(even) {
    height: clamp(79px, 19vw, 94px);
    transform-origin: center top;
    transform: skewX(-2.6deg);
  }
  .folio-leaf:nth-child(even) {
    transform-origin: center bottom;
    transform: skewX(2.6deg);
  }
  .leaf-paper {
    inset: 0 0 -0.5px;
    display: grid;
    align-content: center;
    grid-template-columns: minmax(0, 1fr) 34px;
    grid-template-rows: auto auto;
    padding: 9px 41% 10px 16px;
    box-shadow: none;
  }
  .leaf-name {
    grid-column: 1/-1;
    margin: 0;
    font-size: clamp(27px, 6.5vw, 35px);
  }
  .leaf-print {
    position: absolute;
    inset: 0 0 0 auto;
    width: 35%;
  }
  .leaf-foot {
    grid-column: 1/-1;
    display: block;
    padding: 0;
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.17;
    min-height: 0;
    border: 0;
  }
  .leaf-foot > span {
    max-width: none;
  }
  .leaf-arrow {
    position: absolute;
    top: calc(50% - 7px);
    right: 36%;
    width: 14px;
  }
  .leaf-paper::after {
    box-shadow:
      inset 0 1px #efdfb336,
      inset 0 -1px #31282066;
  }
}
@media (max-width: 650px) {
  .name-wide {
    display: none;
  }
  .name-stack {
    display: block;
  }
}
@media (max-width: 360px) {
  .signature {
    width: clamp(110px, 37vw, 128px);
  }
  .cover-role {
    font-size: clamp(35px, 11.7vw, 42px);
  }
  .leaf-foot {
    font-size: 12px;
  }
  .leaf-paper {
    padding-right: 39%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .folio-leaf:is(:hover, :focus-visible) .leaf-arrow {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce), print {
  .intro-active .name-art {
    display: none !important;
  }
  .intro-active :is(.signature, .byline-role, .cover-role, .cover-note, .work-folio, .mast .navigation, .chapter) {
    opacity: 1 !important;
    pointer-events: auto;
  }
}
@media print {
  .hero {
    min-height: auto;
    display: block;
  }
  .cover-body {
    padding: 15px 0;
  }
}
/* The paper is also the project navigation. Its anchors and text stay in the
   normal layout. The sheets move around their shared creases. */
.paper-pending .work-folio {
  visibility: hidden;
}
.work-folio.is-unfolding { transform-origin: left center; }
.is-unfolding :is(.folio-rest, .folio-object) { pointer-events: none; }
.is-unfolding .folio-leaf { pointer-events: auto; }
.is-unfolding .folio-object,
.is-unfolding .folio-leaf {
  transform-style: preserve-3d;
}
.crease-light {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(90deg, #292419, #141710 85%);
  opacity: 0;
  pointer-events: none;
}
.is-unfolding .folio-leaf,
.is-unfolding .folio-leaf:nth-child(even) {
  transform-origin: 0 0;
}
.is-unfolding .leaf-paper,
.is-unfolding .folio-leaf::before {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.is-unfolding .folio-leaf::before {
  content: "";
  position: absolute;
  inset: 0 -0.45px 0 0;
  background:
    linear-gradient(93deg, #29251526, transparent 55%),
    url(assets/folio-paper.png), var(--sheet);
  box-shadow:
    inset 1px 0 #e9ddae55,
    inset -1px 0 #201d1b55;
  transform: rotateY(180deg);
  pointer-events: none;
}
.folio-shadow {
  transform-origin: left center;
}
.print-drawing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  pointer-events: none;
}
.probe-pulse,
.receipt-ring {
  opacity: 0;
}
.phone-check {
  stroke-dasharray: 1;
}
.receipt-ring {
  transform-box: fill-box;
  transform-origin: center;
}

@media (max-width: 800px) {
  .work-folio.is-unfolding { transform-origin: center top; }
  .folio-rest {
    perspective: 1150px;
    perspective-origin: 50% 25%;
  }
  .folio-shadow {
    transform-origin: center top;
  }
  .is-unfolding .folio-leaf::before {
    inset: 0 0 -0.5px;
    transform: rotateX(180deg);
  }
  .crease-light {
    background: linear-gradient(#302a1f, #171a14 90%);
  }
  .print-drawing {
    inset: auto 0;
    top: 50%;
    height: auto;
    aspect-ratio: 260/262;
    transform: translateY(-50%);
  }
  .leaf-apkudo .print-drawing {
    top: 47%;
    transform: translateY(-47%);
  }
  .leaf-xoi .print-drawing {
    top: 45%;
    transform: translateY(-45%);
  }
  .cover-role .role-line {
    display: inline-block;
    vertical-align: top;
    overflow: clip;
    padding: 0.06em 0.025em 0.09em;
    margin: -0.06em -0.025em -0.09em;
  }
  .role-line + .role-line::before {
    content: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  /* A test runs out over each bus and stamps the two devices on receipt. */
  .is-printing .handset {
    transform-box: fill-box;
    transform-origin: 50% 64%;
    animation: ink-seat 1040ms var(--ease) both;
  }
  .handset-ios {
    --lift: translate(-6px, -9px) rotate(-4deg);
    --trigger: 0ms;
  }
  .handset-android {
    --lift: translate(8px, 11px) rotate(4deg);
    --trigger: 95ms;
  }
  .is-printing .handset-android {
    animation-delay: 90ms;
  }
  .is-printing .probe-pulse {
    stroke-dasharray: 0.23 1.1;
    animation: ink-probe 760ms ease-out 80ms both;
  }
  .is-printing .second-port {
    animation-delay: 185ms;
  }
  .is-printing .phone-check {
    animation: ink-tick 970ms var(--ease) var(--trigger) both;
  }
  .is-printing .receipt-ring {
    animation: ink-received 480ms ease-out calc(590ms + var(--trigger)) both;
  }
  @keyframes ink-seat {
    0%,
    100% {
      transform: none;
    }
    33% {
      transform: var(--lift);
    }
  }
  @keyframes ink-probe {
    0% {
      stroke-dashoffset: 0.24;
      opacity: 0;
    }
    12%,
    80% {
      opacity: 1;
    }
    100% {
      stroke-dashoffset: -1;
      opacity: 0;
    }
  }
  @keyframes ink-tick {
    0%,
    100% {
      stroke-dashoffset: 0;
    }
    19%,
    47% {
      stroke-dashoffset: 1.03;
    }
  }
  @keyframes ink-received {
    from {
      opacity: 0;
      transform: scale(0.9);
    }
    18% {
      opacity: 0.95;
    }
    to {
      opacity: 0;
      transform: scale(1.68);
    }
  }

  /* All 32 findings turn around the one pin visible in the front sheet. */
  .is-printing .pinned-sheet {
    transform-box: view-box;
    transform-origin: 132px 183px;
    animation: ink-riffle 1250ms ease-in-out var(--turn-delay) both;
  }
  @keyframes ink-riffle {
    0%,
    100% {
      transform: rotate(0deg);
    }
    31% {
      transform: rotate(var(--gather));
      animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
    }
  }
}

@media (prefers-reduced-motion: reduce), print {
  .paper-pending .work-folio {
    visibility: visible;
  }
}
.is-unfolding .leaf-apkudo {
  z-index: 3;
}
.is-unfolding .leaf-xoi {
  z-index: 2;
}
