:root,
:root[data-theme="dark"]{
  --bg: #0B1628;
  --bg-1: #0F1B2E;
  --bg-2: #132238;
  --bg-3: #162544;
  --bg-elev: #1A2D4A;
  --border: #1E3A5F;
  --border-strong: #26456E;
  --border-bright: #335885;
  --text: #F0F4FA;
  --text-2: #8EA3C0;
  --text-3: #5E7A9E;
  --text-mute: #4A638A;
  --accent: #E07040;
  --accent-soft: rgba(224,112,64,0.10);
  --accent-glow: rgba(224,112,64,0.25);
  --green: #4ade80;

  /* Theme-aware composite tokens */
  --sky-gradient: linear-gradient(180deg, #0B1628 0%, #0F1B2E 40%, #132238 70%, #1A2D4A 100%);
  --card-bg: rgba(15, 27, 46, 0.85);
  --card-bg-strong: rgba(15, 27, 46, 0.92);
  --side-nav-bg: rgba(15, 27, 46, 0.78);
  --cloud-color: rgba(255,255,255,0.03);
  --shadow-soft: rgba(0,0,0,0.3);
  --shadow-strong: rgba(0,0,0,0.4);
  --avatar-shadow: rgba(0,0,0,0.3);
  --stars-opacity: 1;
  --city-opacity: 0.10;
  --confetti-color-2: #F0F4FA;
  --confetti-color-3: #3B6CB5;
  --confetti-color-4: #60a5fa;
  --confetti-color-5: #26456E;
  --building-gradient: linear-gradient(180deg, #26456E 0%, #0B1628 100%);
}

:root[data-theme="light"]{
  --bg: #F2F5FA;
  --bg-1: #FFFFFF;
  --bg-2: #ECF0F6;
  --bg-3: #DEE5EE;
  --bg-elev: #FFFFFF;
  --border: #DDE3EC;
  --border-strong: #C5CFDB;
  --border-bright: #A0AEC0;
  --text: #1A2238;
  --text-2: #4A5972;
  --text-3: #6B7C95;
  --text-mute: #98A4B8;
  --accent: #C55A30;
  --accent-soft: rgba(197,90,48,0.10);
  --accent-glow: rgba(197,90,48,0.30);
  --green: #16a34a;

  /* Theme-aware composite tokens */
  --sky-gradient: linear-gradient(180deg, #EAF1FA 0%, #DCE6F2 40%, #CDD9E8 70%, #BFCEE0 100%);
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-bg-strong: rgba(255, 255, 255, 0.95);
  --side-nav-bg: rgba(255, 255, 255, 0.85);
  --cloud-color: rgba(255,255,255,0.55);
  --shadow-soft: rgba(30,50,90,0.08);
  --shadow-strong: rgba(30,50,90,0.14);
  --avatar-shadow: rgba(30,50,90,0.18);
  --stars-opacity: 0;
  --city-opacity: 0.10;
  --confetti-color-2: #1A2238;
  --confetti-color-3: #3B6CB5;
  --confetti-color-4: #2563eb;
  --confetti-color-5: #C5CFDB;
  --building-gradient: linear-gradient(180deg, #6B7C95 0%, #98A4B8 100%);
}

*{box-sizing:border-box;margin:0;padding:0}
html{
  scroll-behavior:smooth;
  /* Prevent iOS text size auto-adjust on rotation */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
  transition: background-color 0.45s ease, color 0.45s ease;
  /* Avoid iOS rubber-band exposing content behind */
  overscroll-behavior-y: none;
}
::selection{background: var(--accent); color: var(--text)}

/* Make every interactive element snappy on touch (removes 300ms delay) */
a, button, .filter, .pill, .curiosity-card, .contact-item, .scroll-down,
.theme-toggle, .side-nav a, .rail-marker{
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Vertical spacers that scale with viewport */
.vspace{ width: 100%; }
.vspace-lg{ height: 30vh; }
.vspace-md{ height: 20vh; }

/* About section grid — defaults to 2 cols on desktop, stacks on mobile via media query */
.about-grid{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-lead{
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  line-height: 1.45;
  color: var(--text);
}
.about-body{
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.7;
}

/* Language section card spacing — overridable for mobile.
   Uses compound selector so it beats .content-card (defined later) at same specificity. */
.content-card.lang-section-card{ padding: 48px; }
.section-title--spaced{ margin-bottom: 36px; }

/* Contact section padding/width — overridable for mobile.
   Compound selectors for the same cascade reason. */
.content-section.contact-section{ padding-top: 80px; padding-bottom: 140px; }
.contact-card.contact-card--narrow{ max-width: 720px; margin: 0 auto; }

/* ============================================================
   PARALLAX WORLD SCENE
   ============================================================ */
.world-container{
  position: relative;
  width: 100%;
}

/* Sky layer - fixed background */
.sky-layer{
  position: fixed;
  inset: 0;
  background: var(--sky-gradient);
  z-index: 0;
  transition: background 0.6s ease;
}

/* Stars */
.stars{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--stars-opacity);
  transition: opacity 0.6s ease;
}
.star{
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle{
  0%, 100%{ opacity: 0 }
  50%{ opacity: var(--max, 0.8) }
}

/* Clouds */
.clouds-layer{
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.cloud{
  position: absolute;
  background: var(--cloud-color);
  border-radius: 50px;
  filter: blur(20px);
  transition: background 0.6s ease;
}
.cloud::before,.cloud::after{
  content:'';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

/* City silhouette layer */
.city-layer{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 35vh;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  opacity: var(--city-opacity);
  transition: opacity 0.6s ease;
}
.building{
  background: var(--building-gradient);
  margin-right: 2px;
  border-radius: 2px 2px 0 0;
  flex-shrink: 0;
  transition: background 0.6s ease;
}
.building.windows::after{
  content:'';
  display: block;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, rgba(224,112,64,0.3) 1px, transparent 1px);
  background-size: 8px 12px;
}

/* ============================================================
   DOT FLYER — Flies from right to hero-name em
   ============================================================ */
.dot-flyer{
  position: fixed;
  z-index: 50;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(224,112,64,0.3);
  pointer-events: none;
  opacity: 0;
  /* start position: right side of screen, vertically centered */
  left: calc(100vw + 30px);
  top: 50%;
  transform: translate(-50%, -50%);
}
.dot-flyer.fly{
  opacity: 1;
  animation: dotFly 2s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes dotFly{
  0%{
    left: calc(100vw + 30px);
    top: 50%;
    transform: translate(-50%, -50%) scale(0.5);
  }
  60%{
    transform: translate(-50%, -50%) scale(1.2);
  }
  100%{
    left: var(--target-x, calc(50% + 140px));
    top: var(--target-y, 40%);
    transform: translate(-50%, -50%) scale(1);
  }
}
.dot-flyer.vanish{
  animation: dotVanish 0.5s ease forwards;
}
@keyframes dotVanish{
  0%{ opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100%{ opacity: 0; transform: translate(-50%, -50%) scale(0); }
}

/* Trail behind the flying dot */
.dot-trail{
  position: absolute;
  right: 50%;
  top: 50%;
  height: 2px;
  width: 0px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, var(--accent) 0px, var(--accent) 4px, transparent 4px, transparent 8px);
  opacity: 0.8;
  pointer-events: none;
  border-radius: 1px;
}
.dot-flyer.fly .dot-trail{
  animation: trailGrow 2s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes trailGrow{
  0%{ width: 0px; opacity: 0.8; }
  100%{ width: 60vw; opacity: 0; }
}

/* Hero name em arrives and glows */
.hero-name em{
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--accent);
  display: inline-block;
  transition: all 0.6s cubic-bezier(.2,.8,.2,1);
}
.hero-name em.dot-arrived{
  animation: dotArrived 2s ease-in-out infinite;
  text-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(224,112,64,0.2);
}
@keyframes dotArrived{
  0%, 100%{ transform: scale(1); }
  50%{ transform: scale(1.15); }
}

/* ============================================================
   AVATAR — Inside Timeline Rail
   ============================================================ */
.avatar-container{
  position: absolute;
  top: 50%;
  left: 0%;
  z-index: 10;
  transform: translate(-50%, -50%);
  transition: left 0.12s linear;
  pointer-events: none;
}
.avatar{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #C55A30);
  border: 3px solid var(--text);
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 12px var(--shadow-strong);
  display: grid;
  place-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  position: relative;
}
.avatar::after{
  content:'';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 5px;
  background: var(--avatar-shadow);
  border-radius: 50%;
  filter: blur(2px);
}
.avatar-walk{ animation: avatar-bounce 0.6s ease-in-out infinite }
@keyframes avatar-bounce{
  0%, 100%{ transform: translateY(0) }
  50%{ transform: translateY(-5px) }
}
.avatar-label{
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  white-space: nowrap;
  background: var(--bg-elev);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}
.avatar-container:hover .avatar-label,
.avatar-container.show-label .avatar-label{ opacity: 1 }

/* ============================================================
   HERO
   ============================================================ */
.hero{
  min-height: 100vh;
  /* Dynamic viewport height — accounts for mobile browser chrome (Safari, Chrome) */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 0 24px;
  /* Respect notch on landscape iPhones */
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
.hero-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 32px;
  animation: fadein 1s 0.3s both;
}
.hero-badge .pulse{
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: live 2s ease-in-out infinite;
}
@keyframes live{ 0%,100%{opacity:1} 50%{opacity:.4} }
.hero-name{
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 24px;
  animation: rise 1s 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.hero-tagline{
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 40px;
  animation: fadein 1s 0.8s both;
  min-height: 3.2em;
}
.hero-tagline strong{
  color: var(--text);
  font-weight: 500;
}
.scroll-down{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  text-decoration: none;
  animation: fadein 1s 1.2s both;
  cursor: pointer;
  transition: color 0.3s;
}
.scroll-down:hover{ color: var(--accent) }
.scroll-down .arrow{
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  animation: bounce-arrow 2s ease-in-out infinite;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.scroll-down:hover .arrow{
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
@keyframes bounce-arrow{
  0%, 100%{ transform: translateY(0) }
  50%{ transform: translateY(8px) }
}
@keyframes rise{ from{ transform: translateY(40px); opacity: 0 } to{ transform: translateY(0); opacity: 1 } }
@keyframes fadein{ from{ opacity: 0 } to{ opacity: 1 } }
.typewriter-cursor{
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 1s step-end infinite;
}
@keyframes blink-cursor{ 0%, 100%{ opacity: 1 } 50%{ opacity: 0 } }

/* ============================================================
   CONTENT SECTIONS (floating cards along the journey)
   ============================================================ */
.content-section{
  position: relative;
  z-index: 6;
  padding: 100px 24px;
  max-width: 900px;
  margin: 0 auto;
}
.content-card{
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: background-color 0.45s ease, border-color 0.4s cubic-bezier(.4,0,.2,1), transform 0.4s cubic-bezier(.4,0,.2,1), box-shadow 0.4s cubic-bezier(.4,0,.2,1);
}
.content-card::before{
  content:'';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.content-card:hover{
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px var(--shadow-soft);
}
.section-tag{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 20px;
}
.section-tag .num{ color: var(--accent); font-weight: 500; }
.section-title{
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}
.section-title em{
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--accent);
}
.section-sub{
  color: var(--text-2);
  font-size: 15px;
  max-width: 540px;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Reveal animation */
.reveal{
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.8,.2,1);
}
.reveal.in{
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   EXPERIENCE TIMELINE — Horizontal scroll
   ============================================================ */
.filter-bar{
  display: inline-flex;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
}
.filter-bar button{
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: 8px 16px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: all .25s ease;
  border-radius: 8px;
  letter-spacing: 0.02em;
}
.filter-bar button:hover{ color: var(--text) }
.filter-bar button.active{
  background: var(--bg-3);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;
}

/* Override #exp container so the horizontal track can break out */
#exp{
  max-width: none;
  padding: 100px 0;
}
.exp-head-wrap{
  max-width: 900px;
  margin: 0 auto 12px;
  padding: 0 24px;
}
.exp-head-wrap .content-card-head{
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  transition: background-color 0.45s ease, border-color 0.4s ease;
}
.exp-head-wrap .content-card-head::before{
  content:'';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.exp-head-wrap .filter-bar{ margin-bottom: 0 }

/* Horizontal scroll wrapper */
.exp-scroll-wrapper{
  position: relative;
  width: 100%;
}
.exp-scroll-sticky{
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0 0;
}
.exp-track-viewport{
  flex: 1;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 0;
}
.exp-track{
  display: flex;
  gap: 20px;
  padding: 0 max(48px, calc((100vw - 900px) / 2 + 24px));
  will-change: transform;
  transition: transform .08s linear;
}

/* Expanded cards */
.exp-card{
  flex-shrink: 0;
  width: 420px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: background-color .45s ease, border-color .35s ease, box-shadow .35s ease, transform .35s ease, opacity .35s ease;
}
.exp-card::before{
  content:'';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 18px 18px 0 0;
  opacity: 0;
  transition: opacity .35s ease;
}
.exp-card.is-active{
  border-color: var(--accent);
  box-shadow: 0 24px 60px var(--shadow-strong), 0 0 0 1px rgba(224,112,64,0.15);
  transform: translateY(-4px);
}
.exp-card.is-active::before{ opacity: 0.8 }
.exp-card.hidden{ display: none }

.exp-card .card-top{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.exp-card .card-index{
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}
.exp-card .card-index .num{ color: var(--accent) }
.exp-card .duration{
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  padding: 4px 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(224,112,64,0.25);
  border-radius: 100px;
}
.exp-card .duration::before{
  content:'';
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
}

.exp-card .period{
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 14px;
}
.exp-card h3{
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -.015em;
  margin-bottom: 10px;
  color: var(--text);
  display: flex; align-items: flex-start; gap: 10px;
  flex-wrap: wrap;
}
.exp-card h3 .role-tag{
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  padding: 2px 8px;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  border-radius: 100px;
  font-weight: 400;
  letter-spacing: 0;
  align-self: center;
  flex-shrink: 0;
}
.exp-card .company{
  color: var(--text-2);
  font-size: 12.5px;
  font-family: 'Space Mono', monospace;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.exp-card .desc{
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
  /* Description is no longer scrolled inside the card — it expands so everything is always visible. */
  flex: 1 0 auto;
}
.exp-card .exp-tags{
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.exp-card .exp-tags span{
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  padding: 4px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
}

/* Internal timeline rail */
.timeline-rail{
  position: relative;
  width: 100%;
  padding: 24px max(48px, calc((100vw - 900px) / 2 + 24px)) 32px;
  flex-shrink: 0;
}
.rail-track{
  position: relative;
  height: 2px;
  background: var(--border);
  border-radius: 100px;
  overflow: visible;
}
.rail-progress{
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #C55A30 100%);
  border-radius: 100px;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width .12s linear;
}
.rail-playhead{
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(224,112,64,0.18), 0 0 16px var(--accent-glow);
  transition: left .12s linear;
  z-index: 3;
}
.rail-markers{
  position: relative;
  height: 100%;
}
.rail-marker{
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}
.rail-marker .dot{
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1.5px solid var(--border-bright);
  transition: all .35s ease;
  display: block;
}
.rail-marker .label{
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  transition: color .35s ease;
}
.rail-marker.passed .dot{
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.rail-marker.is-active .dot{
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.4);
  box-shadow: 0 0 0 4px rgba(224,112,64,0.18), 0 0 12px var(--accent-glow);
}
.rail-marker.is-active .label{
  color: var(--text);
}
.rail-meta{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 44px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rail-meta .scroll-hint{
  display: flex; align-items: center; gap: 8px;
  color: var(--text-3);
}
.rail-meta .scroll-hint svg{
  width: 12px; height: 12px;
  color: var(--accent);
  animation: scroll-hint-bob 2s ease-in-out infinite;
}
@keyframes scroll-hint-bob{
  0%,100%{ transform: translateY(0) }
  50%{ transform: translateY(2px) }
}
.rail-meta .counter-bg{ color: var(--text-2) }
.rail-meta .counter-bg .now{ color: var(--accent) }

/* ============================================================
   SKILLS, EDU, LANG CARDS
   ============================================================ */
.skills-grid, .edu-grid, .lang-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.skill-group, .edu-card, .lang-card{
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  transition: all 0.3s;
}
.skill-group:hover, .edu-card:hover, .lang-card:hover{
  border-color: var(--border-strong);
  background: var(--bg-2);
}
.skill-group h4{
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.group-count{
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 100px;
}
.group-desc{
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.skill{ margin-bottom: 14px }
.skill:last-child{ margin-bottom: 0 }
.skill-row{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.skill-name{
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.skill-level{
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  color: var(--text-3);
}
.skill-bar{
  height: 4px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.skill-fill{
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent) 0%, #C55A30 100%);
  border-radius: 100px;
  width: 0;
  transition: width 1.4s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 8px var(--accent-glow);
}
.edu-card .status{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-bottom: 16px;
  color: var(--text-3);
}
.edu-card.current .status{
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(224,112,64,0.25);
}
.edu-card h3{
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.015em;
  color: var(--text);
}
.edu-card .institution{
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 16px;
}
.edu-card .period{
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.lang-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.lang-card .name{
  font-weight: 500;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  color: var(--text);
}
.level-bar{ display: flex; gap: 4px }
.level-bar div{ flex: 1; height: 4px; background: var(--bg-3); border-radius: 100px }
.level-bar div.on{ background: var(--accent); box-shadow: 0 0 6px var(--accent-glow) }
.level-pill{
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  padding: 3px 9px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-2);
}

/* ============================================================
   INTERESTS
   ============================================================ */
.interests-cloud{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.pill{
  padding: 8px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 400;
  cursor: default;
  transition: all 0.3s ease;
  border-radius: 100px;
}
.pill:hover{
  background: var(--bg-2);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}
.curiosities-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.curiosity-card{
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(.4,0,.2,1);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.curiosity-card:hover{
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(224,112,64,0.12);
}
.c-front{
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.c-icon{
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 16px;
}
.c-title{ font-weight: 500; font-size: 14px; color: var(--text); }
.c-hint{
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
}
.c-back{
  position: absolute;
  inset: 0;
  padding: 20px;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.curiosity-card.revealed .c-front{ opacity: 0; transform: translateY(-10px) }
.curiosity-card.revealed .c-back{ opacity: 1; transform: translateY(0); pointer-events: auto }
.c-back p{ font-size: 13.5px; color: var(--text-2); line-height: 1.55 }
.c-back strong{ color: var(--accent); font-weight: 500 }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-card{
  padding: 40px;
  border-radius: 20px;
  background: var(--card-bg-strong);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: background-color 0.45s ease, border-color 0.4s ease;
}
.contact-card::before{
  content:'';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}
.contact-inner{
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.contact-card h2{
  font-weight: 600;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.contact-card h2 em{
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--accent);
}
.contact-list{ display: flex; flex-direction: column; gap: 8px }
.contact-item{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
}
.contact-item:hover{
  background: var(--bg-3);
  border-color: var(--border-strong);
  transform: translateX(4px);
}
.contact-item .label{
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.contact-item .val{
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.contact-item .arrow-wrap{
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: all 0.3s;
  flex-shrink: 0;
  background: var(--bg-1);
}
.contact-item:hover .arrow-wrap{
  color: var(--text);
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(-45deg);
}

/* ============================================================
   SIDE CONTROLS WRAPPER (theme toggle + side nav)
   ============================================================ */
.side-controls{
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none; /* children re-enable */
}
.side-controls > *{ pointer-events: auto; }

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle{
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--side-nav-bg);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 32px var(--shadow-strong), 0 1px 0 rgba(255,255,255,0.03) inset;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-2);
  position: relative;
  overflow: hidden;
  transition: background-color 0.45s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s ease;
  padding: 0;
}
.theme-toggle:hover{
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.06);
  box-shadow: 0 8px 32px var(--shadow-strong), 0 0 14px var(--accent-glow);
}
.theme-toggle:active{ transform: scale(0.96); }
.theme-toggle:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.theme-toggle svg{
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(.4,0,.2,1);
}
/* Show sun in dark mode (action: switch to light) */
:root[data-theme="dark"] .theme-toggle .icon-sun{
  opacity: 1; transform: rotate(0deg) scale(1);
}
:root[data-theme="dark"] .theme-toggle .icon-moon{
  opacity: 0; transform: rotate(-90deg) scale(0.6);
}
/* Show moon in light mode (action: switch to dark) */
:root[data-theme="light"] .theme-toggle .icon-sun{
  opacity: 0; transform: rotate(90deg) scale(0.6);
}
:root[data-theme="light"] .theme-toggle .icon-moon{
  opacity: 1; transform: rotate(0deg) scale(1);
}

/* ============================================================
   SIDE NAV (vertical pill, expands on hover)
   ============================================================ */
.side-nav{
  position: relative; /* positioning handled by .side-controls wrapper */
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--side-nav-bg);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border-strong);
  border-radius: 100px; /* fully rounded pill */
  box-shadow: 0 8px 32px var(--shadow-strong), 0 1px 0 rgba(255,255,255,0.03) inset;
  width: 52px; /* collapsed: just icons */
  overflow: hidden;
  transition: width 0.42s cubic-bezier(.4,0,.2,1),
              border-radius 0.42s cubic-bezier(.4,0,.2,1),
              background-color 0.45s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}
.side-nav:hover,
.side-nav:focus-within{
  width: 200px;
  border-radius: 26px; /* softens to a tall pill while expanded */
}
.side-nav a{
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  text-decoration: none;
  border-radius: 100px;
  transition: color 0.3s cubic-bezier(.4,0,.2,1),
              background-color 0.3s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.side-nav .nav-icon{
  /* Fixed square that fills the pill's inner width when collapsed,
     so the SVG inside is always perfectly centered horizontally
     and stays anchored in place during the expand/collapse animation. */
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: inherit;
  transition: color 0.3s ease, transform 0.3s ease;
}
.side-nav .nav-icon svg{
  width: 20px;
  height: 20px;
  display: block;
}
.side-nav .nav-label{
  /* Label is a 0-width flex item when collapsed (occupies no space at all,
     so the icon is truly centered) and grows on hover/focus. */
  max-width: 0;
  padding-right: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.42s cubic-bezier(.4,0,.2,1),
              padding-right 0.42s cubic-bezier(.4,0,.2,1),
              opacity 0.28s ease 0.05s;
}
.side-nav:hover .nav-label,
.side-nav:focus-within .nav-label{
  max-width: 140px;
  padding-right: 14px;
  opacity: 1;
}
.side-nav a:hover{
  color: var(--text);
  background: var(--bg-3);
}
.side-nav a:hover .nav-icon{
  transform: scale(1.08);
}
.side-nav a.active{
  color: var(--accent);
  background: var(--accent-soft);
}
.side-nav a.active .nav-icon{
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.side-nav a:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   METHODOLOGY — five-step process card
   Visually structured like a numbered framework, professional tone.
   Replaces the legacy "secret coffee recipe" section.
   ============================================================ */
.method-steps{
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  counter-reset: step;
}
.method-steps li{
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.6;
  padding: 16px 18px;
  background: var(--bg-1);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}
.method-steps li:hover{
  border-color: var(--border-strong);
  background: var(--bg-2);
  transform: translateX(3px);
}
.method-steps li .step-body{
  flex: 1;
  min-width: 0; /* lets long words wrap inside flex item */
}
.method-steps li strong{
  color: var(--text);
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.005em;
}
.step-num{
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================================
   CONFETTI, TOAST, FUN ELEMENTS
   ============================================================ */
#confetti-canvas{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}
.toast-container{
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast{
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 24px var(--shadow-soft);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.5s cubic-bezier(.2,.8,.2,1);
  max-width: 320px;
  pointer-events: auto;
  cursor: pointer;
}
.toast.show{ transform: translateX(0); opacity: 1 }
.toast .toast-title{
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.fun-fact-tooltip{
  position: fixed;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.2,.8,.2,1);
  max-width: 280px;
}
.fun-fact-tooltip.show{ opacity: 1; transform: translateY(0) scale(1) }
.fun-fact-inner{
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px var(--shadow-strong), 0 0 16px var(--accent-glow);
}
.fun-fact-inner .label{
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.fun-fact-inner .text{ font-size: 13.5px; color: var(--text); line-height: 1.5 }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.scroll-progress{
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #C55A30);
  z-index: 200;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer{
  position: relative;
  z-index: 6;
  padding: 60px 24px;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
}
footer span{ color: var(--accent) }

/* ============================================================
   WIGGLE ANIMATION (for easter egg)
   ============================================================ */
@keyframes wiggle{
  0%,100%{ transform: rotate(0deg) scale(1.3) }
  25%{ transform: rotate(-15deg) scale(1.3) }
  75%{ transform: rotate(15deg) scale(1.3) }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ============================================================
   RESPONSIVE — Comprehensive mobile/tablet system
   Breakpoints: 1024 (tablet landscape), 768 (tablet/phone),
   480 (phone), 360 (small phone)
   ============================================================ */

/* Only apply hover effects on devices that actually support hover.
   This prevents "stuck hover" bug on touch devices where a tapped
   element keeps its hover state until you tap somewhere else. */
@media (hover: none){
  .content-card:hover,
  .skill-group:hover, .edu-card:hover, .lang-card:hover,
  .curiosity-card:hover,
  .pill:hover,
  .contact-item:hover,
  .method-steps li:hover,
  .theme-toggle:hover,
  .side-nav a:hover,
  .scroll-down:hover{
    transform: none;
    box-shadow: none;
  }
  .contact-item:hover .arrow-wrap{ transform: none; }
  .side-nav a:hover .nav-icon{ transform: none; }
  /* Active state for touch — happens on tap */
  .contact-item:active{ background: var(--bg-3); }
  .pill:active{ background: var(--bg-2); border-color: var(--accent); }
  .curiosity-card:active{ border-color: var(--accent); }
  .filter-bar button:active{ background: var(--bg-3); }
}

/* Respect users who prefer less motion — important accessibility feature
   that's especially helpful on mobile where animations can cause discomfort */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal{ opacity: 1 !important; transform: none !important; }
  .star{ animation: none; opacity: var(--max, 0.5); }
  .typewriter-cursor{ animation: none; }
  .scroll-down .arrow{ animation: none; }
  .hero-badge .pulse{ animation: none; }
  .rail-meta .scroll-hint svg{ animation: none; }
}

/* ----------- TABLET LANDSCAPE & SMALLER (≤ 1024px) ----------- */
@media (max-width: 1024px){
  .content-section{ padding: 80px 22px; }
  #exp{ padding: 80px 0; }
  .exp-card{ width: 380px; }
  .curiosities-grid{ grid-template-columns: repeat(2, 1fr); }
  .content-card.lang-section-card{ padding: 40px; }
}

/* ----------- TABLET PORTRAIT & MOBILE (≤ 900px) -----------
   This is the major breakpoint — switches the whole layout to mobile.
   Disables horizontal scroll-jacking on the experience timeline,
   collapses navigation to a bottom pill, and stacks grids. */
@media (max-width: 900px){
  /* ----- SIDE CONTROLS: bottom pill bar with safe-area for iPhones ----- */
  .side-controls{
    left: 50%;
    top: auto;
    bottom: 16px;
    /* Respect home indicator on iPhones with notch */
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    flex-direction: row;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 24px);
  }
  .theme-toggle{
    width: 46px;   /* Larger touch target — Apple recommends min 44x44 */
    height: 46px;
    flex-shrink: 0;
  }
  .theme-toggle svg{ width: 18px; height: 18px; }

  /* Side nav: horizontal pill with all items visible, no hover-expand */
  .side-nav{
    flex-direction: row;
    width: auto;
    padding: 6px;
    gap: 2px;
    border-radius: 100px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  .side-nav::-webkit-scrollbar{ display: none; }
  .side-nav:hover,
  .side-nav:focus-within{
    width: auto;
    border-radius: 100px;
  }
  .side-nav a{ padding: 0; }
  .side-nav .nav-icon{
    width: 44px;   /* Larger touch target */
    height: 44px;
  }
  .side-nav .nav-icon svg{
    width: 20px;
    height: 20px;
  }
  .side-nav .nav-label{ display: none; }

  /* ----- EXPERIENCE TIMELINE: kill horizontal scroll-jacking on mobile ----- */
  #exp{ padding: 60px 0 }
  .exp-head-wrap{ padding: 0 16px }
  .exp-head-wrap .content-card-head{ padding: 24px 20px }
  .exp-scroll-wrapper{ height: auto !important }
  .exp-scroll-sticky{
    position: relative;
    height: auto;
    padding: 0 16px;
  }
  .exp-track-viewport{ overflow: visible }
  .exp-track{
    flex-direction: column;
    gap: 14px;
    padding: 0 !important;
    transform: none !important;
  }
  .exp-card{
    width: 100%;
    min-height: 0;
  }
  .exp-card .desc{
    -webkit-mask-image: none; mask-image: none;
    overflow-y: visible;
  }
  .timeline-rail{ display: none }

  /* ----- FILTER BAR: scroll horizontally if it overflows ----- */
  .filter-bar{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    flex-wrap: nowrap;
  }
  .filter-bar::-webkit-scrollbar{ display: none; }
  .filter-bar button{
    flex-shrink: 0;
    padding: 10px 14px;     /* Bigger touch target */
    font-size: 12px;
  }

  /* ----- ABOUT SECTION: stack the two-column grid ----- */
  .about-grid{
    grid-template-columns: 1fr;
    gap: 22px;
  }

  /* ----- GENERAL GRIDS: stack everything ----- */
  .skills-grid, .edu-grid{ grid-template-columns: 1fr }
  .lang-grid{ grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .curiosities-grid{ grid-template-columns: 1fr }
  .contact-inner{ grid-template-columns: 1fr; gap: 28px }

  /* ----- SECTIONS: tighter padding ----- */
  .content-section{ padding: 60px 18px; }
  .content-card{ padding: 28px 22px }
  .content-card.lang-section-card{ padding: 32px 22px; }
  .section-title--spaced{ margin-bottom: 24px; }
  .content-section.contact-section{ padding-top: 60px; padding-bottom: 100px; }
  .contact-card{ padding: 28px 22px; }

  /* ----- VERTICAL SPACERS: smaller on mobile ----- */
  .vspace-lg{ height: 12vh; min-height: 60px; }
  .vspace-md{ height: 8vh; min-height: 40px; }

  /* ----- HERO: bigger touch target on scroll-down arrow ----- */
  .hero-name{ font-size: clamp(2.4rem, 12vw, 5rem) }
  .hero-tagline{ padding: 0 4px; }
  .scroll-down .arrow{ width: 44px; height: 44px; }

  /* ----- TOAST: stack above bottom nav, full-width ----- */
  .toast-container{
    right: 12px;
    left: 12px;
    /* Sit above the bottom nav-pill (which is at 16px + ~46px tall + padding) */
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .toast{ max-width: 100% }

  /* ----- FUN-FACT TOOLTIP: cap width, prevent overflow ----- */
  .fun-fact-tooltip{
    max-width: calc(100vw - 24px);
  }

  /* ----- CURIOSITY CARDS: bigger touch + clearer "tap to flip" hint ----- */
  .curiosity-card{ min-height: 110px; padding: 18px; }

  /* ----- CONTACT: bigger tap targets ----- */
  .contact-item{ padding: 18px; }
  .contact-item .val{ font-size: 14.5px; word-break: break-word; }

  /* ----- METHODOLOGY STEPS: tighter for mobile ----- */
  .method-steps li{ font-size: 13.5px; padding: 14px; gap: 12px; }
  .step-num{ width: 24px; height: 24px; font-size: 11px; }

  /* ----- DOT FLYER: shorter trail on mobile (was 60vw which looked huge) ----- */
  @keyframes trailGrow{
    0%{ width: 0px; opacity: 0.8; }
    100%{ width: 50vw; opacity: 0; }
  }

  /* ----- PARALLAX BG: lighter blur on mobile (perf) ----- */
  .content-card,
  .exp-head-wrap .content-card-head,
  .exp-card,
  .side-nav,
  .theme-toggle{
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* ----- CITY LAYER: shorter on mobile so it doesn't dominate ----- */
  .city-layer{ height: 25vh; }
}

/* ----------- PHONE (≤ 480px) ----------- */
@media (max-width: 480px){
  body{ font-size: 14.5px; }

  .content-section{ padding: 50px 14px; }
  .content-card{ padding: 24px 18px; border-radius: 16px; }
  .content-card.lang-section-card{ padding: 26px 18px; }
  .contact-card{ padding: 24px 18px; border-radius: 16px; }
  .exp-head-wrap{ padding: 0 14px; }
  .exp-head-wrap .content-card-head{ padding: 22px 18px; border-radius: 16px; }
  .exp-scroll-sticky{ padding: 0 14px; }

  /* Hero gets a bit smaller spacing on phones */
  .hero{ padding: 0 18px; }
  .hero-badge{ font-size: 11px; padding: 5px 12px; margin-bottom: 24px; }
  .hero-name{ margin-bottom: 20px; }
  .hero-tagline{ margin-bottom: 32px; min-height: 4em; }

  /* Section titles wrap nicer */
  .section-title{ font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .section-sub{ font-size: 14px; }

  /* About lead text smaller on phones */
  .about-lead{ font-size: 1.05rem; line-height: 1.5; }
  .about-body{ font-size: 14px; }

  /* Experience cards: tighter padding, slightly smaller heading */
  .exp-card{ padding: 22px 18px; border-radius: 16px; }
  .exp-card h3{ font-size: 1.1rem; }
  .exp-card .desc{ font-size: 13px; }
  .exp-card .card-top{ margin-bottom: 16px; padding-bottom: 14px; }
  .exp-card .company{ margin-bottom: 14px; padding-bottom: 14px; }
  .exp-card .exp-tags{ margin-top: 14px; padding-top: 14px; }

  /* Skills */
  .skill-group, .edu-card, .lang-card{ padding: 20px 18px; }

  /* Languages: keep 2 cols but smaller */
  .lang-card .name{ font-size: 1.7rem; margin-bottom: 16px; }

  /* Education */
  .edu-card h3{ font-size: 1rem; }

  /* Interests pills: a bit bigger touch area */
  .pill{ padding: 8px 14px; font-size: 13.5px; }

  /* Curiosities */
  .curiosity-card{ min-height: 100px; padding: 16px; }
  .c-icon{ width: 32px; height: 32px; font-size: 14px; }
  .c-back{ padding: 16px; }
  .c-back p{ font-size: 13px; }

  /* Contact */
  .contact-item{ padding: 16px; }
  .contact-item .label{ font-size: 9.5px; }
  .contact-item .val{ font-size: 13.5px; }
  .contact-item .arrow-wrap{ width: 28px; height: 28px; }

  /* Side nav: trim 1 px so the pill comfortably fits 6 items on a 360-px-wide screen */
  .side-nav{ padding: 4px; }
  .side-nav .nav-icon{ width: 40px; height: 40px; }
  .side-nav .nav-icon svg{ width: 18px; height: 18px; }
  .theme-toggle{ width: 42px; height: 42px; }

  /* Filter bar even tighter */
  .filter-bar button{ padding: 9px 12px; font-size: 11px; }

  /* Methodology steps even tighter */
  .method-steps li{ font-size: 13px; padding: 12px; }

  /* Hide trail entirely on small phones — it was overwhelming there */
  .dot-trail{ display: none; }
}

/* ----------- SMALL PHONE (≤ 360px — iPhone SE 1st gen, older Androids) ----------- */
@media (max-width: 360px){
  .content-section{ padding: 44px 12px; }
  .content-card, .contact-card{ padding: 22px 16px; }
  .exp-head-wrap{ padding: 0 12px; }
  .exp-scroll-sticky{ padding: 0 12px; }

  .hero{ padding: 0 14px; }
  .hero-name{ font-size: clamp(2.1rem, 13vw, 3.4rem); }
  .hero-tagline{ font-size: 0.95rem; }

  .section-title{ font-size: clamp(1.4rem, 7.5vw, 2rem); }

  /* Languages stack on truly tiny screens — 2-col was getting cramped */
  .lang-grid{ grid-template-columns: 1fr; }

  /* Side nav pill needs to stay within the screen */
  .side-controls{ gap: 6px; max-width: calc(100% - 16px); }
  .side-nav{ padding: 3px; }
  .side-nav .nav-icon{ width: 38px; height: 38px; }
  .theme-toggle{ width: 40px; height: 40px; }
  .theme-toggle svg{ width: 16px; height: 16px; }

  .pill{ font-size: 13px; padding: 7px 12px; }

  /* Vertical spacers nearly disappear */
  .vspace-lg{ height: 8vh; min-height: 40px; }
  .vspace-md{ height: 5vh; min-height: 28px; }
}

/* ----------- LANDSCAPE PHONE (height-constrained) -----------
   When a phone is rotated landscape, the hero's 100dvh becomes very short.
   We tighten things so the name+tagline+scroll-down still fit. */
@media (max-height: 500px) and (orientation: landscape){
  .hero{ min-height: 100vh; padding: 16px 24px; }
  .hero-badge{ margin-bottom: 14px; }
  .hero-name{ margin-bottom: 12px; font-size: clamp(2rem, 7vw, 3.5rem); }
  .hero-tagline{ margin-bottom: 18px; min-height: 2.6em; font-size: 0.95rem; }
  .scroll-down{ font-size: 10px; }
  .scroll-down .arrow{ width: 34px; height: 34px; }

  /* In landscape, side-controls goes back to the side to save vertical space */
  .side-controls{
    left: max(16px, env(safe-area-inset-left));
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    max-width: none;
  }
}
