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

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

body {
  background: #111;
  color: #e8e8e8;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #4a9eff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ─── STICKY NAV ────────────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
}

.nav-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e8e8e8;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-name:hover {
  color: #4a9eff;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-pill {
  padding: 4px 12px;
  border: 1px solid #333;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #aaa;
  background: transparent;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.nav-pill:hover {
  border-color: #4a9eff;
  color: #4a9eff;
  text-decoration: none;
}

/* ─── MAIN CONTAINER ────────────────────────────────────────────── */
main {
  max-width: 650px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* ─── SECTION DIVIDER ───────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid #222;
  margin: 40px 0;
}

/* ─── SECTION LABEL ─────────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 24px;
}

/* ─── HEADER / INTRO ────────────────────────────────────────────── */
.header-section {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 0;
}

.profile-photo {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #2a2a2a;
  /* fallback if image missing */
  display: block;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}

.header-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e8e8e8;
  line-height: 1.2;
}

.subtitle {
  font-size: 0.9rem;
  font-weight: 400;
  color: #bbb;
  line-height: 1.6;
}

.social-row {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.social-icon {
  color: #aaa;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.social-icon:hover {
  color: #4a9eff;
}

.email-row {
  margin-top: 2px;
}

.email-link {
  font-size: 0.82rem;
  color: #4a9eff;
  text-decoration: none;
  transition: color 0.15s;
}

.email-link:hover {
  color: #7ab8ff;
  text-decoration: underline;
}

.email-reveal {
  font-size: 0.82rem;
  color: #555;
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
}

.email-reveal:hover {
  color: #4a9eff;
}

/* ─── EDUCATION TIMELINE ────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #333;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
}

.timeline-year {
  color: #555;
  font-size: 0.82rem;
  padding-top: 3px;
  line-height: 1.4;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edu-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.logo-placeholder {
  width: 48px;
  height: 48px;
  background: #2a2a2a;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid #333;
}

.edu-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid #333;
}

.edu-institution {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e8e8e8;
  line-height: 1.4;
}

.edu-degree {
  font-size: 0.83rem;
  color: #888;
  margin-top: 2px;
}

.edu-desc {
  font-size: 0.83rem;
  color: #666;
  line-height: 1.55;
}

/* ─── PROJECTS GRID ─────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-thumb {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 6px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s;
  cursor: pointer;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumb:hover {
  filter: brightness(1.15);
}

.project-thumb:hover img {
  filter: brightness(1.15);
}

.thumb-initials {
  color: #444;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.project-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.project-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e8e8e8;
  text-decoration: none;
  transition: color 0.15s;
}

.project-name:hover {
  color: #4a9eff;
  text-decoration: none;
}

.demo-link {
  font-size: 0.75rem;
  color: #4a9eff;
  text-decoration: none;
}

.demo-link:hover {
  text-decoration: underline;
}

.project-tagline {
  font-size: 0.78rem;
  color: #777;
}

.project-tech {
  font-size: 0.73rem;
  color: #555;
  font-style: italic;
}

.project-desc {
  font-size: 0.78rem;
  color: #666;
  line-height: 1.55;
  margin-top: 2px;
}

/* ─── ACHIEVEMENTS GRID ─────────────────────────────────────────── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.achievement-card {
  background: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.ach-title {
  font-size: 0.87rem;
  font-weight: 600;
  color: #e8e8e8;
  line-height: 1.3;
}

.ach-issuer {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

.ach-year {
  font-size: 0.72rem;
  color: #555;
  margin-top: 8px;
  text-align: right;
}

/* ─── FOOTER ────────────────────────────────────────────────────── */
footer {
  text-align: center;
  margin-top: 0;
}

.footer-text {
  font-size: 0.78rem;
  color: #444;
}

/* ─── RESPONSIVE ────────────────────────────────────────────────── */

/* Tablet: 600–900px → 2 columns */
@media (max-width: 900px) and (min-width: 601px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: < 600px → 1 column, stacked header */
@media (max-width: 600px) {
  main {
    padding: 32px 16px 48px;
  }

  .topnav {
    padding: 10px 16px;
    gap: 8px;
  }

  .nav-links {
    gap: 6px;
  }

  .nav-pill {
    padding: 3px 9px;
    font-size: 0.72rem;
  }

  .header-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo {
    width: 110px;
    height: 110px;
  }

  .social-row {
    justify-content: center;
  }

  .email-row {
    text-align: center;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .timeline-year {
    font-size: 0.78rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }
}
