:root {
  --paper: #f4f4f2;
  --ink: #9a9a98;
  --ink-dark: #7f7f7d;
  --pink: #efbee6;
  --blue: #bed5f3;
  --pad: clamp(1.25rem, 3.3vw, 4rem);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

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

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-200%);
  padding: 0.7rem 1rem;
  background: #fff;
  color: #333;
  font: 700 0.9rem/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.skip-link:focus {
  transform: translateY(0);
}

.page {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(5rem, 15vh, 12rem);
  padding: var(--pad);
  padding-bottom: clamp(4rem, 8vh, 7rem);
}

.statement {
  max-width: 14.7em;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.65rem, 6.15vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.98;
  text-wrap: pretty;
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: normal;
}

.statement--secondary {
  max-width: 15.2em;
}

.highlight {
  position: relative;
  white-space: nowrap;
  display: inline;
  z-index: 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 0.08em;
  /* Box height. Helvetica Neue Bold: cap height 0.714em, ascent 0.975em,
     descent 0.217em. Insets below centre the box on the caps, with equal
     space above the cap line and below the baseline. */
  --hl-h: 1.014em;
}

.highlight::before {
  position: absolute;
  z-index: -1;
  top: calc(0.618em - var(--hl-h) / 2);
  right: -0.01em;
  left: -0.01em;
  height: var(--hl-h);
  content: "";
  background: var(--highlight);
}

.highlight--pink {
  --highlight: var(--pink);
}

.highlight--blue {
  --highlight: var(--blue);
}

.office-link {
  color: var(--ink-dark);
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}

.office-link::after {
  position: absolute;
  z-index: -2;
  top: calc(0.618em - var(--hl-h) / 2);
  right: -0.01em;
  left: -0.01em;
  height: var(--hl-h);
  content: "";
  background: var(--pink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 220ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.office-link:hover::after,
.office-link:focus-visible::after {
  transform: scaleY(1);
}

.office-link:focus-visible {
  outline: 0.08em solid var(--ink-dark);
  outline-offset: 0.06em;
}

.page {
  opacity: 0;
  animation: fade-in 2.4s 0.2s ease-out forwards;
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* Desktop: the whole statement fits in one screen, no scrolling.
   Type scales by width, but never taller than the viewport allows
   (7 lines of text + the gap between paragraphs). */
@media (min-width: 721px) {
  .page {
    --gap: clamp(1.5rem, 7vh, 12rem);
    height: 100svh;
    min-height: 0;
    gap: var(--gap);
    padding-bottom: var(--pad);
    overflow: hidden;
  }

  .statement {
    font-size: calc(
      min(6.15vw, 7.5rem, (100svh - 2 * var(--pad) - var(--gap)) / 7.4) * var(--fit, 1)
    );
  }
}

@media (max-width: 720px) {
  .page {
    min-height: 100svh;
    gap: 6rem;
  }

  .statement {
    max-width: none;
    /* Sized so "Thomas Martinez" (~8.14em wide in Helvetica Neue) always fits on one line */
    font-size: min(calc((100vw - 2.5rem) / 8.5), 5.3rem);
    line-height: 0.97;
  }

  .statement--secondary {
    font-size: min(calc((100vw - 2.5rem) / 9.35), 4.5rem);
  }

  /* Secondary type is 8.5/9.35 the size of the primary; scale its box up
     so both highlights are the same height on screen. */
  .statement--secondary .highlight {
    --hl-h: calc(1.014em * 9.35 / 8.5);
  }
}

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

  .page {
    opacity: 1;
    animation: none;
  }

  .office-link::after {
    transition: none;
  }
}
