@font-face {
  font-family: "Inter Tight";
  src: url("assets/inter-tight.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #141414;
  --muted: #6b6b6b;
  --underline: #b2b2b2;
  --type: "Relative Grotesque", "Inter Tight", "Helvetica Neue", Arial, sans-serif;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--muted);
  font: 460 15px / 1.6 var(--type);
  -webkit-font-smoothing: antialiased;
}

.page {
  display: grid;
  gap: 48px;
  max-inline-size: 650px;
  margin-inline: auto;
  padding: 48px 25px 96px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portrait {
  display: block;
  flex: none;
  inline-size: 2rem;
  block-size: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

h1, h2, p { margin: 0; }

h1, h2 {
  color: var(--ink);
  font-weight: 540;
}

h1 {
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -.02em;
}

section {
  display: grid;
  gap: 16px;
  scroll-margin-top: 88px;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -.01em;
}

p {
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
}

a {
  color: var(--ink);
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: text-decoration-color 160ms;
}

a:hover, a:focus-visible { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
::selection { background: #e5e5e5; color: var(--ink); }

@supports (animation-timeline: view()) and (animation-range: cover 0px cover 110px) {
  @media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
    .reveal-word {
      display: inline-block;
      white-space: nowrap;
      animation: word-enter cubic-bezier(.2, 0, .2, 1) both,
                 word-exit cubic-bezier(.8, 0, .8, 1) forwards;
      animation-timeline: view(), view();
      animation-range: cover 0px cover 110px, cover calc(100% - 70px);
    }

    a > .reveal-word { text-decoration: inherit; }
    a:focus-visible > .reveal-word { animation: none; }

    @keyframes word-enter {
      from { opacity: 0; transform: scaleX(.82); }
    }

    @keyframes word-exit {
      to { opacity: 0; transform: scaleX(.82); }
    }
  }
}

.scroll-edge { display: none; }

@supports (animation-timeline: scroll()) and (backdrop-filter: blur(2px)) {
  @media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
    .scroll-edge {
      position: fixed;
      z-index: 1;
      inset-inline: 0;
      inset-block-end: 0;
      block-size: 120px;
      display: block;
      pointer-events: none;
    }

    .scroll-edge > span,
    .scroll-edge::after {
      position: absolute;
      inset: 0;
      animation: edge-fade-out linear both;
      animation-timeline: scroll(root);
      animation-range: calc(100% - 80px) 100%;
    }

    .scroll-edge > span {
      backdrop-filter: blur(var(--blur));
      mask-image: linear-gradient(to bottom, var(--blur-band));
    }

    .scroll-edge span:nth-child(1) {
      --blur: .5px;
      --blur-band: transparent 0%, #000 10% 30%, transparent 40%;
    }

    .scroll-edge span:nth-child(2) {
      --blur: 1px;
      --blur-band: transparent 10%, #000 20% 40%, transparent 50%;
    }

    .scroll-edge span:nth-child(3) {
      --blur: 2px;
      --blur-band: transparent 30%, #000 40% 60%, transparent 70%;
    }

    .scroll-edge span:nth-child(4) {
      --blur: 4px;
      --blur-band: transparent 50%, #000 60% 80%, transparent 90%;
    }

    .scroll-edge span:nth-child(5) {
      --blur: 8px;
      --blur-band: transparent 70%, #000 90%;
    }

    .scroll-edge::after {
      content: "";
      background: linear-gradient(to bottom, transparent, #ffffff80);
    }

    .page:has(:focus-visible) ~ .scroll-edge { visibility: hidden; }

    @keyframes edge-fade-out { from { opacity: 1; } to { opacity: 0; } }
  }
}

@media (max-width: 420px) {
  .page { padding-inline: 20px; }
}
