:root {
  --navy: #12224b;
  --blue: #4678bb;
  --blue-deep: #2f5d9e;
  --sky: #9bb5d9;
  --red: #e0302a;
  --white: #fff;
  --ink: #111;
  --nav-h: 80px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--white);
  background: #4a6fb5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
ul { list-style: none; margin: 0; padding: 0; }
a:focus-visible { outline: 3px solid #ffd45c; outline-offset: 3px; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  background: var(--white);
  border: 2px solid var(--blue-deep);
  border-bottom-width: 2px;
}
.navbar__logo { padding-left: clamp(16px, 4.5vw, 64px); }
.navbar__logo img { width: clamp(150px, 15.5vw, 224px); height: auto; }

.navbar__toggle, .navbar__cv-mobile { display: none; }

.navbar__links {
  display: flex;
  gap: clamp(18px, 2.5vw, 36px);
  font-family: "Inter", sans-serif;
  font-size: 16px;
}
.navbar__links a {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.navbar__links a:hover { border-color: rgba(47, 93, 158, .5); }
.navbar__links a.is-active {
  color: var(--blue-deep);
  font-weight: 600;
  border-color: var(--blue-deep);
}

.navbar__cv {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: clamp(0px, 2vw, 40px);
  background: linear-gradient(90deg, #3d6bab, #24497f);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 5.5% 100%, 0 0);
}
.btn-cv {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: var(--white);
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: background .2s;
}
.btn-cv:hover { background: rgba(255,255,255,.25); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 575px;
  overflow: hidden;
  border-bottom: 3px solid var(--white);
  background:
    linear-gradient(rgba(10, 28, 78, .62), rgba(10, 28, 78, .62)),
    url("assets/hero-bg.png") center / cover no-repeat;
}
.hero__text {
  position: relative;
  z-index: 2;
  width: min(54%, 680px);
  padding: 100px 0 80px clamp(24px, 7vw, 100px);
}
.hero h1 {
  margin: 0 0 6px;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  font-size: clamp(36px, 4.4vw, 60px);
  line-height: 1.08;
  text-transform: uppercase;
}
.hero__field {
  margin: 0 0 8px;
  font-family: "Poppins", sans-serif;
  font-size: clamp(18px, 1.7vw, 24px);
}
.hero__uni, .hero__tagline {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: clamp(13px, 1.1vw, 15.5px);
  line-height: 1.55;
}
.hero__uni { margin-bottom: 18px; }
.hero__tagline { max-width: 560px; }

.hero__photo {
  position: absolute;
  z-index: 1;
  bottom: -60px;
  left: 47%;
  width: clamp(380px, 41vw, 590px);
  height: auto;
}

.hero__text > * {
  opacity: 0;
  transform: translateX(-60px);
  animation: slide-in .8s cubic-bezier(.22, .61, .36, 1) forwards;
}
.hero__text > :nth-child(1) { animation-delay: .1s; }
.hero__text > :nth-child(2) { animation-delay: .3s; }
.hero__text > :nth-child(3) { animation-delay: .45s; }
.hero__text > :nth-child(4) { animation-delay: .6s; }

@keyframes slide-in {
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Section titles ---------- */
.section-title {
  position: relative;
  display: inline-block;
  margin: 0 0 44px;
  font-weight: 300;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: .03em;
}
.section-title--upper { text-transform: uppercase; letter-spacing: .01em; }
.section-title--upper::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -10px;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0 70%, transparent);
}

/* ---------- Research ---------- */
.research {
  background: var(--navy);
  border-bottom: 3px solid var(--white);
  padding: 34px clamp(24px, 8vw, 120px) 56px;
  text-align: center;
}
.marquees {
  --gap: 16px;
  display: grid;
  gap: 28px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: clamp(16px, 1.55vw, 22px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee {
  display: flex;
  gap: var(--gap);
  overflow: hidden;
  user-select: none;
}
.marquee__group {
  display: flex;
  flex-shrink: 0;
  min-width: 100%;
  justify-content: space-around;
  gap: var(--gap);
  white-space: nowrap;
  animation: marquee 32s linear infinite;
}
.marquee--reverse .marquee__group { animation-direction: reverse; animation-duration: 28s; }
.marquees:hover .marquee__group { animation-play-state: paused; }
.marquee li { padding: 4px 22px; }
@keyframes marquee {
  to { transform: translateX(calc(-100% - var(--gap))); }
}

/* ---------- Certifications ---------- */
.certs {
  background: var(--blue);
  padding: 60px clamp(24px, 8vw, 120px) 120px;
  text-align: center;
}
.certs .section-title { margin-bottom: 30px; }
.certs__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.certs__list li { width: clamp(150px, 12.5vw, 182px); }
.cert-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255,255,255,.7);
  background: var(--white);
  cursor: zoom-in;
  transition: transform .2s;
}
.cert-thumb:hover { transform: translateY(-4px); }
.cert-thumb:focus-visible { outline: 3px solid #ffd45c; outline-offset: 3px; }
.certs__list img { width: 100%; height: auto; aspect-ratio: 10 / 7; object-fit: cover; }

/* ---------- Contact ---------- */
.contact {
  background: var(--sky);
  min-height: 144px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 40px;
  padding: 24px;
}
.contact__title {
  margin: 0;
  font-weight: 300;
  font-size: 26px;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}
.contact__icons { display: flex; gap: 24px; }
.contact__icons img { width: 66px; height: 66px; object-fit: contain; transition: transform .2s; }
.contact__icons a:hover img { transform: scale(1.08); }

.credit {
  background: var(--sky);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
}

/* ---------- Certificate modal ---------- */
.cert-modal {
  width: min(92vw, 1000px);
  max-height: 92vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.cert-modal::backdrop { background: rgba(6, 14, 36, .85); }
.cert-modal[open] { display: flex; align-items: center; justify-content: center; }
.cert-modal__img {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  background: var(--white);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.cert-modal__close,
.cert-modal__nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.cert-modal__close { top: -14px; right: -14px; z-index: 2; }
.cert-modal__nav { top: 50%; transform: translateY(-50%); }
.cert-modal__nav--prev { left: -22px; }
.cert-modal__nav--next { right: -22px; }
.cert-modal__close:focus-visible,
.cert-modal__nav:focus-visible { outline: 3px solid #ffd45c; outline-offset: 2px; }
@media (max-width: 700px) {
  .cert-modal__nav--prev { left: 6px; }
  .cert-modal__nav--next { right: 6px; }
  .cert-modal__close { top: 6px; right: 6px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --nav-h: 72px; }

  /* Navbar: simple flex row (no grid areas) */
  .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    padding: 0;
  }
  .navbar__logo { padding: 0 0 0 16px; }
  .navbar__cv { display: none; }

  /* Hamburger button (bars are absolutely positioned so Safari can't collapse them) */
  .navbar__toggle {
    display: block;
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-right: 12px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
  }
  .navbar__toggle span {
    position: absolute;
    left: 10px;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: var(--navy);
    transition: transform .3s, top .3s, opacity .2s;
  }
  .navbar__toggle span:nth-child(1) { top: 13px; }
  .navbar__toggle span:nth-child(2) { top: 21px; }
  .navbar__toggle span:nth-child(3) { top: 29px; }
  .navbar__toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
  .navbar__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .navbar__toggle[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }
  .navbar__toggle:focus-visible { outline: 3px solid var(--blue-deep); outline-offset: 2px; }

  /* Dropdown panel */
  .navbar__links {
    position: absolute;
    top: 100%;
    left: -2px;
    right: -2px;
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
    background: #14264f;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .25);
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateY(-8px);
    transform: translateY(-8px);
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .navbar__links.is-open {
    opacity: 1;
    visibility: visible;
    -webkit-transform: none;
    transform: none;
  }
  .navbar__links a {
    padding: 14px 4px;
    border-bottom: 1px solid #e3e8f2;
    font-size: 17px;
    color: var(--white);
  }
  .navbar__links a.is-active { color: #9fc0f2; border-bottom-color: #9fc0f2; }
  .navbar__links .navbar__cv-mobile {
    display: block;
    margin-top: 14px;
    padding: 12px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--blue-deep);
    color: var(--white);
    text-align: center;
  }

  .hero { min-height: 0; display: flex; flex-direction: column; }
  .hero__text { width: 100%; padding: 48px 24px 0; }
  .hero__photo { position: relative; left: auto; bottom: -1px; align-self: center; width: min(420px, 90%); margin-top: 20px; }
  .certs { padding-bottom: 72px; }
}
@media (max-width: 520px) {
  .contact__icons { gap: 16px; }
  .contact__icons img { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .hero__text > * { opacity: 1; transform: none; animation: none; }
  .page-hero h1 { animation: none; }
  .edu-card { opacity: 1; transform: none; animation: none; }
  .marquees { -webkit-mask-image: none; mask-image: none; }
  .marquee { flex-wrap: wrap; justify-content: center; }
  .marquee__group { animation: none; flex-wrap: wrap; justify-content: center; min-width: 0; }
  .marquee__group[aria-hidden="true"] { display: none; }
  .edu-card, .about__panel { opacity: 1; transform: none; animation: none; }
}


/* ---------- Education page ---------- */
.page-hero {
  display: grid;
  place-items: center;
  min-height: clamp(170px, 22vw, 315px);
  border-bottom: 3px solid var(--white);
  background:
    linear-gradient(rgba(10, 28, 78, .55), rgba(10, 28, 78, .55)),
    url("assets/others-bg.png") center / cover no-repeat;
}
.page-hero h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 900;
  font-size: clamp(48px, 8.4vw, 118px);
  line-height: 1.1;
  text-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  animation: fade-in 1s ease-out both;
}
.edu {
  display: grid;
  gap: 14px;
  padding: 44px clamp(16px, 8vw, 110px) 46px;
  background: var(--blue);
}
.edu-card {
  display: flex;
  align-items: center;
  padding: 26px clamp(20px, 3.4vw, 46px);
  border-radius: clamp(36px, 5vw, 66px);
  background: var(--navy);
  opacity: 0;
  transform: translateY(24px);
  animation: rise-in .7s cubic-bezier(.22, .61, .36, 1) forwards;
}
.edu-card:nth-child(1) { animation-delay: .15s; }
.edu-card:nth-child(2) { animation-delay: .3s; }
.edu-card:nth-child(3) { animation-delay: .45s; }
@keyframes rise-in { to { opacity: 1; transform: none; } }

.edu-card__logo {
  flex: 0 0 auto;
  width: clamp(96px, 13vw, 177px);
  aspect-ratio: 1;
  border: 2px solid var(--blue);
  background: var(--white);
}
.edu-card__logo img { width: 100%; height: 100%; object-fit: contain; }
.edu-card__body {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: clamp(18px, 2.2vw, 30px);
  padding: 8px 0 8px clamp(18px, 2.2vw, 30px);
  border-left: 1px solid rgba(255, 255, 255, .55);
  font-family: "Inter", sans-serif;
}
.edu-card__body h2 {
  margin: 0 0 14px;
  font-weight: 300;
  font-size: clamp(20px, 2.5vw, 34px);
  line-height: 1.25;
}
.edu-card__body p {
  margin: 0 0 10px;
  font-size: clamp(14px, 1.65vw, 22px);
  line-height: 1.5;
}
.edu-card__body p:last-child { margin-bottom: 0; }

@media (max-width: 700px) {
  .edu-card { flex-direction: column; text-align: center; padding: 28px 22px; }
  .edu-card__body {
    margin: 20px 0 0;
    padding: 18px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .55);
  }
}

/* ---------- Experience page ---------- */
.exp { padding: 16px clamp(10px, 2.4vw, 32px) 20px; background: var(--blue); }
.exp__panel {
  display: grid;
  gap: 14px;
  padding: clamp(14px, 2.2vw, 30px) clamp(12px, 5.8vw, 78px);
  border-radius: clamp(28px, 4.5vw, 60px);
  background: var(--white);
}
.exp .edu-card__body p:nth-of-type(2) { line-height: 1.45; }
.exp .edu-card__logo img { padding: 4px; }

/* ---------- About page ---------- */
.about { padding: 14px clamp(10px, 3.2vw, 42px) 18px; background: var(--blue); }
.about__panel {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(28px, 6vw, 78px) clamp(20px, 6vw, 80px);
  border-radius: clamp(32px, 5.5vw, 72px);
  background: var(--white);
  color: #111;
  opacity: 0;
  transform: translateY(24px);
  animation: rise-in .8s cubic-bezier(.22, .61, .36, 1) .15s forwards;
}
.about__photos {
  position: relative;
  width: 100%;
  aspect-ratio: 340 / 680;
}
.about__photo { position: absolute; display: block; object-fit: cover; }
.about__photo--1 { left: 0; top: 0; width: 63.8%; height: 30.7%; }
.about__photo--2 { left: 0; top: 32.8%; width: 40.9%; height: 36%; }
.about__photo--3 { left: 41.2%; top: 32.1%; width: 58.8%; height: 52.2%; }
.about__photo--4 { left: 0; top: 71%; width: 58.8%; height: 28.5%; }

.about__text {
  align-self: stretch;
  padding: 8px 0 8px clamp(20px, 3vw, 40px);
  border-left: 1px solid #555;
  font-family: "Playfair Display", Georgia, serif;
}
.about__text h2 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.about__text p {
  margin: 0 0 8px;
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 2.05;
}
.about__text strong { font-weight: 700; }

@media (max-width: 800px) {
  .about__panel { grid-template-columns: 1fr; }
  .about__photos { max-width: 340px; margin: 0 auto; }
  .about__text { padding: 20px 0 0; border-left: 0; border-top: 1px solid #999; }
}



/* publication page */

.thesis-poster {
  position: relative;
  margin: 0 70px;
  padding: 24px 16px 28px;
  background: #4a6fb5;
  font-family: Georgia, "Times New Roman", serif;
  color: #f2f4fa;
}

.thesis-poster__img {
  display: flex;
  justify-content: center;
}

.thesis-badge {
  padding: 8px 44px;
  background: #fff;
  color: #101a33;
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  border-radius: 14px 0 14px 0;
  white-space: nowrap;
  margin: 0 auto 24px;
  display: inline-block;
}

.thesis-panel {
  background: #14264f;
  border: 2px solid #fff;
  border-radius: 18px;
  padding: 56px clamp(18px, 4vw, 40px) 34px;
}

.thesis-title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  line-height: 1.4;
}

.thesis-abstract {
  margin: 0;
  padding-bottom: 20px;
  text-align: justify;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  font-weight: 700;
  line-height: 1.55;
}

.thesis-figures {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.thesis-fig {
  background: #fff;
  border-radius: 4px;
  padding: 10px;
}

.thesis-fig img {
  display: block;
  width: 100%;
  height: auto;
}

.thesis-fig-wide {
  max-width: 40%;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .thesis-figures { grid-template-columns: 1fr; }
  .thesis-badge { padding: 6px 24px; }
  .thesis-poster { margin: 0 10px; padding: 10px 16px 10px; }
  .thesis-panel { padding: 15px clamp(18px, 4vw, 40px) 15px; }
  .thesis-fig-wide { max-width: 100%; }
}