:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --text: #1a1a1a;
  --muted: #666666;
  --border: #e4e4e0;
  --accent: #0f766e;
  --accent-dark: #0b5a54;
  --coral: #ff6b6b;
  --shadow: 0 12px 35px rgba(20, 35, 33, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

section {
  padding: 105px 8%;
  scroll-margin-top: 75px;
}

/* Navigation */

nav {
  position: fixed;
  z-index: 1000;
  top: 0;
  width: 100%;
  padding: 18px 8%;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.nav-container {
  display: flex;
  max-width: 1280px;
  margin: auto;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.nav-toggle {
  display: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  margin: 5px;
  background: var(--text);
}

/* Hero */

.hero {
  display: grid;
  min-height: 100vh;
  max-width: 1280px;
  margin: auto;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 60px;
}

.hero h1 {
  max-width: 680px;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.04;
  letter-spacing: -3px;
}

.hero-subtitle {
  margin-top: 22px;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
}

.hero-description {
  max-width: 630px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 1.05rem;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.cta-primary,
.submit-btn,
.cv-download-btn {
  display: inline-block;
  padding: 13px 23px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cta-primary:hover,
.submit-btn:hover,
.cv-download-btn:hover {
  background: var(--accent-dark);
}

.cta-secondary {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
}

.cta-secondary:hover {
  color: white;
}

.profile-container {
  position: relative;
  width: min(360px, 75vw);
  aspect-ratio: 1;
  margin: auto;
}

.profile-main {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 38% 62% 59% 41% / 43% 44% 56% 57%;
  background: #d9f1ec;
  place-items: center;
}

.profile-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-main input {
  position: absolute;
  bottom: 15px;
  left: 15px;
  width: 42px;
  opacity: 0;
  cursor: pointer;
}

.profile-accent {
  position: absolute;
  right: -25px;
  bottom: -25px;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 47% 53% 38% 62% / 60% 40% 60% 40%;
  background: var(--coral);
}

/* Shared headings */

.section-header {
  max-width: 760px;
  margin: 0 auto 50px;
  text-align: center;
}

.section-number {
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
}

.section-title {
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  letter-spacing: -1.6px;
}

.section-description {
  margin-top: 10px;
  color: var(--muted);
}

/* About */

.about-content {
  display: grid;
  max-width: 1100px;
  margin: auto;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: center;
  gap: 70px;
}

.about-text {
  color: var(--muted);
  font-size: 1.05rem;
}

.stats-grid {
  display: grid;
  margin-top: 35px;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.stat-item,
.skill-card,
.contact-form {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
  box-shadow: var(--shadow);
}

.stat-item {
  padding: 23px;
}

.stat-number {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 800;
}

.stat-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
}

.about-visual {
  display: grid;
  gap: 18px;
}

.visual-element {
  height: 82px;
  border-radius: 12px;
  background: linear-gradient(125deg, #d9f1ec, #fff3ee);
}

.visual-element:nth-child(2) {
  width: 76%;
  margin-left: auto;
  background: linear-gradient(125deg, #ffe0d8, #ffffff);
}

.visual-element:nth-child(3) {
  width: 58%;
  background: linear-gradient(125deg, #e4f3ef, #ffffff);
}

/* Skills */

.skills-grid {
  display: grid;
  max-width: 1180px;
  margin: auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-card {
  padding: 29px;
}

.skill-icon {
  display: block;
  margin-bottom: 14px;
  font-size: 2rem;
}

.skill-title {
  font-size: 1.1rem;
}

.skill-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Projects */

.projects-carousel {
  max-width: 1180px;
  margin: auto;
}

.carousel-container {
  position: relative;
  overflow: hidden;
}

.carousel-wrapper {
  display: flex;
  gap: 25px;
  transition: transform 0.4s ease;
}

.carousel-slide {
  min-width: 280px;
}

.project-card {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.project-card:hover {
  transform: translateY(-6px);
}

.project-image {
  height: 180px;
  overflow: hidden;
  background: var(--bg-soft);
}

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

.project-content {
  padding: 20px;
}

.project-title {
  font-size: 1.08rem;
}

.project-description {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.project-tech,
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tech-tag,
.skill-tag {
  padding: 4px 9px;
  border-radius: 999px;
  background: #e5f3f0;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 600;
}

.carousel-nav {
  position: absolute;
  top: 45%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d6d6d1;
  cursor: pointer;
}

.dot.active {
  background: var(--accent);
}

/* Publications — compact academic list */

#publications {
  padding-top: 75px;
  padding-bottom: 75px;
  background: var(--bg-soft);
}

#publications .section-header {
  margin-bottom: 25px;
}

.publications-list {
  max-width: 950px;
  margin: auto;
}

.publication-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.publication-item:first-child {
  border-top: 1px solid var(--border);
}

.publication-item h3 {
  font-size: 1rem;
  line-height: 1.45;
}

.publication-item p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.publication-item a {
  margin-left: 4px;
  color: var(--accent);
  font-weight: 700;
}

/* Contact */

.contact-container {
  display: grid;
  max-width: 1050px;
  margin: auto;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 55px;
}

.contact-info h3 {
  font-size: 1.5rem;
}

.contact-info > p {
  margin-top: 9px;
  color: var(--muted);
}

.contact-links {
  display: grid;
  gap: 12px;
  margin-top: 25px;
}

.contact-link {
  display: block;
  padding: 15px;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
}

.contact-link span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.contact-form {
  padding: 28px;
}

.form-group {
  margin-bottom: 17px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.87rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font: inherit;
}

.form-group textarea {
  resize: vertical;
}

/* CV modal */

.cv-modal {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: none;
  overflow-y: auto;
  padding: 35px 15px;
  background: rgba(0, 0, 0, 0.55);
}

.cv-modal.active {
  display: block;
}

.cv-content {
  max-width: 900px;
  margin: auto;
  overflow: hidden;
  border-radius: 13px;
  background: white;
}

.cv-header {
  position: relative;
  padding: 36px;
  background: var(--accent);
  color: white;
}

.cv-close {
  position: absolute;
  top: 15px;
  right: 18px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

.cv-body {
  padding: 35px;
}

.cv-section {
  margin-bottom: 28px;
}

.cv-section h3 {
  margin-bottom: 13px;
  color: var(--accent);
}

.cv-item {
  margin-bottom: 16px;
}

.company,
.date {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer and animation */

footer {
  padding: 26px;
  background: #173c39;
  color: white;
  text-align: center;
  font-size: 0.85rem;
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: 0.6s ease;
}

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

/* Responsive */

@media (max-width: 850px) {
  .hero,
  .about-content,
  .contact-container {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 130px;
  }

  .hero-visual {
    display: none;
  }

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

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 73px;
    left: 0;
    display: none;
    width: 100%;
    padding: 20px 8%;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    background: white;
  }

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

@media (max-width: 560px) {
  section {
    padding: 82px 6%;
  }

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

  .publication-item {
    padding: 14px 0;
  }
}
