:root {
  --font: 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  /* Light mode (default) */
  --bg: #fafafa;
  --bg-subtle: #f0f0f0;
  --text: #171717;
  --text-secondary: #525252;
  --text-tertiary: #a3a3a3;
  --accent: #171717;
  --border: #e5e5e5;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bg-subtle: #171717;
    --text: #fafafa;
    --text-secondary: #a3a3a3;
    --text-tertiary: #525252;
    --accent: #fafafa;
    --border: #262626;
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.glow {
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.glow-1,
.glow-3 {
  position: fixed;
}

.glow-2 {
  position: absolute;
}

.glow-1 {
  width: 400px;
  height: 400px;
  background: #6366f1;
  top: 60px;
  right: -100px;
}

.glow-2 {
  width: 350px;
  height: 350px;
  background: #8b5cf6;
  bottom: -150px;
  left: -100px;
}

.glow-3 {
  width: 300px;
  height: 300px;
  background: #06b6d4;
  top: 40%;
  left: 60%;
}

main,
footer {
  position: relative;
  z-index: 1;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(4.5rem, 10vh, 7rem) 2rem 2rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

header {
  margin-bottom: 1.1rem;
}

main > .hero,
main > .writing {
  width: 100%;
}

h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 0.98;
  margin-bottom: 0.55rem;
}

.role {
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.hero {
  display: grid;
  gap: 0;
  margin-bottom: 0.9rem;
}

.hero-copy {
  display: grid;
  gap: 0;
  max-width: 100%;
}

.bio {
  margin-top: 1.9rem;
  margin-bottom: 1.7rem;
}

.bio p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
  max-width: 34ch;
}

.links {
  display: inline-flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
  width: fit-content;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  padding: 0.05rem 0.15rem 0.05rem 0;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition), opacity var(--transition);
}

.links a:hover,
.links a:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 24%, transparent);
  opacity: 0.85;
}

.links a:focus-visible {
  outline: none;
}

footer {
  padding: 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.location {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main > * {
  animation: fadeIn 0.6s ease-out both;
}

header { animation-delay: 0s; }
.bio { animation-delay: 0.08s; }
.writing { animation-delay: 0.16s; }
.links { animation-delay: 0.24s; }

@media (max-width: 720px) {
  main {
    padding: clamp(3.5rem, 8vh, 5rem) 1.5rem 2rem;
    max-width: 100%;
  }

  h1 {
    font-size: 2.2rem;
  }

  .bio {
    margin-top: 1.7rem;
    margin-bottom: 1.5rem;
  }

  .bio p {
    max-width: 100%;
  }

  .links {
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 3rem 1.5rem 1.5rem;
  }

  h1 {
    font-size: 1.95rem;
  }

  .role {
    font-size: 0.86rem;
  }

  .bio {
    margin-top: 1.5rem;
  }

  .links {
    gap: 0.7rem;
    width: auto;
  }
}

::selection {
  background: var(--text);
  color: var(--bg);
}
