:root {
  color-scheme: dark;
  --bg: #101c3a;
  --surface: rgba(15, 22, 38, 0.92);
  --surface-soft: rgba(17, 26, 48, 0.82);
  --surface-strong: rgba(11, 16, 29, 0.98);
  --text: #e6eef9;
  --muted: #8fa7c1;
  --accent: #5d9bff;
  --accent-soft: rgba(93, 155, 255, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  font-family: 'Inter', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(93, 155, 255, 0.16), transparent 24%),
              radial-gradient(circle at 20% 20%, rgba(125, 97, 255, 0.12), transparent 18%),
              linear-gradient(180deg, #05070f 0%, #08101d 100%);
  color: var(--text);
}

button, a {
  font: inherit;
}

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

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

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  height: 100px;
  z-index: 50;
  backdrop-filter: blur(20px);
  background: rgba(4, 8, 19, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100px;
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text);
  font-size: 1.15rem;
}

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

.nav-link {
  position: relative;
  color: var(--muted);
  transition: color 0.25s ease;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
}

.theme-toggle:hover {
  color: var(--text);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link.active::after,
.nav-link:hover::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.mobile-toggle {
  display: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.4rem;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
  border-radius: 999px;
}

.hero {
  padding: 120px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  align-items: center;
  gap: 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-copy h1 {
  font-size: clamp(3rem, 4vw, 4.5rem);
  line-height: 0.95;
  margin: 0;
  font-weight: 800;
}

.hero-copy h1 span {
  color: var(--accent);
}

.hero-text {
  margin: 1.7rem 0 2rem;
  max-width: 640px;
  line-height: 1.75;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 1rem 1.8rem;
  min-height: 56px;
  border: 1px solid transparent;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

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

.primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
}

.secondary {
  border-color: rgba(255,255,255,0.15);
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.hero-meta div {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 1.15rem 1.2rem;
}

.hero-meta strong {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-meta span {
  display: block;
  margin-top: 0.55rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.social-links {
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.social-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  transition: transform 0.2s ease, background 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-2px);
  background: rgba(93, 155, 255, 0.18);
}

.hero-card {
  position: relative;
}

.profile-card {
  background: rgba(15, 22, 38, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.profile-photo {
  width: 120px;
  height: 150px;
  border-radius: 32px;
  margin-bottom: 1.5rem;
  background: radial-gradient(circle at top left, #6f86ff, #1d4ed8);
  box-shadow: inset 0 10px 40px rgba(0,0,0,0.28);
}

.profile-info h2 {
  margin: 0;
  font-size: 2rem;
}

.profile-info p,
.profile-card p {
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.profile-stats {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

.profile-stats div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: center;
  padding: 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: 22px;
}

.profile-stats strong {
  color: var(--muted);
}

.section {
  padding: 100px 0;
}

.section-alt {
  background: rgba(8, 15, 30, 0.92);
}

.section-header {
  max-width: 720px;
  margin-bottom: 2.5rem;
}

.section-label {
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(2rem, 2.5vw, 3rem);
  line-height: 1.05;
}

.section-header p {
  margin-top: 1rem;
  line-height: 1.8;
  color: var(--muted);
  text-align: justify;
}

.section-grid {
  display: grid;
  gap: 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-bottom: 2rem;
}

.glass-card {
  background: rgba(15, 22, 38, 0.78);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
}

.glass-card h3 {
  margin-top: 0;
}

.glass-card ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.8rem;
}

.glass-card li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--muted);
}

.glass-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.skills-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 32px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.skills-header h3 {
  margin: 0;
}

.skills-header p {
  margin: 0.7rem 0 1.6rem;
  color: var(--muted);
}

.skills-list {
  display: grid;
  gap: 1rem;
}

.skill-item {
  display: grid;
  gap: 0.55rem;
}

.skill-item span:first-child {
  color: var(--text);
  font-weight: 600;
}

.skill-item div {
  width: 100%;
  height: 11px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.skill-item div span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5d9bff, #7c3aed);
}

.cert-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.filter {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.filter.active,
.filter:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.3rem;
}

.cert-card {
  background: rgba(12, 18, 32, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  padding: 1.8rem;
  display: grid;
  gap: 1.2rem;
}

.cert-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: rgba(93, 155, 255, 0.12);
  color: #dbe6ff;

  width: 100%;
  text-align: center;
  font-size: 0.9rem;
}

.cert-card h3 {
  margin: 0;
}

.cert-card p {
  margin: 0;
  color: var(--muted);
}

.cert-button {
  justify-self: start;
  border: 1px solid rgba(93, 155, 255, 0.22);
  background: transparent;
  color: var(--accent);
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
}

.contact-panel {
  background: rgba(255,255,255,0.03);
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.contact-panel h2 {
  margin-top: 0.4rem;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.8rem 0 2rem;
}

.contact-cards article {
  padding: 1.3rem 1.4rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
}

.map-placeholder {
  min-height: 280px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15,22,38,0.92);
  overflow: hidden;
}

.map-placeholder .map-frame {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 0;
  border-radius: 28px;
}

.contact-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  background: rgba(12, 18, 32, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 32px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  margin-inline: auto;
  justify-self: center;
}

.contact-form label {
  display: grid;
  gap: 0.65rem;
  color: var(--muted);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text);
  text-decoration: none;
}

.contact-link img {
  display: block;
  width: 32px;
  height: 32px;
}

.contact-form span {
  font-weight: 600;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 1rem 1.1rem;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(93,155,255,0.45);
  box-shadow: 0 0 0 4px rgba(93,155,255,0.12);
}

.footer {
  padding: 2rem 0 3rem;
}

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

.footer-links {
  display: flex;
  gap: 1.2rem;
}

.footer-links a {
  color: var(--muted);
}

.loader {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.95);
  display: grid;
  place-items: center;
  z-index: 999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-ring {
  width: 72px;
  height: 72px;
  border: 6px solid rgba(255,255,255,0.12);
  border-top: 6px solid var(--accent);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  margin-bottom: 1.2rem;
}

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

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

.theme-toggle {
  position: fixed;
  right: 1.25rem;
  top: 1.25rem;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.reveal,
.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible,
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero-grid, .section-grid {
    grid-template-columns: 1fr;
  }

  .about-grid,
  .cert-grid,
  .contact-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .nav {
    position: fixed;
    inset: 78px 0 auto;
    flex-direction: column;
    padding: 1.4rem;
    gap: 1rem;
    background: rgba(7, 11, 20, 0.96);
    backdrop-filter: blur(20px);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
  }

  /* Hide the inline nav in the topbar and only show the fixed nav when opened */
  .topbar-inner .nav {
    display: none;
  }

  .nav.open {
    display: flex;
    transform: translateY(0);
  }

  .nav.open {
    transform: translateY(0);
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .hero-meta,
  .contact-cards,
  .about-grid,
  .cert-grid {
    grid-template-columns: 1fr;
  }

  .contact-panel,
  .contact-form {
    padding: 1.6rem;
  }
}

body.light {
  color-scheme: light;
  --bg: #f5f8ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --text: #09121f;
  --muted: #52627b;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.16);
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  background: linear-gradient(180deg, #eef5ff 0%, #f6f9ff 100%);
}

body.light .topbar,
body.light .nav,
body.light .profile-card,
body.light .glass-card,
body.light .skills-panel,
body.light .cert-card,
body.light .contact-panel,
body.light .contact-form {
  background: rgba(255,255,255,0.96);
}

body.light .topbar,
body.light .nav {
  border-color: rgba(15, 23, 42, 0.08);
}

body.light .nav-link,
body.light .filter,
body.light .footer,
body.light .social-icon,
body.light .button,
body.light .contact-form input,
body.light .contact-form textarea {
  color: inherit;
}

body.light .nav-link:hover,
body.light .nav-link.active,
body.light .filter.active,
body.light .filter:hover {
  color: var(--accent);
}

body.light .button.secondary {
  color: var(--text);
  background: rgba(37, 99, 235, 0.08);
}

body.light .map-placeholder {
  background: linear-gradient(135deg, #eef3ff, #e0e7ff);
  color: #405669;
}
