:root {
  --text: #142033;
  --muted: #5c6880;
  --line: #d9e2f0;
  --accent: #2450a6;
  --accent-2: #4f7df0;
  --surface: rgba(255, 255, 255, 0.92);
  --shadow: 0 16px 40px rgba(20, 32, 51, 0.08);
  --shadow-soft: 0 10px 24px rgba(36, 80, 166, 0.12);
  --radius: 22px;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.68;
  background:
    radial-gradient(circle at top left, rgba(79, 125, 240, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(36, 80, 166, 0.08), transparent 22%),
    linear-gradient(180deg, #f8fbff 0%, #f3f6fb 100%);
}

main {
  flex: 1;
}

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

a:hover {
  color: #173a7d;
}

.container {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
  background: rgba(248, 251, 255, 0.82);
  border-bottom: 1px solid rgba(217, 226, 240, 0.9);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}

.brand {
  font-weight: 850;
  color: var(--text);
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.95rem;
}

.nav-links a {
  color: #34518d;
  font-weight: 650;
}

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

/* Base layout */

.card {
  background: var(--surface);
  border: 1px solid rgba(217, 226, 240, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

section {
  padding: 14px 0 22px;
}

.hero {
  padding: 54px 0 26px;
}

.section-card {
  padding: 30px;
}

.section-head {
  margin-bottom: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.item {
  padding: 20px;
  border: 1px solid #dbe4f3;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: #c8d8f0;
}

/* Typography */

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.7rem);
}

h2 {
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
}

h3 {
  font-size: 1.08rem;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 68ch;
  margin-bottom: 20px;
}

.muted {
  color: var(--muted);
}

.kicker {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 7px;
}

.list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.list li {
  margin-bottom: 6px;
}

/* Buttons */

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 800;
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 26px rgba(36, 80, 166, 0.22);
}

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

.btn-secondary:hover {
  border-color: #c8d8f0;
  box-shadow: var(--shadow-soft);
}

/* Labels and tags */

.eyebrow {
  display: inline-flex;
  padding: 8px 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf3ff, #f5f8ff);
  color: var(--accent);
  border: 1px solid #dce8ff;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

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

.tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7faff 0%, #edf3fb 100%);
  border: 1px solid #d6e0ef;
  font-size: 0.92rem;
  color: #31425d;
  transition: all 0.18s ease;
}

.tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* Homepage */

.home-hero {
  padding: 72px 0 34px;
}

.home-layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 56px;
  align-items: center;
}

.home-copy {
  max-width: 620px;
}

.home-copy h1 {
  font-size: clamp(3rem, 6vw, 5.6rem);
  margin-bottom: 18px;
}

.home-copy .subtitle {
  font-size: 1.22rem;
  max-width: 58ch;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 22px;
}

.home-links a {
  font-weight: 750;
  color: var(--accent);
  border-bottom: 1px solid rgba(36, 80, 166, 0.28);
}

.home-links a:hover {
  border-bottom-color: var(--accent);
}

.home-profile {
  justify-self: end;
  width: min(100%, 390px);
}

.home-photo-large {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
}

.home-profile-caption {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(217, 226, 240, 0.95);
  box-shadow: 0 10px 24px rgba(20, 32, 51, 0.06);
}

.home-profile-caption h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.home-profile-caption p {
  margin: 4px 0;
  color: var(--muted);
  font-weight: 600;
}

.about-text p {
  margin-top: 0;
}

/* Projects */

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

.project-card p {
  flex: 1;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dbe4f3;
  background: #f8fbff;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 750;
  transition: all 0.18s ease;
}

.project-links a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

/* Publications */

.pub {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.pub:first-child {
  border-top: 0;
  padding-top: 0;
}

.pub a {
  color: var(--text);
}

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

.pub-meta {
  color: var(--muted);
  font-size: 0.98rem;
  margin-top: 4px;
}

/* Contact */

.contact-form {
  display: grid;
  gap: 14px;
}

.input,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid #dbe4f3;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.input:focus,
textarea:focus {
  outline: none;
  border-color: #7ea2f6;
  box-shadow: 0 0 0 4px rgba(79, 125, 240, 0.1);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

/* Skill meters */

.skills-meter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 26px;
}

.skill-meter {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #dbe4f3;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.skill-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  font-weight: 800;
}

.skill-top span:last-child {
  color: var(--accent);
  font-size: 0.92rem;
}

.meter {
  height: 12px;
  border-radius: 999px;
  background: #e8eef8;
  overflow: hidden;
}

.meter div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.skill-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

/* Certificate cards */

.certificate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.certificate-card {
  padding: 16px;
  border: 1px solid #dbe4f3;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.certificate-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: #c8d8f0;
}

.certificate-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #dbe4f3;
  background: #f3f6fb;
  margin-bottom: 14px;
}

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

.certificate-card h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin-bottom: 0;
}

.certificate-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(10, 20, 35, 0.78);
}

.certificate-modal.active {
  display: flex;
}

.certificate-modal img {
  max-width: min(100%, 1100px);
  max-height: 90vh;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.modal-close {
  position: fixed;
  top: 22px;
  right: 28px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* Footer */

.footer {
  padding: 18px 0 20px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.94rem;
}

.footer-card {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

/* Responsive */

@media (max-width: 920px) {
  .home-layout,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .section-card {
    padding: 24px;
  }

  .home-layout {
    gap: 32px;
  }

  .home-profile {
    justify-self: start;
    width: min(100%, 320px);
    order: -1;
  }

  .home-copy h1 {
    font-size: clamp(2.7rem, 11vw, 4rem);
  }

  .skills-meter-grid,
  .certificate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .nav-inner {
    align-items: flex-start;
  }

  .nav-links {
    gap: 10px 14px;
    font-size: 0.88rem;
  }

  .hero {
    padding-top: 30px;
  }

  .home-hero {
    padding: 36px 0 20px;
  }

  .home-profile {
    width: 100%;
  }

  .home-photo-large {
    aspect-ratio: 1 / 1;
  }

  .home-links {
    gap: 10px 14px;
  }

  .subtitle {
    font-size: 1rem;
  }

  .btn {
    width: 100%;
  }

  .hero-actions {
    display: grid;
  }

  .skills-meter-grid,
  .certificate-grid {
    grid-template-columns: 1fr;
  }

  .skill-scale {
    font-size: 0.78rem;
  }
}
