/* ==========================================================
   Compact Cyborg-inspired Personal Website
   More compact, dashboard-like and closer to the reference layout.
   ========================================================== */

:root {
  --bg: #05070b;
  --panel: rgba(255,255,255,0.075);
  --panel-strong: rgba(255,255,255,0.12);
  --line: rgba(255,255,255,0.14);
  --line-soft: rgba(255,255,255,0.08);
  --text: #f8fafc;
  --muted: rgba(248,250,252,0.66);
  --faint: rgba(248,250,252,0.42);
  --green: #9eff6e;
  --blue: #67d7ff;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --max: clamp(1180px, 92vw, 1760px);
  --gutter: clamp(10px, 2vw, 42px);
  --fluid-gap: clamp(12px, 1.15vw, 24px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 5%, rgba(158,255,110,0.12), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(103,215,255,0.10), transparent 26rem),
    linear-gradient(180deg, #05070b 0%, #090d15 50%, #05070b 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

a {
  color: inherit;
}

.page-top-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: min(var(--max), calc(100% - 28px));
  margin: 12px auto 0;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5,7,11,0.76);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 2px;
  text-decoration: none;
}

.logo span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #07110a;
  background: var(--green);
  font-weight: 900;
  font-size: 13px;
}

.logo strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.menu {
  display: flex;
  align-items: center;
  gap: 3px;
}

.menu a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 9px 12px;
  border-radius: 999px;
}

.menu a:hover {
  color: var(--text);
  background: var(--panel);
}

.menu-btn {
  display: none;
  appearance: none;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 17px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.menu-btn.is-active span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-btn.is-active span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Hero */

.cyber-hero {
  width: min(var(--max), calc(100% - 28px));
  min-height: calc(100vh - 74px);
  margin: 0 auto;
  padding: 26px 0 28px;
  display: flex;
  align-items: center;
}

.hero-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(260px, 0.48fr) minmax(280px, 0.72fr);
  gap: 14px;
  align-items: stretch;
}

.intro-panel,
.profile-panel,
.dashboard-panel,
.mini-card,
.certificate-strip,
.line-item,
.contact-compact {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: 0 22px 70px rgba(0,0,0,0.28);
}

.intro-panel {
  min-height: 560px;
  padding: clamp(24px, 4vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.microline {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(158,255,110,0.16);
}

.pretitle,
.section-title p,
.certificate-copy p,
.contact-compact p {
  margin: 0 0 12px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 900;
}

.intro-panel h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(50px, 7.6vw, 108px);
  line-height: 0.83;
  letter-spacing: -0.085em;
  font-weight: 950;
}

.intro-panel h1 span {
  display: block;
  color: var(--green);
}

.lead {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.48;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-btn,
.ghost-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  transition: transform 0.2s ease, background 0.2s ease;
}

.primary-btn {
  background: var(--green);
  color: #07110a;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.045);
}

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

.profile-panel {
  overflow: hidden;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.profile-panel img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  flex: 1;
}

.profile-caption {
  padding: 14px 16px 16px;
  background: rgba(5,7,11,0.72);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-caption strong,
.profile-caption span {
  display: block;
}

.profile-caption strong {
  font-size: 16px;
}

.profile-caption span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-icon-link {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.social-svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.social-icon-link:hover {
  color: #07110a;
  background: var(--green);
  border-color: rgba(158,255,110,0.65);
  transform: translateY(-1px);
}

.dashboard-panel {
  min-height: 560px;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.dashboard-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 4px 0;
}

.metric-main {
  padding: 22px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 0%, rgba(158,255,110,0.18), transparent 40%),
    rgba(255,255,255,0.055);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-main span,
.metric-row span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-main strong {
  margin-top: 14px;
  font-size: clamp(64px, 7vw, 102px);
  letter-spacing: -0.09em;
  line-height: 0.82;
}

.metric-main small,
.metric-row small {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.metric-row > div {
  min-height: 96px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.055);
  border: 1px solid var(--line-soft);
}

.metric-row strong {
  display: block;
  margin-top: 8px;
  font-size: 38px;
  line-height: 0.9;
  letter-spacing: -0.07em;
}

/* Compact sections */

.compact-section {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto 38px;
}

.section-title {
  display: grid;
  grid-template-columns: 0.28fr 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(26px, 3.2vw, 50px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.compact-cards,
.timeline-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.mini-card {
  min-height: 188px;
  padding: 20px;
}

.mini-card span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 22px;
  border-radius: 50%;
  color: var(--green);
  background: rgba(158,255,110,0.13);
  font-size: 13px;
  font-weight: 900;
}

.mini-card h3,
.line-item h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.mini-card p,
.line-item p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
}

/* Personal / Travel section */

.travel-section {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto 38px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: stretch;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 12% 10%, rgba(103,215,255,0.12), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(158,255,110,0.12), transparent 24%),
    var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: 0 22px 70px rgba(0,0,0,0.28);
}

.travel-copy,
.travel-map-card {
  min-height: 440px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.045);
}

.travel-copy {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.travel-copy p,
.travel-map-top span {
  margin: 0 0 12px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 900;
}

.travel-copy h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.travel-copy > span {
  display: block;
  max-width: 650px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.travel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.travel-stats div {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.05);
}

.travel-stats strong {
  display: block;
  font-size: 34px;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.travel-stats small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.continent-tags,
.travel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.continent-tags span,
.travel-tags span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.travel-map-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.travel-map-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 2px 2px 14px;
}

.travel-map-top span {
  margin: 0;
}

.travel-map-top small {
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
}

.travel-map-shell {
  flex: 1;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 20% 20%, rgba(103,215,255,0.14), transparent 22%),
    linear-gradient(180deg, rgba(10,16,24,0.95), rgba(8,12,18,0.95));
  position: relative;
  padding: 10px;
}

.visited-map {
  width: 100%;
  height: clamp(300px, 34vw, 440px);
  min-height: 300px;
  max-height: 460px;
}

.visited-map svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
}

.travel-map-legend {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  z-index: 2;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5,7,11,0.72);
  backdrop-filter: blur(10px);
}

.travel-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legend-box {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
}

.legend-visited {
  background: var(--green);
  border-color: rgba(158,255,110,0.45);
}

.legend-base {
  background: rgba(255,255,255,0.12);
}

/* jsVectorMap dark theme overrides */

.jvm-container {
  background: transparent !important;
}

.jvm-tooltip {
  padding: 8px 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: rgba(5,7,11,0.95) !important;
  color: var(--text) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 12px !important;
  box-shadow: 0 14px 40px rgba(0,0,0,0.28) !important;
}

.jvm-zoom-btn,
.jvm-series-container,
.jvm-legend,
.jvm-line {
  display: none !important;
}

/* Certificate strip */

.certificate-strip {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto 38px;
  min-height: 230px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 14px;
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(158,255,110,0.12), transparent 42%),
    var(--panel);
}

.certificate-copy {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.certificate-copy h2 {
  margin: 0;
  font-size: clamp(34px, 4.3vw, 66px);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.certificate-copy span {
  display: block;
  max-width: 780px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.certificate-image {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.06);
}

.certificate-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Timeline compact */

.line-item {
  min-height: 150px;
  padding: 18px;
}

.line-item span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

/* Contact */

.contact-compact {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto 32px;
  padding: 22px;
  min-height: 170px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  background:
    radial-gradient(circle at 16% 8%, rgba(158,255,110,0.16), transparent 34%),
    var(--panel);
}

.contact-compact h2 {
  margin: 0;
  max-width: 800px;
  font-size: clamp(30px, 4vw, 60px);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

/* Footer */

.footer {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
  padding: 0 0 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
  font-size: 13px;
}

.footer a {
  text-decoration: none;
  color: var(--muted);
}

.footer-social {
  width: 34px;
  height: 34px;
}

.footer-social .social-svg {
  width: 16px;
  height: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

/* Reveal
   Safe fallback: content stays visible if JavaScript does not load.
   main.js adds .js to <html>; only then reveal animation is activated.
*/

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.06s;
}

.delay-2 {
  transition-delay: 0.12s;
}

/* Responsive */

@media (max-width: 1080px) {
  .cyber-hero {
    min-height: auto;
    padding-top: 22px;
  }

  .hero-grid {
    grid-template-columns: 1fr 0.75fr;
  }

  .intro-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .profile-panel,
  .dashboard-panel {
    min-height: 440px;
  }

  .section-title {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .travel-section {
    grid-template-columns: 1fr;
  }

  .travel-copy,
  .travel-map-card {
    min-height: auto;
  }

  .travel-map-shell {
    min-height: 320px;
  }

  .certificate-strip {
    grid-template-columns: 1fr;
  }

  .certificate-image {
    max-height: 310px;
  }
}

@media (max-width: 760px) {
  .topbar {
    margin-top: 10px;
  }

  .menu-btn {
    display: block;
  }

  /* No-JS fallback: show the menu on mobile instead of hiding the whole navigation. */
  .menu {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(5,7,11,0.94);
    box-shadow: 0 22px 70px rgba(0,0,0,0.32);
  }

  .js .menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 62px;
    display: none;
    width: auto;
    margin-top: 0;
  }

  .js .menu.is-open {
    display: flex;
  }

  .menu a {
    padding: 13px 14px;
  }

  .profile-socials {
    justify-content: flex-start;
  }

  .hero-grid,
  .compact-cards,
  .timeline-compact,
  .travel-stats {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    padding: 24px;
  }

  .intro-panel h1 {
    font-size: clamp(48px, 16vw, 76px);
  }

  .profile-panel,
  .dashboard-panel {
    min-height: auto;
  }

  .profile-panel img {
    max-height: 430px;
  }

  .travel-map-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .travel-map-shell {
    min-height: 0;
    padding: 8px;
  }

  .visited-map {
    height: clamp(250px, 72vw, 340px);
    min-height: 250px;
    max-height: 340px;
  }

  .travel-copy h2 {
    font-size: clamp(28px, 9vw, 42px);
  }

  .travel-copy > span {
    font-size: 14px;
  }

  .continent-tags,
  .travel-tags {
    gap: 7px;
  }

  .continent-tags span,
  .travel-tags span {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  .travel-map-legend {
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 18px;
  }

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

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }

  .footer {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .logo strong {
    display: none;
  }

  .cyber-hero,
  .compact-section,
  .certificate-strip,
  .travel-section,
  .contact-compact,
  .footer,
  .topbar {
    width: min(var(--max), calc(100% - 20px));
  }

  .metric-main strong {
    font-size: 78px;
  }

  .certificate-copy,
  .mini-card,
  .line-item,
  .contact-compact,
  .travel-copy,
  .travel-map-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


@media (max-width: 420px) {
  .travel-map-card {
    padding: 12px;
  }

  .visited-map {
    height: 245px;
    min-height: 245px;
  }

  .travel-map-legend {
    position: static;
    margin-top: 8px;
    justify-content: flex-start;
    border-radius: 16px;
  }
}


/* ==========================================================
   Adaptive layout upgrade
   Scales cleanly from small phones to large desktop / ultra-wide screens.
   ========================================================== */

.topbar,
.cyber-hero,
.compact-section,
.certificate-strip,
.travel-section,
.contact-compact,
.footer {
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
}

.topbar {
  min-height: clamp(54px, 3.4vw, 66px);
}

.hero-grid,
.compact-cards,
.timeline-compact {
  gap: var(--fluid-gap);
}

.hero-grid {
  grid-template-columns:
    minmax(0, 1.22fr)
    minmax(clamp(240px, 16vw, 360px), 0.48fr)
    minmax(clamp(280px, 22vw, 430px), 0.72fr);
}

.cyber-hero {
  min-height: min(900px, calc(100svh - 74px));
  padding: clamp(18px, 1.8vw, 36px) 0 clamp(24px, 2vw, 44px);
}

.intro-panel,
.profile-panel,
.dashboard-panel {
  min-height: clamp(520px, 42vw, 740px);
}

.intro-panel {
  padding: clamp(24px, 3.2vw, 60px);
}

.intro-panel h1 {
  max-width: 920px;
  font-size: clamp(52px, 6.3vw, 132px);
}

.lead {
  max-width: 780px;
  font-size: clamp(16px, 1.18vw, 22px);
}

.metric-main strong {
  font-size: clamp(64px, 5.6vw, 118px);
}

.compact-section,
.certificate-strip,
.travel-section {
  margin-bottom: clamp(28px, 2.4vw, 52px);
}

.section-title {
  grid-template-columns: minmax(150px, 0.26fr) minmax(0, 1fr);
  gap: clamp(14px, 1.4vw, 28px);
}

.section-title h2,
.contact-compact h2 {
  max-width: 1080px;
}

.compact-cards,
.timeline-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-card,
.line-item {
  padding: clamp(18px, 1.4vw, 28px);
}

.certificate-strip {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.46fr);
  gap: var(--fluid-gap);
  min-height: clamp(230px, 18vw, 350px);
}

.certificate-copy {
  padding: clamp(22px, 2vw, 38px);
}

.certificate-copy h2 {
  font-size: clamp(36px, 3.8vw, 76px);
}

.travel-section {
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.22fr);
  gap: var(--fluid-gap);
}

.travel-copy,
.travel-map-card {
  min-height: clamp(420px, 31vw, 610px);
}

.travel-copy,
.travel-map-card {
  padding: clamp(16px, 1.3vw, 28px);
}

.travel-copy h2 {
  font-size: clamp(32px, 3.35vw, 68px);
}

.travel-copy > span {
  max-width: 760px;
  font-size: clamp(14px, 0.98vw, 18px);
}

.visited-map {
  height: clamp(340px, 27vw, 560px);
  min-height: 320px;
  max-height: none;
}

.travel-tags {
  max-height: clamp(108px, 9vw, 170px);
  overflow: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.contact-compact {
  min-height: clamp(160px, 13vw, 250px);
  padding: clamp(22px, 2vw, 38px);
}

/* Large desktop: use the available space instead of looking too narrow. */
@media (min-width: 1500px) {
  .logo span {
    width: 42px;
    height: 42px;
  }

  .logo strong,
  .menu a,
  .primary-btn,
  .ghost-btn {
    font-size: 15px;
  }

  .hero-grid {
    grid-template-columns:
      minmax(0, 1.26fr)
      minmax(320px, 0.48fr)
      minmax(390px, 0.72fr);
  }

  .profile-caption {
    padding: 18px 20px 20px;
  }

  .profile-caption strong {
    font-size: 18px;
  }

  .dashboard-panel,
  .intro-panel,
  .profile-panel {
    min-height: clamp(640px, 40vw, 780px);
  }

  .travel-section {
    grid-template-columns: minmax(430px, 0.72fr) minmax(0, 1.28fr);
  }
}

/* Ultra-wide screens: controlled growth, no overstretched text. */
@media (min-width: 1900px) {
  :root {
    --max: 1840px;
  }

  .intro-panel h1 {
    max-width: 1040px;
  }

  .lead {
    max-width: 850px;
  }

  .visited-map {
    height: 600px;
  }
}

/* Laptop/tablet: avoid squeezed three-column hero. */
@media (max-width: 1280px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.58fr);
  }

  .intro-panel {
    grid-column: 1 / -1;
  }

  .intro-panel,
  .profile-panel,
  .dashboard-panel {
    min-height: auto;
  }

  .profile-panel img {
    max-height: 580px;
  }

  .travel-section {
    grid-template-columns: 1fr;
  }

  .travel-copy,
  .travel-map-card {
    min-height: auto;
  }

  .visited-map {
    height: clamp(330px, 48vw, 520px);
  }

  .certificate-strip {
    grid-template-columns: 1fr;
  }
}

/* Navigation switches earlier, so tablets and small laptops do not break the menu. */
@media (max-width: 880px) {
  .topbar {
    flex-wrap: wrap;
    border-radius: 24px;
  }

  .menu-btn {
    display: block;
  }

  .menu {
    order: 3;
    position: static;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(5,7,11,0.94);
    box-shadow: 0 22px 70px rgba(0,0,0,0.32);
  }

  .js .menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 62px;
    display: none;
    width: auto;
    margin-top: 0;
  }

  .js .menu.is-open {
    display: flex;
  }

  .menu a {
    padding: 13px 14px;
  }
}

/* Small screens: keep everything readable, no horizontal scrolling. */
@media (max-width: 760px) {
  :root {
    --gutter: 10px;
  }

  .hero-grid,
  .compact-cards,
  .timeline-compact,
  .travel-stats {
    grid-template-columns: 1fr;
  }

  .intro-panel h1 {
    font-size: clamp(44px, 15vw, 76px);
    letter-spacing: -0.075em;
  }

  .section-title {
    grid-template-columns: 1fr;
  }

  .travel-section {
    padding: 10px;
  }

  .travel-copy,
  .travel-map-card {
    padding: 18px;
  }

  .continent-tags,
  .travel-tags {
    max-height: 150px;
  }

  .visited-map {
    height: clamp(240px, 72vw, 340px);
    min-height: 240px;
  }

  .travel-map-legend {
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  .logo strong {
    display: inline;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .intro-panel,
  .certificate-copy,
  .mini-card,
  .line-item,
  .contact-compact,
  .travel-copy,
  .travel-map-card {
    padding: 16px;
  }

  .visited-map {
    height: 235px;
    min-height: 235px;
  }
}

/* ==========================================================
   Mobile repair for the section after Expertise
   Keeps Personal / Map / Certificate / Experience readable on phones.
   ========================================================== */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.page-top-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  outline: none;
}

/* Make the travel map robust when the CDN vector map renders on narrow screens. */
.travel-section,
.travel-map-card,
.travel-map-shell,
.visited-map {
  min-width: 0;
}

.travel-map-shell .jvm-container,
.travel-map-shell .jvm-container svg,
.visited-map svg {
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 760px) {
  /* On mobile, avoid reveal/observer issues below the hero. */
  .js .travel-section,
  .js .certificate-strip,
  .js #experience,
  .js #contact,
  .js .travel-section .reveal,
  .js .certificate-strip .reveal,
  .js #experience .reveal,
  .js #contact .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .compact-section,
  .travel-section,
  .certificate-strip,
  .contact-compact,
  .footer {
    width: calc(100% - 20px) !important;
  }

  .travel-section {
    display: block !important;
    grid-template-columns: none !important;
    padding: 10px !important;
    margin: 0 auto 28px !important;
    overflow: visible !important;
  }

  .travel-copy,
  .travel-map-card {
    width: 100% !important;
    min-height: 0 !important;
    padding: 16px !important;
  }

  .travel-map-card {
    margin-top: 10px !important;
  }

  .travel-copy h2 {
    font-size: clamp(28px, 9vw, 42px) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.055em !important;
  }

  .travel-copy > span {
    max-width: none !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
  }

  .travel-stats {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-top: 18px !important;
  }

  .travel-stats div {
    padding: 14px !important;
  }

  .continent-tags {
    max-height: none !important;
    overflow: visible !important;
    margin-top: 18px !important;
  }

  .travel-tags {
    max-height: 150px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 4px !important;
    margin-top: 14px !important;
    -webkit-overflow-scrolling: touch;
  }

  .continent-tags span,
  .travel-tags span {
    min-height: 30px !important;
    max-width: 100% !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.15 !important;
  }

  .travel-map-top {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    padding-bottom: 10px !important;
  }

  .travel-map-shell {
    min-height: 0 !important;
    height: auto !important;
    padding: 8px !important;
    overflow: hidden !important;
  }

  .visited-map {
    width: 100% !important;
    height: min(68vw, 315px) !important;
    min-height: 230px !important;
    max-height: 315px !important;
  }

  .travel-map-legend {
    position: static !important;
    width: 100% !important;
    margin-top: 8px !important;
    padding: 8px 10px !important;
    border-radius: 16px !important;
    justify-content: flex-start !important;
    gap: 8px 12px !important;
  }

  .travel-map-legend span {
    font-size: 11px !important;
  }

  .certificate-strip {
    display: block !important;
    grid-template-columns: none !important;
    padding: 10px !important;
    overflow: visible !important;
  }

  .certificate-copy {
    padding: 16px !important;
  }

  .certificate-copy h2 {
    font-size: clamp(30px, 10vw, 44px) !important;
    line-height: 0.98 !important;
  }

  .certificate-image {
    margin-top: 10px !important;
    max-height: none !important;
  }

  .certificate-image img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .timeline-compact {
    grid-template-columns: 1fr !important;
  }

  .line-item {
    min-height: 0 !important;
  }
}

@media (max-width: 420px) {
  .travel-copy,
  .travel-map-card,
  .certificate-copy,
  .mini-card,
  .line-item,
  .contact-compact {
    padding: 14px !important;
  }

  .visited-map {
    height: 235px !important;
    min-height: 235px !important;
  }

  .travel-tags {
    max-height: 138px !important;
  }

  .travel-map-legend {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}
