*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #F5F7FB;
  --color-surface: #ffffff;
  --color-text: #111111;
  --color-muted: #2D3748;
  --color-primary: #1F3A8A;
  --color-secondary: #3B82F6;
  --color-accent-light: #E8F0FE;
  --color-border: #E2E8F0;
  --color-hero-bg: #EDF2FB;
  --max-width: 820px;
}

html {
  scroll-behavior: smooth;
}

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

/* ── Header & Nav ── */

header {
  background-color: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.nav-brand {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  flex-shrink: 0;
}

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

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.4rem 0.85rem;
  border-radius: 5px;
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background-color: #ffffff;
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links a:hover {
  color: #ffffff;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-links a.active {
  color: #ffffff;
}

/* ── Hamburger toggle ── */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Scroll progress bar ── */

#scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background-color: var(--color-secondary);
  transition: width 0.1s linear;
  z-index: 101;
}

/* ── Hero ── */

#hero {
  background: linear-gradient(150deg, #dce8fb 0%, #EDF2FB 55%, #e4edfc 100%);
  text-align: center;
  padding: 2.5rem 1.5rem 4.5rem;
  clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

#hero img {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(59, 130, 246, 0.3);
  display: block;
  margin: 0 auto 2.25rem;
  box-shadow: 0 6px 28px rgba(31, 58, 138, 0.16);
}

#hero h1 {
  color: #0a0a0a;
  font-size: 2.7rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.tagline {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.9rem;
}

.intro {
  font-size: 0.97rem;
  color: var(--color-muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Main content sections ── */

main > section:not(#hero) {
  padding: 2.5rem max(1.5rem, calc((100% - var(--max-width)) / 2));
  background-color: var(--color-surface);
  position: relative;
}

#education,
#projects {
  background-color: #F4F7FD;
}

/* ── Headings ── */

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1.25rem;
  padding-left: 1.1rem;
  border-left: 4px solid var(--color-secondary);
  display: block;
  line-height: 1.3;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

h2.visible {
  opacity: 1;
  transform: translateX(0);
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

p {
  margin-bottom: 1.1rem;
  color: var(--color-muted);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ── About ── */

#about p {
  max-width: 660px;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

/* ── Education ── */

.education-item {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 2rem 2.25rem;
  background-color: var(--color-surface);
  border: 1px solid #dde6f5;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(31, 58, 138, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.education-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(31, 58, 138, 0.13);
}

.education-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.education-logo img {
  height: 52px;
  width: auto;
  display: block;
  object-fit: contain;
}

.education-body {
  flex: 1;
}

.education-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.1rem;
}

.org {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.education-major {
  font-size: 0.93rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.education-details {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.75rem;
  margin-top: 0;
}

.education-details li {
  font-size: 0.9rem;
  color: var(--color-muted);
  position: relative;
  padding-left: 0.85rem;
}

.education-details li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--color-secondary);
  font-weight: 700;
}

/* ── Experience ── */

.experience-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  background-color: var(--color-surface);
  border: 1px solid #dde6f5;
  border-radius: 16px;
  margin-bottom: 1.1rem;
  box-shadow: 0 2px 16px rgba(31, 58, 138, 0.08);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.22s ease;
}

.experience-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.experience-item.visible:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(31, 58, 138, 0.13);
}

.experience-item:last-child {
  margin-bottom: 0;
}

.experience-logo {
  flex-shrink: 0;
  width: 68px;
  display: flex;
  align-items: flex-start;
  padding-top: 0.1rem;
}

.experience-logo img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 8px;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  padding: 4px;
}

.experience-body {
  flex: 1;
}

.experience-item p {
  font-size: 0.94rem;
  margin-bottom: 0;
}

/* ── Skills ── */

.skills-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.skill-group-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 0.8rem;
}

.skill-tag {
  background-color: var(--color-accent-light);
  color: var(--color-primary);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(59, 130, 246, 0.45);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.skill-tag.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Projects ── */

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-bottom: 0.65rem;
}

.tech-tag {
  color: var(--color-primary);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: none;
  border: none;
  padding: 0;
}

.tech-tag:not(:last-child)::after {
  content: '\00A0\2022\00A0';
  font-weight: 400;
  opacity: 0.55;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.1rem;
}

.project-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--color-secondary);
  border-radius: 999px;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.project-btn:hover {
  background-color: var(--color-secondary);
  color: #ffffff;
}

/* ── Contact ── */

#contact {
  background-color: var(--color-hero-bg);
}

#contact p {
  margin-bottom: 1.25rem;
}

.contact-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.6rem;
  border: 1.5px solid var(--color-secondary);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(10px);
  transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.25s ease, opacity 0.3s ease;
}

.contact-links a svg {
  flex-shrink: 0;
}

.contact-links a.visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-links a:hover {
  background-color: var(--color-secondary);
  color: #ffffff;
  transform: translateY(-2px);
}

/* ── Hero load animation ── */

.hero-animate {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.hero-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scroll fade-in ── */

.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Footer ── */

footer {
  background-color: var(--color-primary);
  text-align: center;
  padding: 2rem 1.5rem;
}

footer p {
  font-size: 0.8rem;
  color: #ffffff;
}

footer p + p {
  margin-top: 0.25rem;
  font-size: 0.74rem;
  color: #ffffff;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  #hero {
    padding: 2.25rem 1.25rem 5rem;
  }

  body {
    font-size: 18px;
  }

  #hero h1 {
    font-size: 2rem;
  }

  .tagline {
    font-size: 0.95rem;
  }

  main > section:not(#hero) {
    padding: 2rem 1.25rem;
  }

  .education-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
  }

  .experience-item {
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.5rem;
  }

  .experience-logo {
    padding-top: 0;
  }

  h2 {
    font-size: 1.35rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  #hero img {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
  }

  .project-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .skills-grid {
    gap: 0.65rem 0.6rem;
  }

  .skill-tag {
    font-size: 0.88rem;
    padding: 0.5rem 1.1rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background-color: var(--color-primary);
    flex-direction: column;
    padding: 0.5rem 0 1rem;
    z-index: 99;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  }

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

  .nav-links a {
    padding: 0.9rem 1.75rem;
    font-size: 0.95rem;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.85);
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 320px) {
  #hero h1 {
    font-size: 1.5rem;
  }
}
