/* ---- Custom Properties ---- */
:root {
  --bg: #FAFAF8;
  --text: #111827;
  --text-muted: #6B7280;
  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --border: #E5E7EB;
  --card-bg: #FFFFFF;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --header-h: 64px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--text);
}

/* ---- Layout ---- */
.section-inner,
.header-inner,
.hero-inner,
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.header-logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 64px;
  width: auto;
  display: block;
}

.logo-img--footer {
  height: 52px;
}

.main-nav ul {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

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

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Hero ---- */
.hero {
  padding: calc(var(--header-h) + 72px) 0 112px;
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  background-image: url('../images/hero-bg.jpg');
  background-size: cover;
  background-position: right center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--bg) 35%,
    rgba(250, 250, 248, 0.75) 58%,
    rgba(250, 250, 248, 0.2) 100%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 108px);
  font-weight: 900;
  line-height: 0.93;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 36px;
}

.hero-value {
  max-width: 38ch;
  font-size: 1.125rem;
  line-height: 1.65;
  color: #374151;
  margin-bottom: 44px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-links {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-link {
  color: var(--text-muted);
  transition: color 0.15s;
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 11px 24px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* ---- Sections ---- */
.section {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 52px;
  color: var(--text);
}

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

.section-header .section-title { margin-bottom: 0; }

.resume-link {
  font-size: 0.875rem;
  color: var(--accent);
  transition: opacity 0.15s;
  white-space: nowrap;
}

.resume-link:hover { opacity: 0.7; }

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 64px;
  align-items: start;
}

.about-text p {
  max-width: 62ch;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 22px;
}

.about-text p:last-child { margin-bottom: 0; }

.about-image img {
  width: 100%;
  border-radius: 8px;
  filter: grayscale(15%);
}

/* ---- Experience ---- */
.experience-list {
  display: flex;
  flex-direction: column;
}

.experience-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}

.experience-item:first-child { border-top: 1px solid var(--border); }

.experience-item--minor .exp-content p {
  color: var(--text-muted);
}

.exp-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
}

.exp-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
}

.exp-company {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.exp-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.exp-content p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 62ch;
}

.education { margin-top: 52px; }

.subsection-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.edu-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: baseline;
}

.edu-degree {
  font-size: 0.9375rem;
  color: var(--text);
}

/* ---- Projects ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

.project-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--border);
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.project-card:hover .project-img-wrap img {
  transform: scale(1.04);
}

.project-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tags li {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(29, 78, 216, 0.07);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ---- Skills ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 36px 56px;
}

.skill-group dt {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.skill-group dd {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.65;
}

/* ---- Contact ---- */
.contact-intro {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 50ch;
  margin-bottom: 52px;
  line-height: 1.7;
  margin-top: -24px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-email {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.contact-email a {
  color: var(--accent);
  transition: opacity 0.15s;
}

.contact-email a:hover { opacity: 0.7; }

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-links a {
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

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

.contact-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 20px;
}

.contact-form label:first-of-type { margin-top: 0; }

.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.contact-form textarea { resize: vertical; }

.contact-form .btn { margin-top: 20px; }

/* ---- Footer ---- */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-logo { display: flex; align-items: center; }

.footer-location {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
  transition: color 0.15s;
}

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .main-nav.open {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .main-nav.open ul {
    flex-direction: column;
    gap: 28px;
    text-align: center;
  }

  .main-nav.open .nav-link {
    font-size: 1.25rem;
    color: var(--text);
  }

  .hero {
    padding-top: calc(var(--header-h) + 40px);
    min-height: auto;
    padding-bottom: 72px;
  }

  .about-grid { grid-template-columns: 1fr; }
  .about-image { display: none; }

  .experience-item,
  .edu-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-grid { grid-template-columns: 1fr; gap: 40px; }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  .section { padding: 64px 0; }
  .section-title { margin-bottom: 36px; }
  .section-header { margin-bottom: 36px; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 48px; }
  .hero-cta .btn { width: 100%; text-align: center; }
  .project-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}

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