:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b68;
  --border: #e5e4df;
  --green: #7a9e8e;
  --green-soft: #eaf0ec;
  --blue: #6f93c2;
  --blue-soft: #eaf0f8;
  --max-width: 760px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

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

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover { color: var(--green); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* ---------- Layout ---------- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section h2 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.section-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-top: 5rem;
  padding-bottom: 4rem;
}

.hero-portrait { flex-shrink: 0; }

.portrait {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
}

.hero-text h1 {
  font-size: 2.4rem;
  margin: 0 0 0.5rem;
}

.tagline {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0 0 1.25rem;
}

.icon-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.icon-row svg {
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.icon-row a:hover svg { color: var(--blue); }

.resume-link {
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  color: var(--text);
}

.resume-link:hover {
  border-color: var(--green);
  color: var(--green);
  text-decoration: none;
}

@media (max-width: 640px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 3.5rem;
  }
  .icon-row { justify-content: center; }
}

/* ---------- About ---------- */
.prose p { margin: 0 0 1rem; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-group h3 {
  font-size: 1rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.9rem;
}

.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pill-list li {
  background: var(--green-soft);
  color: var(--text);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
  display: inline-block;
}

.skill-group:nth-child(2) .pill-list li { background: var(--blue-soft); }

@media (max-width: 640px) {
  .skills-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.project-card h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.project-card p { margin: 0 0 1rem; color: var(--muted); }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.78rem;
  background: var(--blue-soft);
  color: var(--text);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.card-links a { font-weight: 500; font-size: 0.92rem; }

.card-note {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}

.project-card--listed { padding-bottom: 1.25rem; }

/* ---------- Experience ---------- */
.experience-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.experience-list li {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
}

.experience-list li:last-child { border-bottom: none; }

.exp-title { font-weight: 600; }
.exp-org { color: var(--muted); }
.exp-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.experience-list p {
  flex: 1 0 100%;
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Writing ---------- */
.writing-entry h3 { font-size: 1.1rem; margin: 0 0 0.3rem; }
.writing-venue { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.6rem; }

/* ---------- Contact ---------- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.contact-form label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.6rem;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--green);
}

.contact-form button {
  margin-top: 1rem;
  align-self: flex-start;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.contact-form button:hover { opacity: 0.88; }

.contact-icons { margin-top: 0.5rem; }

/* ---------- Gallery ---------- */
.gallery-slider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gallery-track-wrap {
  overflow: hidden;
  flex: 1;
}

.gallery-track {
  display: flex;
  gap: 0.75rem;
  transition: transform 0.3s ease;
}

.gallery-photo {
  flex: 0 0 calc((100% - 1.5rem) / 3);
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--green-soft);
}

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

.gallery-status {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.gallery-arrow {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-arrow:hover { border-color: var(--blue); color: var(--blue); }

.gallery-arrow:disabled { opacity: 0.4; cursor: default; }

.gallery-arrow:disabled:hover { border-color: var(--border); color: var(--text); }

@media (max-width: 640px) {
  .gallery-photo { flex-basis: calc((100% - 0.75rem) / 2); }
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    display: none;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.75rem 1.5rem;
  }
}
