/* ==========================================================================
   Een brief aan de Efteling
   Warm papier, één inktkleur, een beetje goud en rood.
   ========================================================================== */

:root {
  --paper: #f2ead6;
  --paper-deep: #e8dcc0;
  --paper-shade: #dccdab;
  --ink: #1b1712;
  --ink-2: #4a3f33;
  --ink-3: #6a5d4f;
  --wet: #26314a;
  --gold: #cc9f3a;
  --gold-deep: #8f6a1c;
  --red: #8c2f2a;
  --green: #4b6440;
  --rule: rgba(27, 23, 18, .22);

  --serif: "Alegreya", "Iowan Old Style", Georgia, serif;
  --sc: "Alegreya SC", "Alegreya", Georgia, serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --initial: "Bodoni Moda", "Bodoni 72", Didot, serif;
  --script: "Mrs Saint Delafield", "Snell Roundhand", cursive;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --measure: 37rem;
  --ease-out: cubic-bezier(.2, .7, .2, 1);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .22 0 0 0 0 .12 1.8 0 0 0 -1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.3'/%3E%3C/svg%3E");
  --fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .11' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .31 0 0 0 0 .15 2.2 0 0 0 -1.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='.14'/%3E%3C/svg%3E");
  --laid: repeating-linear-gradient(0deg, rgba(110, 80, 35, .028) 0 1px, transparent 1px 5px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    var(--grain),
    var(--fibers),
    var(--laid),
    radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(140, 100, 40, .10));
  font-family: var(--serif);
  font-size: clamp(1.0625rem, .99rem + .36vw, 1.25rem);
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

a {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  transition: color .2s;
}
a:hover { color: var(--ink); }

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

::selection { background: rgba(204, 159, 58, .35); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 50;
  padding: .5rem .9rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 2px;
}
.skip-link:focus { top: 1rem; }

/* ---------- Ribbon bookmark ------------------------------------------------ */

.ribbon {
  position: absolute;
  top: 0;
  right: clamp(1rem, 4vw, 3.25rem);
  z-index: 20;
  display: grid;
  place-items: start center;
  width: 2.6rem;
  height: 8.4rem;
  padding-top: .9rem;
  color: #f6e9d6;
  text-decoration: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.18), transparent 22%, rgba(255,255,255,.10) 48%, transparent 70%, rgba(0,0,0,.2)),
    var(--red);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  filter: drop-shadow(0 4px 6px rgba(60, 20, 10, .25));
  transition: height .45s var(--ease-out), transform .45s var(--ease-out);
}
.ribbon span {
  writing-mode: vertical-rl;
  font-family: var(--sc);
  font-size: .8rem;
  letter-spacing: .06em;
  line-height: 1;
}
.ribbon:hover { color: #fff; height: 9.2rem; }
.ribbon:focus-visible { outline: 2px solid #f6e9d6; outline-offset: -5px; }

@media (min-width: 64em) {
  .ribbon { position: fixed; }
  .ribbon.is-tucked { transform: translateY(-1.6rem); }
  .ribbon.is-tucked:hover { transform: none; }
}

/* ---------- Sound toggle --------------------------------------------------- */

.sound {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.75rem;
  padding: .4rem .95rem .45rem .75rem;
  border: 0;
  cursor: pointer;
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-2);
  background: var(--paper-deep);
  clip-path: polygon(2% 8%, 9% 0, 22% 6%, 37% 1%, 52% 7%, 66% 0, 81% 5%, 94% 1%, 100% 14%, 98% 36%, 100% 61%, 97% 84%, 100% 100%, 84% 94%, 69% 100%, 52% 95%, 36% 100%, 20% 94%, 7% 100%, 0 86%, 2% 62%, 0 38%);
  box-shadow: 0 2px 8px rgba(60, 40, 10, .18);
  transition: background .25s, color .25s;
}
.sound:hover { color: var(--ink); background: var(--paper-shade); }
/* The torn edge would cut off the focus ring, so drop it while focused. */
.sound:focus-visible { clip-path: none; }
.sound__icon {
  width: 1.1rem; height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sound__icon circle { fill: currentColor; stroke: none; }
.sound__state {
  font-style: normal;
  font-family: var(--sc);
  letter-spacing: .06em;
  color: var(--ink-3);
}
.sound[aria-pressed="true"] { color: var(--red); }
.sound[aria-pressed="true"] .sound__state { color: var(--red); }
.sound[aria-pressed="true"] .sound__icon { animation: sway 1.9s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes sway { 50% { transform: rotate(-9deg) translateY(-1px); } }

/* Phones: the button gets its own spot above the letterhead, so the name has room. */
@media (max-width: 40em) {
  .intro { padding-top: 4.6rem; }
  .sound {
    position: absolute;
    top: .9rem;
    left: var(--gutter);
    margin: 0;
    min-height: 2.5rem;
    font-size: .9rem;
  }
}

/* ---------- I. Intro -------------------------------------------------------- */

/* The big background letters may run off the page, but never widen it. */
main { position: relative; overflow-x: clip; }

/* The flying carpet, drawn in script.js. It only takes off when motion is welcome. */
.carpet {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none;
  will-change: transform;
}

.intro {
  position: relative;
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(3.25rem, 9vh, 6.5rem) var(--gutter) clamp(2.5rem, 6vh, 4rem);
}

.ghost {
  position: absolute;
  z-index: -1;
  font-family: var(--display);
  font-weight: 700;
  line-height: .8;
  color: var(--ink);
  opacity: .035;
  pointer-events: none;
  user-select: none;
}
.ghost--1 { font-size: clamp(14rem, 34vw, 30rem); top: -2.5rem; right: -4vw; }
.ghost--2 { font-size: clamp(10rem, 24vw, 22rem); top: 52%; left: -9vw; font-style: italic; }

.letterhead {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding-bottom: 1rem;
  margin-bottom: clamp(2rem, 5vh, 3.25rem);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 3px 0 -2px var(--rule);
  padding-right: 3.4rem;
}
.letterhead__text { flex: 1; min-width: 0; }

/* A small oval portrait, like a cameo pasted into the letterhead. */
.portrait {
  flex: none;
  position: relative;
  width: 3.7rem;
  aspect-ratio: 4 / 5;
  border-radius: 50%;
  overflow: hidden;
  background:
    repeating-linear-gradient(-45deg, transparent 0 5px, rgba(27, 23, 18, .07) 5px 6px),
    var(--paper-deep);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink), 0 4px 10px -4px rgba(60, 40, 10, .4);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(.18) saturate(.9);
}
.portrait__empty { display: none; }
.portrait.is-empty .portrait__empty {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: .7rem;
  font-family: var(--sc);
  letter-spacing: .12em;
  color: var(--ink-3);
}
.letterhead__title {
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  gap: 0 .7rem;
  align-items: baseline;
}
.letterhead__name {
  font-family: var(--sc);
  font-weight: 600;
  letter-spacing: .1em;
  font-size: 1.12em;
}
.letterhead__role { font-style: italic; color: var(--ink-2); }
.letterhead__date {
  font-style: italic;
  color: var(--ink-3);
  font-size: .95rem;
}

.intro__body {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) minmax(12rem, 15rem);
  justify-content: space-between;
  gap: 2.5rem 3.5rem;
}

.letter p + p { margin-top: .85em; text-indent: 1.4em; }

/* What the work is made of: a short list inside the letter, with gold lozenges. */
.deeds {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .2em 1.6em;
  margin: .5em 0 .85em;
  padding: 0 0 0 1.4em;
}
.deeds li { position: relative; padding-left: 1.15em; }
.deeds li::before {
  content: "";
  position: absolute;
  left: .1em;
  top: .58em;
  width: .42em;
  height: .42em;
  background: var(--gold);
  transform: rotate(45deg);
}
@media (max-width: 30em) {
  .deeds { grid-template-columns: minmax(0, 1fr); padding-left: 1em; }
}

/* Keep the initial inside the first paragraph so the next one starts cleanly. */
.lede { font-size: 1.04em; display: flow-root; }

.run-in {
  font-family: var(--sc);
  font-weight: 500;
  letter-spacing: .07em;
  font-size: 1.08em;
}

/* The inked initial: shared by hero, project badges and the dialog. */
.initial {
  display: block;
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
}
.initial__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.initial__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--initial);
  font-weight: 900;
  font-size: 7rem;
  line-height: 1;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--ink);
}
.js .initial__fallback { visibility: hidden; }
.js .initial.is-fallback .initial__fallback { visibility: visible; }

.initial--hero {
  float: left;
  width: clamp(6.9rem, 27vw, 12.6rem);
  margin: .38em 1.05rem .35rem -.35rem;
}
.initial--hero .initial__fallback { font-size: clamp(4.6rem, 18vw, 8.4rem); }

/* At a glance — the margin note for a recruiter in a hurry. Beside the letter on a wide screen;
   on a phone it would only push the letter down, so it stays away there (paper still gets it). */
.glance {
  align-self: start;
  margin-top: .45rem;
  padding: 1.15rem 0 0;
  border-top: 2px solid var(--gold);
  font-size: .93rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.glance__title {
  font-weight: 600;
  font-size: .9rem;
  font-family: var(--sc);
  letter-spacing: .14em;
  color: var(--red);
  margin-bottom: .7rem;
}
.glance__list { display: grid; gap: .7rem; }
.glance__list dt {
  font-family: var(--sc);
  letter-spacing: .08em;
  color: var(--ink);
  font-weight: 600;
  font-size: .95em;
}
.glance__list dd { margin: 0; }

@media (max-width: 56em) {
  .intro__body { grid-template-columns: minmax(0, 1fr); }
  .glance {
    padding: 1.1rem 1.15rem 1.2rem;
    border: 1px solid var(--rule);
    border-top: 2px solid var(--gold);
    background: rgba(232, 220, 192, .45);
  }
  .glance__list { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .65rem 1.4rem; }
}
@media screen and (max-width: 56em) {
  .glance { display: none; }
}

@media (max-width: 30em) {
  .letterhead { gap: .8rem; padding-right: 3rem; }
  .portrait { width: 3rem; }
  .letter p + p { text-indent: 1em; }
}

/* ---------- Fleuron divider ------------------------------------------------- */

.fleuron {
  display: flex;
  justify-content: center;
  padding: 1rem var(--gutter) 0;
}
.fleuron svg { width: min(15rem, 70vw); height: auto; overflow: visible; }
.fleuron__line path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.15;
  stroke-linecap: round;
}
.fleuron__lozenge { fill: var(--red); }
.fleuron__dot { fill: var(--gold); }

/* ---------- Section heads -------------------------------------------------- */

.section-head {
  max-width: 34rem;
  margin: 0 auto clamp(2.25rem, 5vh, 3.5rem);
  text-align: center;
}
.section-head__num {
  font-family: var(--display);
  font-style: italic;
  font-size: 1rem;
  color: var(--red);
  letter-spacing: .1em;
  margin-bottom: .2rem;
}
.section-head h2,
.invite h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -.015em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.section-head__lede {
  margin-top: .9rem;
  color: var(--ink-2);
}
.section-head__hint {
  margin-top: .65rem;
  font-size: .9rem;
  font-style: italic;
  color: var(--ink-3);
}

/* ---------- II. Workshop ---------------------------------------------------- */

.workshop {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) var(--gutter) clamp(3rem, 8vh, 5rem);
}

.projects {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2.75rem, 5vw, 4rem) clamp(2rem, 3.5vw, 3.25rem);
}

.project {
  position: relative;
  padding-top: 1.4rem;
}

.project__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: .55rem;
  background: #f7f1e3;
  transform: rotate(var(--tilt, 0deg));
  box-shadow:
    0 1px 1px rgba(60, 40, 10, .08),
    0 14px 26px -16px rgba(60, 40, 10, .45);
  transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out);
}
.project__frame img,
.project__frame .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Photo corners, like in an old album. */
.corner {
  position: absolute;
  width: 1.65rem;
  height: 1.65rem;
  background: linear-gradient(135deg, #3b2f24, #2a211a);
  opacity: .92;
}
.corner--tl { top: -.3rem; left: -.3rem; clip-path: polygon(0 0, 100% 0, 0 100%); }
.corner--tr { top: -.3rem; right: -.3rem; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.corner--bl { bottom: -.3rem; left: -.3rem; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.corner--br { bottom: -.3rem; right: -.3rem; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.placeholder {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .3rem;
  padding: 1rem;
  text-align: center;
  color: var(--ink-3);
  background:
    repeating-linear-gradient(-45deg, transparent 0 9px, rgba(27, 23, 18, .055) 9px 10px),
    var(--paper-deep);
  outline: 1px dashed rgba(27, 23, 18, .3);
  outline-offset: -.6rem;
}
/* A real photo sits on top of its placeholder; if the file is missing it removes itself. */
.placeholder > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.placeholder:has(> img) { outline: none; }
.placeholder__label {
  font-family: var(--sc);
  letter-spacing: .16em;
  font-size: .95rem;
  color: var(--ink-2);
}
.placeholder__file {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .66rem;
  letter-spacing: 0;
  opacity: .75;
}

.project__badge {
  position: absolute;
  top: 0;
  left: -.85rem;
  width: clamp(4.4rem, 7vw, 5.5rem);
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(60, 40, 10, .18));
}

.project__no {
  margin-top: 1.35rem;
  font-family: var(--sc);
  letter-spacing: .14em;
  font-size: .85rem;
  color: var(--red);
}
.project__title {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.36rem;
  line-height: 1.2;
  margin: .1rem 0 .4rem;
  letter-spacing: -.005em;
  font-variation-settings: "SOFT" 60;
}
/* Two tall prints side by side, for a project told in phone screenshots. The columns follow
   the shape of each print, so both stand equally tall. */
.project__photos--pair {
  display: grid;
  grid-template-columns: 77.5fr 50fr;   /* together exactly as tall as a 4:3 print */
  gap: .9rem;
  align-items: start;
}
.project__frame--phone { aspect-ratio: 50 / 100; }
.project__frame--press { aspect-ratio: 77.5 / 100; }
.project__photos--pair .project__frame + .project__frame { transform: rotate(calc(var(--tilt, 0deg) * -1.6)); }

/* Two prints per project: the second lies over the corner of the first. */
.project__photos { position: relative; }
.project__photos .project__second {
  position: absolute;
  right: -.6rem;
  bottom: -1.7rem;
  z-index: 1;
  width: 46%;
  height: auto;
  aspect-ratio: 4 / 3;
  padding: .32rem;
  background: #f7f1e3;
  transform: rotate(calc(var(--tilt, 0deg) * -2.4));
  box-shadow:
    0 1px 1px rgba(60, 40, 10, .1),
    0 10px 18px -10px rgba(60, 40, 10, .55);
  transition: transform .55s var(--ease-out);
}
.project__second img,
.project__second .placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project__second .placeholder { display: grid; padding: .3rem; outline-offset: -.3rem; }
.project__second .placeholder__label { font-size: .7rem; }
.project__caption {
  font-size: .98rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.project__tags {
  margin-top: .5rem;
  font-size: .82rem;
  font-style: italic;
  color: var(--ink-3);
}
.project__link {
  margin-top: .35rem;
  font-size: .92rem;
  font-style: italic;
}

@media (hover: hover) {
  .project:hover .project__frame {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 0 1px 1px rgba(60, 40, 10, .08), 0 22px 32px -18px rgba(60, 40, 10, .5);
  }
  .project:hover .project__second { transform: rotate(calc(var(--tilt, 0deg) * -1)) translate(2px, -6px); }
}

@media (max-width: 62em) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A row that isn't full sits in the middle, so it doesn't read as a missing
   project: every card spans two half-columns. */
@media screen and (width > 62em) {
  .projects { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .project { grid-column: span 2; }
  .project:nth-child(3n + 1):nth-last-child(2) { grid-column: 2 / span 2; }
  .project:nth-child(3n + 1):last-child { grid-column: 3 / span 2; }
}
@media screen and (40em < width <= 62em) {
  .projects { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .project { grid-column: span 2; }
  .project:nth-child(odd):last-child { grid-column: 2 / span 2; }
}

/* Phones: a swipeable row of tipped-in photos keeps the page short. */
@media (max-width: 40em) {
  .projects {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 80%;
    gap: 1.4rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    padding: .4rem var(--gutter) 1.4rem 1.9rem;
    scrollbar-width: none;
  }
  .projects::-webkit-scrollbar { display: none; }
  .project { scroll-snap-align: start; }
  .project__badge { width: 4.2rem; left: -.75rem; }
}

/* ---------- III. Story ------------------------------------------------------ */

.story,
.invite {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.story { padding-top: clamp(2rem, 6vh, 4rem); }

.toc {
  margin: 0 0 clamp(2.25rem, 5vh, 3rem);
  padding: 1.4rem 0 1.2rem;
  border-block: 1px solid var(--rule);
}
.toc__title {
  font-weight: 600;
  font-size: .9rem;
  font-family: var(--sc);
  letter-spacing: .2em;
  text-align: center;
  color: var(--red);
  margin-bottom: .6rem;
}
.toc__list { list-style: none; padding: 0; }
.toc__list li {
  display: flex;
  align-items: flex-end;
  align-items: last baseline;
  gap: .55rem;
  padding: .5rem 0;
}
.toc__num {
  flex: none;
  align-self: flex-start;
  line-height: 1.3;
  width: 2.1rem;
  font-family: var(--display);
  font-style: italic;
  color: var(--red);
}
.toc__entry { flex: 0 1 auto; line-height: 1.3; }
.toc__entry strong { font-weight: 600; }
.toc__entry em {
  display: block;
  font-size: .9em;
  color: var(--ink-2);
}
.toc__lead {
  flex: 1 1 1.25rem;
  min-width: 1.25rem;
  height: 1px;
  margin-bottom: .32em;
  background-image: radial-gradient(circle, rgba(27, 23, 18, .55) .9px, transparent 1.2px);
  background-size: 6px 3px;
  background-repeat: repeat-x;
  background-position: 0 50%;
  transform-origin: left;
}
.toc__page {
  flex: none;
  font-style: italic;
  color: var(--ink-2);
  font-size: .95em;
}
.toc__next .toc__entry strong,
.toc__next .toc__page { color: var(--red); }

.prose p + p,
.prose figure + p { margin-top: .9em; }

/* A snapshot pasted into the margin of the story. */
.snapshot {
  float: right;
  width: min(42%, 15rem);
  margin: .5rem -.75rem 1.2rem 1.6rem;
}
.snapshot__frame {
  position: relative;
  padding: .45rem;
  background: #f7f1e3;
  transform: rotate(2.2deg);
  box-shadow:
    0 1px 1px rgba(60, 40, 10, .08),
    0 14px 26px -16px rgba(60, 40, 10, .45);
}
.snapshot__frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: sepia(.12) saturate(.92);
}
.snapshot .corner { width: 1.3rem; height: 1.3rem; }
.snapshot figcaption {
  margin-top: .8rem;
  font-family: var(--display);
  font-style: italic;
  font-size: .85rem;
  line-height: 1.35;
  text-align: center;
  color: var(--ink-2);
  transform: rotate(1deg);
}
@media (max-width: 40em) {
  .snapshot {
    float: none;
    width: min(78%, 17rem);
    margin: 1.8rem auto 1.6rem;
  }
}

.drop::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 700;
  font-size: 3.55em;
  line-height: .82;
  margin: .07em .09em 0 -.02em;
  color: var(--red);
}
@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .drop::first-letter {
    float: none;
    font-size: inherit;
    line-height: inherit;
    margin: 0 .12em 0 0;
    -webkit-initial-letter: 3;
    initial-letter: 3;
  }
}

/* ---------- Invitation ----------------------------------------------------- */

.invite {
  padding-top: clamp(2rem, 5vh, 3.25rem);
  padding-bottom: clamp(4rem, 12vh, 7rem);
}
.invite h2 { margin-bottom: 1.1rem; }

.signoff { margin-top: 1.4rem; font-style: italic; }
.signature {
  font-family: var(--script);
  font-size: clamp(4rem, 3rem + 4vw, 5.4rem);
  line-height: .9;
  color: var(--wet);
  /* The S swings out beyond its own box, and the writing mask would cut that
     off: room all round, taken back with the margins so nothing moves. */
  padding: .15em .4em .15em .25em;
  margin: calc(.2rem - .15em) 0 calc(-.2rem - .15em) calc(-.15rem - .25em);
  transform: rotate(-4deg);
  transform-origin: left;
  width: max-content;
}
.signname {
  font-family: var(--sc);
  letter-spacing: .1em;
  font-weight: 500;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2.5rem;
  margin-top: 2.2rem;
}

.seal {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  text-decoration: none;
  color: var(--ink);
}
.seal__wax {
  width: 5.4rem;
  height: 5.4rem;
  flex: none;
  filter: drop-shadow(0 3px 3px rgba(70, 20, 15, .35));
  transition: transform .4s var(--ease-out);
}
.seal__s {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 54px;
  fill: #a8483c;
}
.seal__s--shade { fill: #4f1715; opacity: .8; }
.seal__label {
  display: grid;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.15;
  border-bottom: 1px solid currentColor;
  padding-bottom: .15rem;
}
.seal__label small {
  font-family: var(--serif);
  font-size: .9rem;
  color: var(--ink-3);
}
.seal:hover { color: var(--red); }
.seal:hover .seal__wax { transform: rotate(-8deg) scale(1.04); }
.seal:active .seal__wax { transform: scale(.94); }

.contact__list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: .3rem;
  font-size: 1rem;
}
.contact__list em { color: var(--ink-3); }

.todo {
  background: rgba(204, 159, 58, .45);
  padding: 0 .2em;
  font-style: normal;
}

/* ==========================================================================
   Motion. Everything above works without it; this only adds the ink.
   ========================================================================== */

/* ---------- A photo taken up for a closer look --------------------------- */

.zoomable { display: block; height: 100%; cursor: zoom-in; }
.zoomable:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.zoom {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
  cursor: zoom-out;
}
.zoom::backdrop {
  background: rgba(32, 24, 14, .72);
  backdrop-filter: blur(2px);
}
.zoom__print {
  margin: 0;
  padding: .6rem .6rem 0;
  background: #f7f1e3;
  transform: rotate(-.8deg);
  box-shadow: 0 30px 80px -20px rgba(30, 18, 6, .7);
}
.zoom__img {
  display: block;
  max-width: calc(100vw - 3rem);
  max-height: calc(100dvh - 9rem);
  filter: sepia(.12) saturate(.92);
}
.zoom__caption {
  padding: .7rem .4rem .8rem;
  font-family: var(--display);
  font-style: italic;
  font-size: .95rem;
  text-align: center;
  color: var(--ink-2);
}
.zoom__caption:empty { padding: 0 0 .6rem; }
.zoom__close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: .3rem .6rem;
  border: 0;
  background: var(--paper);
  cursor: pointer;
  font: italic .95rem var(--serif);
  color: var(--ink-2);
}
.zoom__close:hover { color: var(--red); }

@media (prefers-reduced-motion: no-preference) {

  /* Words ink in, fast: still wet and a little soft, then dry and sharp. */
  /* Every word is a little block of its own, so it can step aside when the carpet comes by. */
  .js .ink .w { display: inline-block; text-indent: 0; opacity: 0; }
  .js .drop .w:first-child { display: inline; }
  .js .ink.is-inked .w {
    animation: ink-word .62s cubic-bezier(.25, .6, .3, 1) both;
    animation-delay: calc(var(--d0, 0ms) + var(--i) * var(--step, 5ms));
  }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  .js .project[data-reveal] { transform: translateY(22px) rotate(var(--tilt, 0deg)); }
  .js .project[data-reveal].is-in { transform: none; }
  .js .projects .project:nth-child(3n + 2) { transition-delay: .08s; }
  .js .projects .project:nth-child(3n + 3) { transition-delay: .16s; }

  .js .fleuron .fleuron__line path { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
  .js .fleuron.is-in .fleuron__line path { transition: stroke-dashoffset 1.1s cubic-bezier(.5, 0, .2, 1) .1s; stroke-dashoffset: 0; }
  .js .fleuron .fleuron__lozenge,
  .js .fleuron .fleuron__dot { transform-box: fill-box; transform-origin: center; transform: scale(0); }
  .js .fleuron.is-in .fleuron__lozenge { transition: transform .5s cubic-bezier(.3, 1.6, .6, 1); transform: none; }
  .js .fleuron.is-in .fleuron__dot { transition: transform .5s cubic-bezier(.3, 1.6, .6, 1) .25s; transform: none; }

  .js .toc[data-reveal] { transform: none; }
  .js .toc .toc__list li { opacity: 0; transform: translateX(-6px); }
  .js .toc .toc__lead { transform: scaleX(0); }
  .js .toc.is-in .toc__list li {
    opacity: 1; transform: none;
    transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  }
  .js .toc.is-in .toc__lead { transform: none; transition: transform .7s cubic-bezier(.5, 0, .2, 1) .15s; }
  .js .toc.is-in li:nth-child(2), .js .toc.is-in li:nth-child(2) .toc__lead { transition-delay: .09s; }
  .js .toc.is-in li:nth-child(3), .js .toc.is-in li:nth-child(3) .toc__lead { transition-delay: .18s; }
  .js .toc.is-in li:nth-child(4), .js .toc.is-in li:nth-child(4) .toc__lead { transition-delay: .27s; }
  .js .toc.is-in li:nth-child(5), .js .toc.is-in li:nth-child(5) .toc__lead { transition-delay: .36s; }

  /* The signature is written left to right. */
  .js .signature[data-reveal] {
    opacity: 1;
    transform: rotate(-4deg);
    -webkit-mask-image: linear-gradient(100deg, #000 40%, transparent 52%);
    mask-image: linear-gradient(100deg, #000 40%, transparent 52%);
    -webkit-mask-size: 260% 100%;
    mask-size: 260% 100%;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
  .js .signature[data-reveal].is-in {
    transition: -webkit-mask-position 1.3s cubic-bezier(.45, .1, .35, 1) .2s, mask-position 1.3s cubic-bezier(.45, .1, .35, 1) .2s;
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }

  /* Once drawn, the S never quite sits still: leaves sway, gold glints. */
  .initial--hero .is-alive .lf { animation: leaf-sway var(--t, 6s) ease-in-out var(--d, 0s) infinite; }
  .initial--hero .is-alive .dt { animation: glint var(--t, 4s) ease-in-out var(--d, 0s) infinite; }

  .zoom[open] .zoom__print { animation: zoom-in .45s var(--ease-out); }
  .zoom[open]::backdrop { animation: fade-in .3s ease-out; }
}

@keyframes ink-word {
  0%   { opacity: 0; filter: blur(2.5px); color: var(--wet); transform: translateY(.07em); }
  45%  { opacity: .92; filter: blur(.35px); color: var(--wet); }
  100% { opacity: 1; filter: none; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.92) rotate(-2deg); } }
@keyframes leaf-sway {
  25% { transform: rotate(var(--r, 4deg)); }
  75% { transform: rotate(calc(var(--r, 4deg) * -1)); }
}
@keyframes glint { 50% { opacity: .25; } }

/* ==========================================================================
   Print and "save as PDF": the whole letter, also what was never scrolled
   into view, on white paper with the warm details kept.
   ========================================================================== */

@media print {
  @page { margin: 15mm 14mm; }

  .ribbon, .sound, .skip-link, .zoom, .ghost, .carpet, .no-print { display: none !important; }
  html, body { background: #fff !important; }
  body { font-size: 10.5pt; }

  .js [data-reveal],
  .js .ink .w,
  .js .toc .toc__list li,
  .js .toc .toc__lead,
  .js .fleuron .fleuron__lozenge,
  .js .fleuron .fleuron__dot {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    filter: none !important;
  }
  .js .fleuron .fleuron__line path { stroke-dashoffset: 0 !important; }
  .js .signature[data-reveal] {
    transform: rotate(-4deg) !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .intro { padding-top: 0 !important; }
  .initial--hero { width: 6rem; }
  .projects {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    gap: 1.6rem 1.2rem !important;
    overflow: visible !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }
  .project, .glance, .toc, .snapshot, .contact { break-inside: avoid; }
  .section-head, h2, h3 { break-after: avoid; }
  .prose p, .intro p { orphans: 3; widows: 3; }

  .project__frame, .project__second, .snapshot__frame, .corner, .placeholder, .portrait, .glance, .todo {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .project__frame, .snapshot__frame { box-shadow: 0 0 0 1px rgba(60, 40, 10, .18); }

  .contact__list a[href^="http"]::after {
    content: " · " attr(href);
    font-size: .85em;
    color: var(--ink-2);
  }
}
