:root {
  --paper: #f6f1e8;
  --stone: #efe8dc;
  --stone-deep: #e4dccb;
  --ink: #2c241c;
  --ink-soft: rgba(44, 36, 28, 0.72);
  --ink-faint: rgba(44, 36, 28, 0.45);
  --line: rgba(44, 36, 28, 0.12);
  --terracotta: #b85c38;
  --terracotta-soft: rgba(184, 92, 56, 0.14);
  --shadow: 0 18px 40px rgba(44, 36, 28, 0.06);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --max: 52rem;
  --nav-height: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(44, 36, 28, 0.04) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--terracotta);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  min-height: var(--nav-height);
  padding: 0.85rem 1.75rem;
}

.nav-about,
.nav-projects {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.nav-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-bottom: 0.2rem;
  border-bottom: 1.5px solid transparent;
}

.nav-link:hover {
  color: var(--terracotta);
}

.nav-link.is-active {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
}

.page {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kicker {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 650;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.portrait {
  position: relative;
  width: min(16.5rem, 72vw);
  aspect-ratio: 1;
  margin: 2.4rem 0 2rem;
  border-radius: 1.75rem;
  background: var(--stone);
  border: 1.5px dashed color-mix(in srgb, var(--terracotta) 55%, var(--stone-deep));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait:has(img.loaded) {
  border-style: solid;
  border-color: var(--line);
}

.portrait-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-faint);
  pointer-events: none;
}

.portrait:has(img.loaded) .portrait-hint {
  display: none;
}

.bio {
  max-width: 38rem;
  margin: 0 auto 3.75rem;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.section-title {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.hobby-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.hobby-card {
  min-height: 8.5rem;
  padding: 1.15rem 1.2rem 1.3rem;
  background: var(--stone);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.hobby-label {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hobby-title,
.hobby-note {
  margin: 0;
}

.hobby-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 650;
  min-height: 1.5em;
}

.hobby-note {
  margin-top: 0.4rem;
  min-height: 1.5em;
  color: var(--ink-faint);
  font-size: 0.95rem;
}

.project-page {
  padding-top: 4.25rem;
}

.project-title {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.project-lede {
  margin: 0 0 2.25rem;
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: 1.15rem;
}

.soon {
  display: inline-block;
  margin: 0;
  padding: 0.55rem 0.9rem;
  background: var(--terracotta-soft);
  color: var(--terracotta);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .topbar {
    gap: 0.75rem;
    padding-inline: 1rem;
  }

  .nav-link {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }

  .nav-projects {
    gap: 0.9rem;
  }

  .page {
    padding-top: 2.5rem;
  }

  .hobby-grid {
    grid-template-columns: 1fr;
  }

  .project-page {
    padding-top: 2.75rem;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding-inline: 0.9rem;
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    text-transform: none;
  }

  .nav-projects {
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
