:root {
  color-scheme: light dark;
  --bg: light-dark(#f7f9fc, #070b12);
  --surface: light-dark(#ffffff, #0d131d);
  --surface2: light-dark(#eef3f8, #111a27);
  --text: light-dark(#101722, #f3f7fb);
  --muted: light-dark(#5d6b7c, #9ba9ba);
  --line: light-dark(#dce4ed, #223043);
  --accent: #62d8ff;
  --accent2: #8b7cff;
  --max: 1120px;
}

* {
  box-sizing: border-box;
  user-select: none;
  transition: .3s;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px

}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

#app {
  min-height: 100vh;
  background: var(--bg);
}

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

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

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo {
  font-weight: 800;
  letter-spacing: -.04em;
  font-size: 20px;
}

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

.nav-links {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

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

.theme-toggle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s;
}

.theme-toggle:hover {
  transform: translateY(-2px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  padding: 96px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

.hero h1 {
  font-size: clamp(48px, 7.2vw, 86px);
  line-height: 1.02;
  letter-spacing: -.065em;
  margin: 22px 0 22px;
  max-width: 960px;
}

.gradient {
  background: linear-gradient(110deg, var(--text), var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


.hero p {
  font-size: clamp(18px, 2.2vw, 23px);
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 32px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-weight: 650;
  font-size: 14px;
  transition: .2s;
  cursor: pointer;
}

.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

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

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

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 520px);
  justify-content: space-between;
  align-items: end;
  gap: 50px;
  margin-bottom: 38px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11px;
  color: var(--accent);
  font-weight: 800;
}

h2 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -.05em;
  margin: 8px 0 0;
}

.lead {
  max-width: 520px;
  color: var(--muted);
  margin: 0;
}

/* Filter Buttons */
.filter-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 70px;
  align-items: start;
}

.about-copy {
  font-size: 19px;
  line-height: 1.7;
  color: var(--muted);
}

.about-copy p {
  margin-top: 0;
  margin-bottom: 16px;
}

.about-copy strong {
  color: var(--text);
}

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

.stat {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.stat b {
  font-size: 26px;
  display: block;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat span {
  font-size: 13px;
  color: var(--muted);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  transition: .3s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 90%, var(--line));
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.number {
  font-size: 12px;
  color: var(--muted);
}

.card h3 {
  font-size: 18px;
  letter-spacing: -.035em;
  margin: 10px 0 10px;
}

.card p {
  color: var(--muted);
  margin: 0 0 10px;
  font-size: 12px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.tag {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--surface2);
  color: var(--muted);
}

.card-link {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

.skill {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.skill h3 {
  font-size: 15px;
  margin: 0 0 10px;
}

.skill p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.timeline {
  border-left: 1px solid var(--line);
  padding-left: 28px;
  display: grid;
  gap: 34px;
}

.role {
  position: relative;
}

.role:before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  left: -33px;
  top: 8px;
}

.role-meta {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
}

.role h3 {
  margin: 4px 0;
  font-size: 22px;
}

.role-location {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.role p {
  color: var(--muted);
  max-width: 760px;
  margin: 0;
}

/* Grid layout for Certs and Courses */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: .25s;
}

.card-box:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateY(-3px);
}

.card-platform {
  font-size: 12px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.card-box h3 {
  font-size: 20px;
  margin: 8px 0 4px;
  letter-spacing: -.02em;
}

.card-duration {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.card-box p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  flex-grow: 1;
}

.card-action {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  width: fit-content;
  padding-bottom: 2px;
}

.card-action:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  align-items: end;
  gap: 50px;
}

.contact p {
  color: var(--muted);
  max-width: 600px;
}

.email {
  font-size: clamp(20px, 3.5vw, 36px);
  font-weight: 750;
  letter-spacing: -.04em;
  border-bottom: 1px solid var(--text);
  word-break: break-all;
}

.social-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.social-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  transition: .2s;
}

.social-btn:hover {
  background: var(--text);
  color: var(--bg);
}

footer {
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
}

.menu {
  display: none;
}

/* Custom CV Section Styles using your site's Native CSS Variables */
.hidden {
  display: none !important;
}

.cv-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px;
  display: grid;
  gap: 32px;
  font-size: 14px;
}

.cv-header-row {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.cv-header-row h3 {
  font-size: 28px;
  margin: 0 0 4px;
  letter-spacing: -.03em;
}

.cv-subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.cv-contact-info {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  line-height: 1.6;
}

.cv-social-links {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 6px;
}

.cv-social-links a {
  color: var(--text);
  font-weight: 600;
}

.cv-block {
  display: grid;
  gap: 8px;
}

.cv-kicker {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  font-family: tahoma, monospace;
}

.cv-block p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.cv-tech-list {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.cv-tech-list strong {
  color: var(--text);
}

.cv-timeline {
  border-left: 2px solid var(--line);
  padding-left: 20px;
  display: grid;
  gap: 24px;
}

.cv-item-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text);
}

.cv-item-head h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.cv-date {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.cv-sublocation {
  font-size: 12px;
  color: var(--muted);
}

.cv-item ul, .cv-projects-list ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.cv-projects-list {
  display: grid;
  gap: 20px;
}

.cv-project-item h4 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

/* PDF Viewer Card */
.pdf-viewer-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  margin-bottom: 32px;
}

/* Header inside viewer */
.pdf-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  padding-left: 8px;
  padding-right: 8px;
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
}

.pdf-download-link {
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pdf-download-link:hover {
  color: var(--accent);
}

.pdf-viewer-actions {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.pdf-viewer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.pdf-viewer-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Embed PDF Wrapper */
.pdf-viewer-frame-wrap {
  width: 100%;
  height: 800px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* Project Details Modal */
.project-modal {
  --modal-backdrop: light-dark(rgba(16, 23, 34, 0.32), rgba(3, 7, 18, 0.78));
  --modal-surface: light-dark(rgba(255, 255, 255, 0.97), rgba(13, 17, 23, 0.96));
  --modal-text: light-dark(#101722, #f0f4f8);
  --modal-close-text: light-dark(#101722, #fff);
  --modal-border: light-dark(rgba(8, 126, 155, 0.22), rgba(0, 240, 255, 0.25));
  --modal-shadow: 0 25px 100px light-dark(rgba(16, 23, 34, 0.2), rgba(0, 0, 0, 0.5)),
    0 0 35px light-dark(rgba(8, 126, 155, 0.08), rgba(0, 240, 255, 0.08));
  --modal-close-border: light-dark(rgba(16, 23, 34, 0.15), rgba(255, 255, 255, 0.15));
  --modal-close-surface: light-dark(rgba(16, 23, 34, 0.04), rgba(255, 255, 255, 0.06));
  --modal-hover: light-dark(rgba(98, 216, 255, 0.22), rgba(0, 240, 255, 0.15));
  --modal-accent: light-dark(#087e9b, #00f0ff);
  --modal-body-text: light-dark(#5d6b7c, #aab4c3);
  --modal-detail-text: light-dark(#435164, #c4ceda);
  --modal-detail-border: light-dark(rgba(8, 126, 155, 0.2), rgba(0, 240, 255, 0.15));
  --modal-tech-text: light-dark(#176477, #b9f8ff);
  --modal-tech-surface: light-dark(rgba(98, 216, 255, 0.12), rgba(0, 240, 255, 0.06));
  --modal-tech-border: light-dark(rgba(8, 126, 155, 0.22), rgba(0, 240, 255, 0.2));
  --modal-link-surface: light-dark(#62d8ff, #00f0ff);
  --modal-secondary-text: light-dark(#087e9b, #b9f8ff);
  --modal-secondary-border: light-dark(rgba(8, 126, 155, 0.35), rgba(0, 240, 255, 0.35));

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.project-modal__content {
  position: relative;
  width: min(100%, 680px);
  max-height: 85vh;
  overflow-y: auto;
  padding: clamp(24px, 5vw, 44px);
  color: var(--modal-text);
  background: var(--modal-surface);
  border: 1px solid var(--modal-border);
  border-radius: 20px;
  box-shadow: var(--modal-shadow);
  transform: translateY(25px) scale(0.6);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-modal.is-open .project-modal__content {
  transform: translateY(0) scale(1);
}

.project-modal__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--modal-close-border);
  border-radius: 50%;
  background: var(--modal-close-surface);
  color: var(--modal-close-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.project-modal__close:hover {
  background: var(--modal-hover);
  transform: rotate(90deg);
}

.project-modal__category {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--modal-accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: capitalize;
}

.project-modal__content h2 {
  margin: 0 40px 16px 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.2;
}

.project-modal__content p {
  margin: 0;
  color: var(--modal-body-text);
}

.project-modal__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.project-modal__tech span {
  padding: 7px 12px;
  border: 1px solid var(--modal-tech-border);
  border-radius: 999px;
  color: var(--modal-tech-text);
  background: var(--modal-tech-surface);
  font-size: 0.8rem;
}

.project-modal__link {
  display: inline-block;
  padding: 12px 12px;
  border-radius: 8px;
  background: var(--modal-link-surface);
  color:var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.project-modal__link:hover {
  transform: translateY(-2px);
}

.project-modal__link[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

/* Project Details Sections */
.project-modal__header {
  padding-right: 35px;
  margin-bottom: 28px;
}

.project-modal__subtitle {
  margin-top: 10px;
  font-size: 1rem;
  opacity: 0.85;
}

.project-modal__section{
  padding: 18px 0;
}

.project-modal__section h3 {
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--modal-accent);
}

.project-modal__section ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-modal__section li {
  position: relative;
  padding-left: 24px;
  color: var(--modal-detail-text);
}

.project-modal__section li::before {
  position: absolute;
  left: 0;
  color: var(--modal-accent);
  content: "✓";
  font-weight: 700;
}

.project-modal__preview {
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--modal-detail-border);
  border-radius: 14px;
}

.project-modal__preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: cover;
}

.project-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.project-modal__link--secondary {
  color: var(--modal-secondary-text);
  background: transparent;
  border: 1px solid var(--modal-secondary-border);
}

.project-modal__actions [hidden],
.project-modal__preview[hidden],
.project-modal__section[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .project-modal,
  .project-modal__content,
  .project-modal__close,
  .project-modal__link {
    transition: none;
  }
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .menu {
    display: block;
    background: none;
    border: 0;
    color: var(--text);
    font-size: 22px;
  }

  .hero {
    padding: 72px 0;
    min-height: auto;
  }

  .about-grid,
  .projects,
  .grid-cards,
  .contact,
  .section-head {
    grid-template-columns: 1fr;
  }

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

  .section {
    padding: 78px 0;
  }

  .section-head {
    display: grid;
    gap: 18px;
  }
  .stats {
  grid-template-columns: 1fr;
}


  .lead {
    margin-top: 18px;
  }

  .container {
    width: min(var(--max), calc(100% - 28px));
  }

  .nav-links.mobile-open {
    display: flex;
    position: absolute;
    top: 72px;
    left: 14px;
    right: 14px;
    padding: 18px;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .cv-contact-info {
    text-align: left;
  }

  .cv-social-links {
    justify-content: flex-start;
  }

  .cv-card {
    padding: 24px;
  }

}

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

  .hero h1 {
    font-size: 48px;
  }

}