@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/jost-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Jost";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jost-latin-italic.woff2") format("woff2");
}

:root {
  --ink: #000;
  --text: #f4f1ea;
  --text-soft: #c9c5bc;
  --gold: #d8b31a;
  --gold-bright: #efcb37;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --section: clamp(5rem, 11vw, 10rem);
  --gap: clamp(.75rem, 1.6vw, 1.5rem);
  --max: 96rem;
  --paper: url("../images/paper.webp");
  color-scheme: dark;
  scrollbar-color: var(--gold) var(--ink);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--ink);
  color: var(--text);
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  line-height: 1.55;
}

@media (max-width: 900px) {
  :root {
    --paper: url("../images/paper-1280.webp");
  }
}

/* The same crumpled paper runs behind the whole page and stays still */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--paper) center / cover;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-underline-offset: .25em;
  text-decoration-thickness: 1px;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

.sprite {
  position: absolute;
}

/* Read by screen readers, not shown */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: .75rem;
  left: 50%;
  z-index: 40;
  padding: .5rem 1rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 500;
  transform: translate(-50%, -300%);
}

.skip:focus {
  transform: translate(-50%, 0);
}

.heading {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.75rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.025em;
  text-wrap: balance;
}

/* Navigation */

:root {
  --nav-h: 5.25rem;
}

@media (max-width: 860px) {
  :root {
    --nav-h: 4.5rem;
  }
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  min-height: var(--nav-h);
  padding-inline: var(--gutter);
  /* Sized like the page's paper, so the crumples match in scale */
  background: linear-gradient(rgb(0 0 0 / .3), rgb(0 0 0 / .3)), var(--ink) var(--paper) center / max(100vw, 174vh) auto;
}

.nav__home {
  flex: none;
  transition: transform .4s var(--ease-out);
}

.nav__home:hover {
  transform: scale(1.06);
}

.nav__home img {
  width: 4.75rem;
}

.nav__menu {
  flex: 1;
  display: flex;
  align-items: center;
}

.nav__menu nav {
  display: flex;
  gap: clamp(1.25rem, 2.2vw, 2.25rem);
  font-size: 1.2rem;
}

.nav__menu nav a {
  padding-block: .6rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: color .2s;
}

.nav__menu nav a:hover,
.nav__menu nav a[aria-current] {
  color: var(--gold-bright);
}

.social {
  position: relative;
  z-index: 2;
  display: flex;
  gap: .125rem;
  margin: 0 -.5rem 0 auto;
}

.social a {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  color: var(--gold-bright);
  transition: color .2s, transform .35s var(--ease-out);
}

.social a:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.social svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: currentColor;
  fill-rule: evenodd;
}

.action svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav__toggle {
  display: none;
}

@media (max-width: 860px) {
  .nav {
    gap: .25rem;
  }

  .nav__home img {
    width: 4rem;
  }

  .social {
    margin: 0 0 0 -.65rem;
  }

  .nav__toggle {
    position: relative;
    z-index: 2;
    order: 3;
    flex: none;
    display: block;
    margin-left: auto;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    cursor: pointer;
  }

  .nav__toggle span {
    position: absolute;
    left: .4rem;
    right: .4rem;
    top: 50%;
    height: 1.5px;
    background: currentColor;
    transform: translateY(-4px);
    transition: transform .35s var(--ease-out);
  }

  .nav__toggle span:last-child {
    transform: translateY(4px);
  }

  .nav__toggle[aria-expanded="true"] span {
    transform: rotate(45deg);
  }

  .nav__toggle[aria-expanded="true"] span:last-child {
    transform: rotate(-45deg);
  }

  .nav__home {
    position: relative;
    z-index: 2;
  }

  .nav__menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    height: 100dvh;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2.5rem;
    padding: calc(var(--nav-h) + 1rem) var(--gutter) 3rem;
    background: var(--ink) var(--paper) center / cover;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s, visibility .25s;
  }

  .nav__menu.is-open {
    visibility: visible;
    opacity: 1;
  }

  .nav__menu nav {
    flex-direction: column;
    gap: 0;
    font-size: clamp(2.25rem, 10vw, 3rem);
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.2;
  }

  .nav__menu nav a {
    color: var(--text);
    padding-block: .2rem;
  }
}

/* Hero: the pointer lights the paper */

.hero {
  position: relative;
  isolation: isolate;
  clip-path: inset(0);
  margin-top: calc(-1 * var(--nav-h));
  min-height: 100svh;
  display: flex;
  background: linear-gradient(to bottom, rgb(47 93 89 / .85), rgb(47 93 89 / .2) 34%, transparent 70%);
}

/* Fades the light out before the hero's bottom edge, so it never ends in a hard line */
.hero__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, transparent, #000 12rem);
  mask-image: linear-gradient(to top, transparent, #000 12rem);
}

.hero__lit {
  position: fixed;
  inset: 0;
  background: var(--paper) center / cover;
  contain: strict;
  filter: brightness(3) contrast(1.1);
  -webkit-mask-image: radial-gradient(circle min(34rem, 60vw) at var(--mx, 72%) var(--my, 30%), #000, rgb(0 0 0 / .4) 40%, transparent 72%);
  mask-image: radial-gradient(circle min(34rem, 60vw) at var(--mx, 72%) var(--my, 30%), #000, rgb(0 0 0 / .4) 40%, transparent 72%);
}

@media (hover: none) {
  .hero__lit {
    display: none;
  }
}

/* Nothing in the hero keeps working once it has scrolled away */
.hero.is-away .hero__lit {
  display: none;
}

.hero.is-away .hero__logo img {
  animation-play-state: paused;
}

.hero__inner {
  width: 100%;
  max-width: var(--max);
  margin: auto;
  padding: calc(var(--nav-h) + 2.5rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  display: grid;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}

.hero__logo {
  max-width: 100%;
}

.hero__logo img {
  width: 100%;
  animation:
    logo-in 1.4s var(--ease-out) both,
    float 7s 1.4s ease-in-out infinite alternate;
}

/* Phones held sideways: the whole logo fits on the first screen */
@media (orientation: landscape) and (max-height: 520px) {
  .hero__inner {
    padding-top: calc(var(--nav-h) + 1rem);
    align-items: start;
  }

  .hero__logo img {
    width: auto;
    max-width: 100%;
    max-height: calc(100svh - var(--nav-h) - 2rem);
  }
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: translateY(2.5rem) rotate(-2.5deg) scale(.96);
  }
}

@keyframes float {
  to {
    transform: translateY(-.6rem) rotate(.5deg);
  }
}

.hero__intro > * {
  animation: rise-in 1s var(--ease-out) both;
  animation-delay: calc(.35s + var(--i, 0) * .12s);
}

.hero__intro > :nth-child(2) { --i: 1; }
.hero__intro > :nth-child(3) { --i: 2; }
.hero__intro > :nth-child(4) { --i: 3; }
.hero__intro > :nth-child(5) { --i: 3; }

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
}

.hero__intro {
  display: grid;
  gap: 1.1rem;
  color: var(--text-soft);
  text-wrap: pretty;
}

.hero__role {
  color: var(--gold-bright);
  font-size: .95em;
  font-weight: 500;
  line-height: 1.35;
}

.hero__role span {
  white-space: nowrap;
}

.hero__lead {
  color: var(--text);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  line-height: 1.3;
  letter-spacing: -.012em;
}

.hero__sign {
  color: var(--text);
  font-style: italic;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem 1.5rem;
  color: var(--gold-bright);
  font-size: .95em;
}

.hero__links a {
  display: inline-block;
  padding-block: .4rem;
  transition: color .2s;
}

.hero__links a:hover {
  color: var(--text);
}

/* Hero intro, after Nick's motion logo: a whip zoom through the logo, then the
   dog pops in. Both logo layers are the same image, clipped. */

.intro:not(.intro-whip) .hero__logo {
  opacity: 0;
}

/* Keeps the zoomed logo from making the page wider, even for a moment */
.intro .hero {
  overflow: clip;
}

.intro .hero__intro > * {
  animation-delay: calc(1s + var(--i, 0) * .12s);
}

.intro .hero__logo {
  --dog: 37.0% 17.46%, 42.0% 19.05%, 45.33% 14.55%, 46.44% 21.16%, 52.22% 19.05%, 67.78% 14.29%, 69.11% 26.46%, 70.67% 36.24%, 70.22% 43.65%, 68.89% 52.12%, 65.56% 53.17%, 60.56% 46.56%, 58.89% 50.26%, 60.0% 59.79%, 54.44% 63.49%, 48.89% 69.31%, 46.11% 67.72%, 40.67% 59.79%, 42.78% 54.23%, 40.0% 37.04%, 38.33% 25.13%;
  position: relative;
  transform-origin: 46% 28%;
}

.intro .hero__logo img {
  animation: none;
  clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, var(--dog), 37.0% 17.46%, 0 0);
}

.intro .hero__logo .hero__dog {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform-origin: 50% 62%;
  clip-path: polygon(var(--dog));
}

.intro-whip .hero__logo {
  animation: whip 1.5s cubic-bezier(.3, .62, .2, 1) both;
}

.intro-whip .hero__logo .hero__dog {
  animation: dog-pop .75s .3s ease-out both;
}

.intro .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(#3b9091, #174346);
  opacity: .7;
  pointer-events: none;
}

.intro-whip .hero::after {
  animation: teal-out 2s ease-in both;
}

.intro-played .hero__logo img {
  animation: float 7s ease-in-out infinite alternate;
}

@keyframes whip {
  from {
    transform: scale(6) rotate(-3deg);
    filter: blur(10px);
  }

  35% {
    filter: blur(2px);
  }

  to {
    transform: none;
    filter: blur(0);
  }
}

@keyframes dog-pop {
  from {
    opacity: 0;
    transform: translateY(16%) scale(.55) rotate(-12deg);
  }

  20% {
    opacity: 1;
  }

  60% {
    opacity: 1;
    transform: translateY(-2%) scale(1.1) rotate(4deg);
  }

  80% {
    opacity: 1;
    transform: scale(.97) rotate(-1deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes teal-out {
  from {
    opacity: .7;
  }

  to {
    opacity: 0;
  }
}

/* Shared section width */

.clients,
.flush,
.reels,
.editorial,
.close,
.foot,
.page-head,
.contact-body,
.quotes,
.about-quote,
.page-next,
.writing,
.story,
.story-nav,
.resume,
.resume-dripton {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Clients */

.clients {
  --pad: clamp(2rem, 5vw, 4rem);
  padding-block: var(--pad);
  scroll-margin-top: calc(-1 * var(--pad)); /* The nav link lands on the title, not the space above it */
}

.clients .heading {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

/* 15 logos fill both 5 x 3 and 3 x 5 evenly, so no row is ever left short */
.clients__grid {
  --rule: rgb(244 241 234 / .16);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-block: 1px solid var(--rule);
}

.clients__grid li {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 4;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.clients__grid li:nth-child(3n) {
  border-right: 0;
}

.clients__grid li:nth-child(n + 13) {
  border-bottom: 0;
}

/* --w evens out how much space each logo takes, whatever its shape */
.clients__grid img {
  width: min(calc(var(--w) * 1.5%), 86%);
  transition:
    opacity .8s ease-out var(--delay, 0s),
    transform 1.1s var(--ease-out) var(--delay, 0s),
    scale .45s var(--ease-out);
}

/* Revealed by cell, not by image, so a row of different-sized logos arrives together */
.anim .clients__grid li:not(.in) img {
  opacity: 0;
  transform: translateY(1.75rem);
}

@media (min-width: 760px) {
  .clients .heading {
    text-align: center;
  }

  .clients__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .clients__grid li {
    aspect-ratio: 16 / 9;
  }

  .clients__grid li:nth-child(3n) {
    border-right: 1px solid var(--rule);
  }

  .clients__grid li:nth-child(5n) {
    border-right: 0;
  }

  .clients__grid li:nth-child(n + 11) {
    border-bottom: 0;
  }

  .clients__grid img {
    width: calc(var(--w) * 1%);
  }
}

/* Hovering a logo lifts it and draws a gold line along the top of its cell */
@media (hover: hover) {
  .clients__grid li::after {
    content: "";
    position: absolute;
    inset: -1px -1px auto;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .45s var(--ease-out);
    pointer-events: none;
  }

  .clients__grid li {
    transition: background-color .3s ease-out;
  }

  .clients__grid li:hover {
    background-color: rgb(244 241 234 / .05);
  }

  .clients__grid li:hover::after {
    transform: scaleX(1);
  }

  .clients__grid li:hover img {
    scale: 1.06;
  }
}

/* FLUSH */

.flush {
  padding-top: var(--section);
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: end;
}

@media (min-width: 900px) {
  .flush {
    grid-template-columns: minmax(0, 8fr) minmax(0, 3fr);
  }
}

.flush__copy p {
  margin-top: 1rem;
  color: var(--text-soft);
  text-wrap: pretty;
}

.flush__copy b {
  color: var(--text);
  font-weight: 500;
}

/* Players */

.player {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 18px 40px rgb(0 0 0 / .45);
}

.player img,
.player iframe,
.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.player img {
  transition: transform .9s var(--ease-out);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .player:hover img,
  .player:focus-visible img {
    transform: scale(1.06);
  }
}

.player__btn {
  --size: clamp(3.25rem, 6vw, 4.75rem);
  position: absolute;
  bottom: clamp(.75rem, 2vw, 1.5rem);
  left: clamp(.75rem, 2vw, 1.5rem);
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  transition: transform .4s var(--ease-out), background .2s;
}

.player:hover .player__btn {
  background: var(--gold-bright);
  transform: scale(1.08);
}

.player__btn svg {
  width: 42%;
  height: 42%;
  fill: currentColor;
}

.player__out {
  position: absolute;
  bottom: clamp(.75rem, 2vw, 1.5rem);
  left: clamp(.75rem, 2vw, 1.5rem);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .4rem 1.1rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: .95rem;
  font-weight: 500;
  transition: background .2s;
}

.player:hover .player__out {
  background: var(--gold-bright);
}

.player__out svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Reels */

.reels {
  padding-top: var(--section);
  display: grid;
  gap: clamp(3rem, 5vw, 2.5rem) var(--gap);
}

@media (min-width: 760px) {
  .reels {
    grid-template-columns: 1fr 1fr;
  }
}

.reel .heading {
  margin-bottom: 1.25rem;
  font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.5rem);
}

/* Editorial */

.editorial {
  padding-top: var(--section);
}

.editorial__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.wall {
  display: grid;
  gap: var(--gap);
}

/* Each poster's share of its row follows its shape, so rows line up and nothing gets cropped */
.wall__posters {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gap) 0;
}

.wall__posters figure {
  width: calc((100% - 2 * var(--gap)) * var(--d) - .5px);
}

.wall figure {
  margin: 0;
}

.wall img {
  width: 100%;
  border-radius: 4px;
  background: #000;
  box-shadow: 0 14px 30px rgb(0 0 0 / .45);
}

.wall figcaption {
  display: grid;
  gap: .1rem;
  margin-top: .85rem;
  font-size: .85em;
  line-height: 1.35;
  text-wrap: balance;
}

.wall figcaption b {
  color: var(--text);
  font-weight: 500;
}

.wall figcaption span {
  color: var(--text-soft);
}

@media (max-width: 620px) {
  .wall__posters figure {
    order: var(--o, 0);
    width: calc((100% - var(--gap)) * var(--m) - .5px);
  }
}

/* Home page titles: each one borrows a trick from its own section */

/* FLUSH: poster-red edge, and the letters swirl in like water */
.heading--flush {
  text-shadow: .045em .045em 0 #8f1414;
}

.heading--flush .letter {
  display: inline-block;
  pointer-events: none;
}

.anim .heading--flush .letter {
  transition:
    transform 1.1s var(--ease-out) calc(var(--i) * 70ms),
    opacity .4s ease-out calc(var(--i) * 70ms);
}

.anim .heading--flush:not(.in) .letter {
  opacity: 0;
  transform: translateY(.5em) rotate(-260deg) scale(.1);
}

@keyframes swirl {
  45% {
    opacity: 0;
    transform: translateY(.4em) rotate(300deg) scale(.1);
  }
  46% {
    opacity: 0;
    transform: translateY(-.4em) rotate(-120deg) scale(.1);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .flush .heading--flush:hover .letter {
    animation: swirl 1.1s var(--ease-out) calc(var(--i) * 45ms) both;
  }
}

/* MGFX: a colour split that snaps into place, then stays as an offset */
.title-split {
  display: inline-block;
  text-shadow: .045em .03em 0 #1aa89c;
}

@keyframes split-in {
  0% { translate: -.12em 0; text-shadow: .28em 0 0 #1aa89c, -.28em 0 0 var(--gold); }
  18% { translate: .08em 0; text-shadow: -.18em 0 0 #1aa89c, .18em 0 0 var(--gold); }
  36% { translate: -.05em 0; text-shadow: .12em 0 0 #1aa89c, -.12em 0 0 var(--gold); }
  54% { translate: .03em 0; text-shadow: -.06em 0 0 #1aa89c, .06em 0 0 var(--gold); }
  72% { translate: 0 0; text-shadow: .08em .03em 0 #1aa89c, -.03em 0 0 var(--gold); }
}

.anim .heading.in .title-split {
  animation: split-in .7s steps(1) .25s;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .reel:hover .title-split {
    animation: split-in .7s steps(1);
  }
}

/* Food: a gold squiggle draws itself under the word */
.title-squiggle {
  position: relative;
  display: inline-block;
}

.title-squiggle::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -.14em;
  width: 100%;
  height: .2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 8'%3E%3Cpath d='M0 4c3-4 6-4 12 0s9 4 12 0' fill='none' stroke='%23efcb37' stroke-width='2.4'/%3E%3C/svg%3E") 0 0 / .6em 100% repeat-x;
  transition: width .9s var(--ease-out) .35s;
  pointer-events: none;
}

.anim .heading:not(.in) .title-squiggle::after {
  width: 0;
}

@keyframes squiggle-run {
  to { background-position-x: .6em; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .reel:hover .title-squiggle::after {
    animation: squiggle-run .6s linear infinite;
  }
}

/* Editorial Department: a timeline playhead scrubs across and reveals the title */
.heading--splice {
  position: relative;
  display: inline-block;
  padding-right: .3em;
}

.heading--splice span {
  display: block;
}

.heading--splice::after {
  content: "";
  position: absolute;
  top: -.08em;
  bottom: -.08em;
  right: 0;
  width: .16em;
  background: var(--gold-bright);
  clip-path: polygon(0 0, 100% 0, 100% .14em, 62% .3em, 62% 100%, 38% 100%, 38% .3em, 0 .14em);
  pointer-events: none;
}

.anim .heading--splice span {
  transition: clip-path 1.2s cubic-bezier(.6, 0, .2, 1) .1s;
}

.anim .heading--splice::after {
  transition: right 1.2s cubic-bezier(.6, 0, .2, 1) .1s;
}

.anim .heading--splice:not(.in) span {
  clip-path: inset(-.2em 100% -.2em 0);
}

.anim .heading--splice.in span {
  clip-path: inset(-.2em -.2em -.2em 0);
}

.anim .heading--splice:not(.in)::after {
  right: 100%;
}

/* Too narrow for one line: the title wraps and the playhead has nothing to sit beside */
@media (max-width: 350px) {
  .heading--splice {
    padding-right: 0;
  }

  .heading--splice::after {
    display: none;
  }
}

/* Saying: a strip of gold cut paper, like the tape on Fido's logo */
.title-strip {
  display: inline-block;
  padding: .02em .22em .08em;
  background: var(--gold-bright);
  color: var(--ink);
  clip-path: polygon(0 6%, 99% 0, 100% 92%, 2% 100%);
  rotate: -1.6deg;
  transform-origin: left center;
  transition:
    transform .7s var(--ease-out) .3s,
    rotate .4s var(--ease-out);
}

.anim .heading:not(.in) .title-strip {
  transform: scaleX(0);
}

.quotes .heading:hover .title-strip {
  rotate: 1.2deg;
}

/* Companies: the words rise in one after another */
.title-words span {
  display: inline-block;
  transition:
    opacity .5s ease-out calc(var(--i, 0) * 80ms + .1s),
    transform .7s var(--ease-out) calc(var(--i, 0) * 80ms + .1s);
}

.title-words span:nth-child(2) { --i: 1; }
.title-words span:nth-child(3) { --i: 2; }
.title-words span:nth-child(4) { --i: 3; }
.title-words span:nth-child(5) { --i: 4; }

.anim .heading:not(.in).title-words span {
  opacity: 0;
  transform: translateY(.45em);
}

/* Actions */

.action {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 3rem;
  padding: .5rem 1.4rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-bright);
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}

.action svg {
  width: 1.2em;
  height: 1.2em;
  transition: transform .35s var(--ease-out);
}

.action:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--ink);
}

.action:hover svg {
  transform: translateX(3px);
}

.action--solid {
  background: var(--gold);
  color: var(--ink);
}

/* Close */

.close {
  padding-top: var(--section);
  display: grid;
  gap: clamp(2.5rem, 5vw, 5rem);
}

@media (min-width: 760px) {
  .close {
    grid-template-columns: 1fr 1fr;
  }
}

.close p {
  max-width: 30ch;
  margin-bottom: 1.5rem;
  font-size: clamp(1.3rem, 1.1rem + .9vw, 1.9rem);
  line-height: 1.3;
  letter-spacing: -.012em;
  text-wrap: pretty;
}

/* Contact page */

.page-top {
  margin-top: calc(-1 * var(--nav-h));
  padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 6.5rem));
  background: linear-gradient(to bottom, rgb(47 93 89 / .85), rgb(47 93 89 / .2) 60%, transparent);
}

.page-head > * {
  animation: rise-in 1s var(--ease-out) both;
}

.page-head__title {
  font-size: clamp(4rem, 13vw, 11rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
}

.page-head__lead {
  max-width: 34ch;
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  line-height: 1.3;
  letter-spacing: -.012em;
  text-wrap: pretty;
  animation-delay: .12s;
}

.page-head__lead a {
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.contact-body {
  padding-top: clamp(3rem, 6vw, 5.5rem);
  display: grid;
  gap: clamp(3.5rem, 7vw, 7rem);
}

@media (min-width: 900px) {
  .contact-body {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  }
}

.contact-form {
  display: grid;
  gap: 1.5rem;
}

.contact-form__names {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 560px) {
  .contact-form__names {
    grid-template-columns: 1fr 1fr;
  }
}

.field label {
  display: block;
  margin-bottom: .45rem;
  font-weight: 500;
}

.field label span {
  color: var(--text-soft);
  font-size: .85em;
  font-weight: 400;
}

.field__hint {
  margin-bottom: .6rem;
  color: var(--text-soft);
  font-size: .9em;
  line-height: 1.4;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: .7rem .9rem;
  border: 1px solid rgb(244 241 234 / .45);
  border-radius: 4px;
  background: rgb(0 0 0 / .45);
  color: var(--text);
  font: inherit;
  transition: border-color .2s, background .2s;
}

.field textarea {
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--text);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold-bright);
  outline: 2px solid var(--gold-bright);
  outline-offset: 1px;
  background: rgb(0 0 0 / .65);
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-color: #ff9c8a;
}

.contact-form__end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.contact-form button {
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.contact-form__note {
  flex: 1 1 14rem;
  color: var(--text-soft);
  font-size: .9em;
  line-height: 1.4;
}

.contact-form__status:empty {
  display: none;
}

.contact-form__status {
  color: var(--text);
  line-height: 1.4;
}

/* Sent or failed: a coloured edge says which at a glance */
.contact-form__status[data-tone="ok"],
.contact-form__status[data-tone="error"] {
  padding: .85rem 1rem;
  border-left: 3px solid var(--gold-bright);
  background: rgb(0 0 0 / .45);
}

.contact-form__status[data-tone="error"] {
  border-left-color: #ff9c8a;
}

.contact-form button[aria-busy="true"] {
  cursor: progress;
  opacity: .75;
}

/* The spam trap stays out of sight and out of the tab order */
.contact-form__trap {
  display: none;
}

.contact-form__status a {
  color: var(--gold-bright);
}

.contact-services ul {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-services li {
  padding-block: .9rem;
  border-top: 1px solid rgb(244 241 234 / .22);
  line-height: 1.35;
}

.quotes {
  padding-top: var(--section);
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 900px) {
  .quotes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

.quotes .heading {
  grid-column: 1 / -1;
}

.quotes figure {
  margin: 0;
}

.quotes blockquote {
  margin: 0;
  display: grid;
  gap: 1em;
  line-height: 1.5;
  text-wrap: pretty;
}

.quotes figcaption {
  margin-top: 1.25rem;
  color: var(--gold-bright);
  font-weight: 500;
  line-height: 1.35;
}

/* About page: Nick sits in the paper, and the lights come up on him */

.about-hero {
  position: relative;
  overflow: clip;
}

.about-hero__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 52% 30%;
  mask-image: linear-gradient(to top, transparent, #000 30%, #000 94%, transparent); /* The photo's edges fall away into the paper */
  animation: lights-up 1.8s ease-out both;
}

@keyframes lights-up {
  0% {
    filter: brightness(.04) saturate(.5);
    scale: 1.05;
  }
  28% { filter: brightness(.55) saturate(.8); }
  36% { filter: brightness(.25) saturate(.7); }
  100% {
    filter: none;
    scale: 1;
  }
}

.about-hero__copy {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin: -5.5rem auto 0;
  padding-inline: var(--gutter);
}

.about-hero__copy > * {
  animation: rise-in 1s var(--ease-out) .35s both;
}

.about-hero__copy p {
  max-width: 34ch;
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
  font-size: clamp(1.3rem, 1.1rem + .6vw, 1.75rem);
  line-height: 1.32;
  letter-spacing: -.012em;
  text-wrap: pretty;
  animation-delay: .5s;
}

@media (min-width: 900px) {
  .about-hero {
    min-height: calc(100svh - var(--nav-h));
    display: flex;
    align-items: flex-end;
  }

  .about-hero__photo {
    position: absolute;
    inset: 0 0 0 auto;
    width: 76%;
    height: 100%;
    aspect-ratio: auto;
    object-position: 50% 18%;
    mask-image:
      linear-gradient(to right, transparent, #000 26%),
      linear-gradient(to top, transparent, #000 20%, #000 96%, transparent);
    mask-composite: intersect;
  }

  .about-hero__copy {
    margin-top: 0;
    padding-top: 2rem;
    padding-bottom: clamp(2rem, 5vh, 4rem);
  }

  .about-hero__copy p {
    max-width: min(34ch, 38vw);
  }
}

.about-quote {
  margin-block: 0;
  padding-top: var(--section);
}

.about-quote p {
  max-width: 24ch;
  color: var(--gold-bright);
  font-size: clamp(2.25rem, 1.2rem + 4.2vw, 5.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.about-quote .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The quote lights up a word at a time as it scrolls through */
@supports (animation-timeline: view()) {
  .about-hero__photo {
    animation:
      lights-up 1.8s ease-out both,
      about-drift linear both;
    animation-timeline: auto, view();
    animation-range: normal, exit;
  }

  @keyframes about-drift {
    to { translate: 0 10%; }
  }

  .about-quote {
    view-timeline: --quote block;
  }

  .about-quote .word {
    animation: word-lit linear both;
    animation-timeline: --quote;
    animation-range:
      cover calc(10% + var(--p) * 32%)
      cover calc(16% + var(--p) * 32%);
  }

  @keyframes word-lit {
    from { color: rgb(244 241 234 / .2); }
  }
}

.page-next {
  padding-top: clamp(3.5rem, 7vw, 6rem);
}

.page-next ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

@media (min-width: 760px) {
  .page-next ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--gap);
  }
}

.page-next li {
  border-top: 1px solid var(--gold);
}

.page-next a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(.9rem, 1.6vw, 1.4rem);
  color: var(--text);
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 3rem);
  font-weight: 500;
  letter-spacing: -.025em;
  text-decoration: none;
  transition: color .2s;
}

.page-next svg {
  flex: none;
  width: .7em;
  height: .7em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform .35s var(--ease-out);
}

.page-next a:hover,
.page-next a:focus-visible {
  color: var(--gold-bright);
}

.page-next a:hover svg {
  transform: translateX(.2em);
}

/* Writing page: a contents page, set large */

.writing {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.writing__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid rgb(244 241 234 / .22);
}

.writing__list li {
  border-top: 1px solid rgb(244 241 234 / .22);
}

/* Phones: the type and reading time sit under the title. Wider: they line up beside the arrow */
.writing__list a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .35rem 1rem;
  padding-block: clamp(.8rem, 1.6vw, 1.4rem);
  color: var(--text);
  font-size: clamp(2rem, 1.2rem + 3.6vw, 5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.03em;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .2s, padding-left .35s var(--ease-out);
}

.writing__meta {
  grid-row: 2;
  color: var(--text-soft);
  font-size: clamp(.95rem, .9rem + .2vw, 1.1rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: color .2s;
}

@media (min-width: 760px) {
  .writing__list a {
    grid-template-columns: 1fr auto auto;
    column-gap: clamp(1.25rem, 2.5vw, 2.5rem);
  }

  .writing__meta,
  .writing__list svg {
    grid-row: auto;
  }
}

.writing__list a:hover .writing__meta,
.writing__list a:focus-visible .writing__meta {
  color: var(--gold);
}

.writing__list svg {
  grid-row: 1 / span 2;
  grid-column: -2;
  flex: none;
  width: .6em;
  height: .6em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform .35s var(--ease-out);
}

.writing__list a:hover,
.writing__list a:focus-visible {
  color: var(--gold-bright);
  padding-left: .25em;
}

.writing__list a:hover svg {
  transform: translateX(.1em);
}

/* Story pages: a single readable column under a large title */

.story-head__back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
  color: var(--gold-bright);
  font-weight: 500;
  text-decoration: none;
}

.story-head__back svg {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  rotate: 180deg;
  transition: transform .35s var(--ease-out);
}

.story-head__back:hover svg {
  transform: translateX(3px);
}

.story-head .page-head__title {
  max-width: 14ch;
  font-size: clamp(2.25rem, .5rem + 9vw, 8.5rem); /* Small enough at 320px that the longest title word, Shroomagoober, never breaks */
  line-height: .98;
  overflow-wrap: anywhere;
}

.story-head__count {
  margin-top: clamp(1rem, 2vw, 1.5rem);
  color: var(--text-soft);
  font-size: clamp(1rem, .9rem + .3vw, 1.2rem);
  font-variant-numeric: tabular-nums;
  animation-delay: .12s;
}

.story {
  padding-top: clamp(3rem, 6vw, 5rem);
}

/* Paste the text as <p> elements; for a poem add the class story__body--verse and keep its line breaks */
.story__body {
  max-width: 38rem;
  font-size: clamp(1.15rem, 1rem + .45vw, 1.4rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.story__body p + p {
  margin-top: 1.1em;
}

/* "Part One", "Part Two": a gold rule and label that break the story into sections */
.story__part {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25em;
  color: var(--gold-bright);
  font-size: clamp(1rem, .9rem + .3vw, 1.15rem);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.story__part::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gold);
}

.story__body * + .story__part {
  margin-top: 2.75em;
}

.story__body--verse p {
  white-space: pre-line;
}

/* One span per line of verse: a line too long for a phone wraps with an indent, so it can't be mistaken for the next line */
.story__body--verse .line {
  display: block;
  padding-left: 1.25em;
  text-indent: -1.25em;
}

/* Sign-off: Nick's dog and name close every story */
.story__sign {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(.9rem, 2vw, 1.25rem);
  max-width: 38rem;
  margin-top: clamp(3.5rem, 7vw, 5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid rgb(244 241 234 / .16);
  color: var(--text);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.01em;
}

.story__sign img {
  width: clamp(5.5rem, 4.5rem + 3vw, 7rem);
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
}

.story-nav {
  padding-top: clamp(3.5rem, 7vw, 6rem);
}

.story-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

@media (min-width: 760px) {
  .story-nav ul {
    grid-template-columns: 1fr 1fr;
    column-gap: var(--gap);
  }

  .story-nav li + li {
    text-align: right;
  }
}

.story-nav li {
  border-top: 1px solid var(--gold);
}

.story-nav a {
  display: block;
  padding-block: clamp(.9rem, 1.6vw, 1.4rem);
  color: var(--text);
  text-decoration: none;
  transition: color .2s;
}

.story-nav small {
  display: block;
  margin-bottom: .3rem;
  color: var(--text-soft);
  font-size: 1rem;
}

.story-nav span {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.story-nav a:hover,
.story-nav a:focus-visible {
  color: var(--gold-bright);
}

/* Resume page */

.page-head__lead strong {
  font-weight: inherit;
  color: var(--gold-bright);
}

.resume {
  padding-top: clamp(3.5rem, 7vw, 6rem);
  display: grid;
  gap: clamp(3.5rem, 7vw, 6rem);
}

@media (min-width: 900px) {
  .resume {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    column-gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
  }
}

.resume__sub {
  margin-top: clamp(2rem, 4vw, 3rem);
  margin-bottom: .75rem;
  color: var(--gold-bright);
  font-size: clamp(1.25rem, 1.1rem + .5vw, 1.6rem);
  font-weight: 500;
}

.timeline,
.timeline ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline > li {
  display: grid;
  gap: .35rem 1.5rem;
  padding-block: 1.1rem;
  border-top: 1px solid rgb(244 241 234 / .22);
}

@media (min-width: 560px) {
  .timeline > li {
    grid-template-columns: 7.5rem minmax(0, 1fr);
  }
}

.timeline__year {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.timeline__year small {
  display: block;
  font-size: .9rem;
}

.timeline ul {
  display: grid;
  gap: .8rem;
}

.timeline b {
  font-size: clamp(1.2rem, 1.1rem + .4vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.25;
}

.timeline i {
  color: var(--text-soft);
  font-style: normal;
}

.timeline__role,
.timeline__note {
  display: block;
  line-height: 1.4;
}

.timeline__role {
  color: var(--text-soft);
}

.timeline__note {
  margin-top: .2rem;
  max-width: 52ch;
  font-size: .95rem;
  color: var(--text-soft);
}

.resume__side {
  display: grid;
  gap: clamp(3rem, 5vw, 4rem);
}

.resume__side .heading {
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
}

.resume__list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.resume__list li {
  padding-block: .65rem;
  border-top: 1px solid rgb(244 241 234 / .22);
  line-height: 1.35;
}

.resume__edu {
  margin-top: 1rem;
  color: var(--text-soft);
  line-height: 1.45;
}

.resume__edu b {
  display: block;
  margin-bottom: .35rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.25;
}

.resume-dripton {
  padding-top: var(--section);
  display: grid;
  gap: 1.25rem clamp(3rem, 6vw, 6rem);
}

@media (min-width: 900px) {
  .resume-dripton {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
}

.resume-dripton p {
  max-width: 48ch;
  font-size: clamp(1.3rem, 1.1rem + .6vw, 1.75rem);
  line-height: 1.32;
  letter-spacing: -.012em;
  text-wrap: pretty;
}

/* Not found page */

.lost-actions {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Footer */

.foot {
  padding-top: var(--section);
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.foot__end {
  font-size: clamp(4rem, 17vw, 17rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
}

.foot__base {
  margin-top: clamp(2.5rem, 6vw, 5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 1rem;
}

.foot__base:first-child {
  margin-top: 0;
}

.foot__base img {
  width: clamp(9rem, 16vw, 14rem);
}

.foot__meta {
  flex-basis: 100%;
  padding-top: 1rem;
  border-top: 1px solid rgb(244 241 234 / .22);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

@media (min-width: 620px) {
  .foot__meta {
    flex-direction: row;
    align-items: center;
    column-gap: 2rem;
  }
}

.foot__year {
  margin-top: .5rem;
  color: var(--text-soft);
  font-size: .9rem;
}

@media (min-width: 620px) {
  .foot__year {
    margin-top: 0;
    margin-left: auto;
  }
}

.foot__meta a {
  padding-block: .4rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: color .2s;
}

.foot__meta a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: .2em;
}

@media (max-width: 619px) {
  .foot {
    padding-bottom: 3rem;
  }

  .foot__base {
    margin-top: 3.5rem;
    gap: 2rem .5rem;
  }

  .foot__base img {
    width: min(36vw, 9rem);
  }

  .foot__top {
    padding-inline: 1.1rem;
  }

  .foot__meta {
    padding-top: 1.5rem;
    row-gap: .35rem;
  }

  .foot__year {
    margin-top: .85rem;
  }
}

.foot__top svg {
  transform: rotate(-90deg);
}

.foot__top:hover svg {
  transform: rotate(-90deg) translateX(3px);
}

/* Scroll reveals: only hidden once the script confirms it can bring them back */

.anim [data-reveal] {
  opacity: 0;
  transform: translateY(1.75rem);
  transition:
    opacity .8s ease-out var(--delay, 0s),
    transform 1.1s var(--ease-out) var(--delay, 0s);
}

.anim [data-reveal].in {
  opacity: 1;
  transform: none;
}

.anim .player[data-reveal="wipe"] {
  opacity: 1;
  transform: none;
  clip-path: inset(14% 8% round 6px);
  transition: clip-path 1.3s var(--ease-out) var(--delay, 0s);
}

.anim .player[data-reveal="wipe"].in {
  clip-path: inset(0 round 6px);
}

.anim .player[data-reveal="wipe"].done img {
  transition: transform .9s var(--ease-out);
}

.anim .player[data-reveal="wipe"].done {
  clip-path: none;
}

.anim .player[data-reveal="wipe"]:not(.in) img {
  transform: scale(1.14);
}

.anim .player[data-reveal="wipe"] img {
  transition: transform 1.5s var(--ease-out);
}

.anim .player[data-reveal="wipe"]:not(.in) :is(.player__btn, .player__out) {
  opacity: 0;
  transform: scale(.6);
}

.player__btn,
.player__out {
  transition: transform .5s var(--ease-out), opacity .4s, background .2s;
}

.anim .player[data-reveal="wipe"].in :is(.player__btn, .player__out) {
  transition-delay: 0s;
}

/* "That's it." lands letter by letter, and the period lands last */

.foot__end .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.foot__end .letter {
  display: inline-block;
  pointer-events: none; /* The waiting period floats over the Writing button and must not catch its clicks */
}

.anim .foot__end .letter {
  opacity: 0;
  transform: translateY(.5em) rotate(8deg);
  transition:
    opacity .35s ease-out,
    transform .8s cubic-bezier(.2, 1.5, .4, 1);
  transition-delay: calc(var(--i) * 55ms);
}

.anim .foot__end .letter--last {
  transform: translateY(-1.1em);
  transition-delay: calc(var(--i) * 55ms + .45s);
  transition-timing-function: ease-out, cubic-bezier(.3, 1.9, .5, 1);
}

.anim .foot__end.in .letter {
  opacity: 1;
  transform: none;
}

/* Hover details */

.nav__menu nav a {
  position: relative;
}

@media (min-width: 861px) {
  .nav__menu nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: .35rem;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--ease-out);
  }

  .nav__menu nav a:hover::after,
  .nav__menu nav a[aria-current]::after {
    transform: scaleX(1);
  }
}

.nav__home:hover img {
  animation: wag .6s ease-in-out;
}

@keyframes wag {
  25% { transform: rotate(-7deg); }
  60% { transform: rotate(5deg); }
}

.player__btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold-bright);
  opacity: 0;
}

.player:hover .player__btn::after {
  animation: ping 1.2s var(--ease-out) infinite;
}

@keyframes ping {
  from {
    opacity: .9;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.7);
  }
}

/* Scroll-linked: the paper drifts and a gold line tracks progress */

@supports (animation-timeline: scroll()) {
  body::before,
  .hero__lit {
    inset: -8% 0;
    animation: paper-drift linear both;
    animation-timeline: scroll(root);
  }

  @keyframes paper-drift {
    from { transform: translateY(5%); }
    to { transform: translateY(-5%); }
  }

  .nav::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: var(--gold);
    transform-origin: left;
    animation: progress linear both;
    animation-timeline: scroll(root);
  }

  @keyframes progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
