:root {
  /* Colour tokens */
  --bg: #0b1220;
  --bg-alt: #0f1729;
  --card: #16213a;
  --card-border: #24304e;
  --text: #e8edf7;
  --muted: #9aa7c0;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --chip: #1d2a47;

  /* Type scale (1.25 modular) + fluid headings */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-hero: clamp(2rem, 1.1rem + 3.4vw, 3rem);
  --fs-section: clamp(1.5rem, 1.15rem + 1.5vw, 2rem);

  /* Spacing (8-pt grid) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 16px; --sp-4: 24px;
  --sp-5: 32px; --sp-6: 48px; --sp-7: 64px;
  --section-y: clamp(48px, 6vw, 88px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: var(--fs-base);
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 var(--sp-4); }
a { color: var(--accent); text-decoration: none; }

/* Nav */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; position: relative; }
.brand { font-weight: 800; font-size: var(--fs-md); color: var(--text); }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--card-border); color: var(--text);
  font-size: 1.35rem; line-height: 1; width: 44px; height: 44px; border-radius: 10px; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */
.hero { padding: var(--sp-7) 0 var(--sp-7); background: radial-gradient(ellipse 80% 60% at 70% 0%, rgba(56,189,248,0.12), transparent), var(--bg); }
.hero-inner { display: flex; gap: var(--sp-6); align-items: center; }
.hero-photo img, .avatar-fallback {
  width: 220px; height: 220px; border-radius: 50%;
  object-fit: cover; border: 4px solid var(--accent);
  box-shadow: 0 0 60px rgba(56,189,248,0.25);
}
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: var(--fs-hero); font-weight: 800; color: #0b1220;
}
.hero-kicker { text-transform: uppercase; letter-spacing: 3px; color: var(--accent); font-size: var(--fs-xs); font-weight: 700; margin-bottom: var(--sp-2); }
.hero h1 { font-size: var(--fs-hero); font-weight: 800; line-height: 1.12; }
.hero h2 { font-size: var(--fs-md); font-weight: 600; color: var(--muted); margin: var(--sp-2) 0 var(--sp-3); }
.hero h2 .sep { color: var(--accent); margin: 0 6px; }
.hero-summary { color: var(--muted); font-size: var(--fs-base); max-width: 640px; }

/* Hero metric tiles */
.hero-stats { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.stat-tile { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 18px; min-width: 92px; }
.stat-tile .num { display: block; font-size: var(--fs-xl); font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat-tile .lbl { display: block; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

.hero-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }
.hero-meta { display: flex; gap: var(--sp-4); margin-top: var(--sp-3); color: var(--muted); font-size: var(--fs-sm); flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 10px;
  font-weight: 600; font-size: var(--fs-sm); transition: all 0.2s; border: 1px solid transparent;
}
.btn.primary { background: var(--accent); color: #05121f; }
.btn.primary:hover { background: #5ecbfa; transform: translateY(-1px); }
.btn.whatsapp { background: #25d366; color: #05121f; }
.btn.whatsapp:hover { background: #4ce381; transform: translateY(-1px); }
.wa-link { color: #25d366; font-size: var(--fs-sm); font-weight: 600; margin-top: 4px; }
.wa-link:hover { color: #4ce381; }
.btn.ghost { border-color: var(--card-border); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.big { padding: 16px 30px; font-size: var(--fs-md); }
.btn.small { padding: 7px 14px; font-size: var(--fs-xs); }

/* Sections */
.section { padding: var(--section-y) 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: var(--fs-section); font-weight: 800; margin-bottom: var(--sp-2); }
.section-title.light { color: #fff; }
.section-sub { color: var(--muted); margin-bottom: var(--sp-6); max-width: 640px; }

/* Timeline */
.timeline { position: relative; margin-top: var(--sp-6); padding-left: 30px; }
.timeline::before {
  content: ''; position: absolute; left: 60px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(var(--accent), var(--accent-2));
  opacity: 0.4;
}
.timeline-item { display: flex; gap: 28px; margin-bottom: var(--sp-5); }
.timeline-marker {
  flex: 0 0 62px; height: 62px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent); font-size: var(--fs-sm);
  z-index: 1;
}
.timeline-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 14px; padding: var(--sp-4) 28px; flex: 1;
}
.timeline-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.timeline-head h4 { font-size: var(--fs-md); }
.timeline-head .company { color: var(--accent); font-weight: 600; }
.timeline-head .period { color: var(--muted); font-size: var(--fs-sm); margin-left: auto; }
.timeline-card ul { padding-left: 20px; color: var(--muted); font-size: var(--fs-sm); }
.timeline-card li { margin-bottom: 5px; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); }
.skill-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 22px; }
.skill-card h4 { margin-bottom: 14px; color: var(--accent); font-size: var(--fs-base); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--chip); border: 1px solid var(--card-border);
  padding: 5px 12px; border-radius: 999px; font-size: var(--fs-xs); color: var(--text);
}
.chip.small { font-size: var(--fs-xs); padding: 3px 10px; display: inline-block; margin-bottom: 8px; }

/* Certs */
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--sp-4); }
.cert-list, .edu-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 26px; }
.cert-list h4, .edu-card h4 { color: var(--accent); margin-bottom: 14px; }
.cert-list ul, .edu-card ul { padding-left: 20px; color: var(--muted); font-size: var(--fs-sm); }
.cert-list li, .edu-card li { margin-bottom: 7px; }
.edu-degree { font-weight: 600; }
.edu-school { color: var(--muted); font-size: var(--fs-sm); }
.mt { margin-top: 22px; }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.project-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.project-img img { width: 100%; height: 180px; object-fit: cover; display: block; }
.project-body { padding: 20px; }
.project-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.project-top .year { color: var(--muted); font-size: var(--fs-xs); }
.project-body p { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 10px; }
.project-body .tech { font-size: var(--fs-xs); color: var(--accent-2); }
.empty-note { color: var(--muted); font-style: italic; }

/* Showcase CTA */
.photography { background: linear-gradient(135deg, rgba(56,189,248,0.08), rgba(129,140,248,0.1)); }
.photo-cta { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.photo-cta .section-sub { margin-bottom: 0; }

/* Footer */
.footer { background: #070d18; padding: var(--sp-7) 0 var(--sp-6); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-6); }
.contact-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px;
  padding: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text);
  transition: border-color 0.2s;
}
.contact-card:hover { border-color: var(--accent); }
.contact-card span { color: var(--muted); font-size: var(--fs-sm); }
.copyright { color: var(--muted); font-size: var(--fs-xs); text-align: center; border-top: 1px solid var(--card-border); padding-top: var(--sp-4); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Tech / certification logo wall */
.logo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 10px; }
.logo-item {
  height: 84px; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 14px;
  transition: transform .2s, border-color .2s;
}
.logo-item:hover { transform: translateY(-3px); border-color: var(--accent); }
.logo-item img {
  max-height: 46px; max-width: 100%; object-fit: contain;
  filter: brightness(0) invert(.72); opacity: .85; transition: filter .2s, opacity .2s;
}
.logo-item:hover img { filter: brightness(0) invert(1); opacity: 1; }
.logo-text { color: var(--muted); font-weight: 700; font-size: var(--fs-base); text-align: center; letter-spacing: .3px; }
.logo-item:hover .logo-text { color: var(--text); }

/* World map with pins (equirectangular BlankMap 360x180) */
.worldmap { position: relative; width: 100%; max-width: 900px; margin: 10px auto 0; }
.worldmap-img { width: 100%; display: block; filter: invert(.9) hue-rotate(180deg) brightness(.9) contrast(.9); opacity: .85; border-radius: 12px; }
.map-pin { position: absolute; transform: translate(-50%, -50%); }
.map-dot {
  display: block; width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 4px rgba(56,189,248,.25);
  cursor: pointer; animation: pinpulse 2s infinite;
}
@keyframes pinpulse { 0% { box-shadow: 0 0 0 3px rgba(56,189,248,.35); } 70% { box-shadow: 0 0 0 9px rgba(56,189,248,0); } 100% { box-shadow: 0 0 0 3px rgba(56,189,248,0); } }
.map-label {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #0b1220; color: var(--text); border: 1px solid var(--accent); border-radius: 8px;
  padding: 6px 10px; font-size: var(--fs-xs); opacity: 0; pointer-events: none;
  transition: opacity .15s; z-index: 5; max-width: 240px; white-space: normal; text-align: center;
}
.map-pin:hover .map-label,
.map-pin:focus .map-label,
.map-pin.tapped .map-label,
.map-pin:focus-within .map-label { opacity: 1; }
.map-pin.tapped { z-index: 6; }
.map-pin:focus { outline: none; }
.map-pin:focus .map-dot { box-shadow: 0 0 0 6px rgba(56,189,248,.35); }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: var(--sp-4); }
.map-pin.remote .map-dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.25); animation: pinpulse-r 2s infinite; }
@keyframes pinpulse-r { 0% { box-shadow: 0 0 0 3px rgba(245,158,11,.35);} 70% { box-shadow: 0 0 0 9px rgba(245,158,11,0);} 100% { box-shadow: 0 0 0 3px rgba(245,158,11,0);} }
.map-key { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-xs); margin-right: 6px; }
.map-key-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; display: inline-block; }
.map-key-dot.onsite { background: var(--accent); }
.map-key-dot.remote { background: #f59e0b; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-stats, .hero-actions, .hero-meta { justify-content: center; }
  .hero-summary { margin-left: auto; margin-right: auto; }
  .two-col { grid-template-columns: 1fr; }
  .timeline::before { left: 55px; }
  .timeline-item { gap: 16px; }
  /* Mobile nav: hamburger + dropdown */
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 62px; left: 0; right: 0; z-index: 60;
    flex-direction: column; gap: 0; background: var(--bg-alt);
    border-bottom: 1px solid var(--card-border); box-shadow: 0 12px 24px rgba(0,0,0,.35);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; font-size: var(--fs-base); border-top: 1px solid var(--card-border); }
}
@media (max-width: 600px) {
  .container { padding: 0 var(--sp-3); }
  .hero { padding: var(--sp-6) 0; }
  .hero-photo img, .avatar-fallback { width: 150px; height: 150px; }
  .skills-grid, .projects-grid, .contact-grid { grid-template-columns: 1fr; }
  .logo-wall { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .logo-item { height: 68px; padding: 10px; }
  .logo-item img { max-height: 34px; }
  /* Timeline collapses to a single left rail */
  .timeline { padding-left: 0; }
  .timeline::before { left: 21px; }
  .timeline-item { gap: 12px; }
  .timeline-marker { flex-basis: 44px; height: 44px; font-size: var(--fs-xs); }
  .timeline-card { padding: 16px 18px; }
  .photo-cta { flex-direction: column; align-items: flex-start; }
  .map-label { font-size: 0.7rem; }
  .stat-tile { flex: 1 1 40%; min-width: 0; }
}

/* Tech wall: category group headings */
.tech-group-title { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 2px; font-weight: 700; margin: var(--sp-5) 0 var(--sp-3); }
.tech-group-title:first-of-type { margin-top: var(--sp-3); }
