/* ===== CSS RESET & TOKENS ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Typography & colors */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --clr-fg: #1a1a1a;
  --clr-muted: #6e6e6e;
  --clr-accent: #bb86fc;
  --clr-bg: #fafafa;
  --clr-vapor-1: #ff9de2;
  --clr-vapor-2: #7af8ff;
  color-scheme: light dark;

  /* Layout */
  --max-w: 60ch;

  /* Rhythm */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --clr-fg: #f5f5f5;
    --clr-muted: #a3a3a3;
    --clr-accent: #caa0ff;
    --clr-bg: #0e0e0e;
  }
}

/* ===== GLOBAL ===== */
body {
  font-family: var(--font-sans);
  line-height: 1.7;
  background: var(--clr-bg);
  color: var(--clr-fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-wrap: pretty;
  hanging-punctuation: first;
}

main {
  padding: var(--space-4) var(--space-3) calc(var(--space-4) * 2);
  margin-inline: auto;
  max-width: var(--max-w);
}

/* ===== HERO ===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-4);
  gap: var(--space-2);
}

.hero-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    120deg,
    var(--clr-vapor-1),
    var(--clr-vapor-2),
    var(--clr-bg)
  );
  opacity: 0.1;
  backdrop-filter: blur(60px);
}

@supports (backdrop-filter: blur(1px)) {
  .hero-bg {
    backdrop-filter: blur(60px);
  }
}

.avatar {
  width: clamp(128px, 20vw, 240px);
  height: clamp(128px, 20vw, 240px);
  border-radius: 50%;
}

.name {
  font-size: clamp(2rem, 3vw + 1rem, 2.75rem);
  font-weight: 700;
}

/* ===== BIO ===== */
.bio p {
  margin-top: var(--space-3);
}

/* Links */
a {
  color: var(--clr-accent);
  text-decoration: none;
  text-underline-offset: 0.12em;
}

a:hover {
  text-decoration: underline;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 0.15em;
}

/* ===== FOOTER ===== */
.contact {
  margin-top: var(--space-4);
  text-align: center;
  font-size: 0.9rem;
  color: var(--clr-muted);
}

.contact a {
  color: inherit;
  padding: 0 var(--space-1);
}

.connect-label {
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-right: var(--space-1);
  color: var(--clr-fg);
}

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

/* Contact list */
.contact-list {
  display: inline-flex;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact a {
  color: inherit;
  padding: 0 var(--space-1);
}

/* Tag Line */
.tagline {
  margin-top: var(--space-2);
  text-align: center;
  line-height: 1.35;
  text-wrap: balance; /* nicer line breaks on supporting browsers */
}

.tagline .lead {
  display: inline-block;
  font-size: clamp(1.125rem, 1.2rem + 1vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  /* Subtle gradient text with readable fallback */
  color: var(--clr-fg);
  background: linear-gradient(
    90deg,
    var(--clr-vapor-1),
    var(--clr-vapor-2),
    var(--clr-accent)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-contrast: more) {
  .tagline .lead {
    /* Ensure strong contrast if user requests it */
    background: none;
    color: var(--clr-fg);
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
  }
}

.tagline .subtitle {
  display: inline-block;
  margin-top: var(--space-1);
  font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1rem);
  color: var(--clr-muted);
  letter-spacing: 0.01em;
  opacity: 0.9;
}

@media (prefers-reduced-motion: no-preference) {
  .tagline .lead {
    animation: rise-in 600ms ease-out both;
  }
  .tagline .subtitle {
    animation: fade-in 700ms 120ms ease-out both;
  }
  @keyframes rise-in {
    from {
      transform: translateY(6px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  @keyframes fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}
