@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

:root {
  --teal: #0F7A6B;
  --teal-soft: rgba(15, 122, 107, 0.12);
  --teal-muted: rgba(15, 122, 107, 0.5);
  --coral: #C94F3A;
  --coral-soft: rgba(201, 79, 58, 0.1);
  --coral-muted: rgba(201, 79, 58, 0.5);
  --black: #111110;
  --gray-dark: #3a3a38;
  --gray-mid: #888780;
  --gray-light: #d3d1c7;
  --gray-faint: #f1efe8;
  --white: #fafaf8;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --max-width: 720px;
  --nav-height: 64px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--gray-light);
  z-index: 100;
}

.nav-logo {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 12px;
  font-weight: 400;
  color: var(--gray-mid);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--black); }

/* LAYOUT */
.page {
  display: none;
  padding-top: var(--nav-height);
  min-height: 100vh;
}
.page.active { display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* HOMEPAGE */
.hero {
  padding: 7rem 0 5rem;
}

.hero-location {
  font-size: 10px;
  color: var(--teal-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 80px);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 2rem;
}

.hero-bio {
  font-size: 15px;
  color: var(--gray-dark);
  line-height: 1.8;
  max-width: 420px;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

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

.hero-links .primary {
  font-size: 13px;
  color: var(--coral);
  border-bottom: 1px solid rgba(201,79,58,0.35);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.hero-links .primary:hover { border-color: var(--coral); }

.hero-links .secondary {
  font-size: 13px;
  color: var(--gray-mid);
  transition: color 0.2s;
}
.hero-links .secondary:hover { color: var(--black); }

/* SECTION */
.section {
  border-top: 0.5px solid var(--gray-light);
  padding: 3rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
}

.section-label {
  font-size: 10px;
  color: var(--gray-mid);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
}

.section-more {
  font-size: 11px;
  color: var(--teal-muted);
  transition: color 0.2s;
  cursor: pointer;
}
.section-more:hover { color: var(--teal); }

/* WRITING LIST */
.post-list { display: flex; flex-direction: column; }

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 0.5px solid var(--gray-light);
  cursor: pointer;
  transition: opacity 0.2s;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { opacity: 0.65; }

.post-title { font-size: 14px; color: var(--black); font-weight: 300; }
.post-date { font-size: 11px; color: var(--teal-muted); white-space: nowrap; margin-left: 1.5rem; }

/* PROJECTS */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-card {
  border: 0.5px solid var(--gray-light);
  border-radius: 8px;
  padding: 1.2rem;
  transition: border-color 0.2s;
  cursor: pointer;
}
.project-card:hover { border-color: var(--gray-mid); }

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.project-name { font-size: 13px; font-weight: 500; color: var(--black); }

.project-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 400;
}
.project-tag.tool { color: var(--coral); background: var(--coral-soft); }
.project-tag.wip { color: var(--teal); background: var(--teal-soft); }

.project-desc { font-size: 12px; color: var(--gray-mid); line-height: 1.6; font-weight: 300; }

/* HOMEPAGE PHOTOS STRIP */
.photos-strip {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 4rem;
}

.photos-strip-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strip-photo {
  background: var(--gray-faint);
  overflow: hidden;
}

.strip-photo img { transition: transform 0.4s ease; }
.strip-photo:hover img { transform: scale(1.03); }

.strip-photo.tall { aspect-ratio: 3/4; }
.strip-photo.square { aspect-ratio: 1; }
.strip-photo.wide { aspect-ratio: 4/3; }

/* FOOTER */
.footer {
  border-top: 0.5px solid var(--gray-light);
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy { font-size: 11px; color: var(--gray-mid); }

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 11px;
  color: var(--gray-mid);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--black); }

/* PHOTOS PAGE */
#photos-page { padding-top: var(--nav-height); }

.masonry-grid {
  columns: 3;
  column-gap: 0;
  width: 100%;
}

.masonry-item {
  break-inside: avoid;
  display: block;
  overflow: hidden;
  background: var(--gray-faint);
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}
.masonry-item:hover img { transform: scale(1.03); }

.load-more-trigger {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.load-spinner {
  width: 20px; height: 20px;
  border: 1.5px solid var(--gray-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}
.load-spinner.visible { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

/* RESEARCH PAGE */
.research-hero {
  padding: 6rem 0 3rem;
}

.research-hero h2 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.research-hero p {
  font-size: 15px;
  color: var(--gray-dark);
  font-weight: 300;
  max-width: 500px;
  line-height: 1.8;
}

.pub-list { display: flex; flex-direction: column; gap: 0; }

.pub-item {
  padding: 1.5rem 0;
  border-bottom: 0.5px solid var(--gray-light);
}

.pub-year {
  font-size: 10px;
  color: var(--teal-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.pub-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

.pub-authors {
  font-size: 12px;
  color: var(--gray-mid);
  font-weight: 300;
  margin-bottom: 0.3rem;
}

.pub-journal {
  font-size: 12px;
  color: var(--coral-muted);
  font-style: italic;
}

/* BLOG PAGE */
.blog-hero {
  padding: 6rem 0 3rem;
}

.blog-hero h2 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  margin-bottom: 1rem;
}

.blog-list { display: flex; flex-direction: column; }

.blog-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 0.5px solid var(--gray-light);
  cursor: pointer;
  transition: opacity 0.2s;
}
.blog-item:hover { opacity: 0.65; }

.blog-date-block {
  font-size: 10px;
  color: var(--teal-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 3px;
  line-height: 1.5;
}

.blog-item-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.blog-item-excerpt {
  font-size: 13px;
  color: var(--gray-mid);
  font-weight: 300;
  line-height: 1.6;
}

/* PROJECTS PAGE */
.projects-hero {
  padding: 6rem 0 3rem;
}

.projects-hero h2 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  margin-bottom: 1rem;
}

.projects-full-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-bottom: 4rem;
}

.project-full-card {
  border: 0.5px solid var(--gray-light);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}
.project-full-card:hover {
  border-color: var(--gray-mid);
  transform: translateY(-2px);
}

.project-full-name { font-size: 15px; font-weight: 500; margin-bottom: 0.5rem; }
.project-full-desc { font-size: 13px; color: var(--gray-mid); line-height: 1.6; font-weight: 300; margin-bottom: 1rem; }
.project-full-link { font-size: 12px; color: var(--teal); }

/* PAGE ANIMATIONS */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s ease forwards;
}

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

.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.2s; }
.fade-in:nth-child(5) { animation-delay: 0.25s; }

@media (max-width: 600px) {
  nav { padding: 0 1.25rem; }
  .container { padding: 0 1.25rem; }
  .hero-name { font-size: 48px; }
  .projects-grid, .projects-full-grid { grid-template-columns: 1fr; }
  .masonry-grid { columns: 2; }
  .photos-strip { grid-template-columns: 1fr 1fr; }
  .blog-item { grid-template-columns: 1fr; gap: 0.5rem; }
}
