:root {
  --bg: #0a0a0a;
  --surface: #131313;
  --border: #262626;
  --border-hover: #404040;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --dim: #525252;
  --accent: #d4a574;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

::selection {
  background-color: rgba(212, 165, 116, 0.25);
  color: var(--text);
}

.italic {
  font-style: italic;
}

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

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.5s, border-color 0.5s, backdrop-filter 0.5s;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.3s;
}

.nav__logo:hover {
  opacity: 0.7;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}

.nav__link:hover {
  color: var(--text);
}

.nav__link.active {
  color: var(--text);
}

.nav__cta {
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.3s, color 0.3s;
}

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

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(212, 165, 116, 0.05);
  filter: blur(120px);
  pointer-events: none;
}

.hero__content {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero__name {
  font-weight: 600;
}

.hero__wave {
  display: inline-block;
  font-size: 0.7em;
  transform-origin: 70% 70%;
  animation: wave 2.8s ease-in-out 0.6s infinite;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30%, 50% { transform: rotate(14deg); }
  20%, 40%     { transform: rotate(-8deg); }
}

.hero__focus {
  color: var(--accent);
  font-weight: 600;
}

.hero__subtitle {
  margin-top: 1.75rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(1.0625rem, 2.5vw, 1.375rem);
  color: var(--muted);
  line-height: 1.6;
  text-wrap: balance;
}

.hero__actions {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  animation: bounce 2s infinite;
  transition: color 0.3s;
}

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

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
}

.btn--primary {
  background: var(--text);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--accent);
}

.btn--outline {
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--muted);
}

/* ── SECTIONS ── */
.section {
  padding: 8rem 0;
}

.section--border {
  border-top: 1px solid var(--border);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.section__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 300;
  color: var(--text);
  margin-bottom: 4rem;
}

/* ── ABOUT ── */
.about__text {
  max-width: 46rem;
}

.about__lead {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text);
  text-wrap: balance;
}

.about__body {
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ── TIMELINE ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.timeline__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.timeline__meta {
  text-align: left;
}

.timeline__period {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.timeline__org {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.timeline__org a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.3s, border-color 0.3s;
}

.timeline__org a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.timeline__org a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.timeline__role {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
}

/* ── PROJECTS ── */
.projects__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 4rem;
}

.projects__header .section__title {
  margin-bottom: 0;
}

.projects__count {
  font-size: 0.875rem;
  color: var(--muted);
}

.projects__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}

.project-card {
  display: block;
  background: var(--bg);
  padding: 2.5rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.5s;
  cursor: pointer;
}

.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.project-card:hover {
  background: var(--surface);
}

.project-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.project-card__arrow {
  color: var(--dim);
  transition: all 0.3s;
}

.project-card:hover .project-card__arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.project-card__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.3s;
}

.project-card:hover .project-card__title {
  color: var(--accent);
}

.project-card__desc {
  margin-top: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.project-card__tags {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  transition: border-color 0.3s;
}

.project-card:hover .tag {
  border-color: var(--border-hover);
}

/* ── FOOTER ── */
.footer {
  padding: 8rem 0;
  border-top: 1px solid var(--border);
}

.footer__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2rem, 6vw, 3.75rem);
  font-weight: 300;
  color: var(--text);
  line-height: 1.1;
  text-wrap: balance;
}

.footer__actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__bottom {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer__copy {
  font-size: 0.875rem;
  color: var(--dim);
}

.footer__social {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer__social a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}

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

/* ── ANIMATIONS ── */
.fade-in {
  animation: fadeIn 1s ease-out both;
}

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

.fade-up {
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (min-width: 640px) {
  .projects__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .timeline__item {
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
  }

  .footer__bottom {
    flex-direction: row;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}