:root {
  --paper: #edeae3;
  --ink: #2a2927;
  --ink-soft: #5c5850;
  --pad: clamp(20px, 4.5vw, 64px);
  --sans: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Arial, sans-serif;
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
}

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* Layout: statement above, name anchored to the foot of the page. */
.page {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "intro"
    "."
    "masthead"
    "pronunciation";
  padding: var(--pad);
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
}

.intro {
  grid-area: intro;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
}

.line,
.status {
  margin: 0;
  font-weight: 400;
}

.line {
  max-width: 17ch;
  font-size: clamp(1.3125rem, 1rem + 1.05vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.status {
  flex: none;
  font-size: clamp(0.9375rem, 0.85rem + 0.3vw, 1.125rem);
  line-height: 1.4;
  color: var(--ink-soft);
}

.masthead {
  grid-area: masthead;
  container-type: inline-size;
  /* The tight line box leaves unused glyph space; keep it from adding scroll. */
  overflow-x: visible;
  overflow-y: clip;
}

.name {
  margin: 0;
  font-weight: 500;
  /* Sized so the name spans the content width; capped on short screens. */
  font-size: 38vw;
  font-size: min(42.8cqi, 70svh);
  line-height: 0.76;
  padding-bottom: 0.02em;
  letter-spacing: -0.015em;
  white-space: nowrap;
  animation: rise 1100ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Sits outside .masthead so the name's clipping never reaches it. */
.pronunciation {
  grid-area: pronunciation;
  margin: 0.75rem 0 0;
  /* End under the name's final "i": the row is as wide as .masthead, so
     min(42.8%, 70svh) here equals the name's font size, and the "i" ends
     about 2.284em in (measured with Helvetica Neue). */
  margin-right: calc(100% - 2.284 * min(42.8%, 70svh));
  text-align: right;
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-soft);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.08em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Phones: the name leads at the top; the statement sits low, within reach. */
@media (max-width: 640px) {
  .page {
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "masthead"
      "pronunciation"
      "."
      "intro";
  }

  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .line {
    font-size: clamp(1.375rem, 1rem + 2.6vw, 1.75rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .name {
    animation: none;
  }
}
