:root {
  --ink: #16202b;
  --ink-soft: #2e3b49;
  --accent: #1f9ec4;
  --paper: #eef0f2;
  --gutter: 16px;
  color-scheme: light;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--paper);
}

body {
  color: var(--ink);
  font-family: "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  /* Puts the text block in the calm, empty upper part of the image. */
  grid-template-rows: 1fr auto 2fr;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

.hero__media,
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__media img {
  object-fit: cover;
  object-position: 60% 50%;
  animation: settle 2.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__content {
  position: relative;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 100%;
  animation: rise 1.2s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__title {
  margin: 0;
  /* Trailing letter-spacing is offset so the name stays optically centred. */
  padding-left: 0.26em;
  font-size: clamp(1.25rem, 0.85rem + 2.5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: 0.26em;
  line-height: 1.15;
  text-wrap: balance;
}

@media (max-width: 420px) {
  .hero__title {
    padding-left: 0.18em;
    font-size: clamp(1.05rem, 0.35rem + 4.6vw, 1.5rem);
    letter-spacing: 0.18em;
  }
}

.hero__rule {
  display: block;
  width: 44px;
  height: 1px;
  margin: clamp(1rem, 0.7rem + 1.2vw, 1.6rem) 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.hero__email {
  padding: 0.35em 0.1em 0.25em 0.16em;
  font-size: clamp(0.95rem, 0.86rem + 0.35vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 59, 73, 0.28);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.hero__email:hover,
.hero__email:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.hero__email:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

@keyframes settle {
  from {
    transform: scale(1.045);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .hero__media img,
  .hero__content {
    animation: none;
  }
}

.hero__title a {
  color: inherit;
  text-decoration: none;
}
