@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Arial scaled to Geist's width and vertical metrics, so the swap to Geist moves nothing. */
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 106.07%;
  ascent-override: 95.22%;
  descent-override: 27.34%;
  line-gap-override: 0%;
}

:root {
  --color-bg: #fafaf7;
  --color-text: #141413;
  --color-muted: #5e5d59;
  --color-rule: rgb(20 20 19 / 25%);

  --font-sans: "Geist", "Geist Fallback", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1.5rem, 0.5rem + 3.9vw, 4rem);
  --gutter-top: clamp(2rem, 1.2rem + 2.6vw, 3.5rem);
  --gutter-bottom: clamp(1.25rem, 0.8rem + 1.5vw, 2.25rem);

  --headline-size: clamp(2.25rem, 1.5rem + 3.05vw, 5.5rem);
  --headline-pitch: 1.12;
  --headline-gap: 0.24em;
}

html {
  /* Stops pull-to-refresh on a downward drag without cancelling any event. */
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.page {
  box-sizing: border-box;
  min-height: 100vh; /* for browsers without svh */
  min-height: 100svh;
  display: grid;
  /* Equal outer rows, with the padding difference offset on .statement, centre
     the statement on the viewport; the rows grow when content needs room. */
  grid-template-rows: 1fr auto 1fr;
  padding: var(--gutter-top) var(--gutter) var(--gutter-bottom);
}

.identity {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.625rem;
  max-width: 18.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.identity__name,
.identity__about {
  margin: 0;
}

.identity__name {
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.identity__about {
  color: var(--color-muted);
}

.identity__email {
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  text-decoration: underline;
  text-decoration-color: var(--color-rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 160ms ease;
}

.identity__email:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
  border-radius: 2px;
}

.statement {
  min-width: 0;
  padding-bottom: calc(var(--gutter-top) - var(--gutter-bottom));
}

.statement__heading {
  margin: 0;
  font-size: var(--headline-size);
  font-weight: 500;
  line-height: var(--headline-pitch);
  letter-spacing: -0.04em;
}

.statement__visual {
  display: flex;
  white-space: nowrap;
}

.statement__lead {
  flex: none;
}

.statement__column {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--headline-gap);
}

.statement__line {
  display: block;
}

/* Animated: the column keeps one row in flow and its lines move by transform. */
.statement__column.is-animated {
  position: relative;
  height: calc(var(--headline-pitch) * 1em);
}

.is-animated .statement__line {
  position: absolute;
  top: 0;
  left: 0;
  /* Scale long lines about their baseline, so they stay on the lead's baseline. */
  transform-origin: 0 82%;
  will-change: transform, opacity;
}

.is-animated .statement__line:empty::before {
  content: attr(data-text);
}

.controls {
  align-self: end;
  display: flex;
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  margin-left: -0.75rem;
  padding: 0 0.75rem;
  border: 0;
  background: none;
  color: var(--color-muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.motion-toggle[hidden],
.motion-toggle[data-playing="true"] .motion-toggle__play,
.motion-toggle[data-playing="false"] .motion-toggle__pause {
  display: none;
}

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

@media (max-width: 699px) {
  .statement__visual {
    flex-direction: column;
  }

  .statement__column {
    margin-left: 0;
  }
}
