:root {
  --ink: #111111;
  --paper: #ffffff;
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  padding: clamp(1.2rem, 2.2vw, 1.85rem) clamp(1.15rem, 2.2vw, 2rem) clamp(2.75rem, 6vw, 4.5rem);
}

.stanza {
  margin: 0;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: clamp(2.85rem, 8vw, 7.1rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-wrap: pretty;
}
.stanza + .stanza {
  margin-top: 0.9em;
}

.stanza a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.stanza a:hover {
  color: #4F9BF6;
}

.nowrap {
  white-space: nowrap;
}

.portrait {
  margin: 1.1em 0 0;
  width: 100%;
}

.portrait picture,
.portrait img {
  display: block;
  width: 100%;
  height: auto;
}



.stanza a:focus-visible,
.contact a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15em 0.45em;
  margin-top: 1.15em;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.contact a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.07em;
  padding: 0.35em 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.contact a:hover {
  text-decoration: underline;
}

.contact .dot {
  color: inherit;
  pointer-events: none;
  transform: translateY(-0.06em);
}

@media (max-width: 700px) {
  main {
    padding: 1.15rem 5vw calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  .stanza {
    font-size: clamp(2.3rem, 10.6vw, 3.6rem);
    text-wrap: wrap;
  }

  .stanza + .stanza {
    margin-top: 1em;
  }

  .contact {
    margin-top: 1.25em;
    font-size: 1.3rem;
  }
}

@media (max-width: 330px) {
  .stanza--bio .nowrap {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.stanza a.link-hyrox:hover {
  color: #FFEC00;
}

.stanza a.link-pipes:hover {
  color: #558789;
}

.stanza a.link-family:hover {
  color: #DE3986;
}

/* Photo corners: 28px radius, smoothed (squircle) where supported */
.portrait picture,
.portrait img {
  border-radius: 28px;
  overflow: hidden;
}



.contact .copyright {
  margin-left: auto;
}

/* Match the photo top gap to the photo-to-footer gap */
.portrait {
  margin-top: calc(1.15 * clamp(1.3rem, 2.3vw, 2rem));
}

/* Display P3: hex values interpreted in the P3 gamut (as in a Figma P3 file); sRGB hex above is the fallback */
@supports (color: color(display-p3 1 1 1)) {
  @media (color-gamut: p3) {
    .stanza a:hover { color: color(display-p3 0.3098 0.6078 0.9647); }
    .stanza a.link-hyrox:hover { color: color(display-p3 1 0.9255 0); }
    .stanza a.link-pipes:hover { color: color(display-p3 0.3333 0.5294 0.5373); }
    .stanza a.link-family:hover { color: color(display-p3 0.8706 0.2235 0.5255); }
  }
}

@media (max-width: 700px) {
  .portrait picture,
  .portrait img {
    border-radius: 16px;
  }
}

/* Load-in: letters ripple in left to right, line by line; then photo and footer */
.reveal .stanza { visibility: hidden; }
.reveal.reveal--split .stanza { visibility: visible; }
.stanza .w { white-space: nowrap; }
.reveal .stanza .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.reveal--in .stanza .ch { opacity: 1; transform: none; }
.reveal .portrait,
.reveal .contact {
  opacity: 0;
  transform: translateY(1.75rem);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.reveal--in .portrait,
.reveal.reveal--in .contact { opacity: 1; transform: none; }
.reveal.reveal--in .portrait { transition-delay: var(--after-text, 0.8s); }
.reveal.reveal--in .contact { transition-delay: calc(var(--after-text, 0.8s) + 150ms); }
.reveal.reveal--done .portrait,
.reveal.reveal--done .contact { transition-delay: 0s; }
