@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/newsreader-normal-200-800-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-normal-400-latin.woff2') format('woff2');
}

:root {
  /* Cool bone rather than warm cream: this is a laboratory ground, not paper. */
  --ground: #eeedea;
  --ink: #14171a;
  --muted: #6b7076;
  /* Verdigris. A patina is the one common material that is made by time. */
  --accent: #2f6f5e;
  --accent-clear: rgba(47, 111, 94, 0);

  --measure: 44rem;
  --pad: clamp(1.5rem, 7vw, 7rem);
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  padding: var(--pad);
  display: grid;
  align-content: center;
  justify-items: start;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The hatch field sits behind everything and never takes the pointer. */
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--measure);
  /* Nudge the whole composition above true centre, where the eye reads it as
     centred. This sits on the wrapper so it never opens a gap inside it. */
  padding-bottom: 6vh;
}

.masthead {
  margin: 0;
  font-weight: 400;
}

.masthead__name {
  display: block;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.masthead__statement {
  display: block;
  font-size: clamp(1.625rem, 3.6vw, 2.5rem);
  font-weight: 300;
  line-height: 1.26;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* "bio × AI" is one term and never breaks across lines. */
.masthead__pair {
  white-space: nowrap;
}

.masthead__times {
  color: var(--accent);
  font-weight: 400;
  /* Newsreader sets this glyph small; bring it back up to the lowercase. */
  font-size: 1.05em;
  vertical-align: -0.02em;
}

/* The span. A dimension line for a length that has no known upper bound, so it
   is drawn from a fixed origin and fades out rather than closing on a second
   tick. */
.span {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: clamp(2rem, 4.5vw, 3rem);
}

.span__tick {
  flex: none;
  width: 2px;
  height: 13px;
  background: var(--accent);
}

.span__line {
  flex: 1 1 auto;
  height: 2px;
  transform-origin: left center;
  /* Solid for the measured part, then gone. The length is real up to a point
     and open after it. */
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) 52%,
    var(--accent-clear) 100%
  );
}

/* One orchestrated page-load moment: the name, then the statement, then the
   span extends. */
@media (prefers-reduced-motion: no-preference) {
  .masthead__name,
  .masthead__statement {
    animation: rise 900ms cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
  }

  .masthead__name {
    animation-delay: 80ms;
  }

  .masthead__statement {
    animation-delay: 240ms;
  }

  .span__tick {
    animation: fade 700ms ease-out 760ms backwards;
  }

  .span__line {
    animation: extend 1900ms cubic-bezier(0.16, 0.68, 0.3, 1) 860ms backwards;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes extend {
  from {
    transform: scaleX(0.06);
  }
}
