/* Georgia first; Gelasio (metric-compatible, OFL) downloads only where Georgia is missing. */
@font-face {
  font-family: "Gelasio";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/gelasio-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Gelasio";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/gelasio-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --wall: #F1F0EB;
  --ink: #1C1D1A;
  --muted: #5E5F58;
  --rule: #D3D1C8;
  --accent: #A8381F;

  --serif: Georgia, "Gelasio", "Times New Roman", serif;
  --sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --edge: clamp(1.25rem, 5vw, 5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--wall);
}

p {
  margin: 0;
}

/* Frame: a ruled header, the name in the open middle, a ruled footer. */
.page {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 var(--edge);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Both rules draw once on load, left to right: the page's one entrance. */
.top::after,
.bottom::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--rule);
  transform-origin: 0 50%;
  animation: draw-rule 1300ms var(--ease-out) both;
}

@keyframes draw-rule {
  from {
    transform: scaleX(0);
  }
}

/* Header */
.top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: clamp(4.5rem, 8vw, 6.5rem);
}

.top::after {
  bottom: 0;
  animation-delay: 100ms;
}

.mark {
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

.status-dot {
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

/* A soft ring leaves the dot three times, then the dot rests. */
.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: ping 2400ms var(--ease-out) 900ms 3;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* Name and introduction */
.hero {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  padding: clamp(3rem, 9vh, 7rem) 0;
}

.name {
  grid-column: 1 / -1;
  margin: 0 0 clamp(1.75rem, 4vw, 3.5rem) -0.012em;
  font-weight: 400;
  font-size: clamp(3rem, 17.4vw, 20rem);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

/* The text caret: the site is still being written. It blinks a few times, then holds. */
.caret {
  display: inline-block;
  width: 0.05em;
  height: 0.72em;
  margin-left: 0.07em;
  background: var(--accent);
  vertical-align: baseline;
  animation: blink 1100ms steps(1, end) 1200ms 6;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.intro {
  grid-column: 7 / -1;
  max-width: 24ch;
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.875rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--muted);
}

/* Footer */
.bottom {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 0 2rem;
}

.bottom::before {
  top: 0;
  animation-delay: 300ms;
}

.label,
.copy {
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--muted);
}

.label {
  margin-bottom: 0.375rem;
}

.copy {
  padding-bottom: 0.75rem;
}

.email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: var(--ink);
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
  text-decoration: none;
  transition: color 200ms ease;
}

.email-text {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  padding-bottom: 2px;
}

.email-arrow {
  flex-shrink: 0;
  transition: transform 260ms var(--ease-out);
}

.email:hover {
  color: var(--accent);
}

.email:hover .email-text {
  animation: underline 520ms var(--ease-out);
}

.email:hover .email-arrow {
  transform: translate(2px, -2px);
}

@keyframes underline {
  from {
    background-size: 0 1px;
  }
}

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

@media (max-width: 40rem) {
  .intro {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .top::after,
  .bottom::before,
  .status-dot::after,
  .caret,
  .email:hover .email-text {
    animation: none;
  }

  .email-arrow,
  .email {
    transition: none;
  }
}
