:root {
  --bg: #fafaf8;
  --text: #17171a;
  --text-dim: #53535a;
  --tile: #efeeea;
  --line: #e2e1db;
  --navy: #1d3660;
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --maxw: 1200px;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --section-gap: clamp(2.5rem, 5vw, 4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth; scroll-padding-top: 6rem;
  scrollbar-color: var(--text-dim) var(--bg);
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
::selection { background: var(--navy); color: #fff; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
a:focus-visible { outline: 2px solid var(--navy); outline-offset: 5px; }
.skip-link {
  position: fixed; top: 0.5rem; left: var(--gutter); z-index: 20;
  padding: 0.6rem 1rem; background: var(--navy); color: #fff;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 2.5rem;
  padding: 0.6rem var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 1.2rem; font-weight: 500; text-decoration: none; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; min-height: 44px;
}
.brand:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 0.25em; }
.nav-links { display: flex; gap: 1.6rem; }
.nav-links a {
  font-size: 0.92rem; font-weight: 400; color: var(--text-dim);
  text-decoration: none; padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  min-height: 44px; display: flex; align-items: center;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--navy); border-bottom-color: var(--navy); }
.nav-social { margin-left: auto; display: flex; gap: 0.25rem; }
.nav-social a {
  color: var(--text-dim); transition: color 0.15s;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
}
.nav-social a:hover { color: var(--navy); background: var(--tile); border-radius: 6px; }
.nav-social .heart {
  font-size: 0.95rem; line-height: 1; text-decoration: none;
  opacity: 0.85; transition: opacity 0.15s, background-color 0.15s;
}
.nav-social .heart:hover { opacity: 1; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--section-gap);
  align-items: center;
  padding: var(--section-gap) 0 var(--space-xl);
}
.display {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.display.sm { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.hero-tag {
  margin-top: 1rem; font-size: 0.95rem; color: var(--text-dim);
}
.hero-copy p { color: var(--text-dim); font-size: 1.05rem; max-width: 34rem; }
.hero-copy .internship { color: var(--text); }
.hero-buttons { margin-top: var(--space-lg); display: flex; align-items: center; gap: var(--space-lg); flex-wrap: wrap; }
.text-link {
  color: var(--navy); font-size: 0.95rem; font-weight: 400;
  text-underline-offset: 0.25em; text-decoration-thickness: 1px;
  display: inline-flex; align-items: center; min-height: 44px;
}
.text-link:hover { text-decoration-thickness: 2px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3em;
  min-height: 44px; text-align: center;
  background: var(--navy); color: #fff;
  font-weight: 400; font-size: 0.95rem;
  text-decoration: none;
  padding: 0.65rem 1.25rem; border-radius: 6px;
  transition: background-color 0.15s;
}
.pill:hover { background: var(--text); }
.pill span { font-size: 0.85em; }

/* ---------- projects ---------- */
.projects { padding: var(--space-lg) 0 var(--section-gap); }
.section-title { font-size: 1.25rem; font-weight: 400; margin-bottom: var(--space-lg); }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--section-gap) var(--space-xl);
}
.tile { display: flex; flex-direction: column; min-width: 0; gap: var(--space-lg); }
.tile-featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center; gap: var(--section-gap);
}
.project-copy { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.thumb {
  aspect-ratio: 4 / 3;
  background: var(--tile);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s;
}
.thumb:hover { border-color: var(--navy); }
.thumb.photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tile h3 {
  font-size: 1.25rem; font-weight: 500; line-height: 1.3;
}
.tile-featured h3 { font-size: clamp(1.5rem, 2.5vw, 1.9rem); }
.project-description {
  margin-top: var(--space-md); font-size: 0.95rem;
  color: var(--text-dim); flex: 1; max-width: 70ch;
}
.project-date { font-size: 0.85rem; color: var(--text-dim); margin-top: var(--space-sm); }
.project-details { padding-left: 1.1rem; margin-top: var(--space-sm); }
.project-details li + li { margin-top: var(--space-sm); }
.project-details li::marker { color: var(--navy); }
.technologies {
  margin-top: var(--space-lg); display: flex; flex-wrap: wrap;
  gap: 0.25rem 1rem; list-style: none;
  font-size: 0.8rem; color: var(--navy);
}
.repo-link {
  margin-top: 0.8rem;
  font-size: 0.85rem; font-weight: 400; color: var(--navy);
  text-decoration: underline; text-underline-offset: 0.2em;
  word-break: normal; overflow-wrap: anywhere;
  display: flex; align-items: center; min-height: 44px;
}
.repo-link:hover { color: var(--text); text-decoration-thickness: 2px; }

@media (min-width: 701px) and (max-width: 1000px) {
  .projects-grid { grid-template-columns: 1fr; }
  .tile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: var(--space-xl); }
}

/* ---------- resume ---------- */
.resume {
  padding: clamp(2.5rem, 6vh, 4rem) 0;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  border-top: 1px solid var(--line);
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}
@media (max-width: 860px) { .resume { grid-template-columns: 1fr; } }
.resume-intro p { margin: 1rem 0 0.7rem; color: var(--text-dim); max-width: 28ch; }
.resume-block { margin-bottom: 2.4rem; }
.resume-block:last-child { margin-bottom: 0; }
.resume-block h3 {
  font-size: 1.1rem; font-weight: 500;
  color: var(--text); margin-bottom: 1.1rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
}
.entry { margin-bottom: 1.3rem; }
.entry:last-child { margin-bottom: 0; }
.entry b { font-weight: 500; display: block; }
.entry span { font-size: 0.87rem; color: var(--text-dim); }
.entry p { font-size: 0.9rem; color: var(--text-dim); margin-top: 0.3rem; max-width: 44rem; }
.skill-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 1.4rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--line);
}
.skill-row:last-child { border-bottom: none; }
.skill-row b { font-weight: 500; font-size: 0.9rem; }
.skill-row span { font-size: 0.92rem; color: var(--text-dim); }
@media (max-width: 620px) {
  .skill-row { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}
.foot-cols {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(2rem, 5vh, 3rem) var(--gutter);
  display: flex; justify-content: flex-end; gap: clamp(3rem, 8vw, 7rem); flex-wrap: wrap;
}
.foot-cols h2 { font-size: 1.35rem; font-weight: 400; margin-bottom: 0.7rem; }
.foot-cols p { font-size: 0.92rem; color: var(--text-dim); }
.foot-cols a { color: var(--text-dim); text-decoration: none; display: inline-block; padding: 0.3rem 0; overflow-wrap: anywhere; }
.foot-cols > div { min-width: 0; }
.foot-cols a:hover { color: var(--navy); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* Keep section navigation available on a second row on phones. */
@media (max-width: 700px) {
  html { scroll-padding-top: 8rem; }
  nav { flex-wrap: wrap; gap: 0 0.5rem; padding: 0.5rem var(--gutter) 0; }
  .nav-links { order: 3; flex-basis: 100%; gap: 1.75rem; }
  .brand { font-size: 1.05rem; white-space: nowrap; }

  .nav-social .heart { font-size: 1.15rem; }

  .hero { grid-template-columns: 1fr; gap: var(--space-lg); padding: var(--space-xl) 0; }
  .hero-copy p { font-size: 1rem; }
  .hero-buttons { gap: var(--space-md); }
  .projects-grid { grid-template-columns: 1fr; }
  .tile-featured { grid-template-columns: 1fr; gap: var(--space-lg); }

  .project-description { font-size: 1rem; }

  .foot-cols { justify-content: flex-start; gap: 2.5rem; }
}

/* narrow phones: keep the display type from crowding the gutters */
@media (max-width: 400px) {
  :root { --gutter: 1rem; }
  .brand { font-size: 0.95rem; }
  .nav-social { gap: 0; }
  .display { font-size: 2.5rem; }
  .display.sm { font-size: 2rem; }
}
