/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #faf8f5;
  --bg-light:  #f3f0ea;
  --surface:   #ffffff;
  --border:    #e2ddd6;
  --accent:    #8b2035;
  --accent-dim:#6b1828;
  --text:      #1a1814;
  --text-muted:#6b6560;
  --text-dim:  #b0a99f;
  --nav-h:     64px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 6px rgba(0,0,0,0.07), 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08), 0 16px 40px rgba(0,0,0,0.1);
  --shadow-accent: 0 4px 16px rgba(139,32,53,0.18);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); }

/* ── Navbar ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow 0.3s;
}
#navbar.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.1); }

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  counter-increment: nav;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }

/* ── Section base ── */
section {
  padding: 100px 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
}
.section-title::after {
  content: '';
  display: block;
  height: 1px;
  width: 100%;
  background: var(--border);
}

/* ── About ── */
#about {
  background: var(--bg);
  padding-top: calc(var(--nav-h) + 60px);
}

.about-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  padding: 0 2rem;
}

.about-text { flex: 1; }

.greeting {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.about-text h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.hero-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.hero-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}
.hero-social-icon:hover { background: var(--accent-dim); color: #fff; transform: translateY(-2px); }

.about-text h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.about-bio {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.about-links { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(139,32,53,0.3), 0 6px 20px rgba(139,32,53,0.2);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover { background: var(--accent-dim); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(139,32,53,0.35), 0 10px 28px rgba(139,32,53,0.22); }

.btn-secondary {
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-secondary:hover { background: rgba(139,32,53,0.08); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.about-avatar {
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 6px rgba(139,32,53,0.08), var(--shadow-accent);
  flex-shrink: 0;
}

.avatar-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
  display: block;
}

/* ── About Me ── */
#about-me { background: var(--bg); }

.aboutme-top {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.aboutme-text {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.aboutme-text p {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.aboutme-text .highlight {
  color: var(--accent);
  font-weight: 700;
}

.aboutme-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.fact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.fact-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.fact-value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.fact-open {
  color: #2a7a3b;
}

.aboutme-photo-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.aboutme-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transform: scale(1.8);
  transform-origin: 40% 70%;
}

.aboutme-photo-frame .photo-placeholder-text {
  display: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: center;
  padding: 1rem;
}

.aboutme-photo-frame.img-missing {
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.aboutme-photo-frame.img-missing .photo-placeholder-text { display: block; }

.aboutme-right-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.languages-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  box-shadow: var(--shadow-sm);
}

.languages-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.languages-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lang-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.lang-item img {
  width: 36px;
  height: 36px;
}

.lang-item span {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 700px) {
  .aboutme-top { grid-template-columns: 1fr; }
  .aboutme-photo-frame { width: 180px; margin: 0 auto; }
  .aboutme-facts { grid-template-columns: 1fr 1fr; }
}

/* ── Experience ── */
#experience { background: var(--bg-light); }

.timeline { margin-bottom: 3.5rem; }

.timeline-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: -1rem;
  width: 2px;
  background: var(--border);
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 12px rgba(139,32,53,0.2);
}

.timeline-content { flex: 1; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.job-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.job-date {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.job-company {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  display: block;
  margin-bottom: 0.5rem;
}

.job-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Stack */
.stack-section { margin-top: 2rem; }

.stack-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stack-tag {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.stack-tag:hover { border-color: var(--accent); color: var(--accent); }

/* ── Projects ── */
#projects { background: var(--bg); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08), 0 20px 48px rgba(139,32,53,0.14);
}

.project-card--sync {
  position: relative;
  overflow: hidden;
}
.project-card--sync::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('images/synccover2.png') center/cover no-repeat;
  opacity: 0.32;
  transition: opacity 0.3s;
  z-index: 0;
}
.project-card--sync:hover::before {
  opacity: 0.45;
}
.project-card--sync > * {
  position: relative;
  z-index: 1;
}

.project-card--inspectra {
  position: relative;
  overflow: hidden;
}
.project-card--inspectra::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('images/inspectra.jpg') center/cover no-repeat;
  opacity: 0.32;
  transition: opacity 0.3s;
  z-index: 0;
}
.project-card--inspectra:hover::before {
  opacity: 0.45;
}
.project-card--inspectra > * {
  position: relative;
  z-index: 1;
}

.project-card--vlm {
  position: relative;
  overflow: hidden;
}
.project-card--vlm::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('images/vlm-cover.png') center/cover no-repeat;
  opacity: 0.32;
  transition: opacity 0.3s;
  z-index: 0;
}
.project-card--vlm:hover::before {
  opacity: 0.45;
}
.project-card--vlm > * {
  position: relative;
  z-index: 1;
}

.project-card--nasa {
  position: relative;
  overflow: hidden;
}
.project-card--nasa::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('images/NASASUITS.webp') center/cover no-repeat;
  opacity: 0.32;
  transition: opacity 0.3s;
  z-index: 0;
}
.project-card--nasa:hover::before {
  opacity: 0.45;
}
.project-card--nasa > * {
  position: relative;
  z-index: 1;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-icon { font-size: 1.6rem; }

.project-card-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.project-card-links a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.project-card-links a:hover { color: var(--accent); }

.project-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.project-desc {
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.7;
  flex: 1;
}

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

.project-tags span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.project-tags span:not(:last-child)::after { content: ' ·'; color: var(--text-dim); margin-left: 0.5rem; }

/* ── Contact ── */
#contact {
  background: var(--bg-light);
  text-align: center;
}

.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 600px !important;
}

.contact-inner .section-title::after { display: none; }

.contact-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 480px;
}

.contact-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(139,32,53,0.06);
}

/* ── Footer ── */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}
.footer-nav a {
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .about-inner { flex-direction: column-reverse; text-align: center; gap: 2.5rem; }
  .about-links { justify-content: center; }
  .about-bio { margin: 0 auto 2.5rem; }
  .avatar-placeholder { width: 260px; height: 260px; }
  .projects-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 1.2rem; }
  .section-title { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .nav-links { display: none; }
  section { padding: 80px 1.25rem; }
}

/* ── Scroll-reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
