/* =========================================
   IMPORT FONTS
========================================= */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&family=DM+Serif+Display:ital@0;1&display=swap");

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

/* =========================================
   ROOT VARIABLES
========================================= */
:root {
  --ink:        #0d1117;
  --ink-soft:   #4b5563;
  --ink-muted:  #9ca3af;
  --accent:     #1d4ed8;
  --accent-light: #eff6ff;
  --accent-mid: #93c5fd;

  --bg:         #f9fafb;
  --surface:    #ffffff;
  --border:     #e5e7eb;
  --border-strong: #d1d5db;

  --shadow-xs:  0 1px 3px rgba(0,0,0,.06);
  --shadow-sm:  0 4px 16px rgba(0,0,0,.07);
  --shadow-md:  0 12px 32px rgba(0,0,0,.1);
  --shadow-lg:  0 24px 60px rgba(0,0,0,.13);

  --radius-sm:  0.75rem;
  --radius-md:  1rem;
  --radius-lg:  1.5rem;
  --radius-xl:  2rem;

  --ease: cubic-bezier(.25,.46,.45,.94);
  --transition: all 0.3s var(--ease);

  --nav-h: 72px;
}

/* =========================================
   GLOBAL
========================================= */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  font-size: 16px;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

section {
  padding: 7rem clamp(1.5rem, 8%, 10rem);
}

img { display: block; max-width: 100%; }

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

ul { list-style: none; }

button, input, textarea { font-family: inherit; }

p { color: var(--ink-soft); }

/* =========================================
   SCROLLBAR
========================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =========================================
   SECTION LABELS
========================================= */
.section__text__p1 {
  text-align: center;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.title {
  font-family: "DM Serif Display", serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 1rem;
  line-height: 1.15;
  color: var(--ink);
}

/* =========================================
   NAVBAR
========================================= */
nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--nav-h);
  padding: 0 clamp(1.5rem, 8%, 10rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(249,250,251,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: var(--transition);
}

nav.scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: var(--shadow-xs);
}

.logo {
  font-family: "DM Serif Display", serif;
  font-size: 1.65rem;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.logo-dot { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.25s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0%; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.28s var(--ease);
}

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

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* =========================================
   HAMBURGER
========================================= */
#hamburger-nav { display: none; }

.hamburger-menu { position: relative; }

.hamburger-icon {
  width: 28px; height: 20px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger-icon span {
  width: 100%; height: 2.5px;
  background: var(--ink);
  border-radius: 999px;
  transition: var(--transition);
}

.hamburger-icon.open span:first-child  { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-icon.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-icon.open span:last-child   { transform: rotate(-45deg) translate(5px, -5px); }

.menu-links {
  position: absolute;
  top: calc(100% + 1rem);
  right: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s var(--ease);
}

.menu-links.open { max-height: 400px; }

.menu-links li { border-bottom: 1px solid var(--border); }
.menu-links li:last-child { border-bottom: none; }

.menu-links a {
  display: block;
  padding: 0.95rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s;
}

.menu-links a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* =========================================
   HERO
========================================= */
#profile {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(3rem, 8vw, 7rem);
  padding-top: calc(var(--nav-h) + 3rem);
  position: relative;
  overflow: hidden;
}

.hero-bg-shape {
  position: absolute;
  top: -10%; right: -5%;
  width: 55vw; height: 55vw;
  max-width: 700px; max-height: 700px;
  background: radial-gradient(circle, rgba(29,78,216,.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Profile Image */
.section__pic-container {
  position: relative;
  width: min(400px, 85vw);
  aspect-ratio: 1/1;
  flex-shrink: 0;
  z-index: 1;
}

.pic-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed rgba(29,78,216,.25);
  animation: spin 20s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.section__pic-container img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-lg);
  transition: transform 0.5s var(--ease);
}

.section__pic-container img:hover { transform: scale(1.03); }

/* Hero Text */
.section__text {
  max-width: 580px;
  z-index: 1;
}

.greeting {
  font-size: 1rem;
  color: var(--ink-muted);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-family: "DM Serif Display", serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.05;
  margin-bottom: 1rem;
  color: var(--ink);
}

.hero-name em {
  font-style: italic;
  color: var(--accent);
}

.hero-role {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--ink-soft);
  font-weight: 400;
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

/* =========================================
   BUTTONS
========================================= */
.btn-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  border: none;
  border-radius: 999px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, color 0.25s;
}

.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(0); }

.btn-solid {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-solid:hover { background: var(--accent); box-shadow: var(--shadow-md); }

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

.btn-sm { padding: 0.55rem 1.25rem; font-size: 0.82rem; }

/* =========================================
   SOCIAL ICONS
========================================= */
#socials-container {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-link {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.social-link img {
  width: 20px; height: 20px;
  object-fit: contain;
}

.social-link:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

/* =========================================
   ABOUT
========================================= */
#about { background: var(--surface); }

.about-containers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.details-container {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.details-container:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-mid);
}

.details-icon-wrap {
  width: 56px; height: 56px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}

.details-icon-wrap .icon {
  width: 28px; height: 28px;
  object-fit: contain;
}

.details-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.details-container p {
  font-size: 0.9rem;
}

.cert-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}
.cert-link:hover { opacity: 0.75; }

.about-text {
  max-width: 760px;
  margin: 3.5rem auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-text p { font-size: 1.02rem; line-height: 1.8; }

/* =========================================
   SKILLS
========================================= */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 3.5rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  transition: var(--transition);
  cursor: default;
}

.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-mid);
}

.skill-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.skill-level {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}

.skill-level.advanced {
  background: #dcfce7;
  color: #15803d;
}

.skill-level.intermediate {
  background: #fef9c3;
  color: #a16207;
}

.skill-level.professional {
  background: var(--accent-light);
  color: var(--accent);
}

/* =========================================
   PROJECTS
========================================= */
#projects { background: var(--surface); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 2rem;
  margin-top: 3.5rem;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* Image wrapper for uniform height */
.project-img-wrap {
  width: 100%;
  height: 230px;
  overflow: hidden;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s var(--ease);
}

.project-card:hover .project-img { transform: scale(1.05); }

/* Slider */
.image-slider {
  position: relative;
  width: 100%;
  height: 230px;
  overflow: hidden;
  background: #e5e7eb;
}

.image-slider .slide {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.image-slider .slide.active { opacity: 1; }

.image-slider .prev,
.image-slider .next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xs);
}

.image-slider .prev:hover,
.image-slider .next:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.image-slider .prev { left: 10px; }
.image-slider .next { right: 10px; }

.slide-dots {
  position: absolute;
  bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
  z-index: 10;
}

.slide-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transition: background 0.25s, width 0.25s;
  cursor: pointer;
}

.slide-dots span.active {
  background: #fff;
  width: 16px;
  border-radius: 3px;
}

/* Project Content */
.project-content {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.8rem;
}

.project-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.project-description {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

.project-description.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  padding: 0;
  transition: opacity 0.2s;
}
.read-more-btn:hover { opacity: 0.7; }

.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tools span {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.project-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

/* =========================================
   CONTACT
========================================= */
.contact-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 3.5rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  transition: var(--transition);
  cursor: pointer;
  min-width: 300px;
}

.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-mid);
}

.contact-icon-wrap {
  width: 48px; height: 48px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.contact-icon-wrap .icon {
  width: 24px; height: 24px;
  object-fit: contain;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  overflow: hidden;
}

.contact-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--ink-muted);
}

.contact-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-arrow {
  font-size: 1.2rem;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: color 0.2s, transform 0.25s;
}

.contact-card:hover .contact-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* =========================================
   FOOTER
========================================= */
footer {
  background: var(--ink);
  padding: 2.5rem clamp(1.5rem, 8%, 10rem);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: "DM Serif Display", serif;
  font-size: 1.4rem;
  color: #fff;
}

footer p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
}

/* =========================================
   TABLET  ≤ 1024px
========================================= */
@media screen and (max-width: 1024px) {
  :root { --nav-h: 68px; }

  #desktop-nav { display: none; }

  #hamburger-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  section { padding: 6rem clamp(1.25rem, 6%, 5rem); }

  #profile {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
    min-height: auto;
    padding-top: calc(var(--nav-h) + 3.5rem);
  }

  .section__pic-container { width: min(320px, 75vw); }

  .hero-name { font-size: clamp(2.5rem, 7vw, 4rem); }

  .btn-container,
  #socials-container { justify-content: center; }

  .about-containers {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
  }
}

/* =========================================
   MOBILE  ≤ 768px
========================================= */
@media screen and (max-width: 768px) {
  :root { --nav-h: 64px; }

  section { padding: 5rem 1.25rem; }

  nav { padding: 0 1.25rem; }

  .logo { font-size: 1.5rem; }

  #profile {
    gap: 2.5rem;
    padding-top: calc(var(--nav-h) + 2.5rem);
  }

  .section__pic-container { width: min(260px, 80vw); }

  .hero-name { font-size: clamp(2.2rem, 9vw, 3rem); }

  .hero-role { font-size: 1rem; }

  .btn { width: 100%; justify-content: center; }
  .btn-container { flex-direction: column; gap: 0.75rem; }

  .about-containers {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 400px;
    margin: 3rem auto 0;
  }

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

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

  .contact-card {
    min-width: unset;
    width: 100%;
  }

  .contact-container { flex-direction: column; align-items: stretch; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* =========================================
   SMALL MOBILE  ≤ 480px
========================================= */
@media screen and (max-width: 480px) {
  :root { --nav-h: 60px; }

  section { padding: 4.5rem 1rem; }

  nav { padding: 0 1rem; }

  .logo { font-size: 1.35rem; }

  .section__text__p1 { font-size: 0.68rem; letter-spacing: 2px; }

  .title { font-size: 1.85rem; }

  .section__pic-container { width: min(230px, 82vw); }

  .hero-name { font-size: 2.1rem; }

  .greeting { font-size: 0.9rem; }

  .hero-role { font-size: 0.92rem; margin-bottom: 1.5rem; }

  .pic-ring { display: none; }

  .skills-container { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .skill-card { padding: 1.25rem 1rem; }
  .skill-card h3 { font-size: 0.88rem; }

  .image-slider, .project-img-wrap { height: 195px; }

  .project-content { padding: 1.25rem; }
  .project-content h3 { font-size: 1rem; }
  .project-description { font-size: 0.84rem; }
  .project-tools span { font-size: 0.68rem; }

  .contact-card { padding: 1.25rem; }
  .contact-value { font-size: 0.82rem; }

  .details-container { padding: 1.5rem 1rem; }

  .btn { min-height: 48px; padding: 0.75rem 1.25rem; font-size: 0.88rem; }
  .btn-sm { padding: 0.5rem 1rem; font-size: 0.78rem; }
}