/* For Finn. A plain, carefully made page: paper, ink, one soft sage accent. */

:root {
  --paper: #F7F4EE;
  --sheet: #FFFDF9;
  --ink: #1F2328;
  --ink-2: #474D55;
  --muted: #6A6F75;
  --rule: #E3DED4;
  --accent: #5E8C7F;
  --accent-ink: #3D6A5E;
  --sage-wash: #ECF0EB;
  --sage-rule: #D5DFD8;
  --sig-ink: #22385A;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sign: "Herr Von Muellerhoff", "Snell Roundhand", "Segoe Script", cursive;

  --gutter: clamp(20px, 5.4vw, 56px);
  --max: 1160px;
  --bar-h: 56px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  scroll-padding-top: calc(var(--bar-h) + 20px);
  scrollbar-gutter: stable;
}
html.lb-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { overflow-x: clip; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 3px; }
::selection { background: #D3E2DB; color: var(--ink); }

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 50;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 600 .875rem/1 var(--sans); text-decoration: none;
  transform: translateY(-160%); transition: transform .25s var(--ease);
}
.skip:focus { transform: none; }

.noscript { padding: 24px var(--gutter); font-family: var(--sans); }

/* ---------- Top bar ---------- */

.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: background-color .4s, box-shadow .4s;
}
.bar.is-scrolled {
  background: rgb(247 244 238 / .86);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--rule);
}
.bar__mark {
  font-family: var(--serif); font-size: 1.0625rem; font-weight: 500; letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap;
  padding: 10px 0;
  opacity: 0; transform: translateY(6px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  pointer-events: none;
}
.bar.is-past .bar__mark { opacity: 1; transform: none; pointer-events: auto; }

.bar__nav { display: flex; align-items: center; gap: 2px; margin-right: -8px; }
.bar__link {
  position: relative;
  font: 600 .6875rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-2);
  padding: 14px 9px;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  transition: color .25s, background-color .25s, border-color .25s;
}
.bar__link::after {
  content: ""; position: absolute; left: 9px; right: 9px; bottom: 8px; height: 1.5px;
  background: var(--accent); border-radius: 1px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .45s var(--ease);
}
.bar__link[aria-current="true"] { color: var(--ink); }
.bar__link[aria-current="true"]::after { transform: scaleX(1); }
.bar__link--letter {
  margin-left: 6px; padding: 10px 15px;
  color: var(--ink); border: 1px solid rgb(31 35 40 / .8);
}
.bar__link--letter::after { display: none; }
.bar__link--letter[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (hover: hover) {
  .bar__link:hover { color: var(--ink); }
  .bar__link--letter:hover { background: var(--ink); color: var(--paper); }
}
.bar__link--letter:active { transform: scale(.96); }
@media (max-width: 359px) {
  .bar__mark { display: none; }
  .bar { justify-content: flex-end; }
  .bar__link { padding-inline: 7px; letter-spacing: .1em; }
  .bar__link--letter { padding-inline: 12px; margin-left: 4px; }
}

/* ---------- Opening ---------- */

.hero {
  min-height: 84vh;
  min-height: 84svh;
  display: flex; align-items: flex-end;
  padding: calc(var(--bar-h) + env(safe-area-inset-top) + 24px) 0 clamp(36px, 7vh, 88px);
}
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr); }

.hero__kicker {
  display: flex; align-items: center; gap: 12px;
  font: 600 .75rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: clamp(10px, 2.4vh, 28px);
}
.hero__kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }

.hero__name {
  margin: 0 0 0 -.055em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(7.25rem, 47vw, 25rem);
  font-variation-settings: "opsz" 60;
  line-height: .8;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.hero__name .ch { display: inline-block; }

.hero__line {
  margin-top: clamp(26px, 4.5vh, 44px);
  max-width: 19em;
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.875rem);
  line-height: 1.32;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.hero__line em { font-style: italic; color: var(--accent-ink); }

.hero__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 30px; }
.hero__by { font: 500 .875rem/1 var(--sans); color: var(--muted); letter-spacing: .01em; }

.button {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 50px; padding: 0 22px 0 24px;
  border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 600 .9375rem/1 var(--sans); letter-spacing: .01em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .3s var(--ease), background-color .3s;
}
.button__arrow {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .4s var(--ease);
}
@media (hover: hover) {
  .button:hover { background: #30363D; }
  .button:hover .button__arrow { transform: translateY(3px); }
}
.button:active { transform: scale(.97); }

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 24rem);
    grid-template-areas: "kicker kicker" "name side";
    align-items: end;
    column-gap: clamp(32px, 4vw, 64px);
  }
  .hero__kicker { grid-area: kicker; }
  .hero__name { grid-area: name; font-size: min(25rem, 29vw); }
  .hero__side { grid-area: side; padding-bottom: .5rem; }
  .hero__line { margin-top: 0; }
}

/* Load-in: letters rise, then the rest follows. */
.js .hero__name .ch { animation: rise 1.2s var(--ease) both; animation-delay: calc(var(--i) * 75ms + 150ms); }
.js [data-rise] { animation: rise-sm 1s var(--ease) both; animation-delay: calc(var(--d) * 90ms + 200ms); }
@keyframes rise { from { opacity: 0; transform: translateY(.22em); } to { opacity: 1; transform: none; } }
@keyframes rise-sm { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */

.section { padding-block: clamp(72px, 11vw, 132px); }
.letter { padding-top: clamp(28px, 6vw, 72px); }

.eyebrow {
  display: flex; align-items: center; gap: 16px;
  margin: 0 0 clamp(28px, 5vw, 52px);
  font: 600 .75rem/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow__rule { flex: 1; height: 1px; background: var(--rule); }

/* Reveal on scroll */
.js [data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--rd, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Letter ---------- */

.sheet {
  position: relative;
  max-width: 45rem;
  margin-inline: auto;
  background: var(--sheet);
  border: 1px solid #ECE7DD;
  border-radius: 2px;
  padding: clamp(36px, 8vw, 84px) clamp(24px, 7.5vw, 92px) clamp(26px, 5vw, 60px);
  box-shadow:
    0 1px 1px rgb(31 35 40 / .03),
    0 3px 6px rgb(31 35 40 / .03),
    0 22px 48px -20px rgb(31 35 40 / .14);
}
.sheet__greet {
  margin-bottom: 1.05em;
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -.012em;
}
.sheet__body p {
  font-size: clamp(1.125rem, 1.02rem + .45vw, 1.3125rem);
  line-height: 1.74;
  letter-spacing: .002em;
  text-wrap: pretty;
  hanging-punctuation: first;
}
.sheet__body p + p { margin-top: 1.1em; }
.sheet__signoff { margin-top: 1.9em; font-size: clamp(1.125rem, 1.02rem + .45vw, 1.3125rem); }
.sheet__sig { margin: .05em 0 0 -.12em; line-height: 1; }
.sig {
  display: inline-block;
  font-family: var(--sign);
  font-size: clamp(4.25rem, 3.2rem + 4vw, 6rem);
  font-weight: 400;
  line-height: 1;
  color: var(--sig-ink);
  padding: .12em .5em .22em .14em;
  margin-left: -.14em;
}
/* The signature writes itself in, left to right, once the letter is read down to it. */
.js .sig {
  -webkit-mask-image: linear-gradient(90deg, #000 42%, transparent 58%);
  mask-image: linear-gradient(90deg, #000 42%, transparent 58%);
  -webkit-mask-size: 260% 100%;
  mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  transition: -webkit-mask-position 2s cubic-bezier(.45, .1, .25, 1), mask-position 2s cubic-bezier(.45, .1, .25, 1);
}
.js .sig.is-drawn { -webkit-mask-position: 0 0; mask-position: 0 0; }

.sheet__images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.sheet__images:empty { display: none; }
.sheet__thumb {
  width: 96px; height: 96px; padding: 0; border: 1px solid var(--rule); border-radius: 3px;
  overflow: hidden; background: #EEE9E0; cursor: zoom-in;
}
.sheet__thumb img { width: 100%; height: 100%; object-fit: cover; }

.sheet--pending { text-align: center; padding-block: clamp(52px, 11vw, 104px); }
.envelope {
  display: block; width: 64px; height: 44px; margin: 0 auto 26px;
  fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round;
}
.envelope circle { fill: var(--accent); stroke: none; opacity: .9; }
.pending__title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  line-height: 1.2; letter-spacing: -.015em;
  margin-bottom: .55em;
}
.pending__text { color: var(--ink-2); max-width: 24em; margin-inline: auto; text-wrap: balance; }

@media (max-width: 599px) {
  /* A touch wider on phones so the letter gets a comfortable line length. */
  .letter .sheet { margin-inline: calc(10px - var(--gutter)); padding-inline: 24px; }
}

/* ---------- Photos ---------- */

.gallery { --gap: 12px; display: flex; flex-direction: column; gap: clamp(30px, 4.5vw, 44px); }
.gallery__row { display: flex; align-items: flex-start; gap: var(--gap); }
.ph { margin: 0; min-width: 0; flex: var(--a, 1) 1 0%; }
.ph__btn {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; border-radius: 3px; overflow: hidden;
  background: #EAE5DB;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transition: transform .45s var(--ease);
}
.ph__btn img {
  width: 100%; height: auto; object-fit: cover;
  opacity: 0;
  transition: opacity .8s var(--ease), transform 1.1s var(--ease);
}
.ph__btn.is-loaded img { opacity: 1; }
.ph__btn.is-away img { opacity: 0; transition: none; }
.ph__btn:active { transform: scale(.985); }
@media (hover: hover) {
  .ph__btn:hover img { transform: scale(1.03); }
}
.ph__cap {
  display: flex; align-items: baseline; gap: 12px;
  margin-top: 14px;
  font-size: 1rem; line-height: 1.45; color: var(--ink-2);
}
.ph__n {
  flex: none;
  font: 600 .6875rem/1 var(--sans); letter-spacing: .12em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- A few true things ---------- */

.truths { background: var(--sage-wash); }
.truths .eyebrow__rule { background: var(--sage-rule); }
.truths__list { list-style: none; margin: 0; padding: 0; }
.truths__item {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); align-items: baseline;
  padding: clamp(22px, 3.6vw, 34px) 0;
  border-top: 1px solid var(--sage-rule);
}
.truths__item:last-child { border-bottom: 1px solid var(--sage-rule); }
.truths__n {
  font: 600 .75rem/1 var(--sans); letter-spacing: .1em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
  transform: translateY(-.2em);
}
.truths__text {
  font-size: clamp(1.5rem, 1.12rem + 1.7vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -.018em;
  text-wrap: balance;
}
.truths__text em { font-style: italic; color: var(--accent-ink); }

@media (min-width: 900px) {
  .truths__grid {
    display: grid; grid-template-columns: 14rem minmax(0, 1fr);
    column-gap: clamp(40px, 6vw, 96px); align-items: start;
  }
  .truths .eyebrow { position: sticky; top: calc(var(--bar-h) + 40px); margin: 0; padding-top: 2.1rem; }
  .truths .eyebrow__rule { display: none; }
}

/* ---------- Classes ---------- */

.classes__list { list-style: none; margin: 0; padding: 0; }
.classes__item {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.classes__item:last-child { border-bottom: 1px solid var(--rule); }
.classes__year {
  font: 600 .6875rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.classes__year b { font-weight: 700; color: var(--accent-ink); }
.classes__year .dot { margin: 0 .5em; opacity: .6; }
.classes__name {
  font-size: clamp(1.3125rem, 1.15rem + .8vw, 1.75rem);
  line-height: 1.22; letter-spacing: -.012em;
}
.classes__teacher { font-style: italic; color: var(--ink-2); font-size: 1rem; }

@media (min-width: 720px) {
  .classes__item {
    grid-template-columns: 12rem minmax(0, 1fr) auto;
    align-items: baseline; column-gap: 28px;
    padding: 26px 0;
  }
  .classes__teacher { text-align: right; }
}

/* ---------- Footer ---------- */

.foot {
  padding: clamp(80px, 13vw, 150px) 0 calc(36px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
}
.foot__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 30px; }
.foot__sign {
  font-size: clamp(1.875rem, 1.3rem + 2.4vw, 3.25rem);
  line-height: 1.12; letter-spacing: -.022em;
  text-wrap: balance;
}
.foot__class { font-style: italic; color: var(--accent-ink); }
.foot__top {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 6px;
  font: 600 .6875rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
  transition: color .25s;
}
.foot__top svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
@media (hover: hover) {
  .foot__top:hover { color: var(--ink); }
  .foot__top:hover svg { transform: translateY(-3px); }
}

/* ---------- Lightbox ---------- */

.lb {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: #F2EFE8;
  overflow: hidden; overscroll-behavior: contain;
}
.lb::backdrop { background: transparent; }
.lb__bg { position: absolute; inset: 0; background: #131518; opacity: 0; }
.lb__stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb__track { display: flex; height: 100%; will-change: transform; }
.lb__slide {
  flex: 0 0 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: calc(68px + env(safe-area-inset-top)) 12px calc(100px + env(safe-area-inset-bottom));
}
.lb__img {
  flex: none;
  border-radius: 3px;
  background: #24272B center / cover no-repeat;
  object-fit: contain;
  -webkit-user-drag: none; user-select: none;
  box-shadow: 0 24px 60px rgb(0 0 0 / .35);
  transform-origin: 50% 50%;
}

.lb__chrome {
  position: absolute; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  opacity: 0; transition: opacity .35s ease;
}
.lb.is-open .lb__chrome { opacity: 1; }
.lb.is-dragging .lb__chrome { opacity: 0; transition-duration: .2s; }
.lb__top { top: 0; padding-top: calc(10px + env(safe-area-inset-top)); }
.lb__foot { bottom: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); align-items: center; }
.lb__count {
  padding-left: 10px;
  font: 600 .75rem/1 var(--sans); letter-spacing: .16em;
  color: rgb(242 239 232 / .7);
  font-variant-numeric: tabular-nums;
}
.lb__cap {
  flex: 1; min-width: 0; text-align: center;
  font-style: italic; font-size: 1.0625rem; line-height: 1.4;
  color: rgb(242 239 232 / .92);
  text-wrap: balance;
}
.lb__btn {
  flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: rgb(255 255 255 / .09); color: #F2EFE8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s, opacity .25s, transform .25s var(--ease);
}
.lb__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lb__btn:active { transform: scale(.92); }
.lb__btn:disabled { opacity: .22; cursor: default; }
.lb__btn[hidden] { display: grid; visibility: hidden; }
.lb :focus-visible { outline-color: #F2EFE8; }
@media (hover: hover) { .lb__btn:not(:disabled):hover { background: rgb(255 255 255 / .18); } }

@media (min-width: 900px) {
  .lb__slide { padding: calc(76px + env(safe-area-inset-top)) 96px 108px; }
  .lb__top { padding-top: 18px; padding-inline: 22px; }
  .lb__foot { padding-bottom: 24px; padding-inline: 22px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .js .hero__name .ch, .js [data-rise] { animation-name: fade; animation-duration: .6s; }
  .js [data-reveal] { transform: none; transition: opacity .6s ease; }
  .js .sig { transition-duration: .01ms; }
  .ph__btn img, .ph__btn, .button, .button__arrow { transition-duration: .2s; }
  .ph__btn:hover img { transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Headings that receive focus from in-page links don't need a ring. */
[tabindex="-1"]:focus { outline: none; }
