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

html, body {
  height: 100%;
}

/* Subtle paper grain */
html::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.80' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 250px 250px;
  opacity: 0.038;
  pointer-events: none;
  z-index: 9999;
}

/* ── Base ────────────────────────────────────────── */

body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: #F0EBE2;
  color: #1C1C1A;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Shared monospace style ──────────────────────── */

header,
footer {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: clamp(0.62rem, 0.78vw, 0.82rem);
  letter-spacing: 0.025em;
}

/* ── Header ──────────────────────────────────────── */

header {
  padding: 4vh 11vw 0;
  display: flex;
  justify-content: flex-end;
}

#about-link {
  color: inherit;
  text-decoration: none;
  position: relative;
  opacity: 0;
  transition: opacity 0.9s ease;
}

#about-link.visible {
  opacity: 1;
}

/* ── Entrance animation ───────────────────────────── */

@keyframes appear {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Main text block ─────────────────────────────── */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 11vw 32vh;
}

h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 5.6vw, 6.5rem);
  line-height: 1.0;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}

.tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(0.9rem, 1.4vw, 1.35rem);
  color: #4A4A42;
  margin-top: 0.45em;
  letter-spacing: 0.005em;
}

/* ── Footer ──────────────────────────────────────── */

footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 11vw 4vh;
}

.engagements {
  opacity: 0;
  transition: opacity 0.9s ease;
}

.engagements.visible {
  opacity: 1;
}

#contact-link {
  color: inherit;
  text-decoration: none;
  position: relative;
  opacity: 0;
  transition: opacity 0.9s ease;
}

#contact-link.visible {
  opacity: 1;
}

/* Slide-in underline on hover */
#about-link::after,
#contact-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

#about-link:hover::after,
#contact-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 560px) {
  header {
    padding: 4vh 6vw 0;
  }

  main {
    padding: 0 6vw 10vh;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7em;
    padding: 0 6vw 5vh;
  }
}
