@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap");

:root {
  /* Light mode default */
  --bg: #f6f7f8;
  --surface: #ffffff;

  --text: #1f2327;
  --text-muted: #5b6470;
  --heading: #111418;

  --accent: #1f4a44;
  --accent-soft: rgba(31, 74, 68, 0.12);

  --border: rgba(31, 35, 39, 0.14);

  --pill-bg: rgba(31, 35, 39, 0.06);
  --pill-text: #1f2327;
}

body.dark-mode {
  --bg: #0b1f1d;
  --surface: rgba(255, 255, 255, 0.02);

  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.58);
  --heading: #ffffff;

  --accent: #3d8c7e;
  --accent-soft: rgba(61, 140, 126, 0.20);

  --border: rgba(255, 255, 255, 0.18);

  --pill-bg: rgba(255, 255, 255, 0.08);
  --pill-text: rgba(255, 255, 255, 0.92);
}

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

html {
  overflow-x: hidden;
}

body {
  font-family: "DM Sans", sans-serif;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s, color 0.4s;
  overflow-x: hidden;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(246, 247, 248, 0.80);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.4s;
}

.bar-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
body.dark-mode .topbar { background: rgba(11, 31, 29, 0.80); }

.pdf-download-btn {
  background: #1f4a44 !important;
  color: #ffffff !important;
  border-color: #1f4a44 !important;
  font-weight: 700;
}
.pdf-download-btn:hover { opacity: 0.85; }
.btn-label-mobile { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0 16px;
  height: 34px;
  box-sizing: border-box;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.82em;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s;
}
.btn.active {
  background: rgba(31, 74, 68, 0.28);
  border-color: rgba(31, 74, 68, 0.55);
  transform: translateY(-1px);
}
@media (hover: hover) {
  .btn:hover {
    background: rgba(31, 74, 68, 0.28);
    border-color: rgba(31, 74, 68, 0.55);
    transform: translateY(-1px);
  }
}

.bar-group:first-child { flex: 1; justify-content: flex-start; }
.bar-group:last-child  { flex: 1; display: flex; justify-content: flex-end; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 18px 56px;
}

h1 {
  font-size: 2.1em;
  margin: 10px 0 18px;
  color: var(--heading);
  letter-spacing: -0.4px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface);
}

.full { grid-column: 1 / -1; }

h2 {
  font-size: 1.05em;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
}
h2 i { color: var(--accent); }

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

/* Contact layout */
.contact-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
}

.profile-pic {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(31, 74, 68, 0.55);
  box-shadow: 0 14px 36px rgba(0,0,0,0.35);
}

.contact-details { display: block; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 0.95em;
}
.contact-item i {
  width: 18px;
  text-align: center;
  color: var(--accent);
}
.contact-item a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.contact-item a:hover { border-bottom-color: var(--accent); }

/* Skills */
.skills-block { margin-top: 14px; }
.skills-block:first-of-type { margin-top: 0; }

.skills-title {
  font-size: 0.78em;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 12px 0 10px;
  font-weight: 800;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.skills-list li {
  background: var(--pill-bg);
  color: var(--pill-text);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.86em;
  font-weight: 650;
}

.skills-list li.highlight {
  background: rgba(31, 74, 68, 0.30);
  border-color: rgba(31, 74, 68, 0.55);
  color: #fff;
}

body:not(.dark-mode) .skills-list li.highlight {
  color: #0f2e2b;
}

.languages p { margin: 6px 0; }

@media (max-width: 600px) {
  .topbar {
    padding: 10px 12px;
  }
  .bar-group {
    gap: 4px;
  }
  .btn {
    padding: 0 10px;
    height: 30px;
    font-size: 0.75em;
  }
  .btn-label {
    display: none;
  }
  .btn-label-mobile {
    display: inline;
  }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }

  /* Mobile: center photo + contact list */
  .contact-row {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    align-items: center;
  }
  .profile-pic { margin-bottom: 10px; }

  .contact-details { width: 100%; }
  .contact-item {
    justify-content: center;
  }
}
