/* ===========================
   VARIABLES & RESET
=========================== */
:root {
  --bg: #080808;
  --surface: #111111;
  --surface-2: #1a1a1a;
  --surface-3: #222222;
  --primary: #F59E0B;
  --primary-light: #FBBF24;
  --primary-dark: #D97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  --primary-glow-soft: rgba(245, 158, 11, 0.10);
  --text: #F0F0F0;
  --text-muted: #888888;
  --text-dim: #555555;
  --border: rgba(245, 158, 11, 0.12);
  --border-hover: rgba(245, 158, 11, 0.35);
  --radius: 12px;
  --radius-lg: 20px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.3s ease;
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --nav-height: 70px;
  --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  /* Prevent iOS Safari from inflating text on orientation change */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}

/* Scroll lock while the mobile menu is open. `overflow:hidden` alone is
   not honoured by iOS Safari, so the body is pinned and JS restores the
   stashed scroll offset on close. */
body.menu-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===========================
   CUSTOM CURSOR
   Fine-pointer devices only. On touch/coarse pointers the native
   cursor stays intact and the cursor elements are removed entirely.
=========================== */
.cursor-dot, .cursor-ring { display: none; }

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  button { cursor: none; }
  .cursor-dot, .cursor-ring { display: block; }
}

.cursor-dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s, opacity 0.3s;
  mix-blend-mode: normal;
  opacity: 0;
}

.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease, width 0.25s, height 0.25s, border-color 0.2s, opacity 0.3s;
  opacity: 0;
}

body.cursor-active .cursor-dot { opacity: 1; }
body.cursor-active .cursor-ring { opacity: 0.7; }
body.cursor-active.cursor-hover .cursor-ring { opacity: 0.4; }

body.cursor-hover .cursor-dot { width: 12px; height: 12px; background: var(--primary-light); }
body.cursor-hover .cursor-ring { width: 52px; height: 52px; opacity: 0.4; }

/* ===========================
   SCROLL PROGRESS
=========================== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 9998;
  transition: width 0.1s linear;
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 5%;
  padding-left: max(5%, env(safe-area-inset-left));
  padding-right: max(5%, env(safe-area-inset-right));
  z-index: 1000;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--transition), backdrop-filter var(--transition), border-bottom-color var(--transition);
}

/* The menu case matters because pinning the body resets scrollY to 0,
   which would otherwise strip .scrolled and leave the bar transparent
   over the open overlay. */
.navbar.scrolled,
body.menu-open .navbar {
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  /* "P." is only ~21px wide - pad it out to a tappable box */
  min-width: 44px;
  min-height: 44px;
  margin-left: -8px;
  padding: 0 8px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  flex-shrink: 0;
}
.nav-logo span { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: stretch;
  gap: 2.5rem;
}
.nav-links li { display: flex; }

/* Touch tablets (iPad at 1024px) get the desktop nav, so these need a
   real target height rather than the 17px the text alone would give. */
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: color var(--transition);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 10px; left: 0;
  width: 0; height: 1.5px;
  background: var(--primary);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 40px;
  padding: 8px 22px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  font-family: var(--font-body);
}
.nav-cta:hover {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 20px var(--primary-glow);
}

/* 44x44 minimum touch target, with the bars optically centred inside it */
.hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  margin-right: -10px;
  flex-shrink: 0;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: var(--nav-height); left: 0; right: 0; bottom: 0;
  background: rgba(8, 8, 8, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  padding: 1.75rem 5%;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  border-bottom: 1px solid var(--border);
  /* Menu content can exceed a short landscape viewport - let it scroll */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-24px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0s linear 0.4s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0s linear 0s;
}
.mobile-menu ul { display: flex; flex-direction: column; }
.mobile-menu li + li { border-top: 1px solid rgba(245, 158, 11, 0.07); }
.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), padding-left var(--transition);
}
.mobile-menu a:hover { color: var(--primary); padding-left: 8px; }
.mobile-menu a:active { color: var(--primary); }

.mobile-menu-footer {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
/* Scoped through .mobile-menu so it outranks `.mobile-menu a`'s muted colour */
.mobile-menu .mobile-menu-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  width: 100%;
  border-radius: 10px;
  background: var(--primary);
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
}
.mobile-menu .mobile-menu-cta:hover,
.mobile-menu .mobile-menu-cta:active { color: #000; padding-left: 0; }
.mobile-menu-socials { display: flex; gap: 0.9rem; }
.mobile-menu-socials a {
  width: 48px; height: 48px;
  min-height: 48px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 1.15rem;
}
.mobile-menu-socials a:hover { padding-left: 0; }

/* ===========================
   UTILITY
=========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 5%;
  padding-left: max(5%, env(safe-area-inset-left));
  padding-right: max(5%, env(safe-area-inset-right));
}
.section { padding: 100px 0; }
.section-alt { background: var(--surface); }
.mt-6 { margin-top: 2rem; }

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 3.5rem;
  color: var(--text);
}
.section-title span { color: var(--primary); }

.section-sub {
  color: var(--text-muted);
  max-width: 600px;
  margin: -2.5rem 0 3rem;
  font-size: 1.05rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  font-family: var(--font-body);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: #000;
}
.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 8px 30px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-ghost {
  border: 1.5px solid var(--border-hover);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow-soft);
  transform: translateY(-2px);
}

/* Glass Card */
.glass-card {
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* ===========================
   HERO
=========================== */
#hero {
  position: relative;
  min-height: 100vh;
  /* svh = viewport height with the mobile URL bar EXPANDED, so the hero
     never gets clipped by browser chrome. Deliberately not dvh: that
     resizes mid-scroll and thrashes the particle canvas. */
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(245,158,11,0.06) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
  transition: background 0.1s linear;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 5%;
  padding-top: var(--nav-height);
  text-align: center;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.3s ease forwards;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -4px;
  color: var(--text);
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.5s ease forwards;
}

.hero-name .name-text {
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-name .name-cursor {
  display: inline-block;
  margin-left: 4px;
  color: var(--primary);
  font-weight: 300;
  animation: blink 1s infinite;
}

.hero-name .name-cursor.cursor-done {
  animation: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-typewriter {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.7s ease forwards;
}

.typewriter-text {
  color: var(--primary);
  font-weight: 600;
}

.cursor-blink {
  color: var(--primary);
  animation: blink 1s infinite;
  font-weight: 300;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.9s ease forwards;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.7s 1.1s ease forwards;
}

.magnetic-btn { position: relative; }

.hero-socials {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  opacity: 0;
  animation: fadeUp 0.7s 1.3s ease forwards;
}

.hero-socials a {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all var(--transition);
}
.hero-socials a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow-soft);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem; left: 5%;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s 1.8s ease forwards;
}

.scroll-line {
  width: 40px; height: 1px;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}
.scroll-dot {
  width: 8px; height: 100%;
  background: var(--primary);
  position: absolute;
  left: -8px;
  animation: scrollMove 2s ease-in-out infinite;
}

/* ===========================
   ABOUT
=========================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: center;
  margin-bottom: 4rem;
}

.about-photo-wrap {
  display: flex;
  justify-content: center;
}

.about-photo-card {
  position: relative;
  width: 300px;
  height: 360px;
  border-radius: var(--radius-lg);
  overflow: visible;
  transform-style: preserve-3d;
}

.photo-ring {
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  background: conic-gradient(var(--primary), var(--primary-light), var(--primary-dark), var(--primary));
  animation: spinRing 6s linear infinite;
  z-index: 0;
}

.photo-ring::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: var(--bg);
}

.photo-placeholder {
  position: absolute;
  inset: 4px;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  color: var(--primary);
  z-index: 1;
  letter-spacing: -2px;
  overflow: hidden;
}

.photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  border-radius: var(--radius-lg);
}

.photo-badge {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.badge-dot {
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.about-bio h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
  line-height: 1.3;
}

.about-bio p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.0rem;
  line-height: 1.8;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.stat-card {
  text-align: center;
  padding: 1.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition);
  min-width: 0;
}
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

/* Fluid so the widest value ("2000+") still fits a 2-column grid at 320px */
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 7.5vw, 2.8rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.stat-suffix {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5.5vw, 2rem);
  font-weight: 700;
  color: var(--primary);
}

.stat-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ===========================
   SKILLS
=========================== */
.skills-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  /* Falls back to a horizontal scroller instead of overflowing the
     viewport when the three labels can't fit side by side. */
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.skills-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  font-family: var(--font-body);
  white-space: nowrap;
}
.tab-btn.active, .tab-btn:hover {
  background: var(--surface-3);
  color: var(--primary);
}
.tab-btn.active { box-shadow: 0 2px 12px rgba(0,0,0,0.3); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- Skill cards ---------------------------------------------------- */
.skill-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.skill-card {
  flex: 1 1 180px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.7rem 1.1rem 1.3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(158deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: opacity 0.5s ease,
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              border-color var(--transition),
              box-shadow var(--transition);
}

/* Soft accent bloom behind the icon, revealed on hover */
.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 190px; height: 190px;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 68%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.skill-icon {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--primary-glow-soft);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 1.45rem;
  position: relative;
  z-index: 1;
  transition: background var(--transition), color var(--transition),
              box-shadow var(--transition), transform var(--transition);
}

.skill-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  position: relative;
  z-index: 1;
}

/* Qualitative tier replaces the old percentage - same signal, no false precision */
.skill-tier {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.skill-tier::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.skill-card[data-tier="core"] .skill-tier {
  color: var(--primary);
  background: var(--primary-glow-soft);
  border-color: var(--border-hover);
}
.skill-card[data-tier="strong"] .skill-tier {
  color: #cfcfcf;
  background: var(--surface-3);
  border-color: rgba(255, 255, 255, 0.07);
}
.skill-card[data-tier="working"] .skill-tier {
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Staggered entrance. The hidden state is enabled by JS (.js-reveal) so
   the cards stay visible if the script never runs. */
.skill-grid.js-reveal .skill-card {
  opacity: 0;
  transform: translateY(16px);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.skill-grid.js-reveal .skill-card.in {
  opacity: 1;
  transform: translateY(0);
}
.skill-card:nth-child(1) { --i: 0; }
.skill-card:nth-child(2) { --i: 1; }
.skill-card:nth-child(3) { --i: 2; }
.skill-card:nth-child(4) { --i: 3; }
.skill-card:nth-child(5) { --i: 4; }

.skill-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45), 0 0 24px var(--primary-glow-soft);
  transform: translateY(-6px);
  transition-delay: 0s;
}
.skill-card:hover::before { opacity: 1; }
.skill-card:hover .skill-icon {
  background: var(--primary);
  color: #000;
  box-shadow: 0 10px 24px var(--primary-glow);
  transform: translateY(-2px) scale(1.06);
}
/* Beat the .js-reveal rule's transform so hover still lifts the card */
.skill-grid.js-reveal .skill-card.in:hover {
  transform: translateY(-6px);
  transition-delay: 0s;
}

/* --- Supporting toolkit --------------------------------------------- */
.skill-extras {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.skill-extras-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  font-family: var(--font-mono);
}
.skill-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ===========================
   EXPERIENCE TIMELINE
=========================== */
.timeline {
  position: relative;
  padding: 1rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 10%, var(--border) 90%, transparent);
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-node {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.8rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.node-dot {
  width: 16px; height: 16px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--bg);
  position: relative;
  transition: box-shadow var(--transition);
}
.node-dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 6px var(--primary-glow);
}
.node-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--primary);
  opacity: 0.5;
  animation: pulseRing 2s ease-out infinite;
}

.timeline-item[data-side="right"] .timeline-card { grid-column: 2; }
.timeline-item[data-side="left"] .timeline-card { grid-column: 1; }

.timeline-card {
  padding: 1.8rem 1.6rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.card-header > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.job-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.company-name {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.job-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}

.job-type {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.job-type.current { background: rgba(34,197,94,0.12); color: #22c55e; }
.job-type.freelance { background: var(--primary-glow-soft); color: var(--primary); }

.job-bullets {
  list-style: none;
  margin-bottom: 1.2rem;
}
.job-bullets li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 4px 0 4px 1.2rem;
  position: relative;
  line-height: 1.7;
}
.job-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 0.75rem;
  top: 6px;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tech-tags span {
  padding: 4px 12px;
  background: var(--primary-glow-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  font-family: var(--font-mono);
}

/* ===========================
   PROJECTS
=========================== */
.project-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  min-height: 44px;
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
  font-family: var(--font-body);
}
.filter-btn.active, .filter-btn:hover {
  background: var(--primary-glow-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  transform-style: preserve-3d;
}
.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 30px var(--primary-glow-soft);
}

.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.project-card.span-full { grid-column: 1 / -1; }

.project-img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--surface-3);
}
.project-card.featured .project-img { aspect-ratio: auto; min-height: 280px; }

.project-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.3;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  transition: opacity var(--transition);
}
.project-card:hover .project-img-placeholder { opacity: 0.15; }

.project-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.project-card:hover .project-img img { transform: scale(1.06); }

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(8,8,8,0.7);
  opacity: 0;
  transition: opacity var(--transition);
  backdrop-filter: blur(4px);
}
.project-card:hover .project-overlay { opacity: 1; }

/* Touch / coarse pointers can never trigger :hover, so the overlay
   collapses into a permanently visible action bar at the foot of the
   image. Without this, project links are unreachable on mobile. */
@media (hover: none), (pointer: coarse) {
  .project-overlay {
    opacity: 1;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0.9rem;
    background: linear-gradient(to top, rgba(8,8,8,0.92) 0%, rgba(8,8,8,0.55) 45%, transparent 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.proj-link {
  min-height: 44px;
  padding: 10px 20px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(245,158,11,0.1);
  transition: background var(--transition), transform var(--transition);
  display: inline-flex; align-items: center; gap: 7px;
}
.proj-link:hover { background: var(--primary); color: #000; transform: scale(1.05); }

.project-info { padding: 1.5rem; }
.project-card.featured .project-info {
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.project-info h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.project-card.featured .project-info h3 { font-size: 1.5rem; }

.project-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}
.project-card.featured .project-info p { font-size: 1rem; }

.client-label {
  padding: 4px 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.featured-label {
  padding: 4px 12px;
  background: var(--primary-glow-soft);
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-card.hidden { display: none; }

.projects-cta {
  text-align: center;
  margin-top: 3rem;
}

/* ===========================
   ACHIEVEMENTS
=========================== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.achievements-grid.single-item {
  grid-template-columns: minmax(280px, 420px);
  justify-content: center;
}

.achievement-card {
  padding: 2rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  text-align: center;
}
.achievement-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 20px var(--primary-glow-soft);
}

.ach-icon {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: var(--primary-glow-soft);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 auto 1.2rem;
  transition: background var(--transition), box-shadow var(--transition);
}
.achievement-card:hover .ach-icon {
  background: var(--primary);
  color: #000;
  box-shadow: 0 8px 25px var(--primary-glow);
}

.achievement-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
  color: var(--text);
}

.achievement-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.ach-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
}

/* Certs */
.certs-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.certs-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cert-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  flex: 1;
  min-width: 260px;
}
.cert-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.cert-card > i { font-size: 1.8rem; color: var(--primary); flex-shrink: 0; }
.cert-card strong { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.cert-card span { font-size: 0.8rem; color: var(--text-muted); }

/* ===========================
   CONTACT
=========================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: start;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}
.contact-item:first-child { padding-top: 0; }

.contact-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--primary-glow-soft);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-item strong { display: block; font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.contact-item a, .contact-item span { font-size: 0.95rem; color: var(--text); }
.contact-item a:hover { color: var(--primary); }

.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  color: #22c55e;
}
.avail-dot {
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}
.social-links a {
  width: 48px; height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all var(--transition);
}
.social-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow-soft);
  transform: translateY(-3px);
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  /* Must stay >= 16px: iOS Safari auto-zooms the viewport when a
     focused field has a smaller computed font-size. */
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-group input { min-height: 54px; }
.form-group textarea { resize: vertical; min-height: 140px; }

.form-group label {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.25s ease;
  background: var(--surface-2);
  padding: 0 6px;
}
.form-group textarea ~ label { top: 18px; transform: none; }

.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow-soft); }

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: 0;
  font-size: 0.78rem;
  color: var(--primary);
  transform: translateY(-50%);
}
.submit-btn { align-self: flex-start; }

/* ===========================
   FOOTER
=========================== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.marquee-wrap {
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  gap: 3rem;
  animation: marquee 20s linear infinite;
}
.marquee-track span { font-family: var(--font-display); font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.marquee-dot { color: var(--primary) !important; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.8rem 5%;
  padding-bottom: calc(1.8rem + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p { font-size: 0.9rem; color: var(--text-muted); }
.footer-bottom p span { color: var(--primary); font-weight: 600; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--primary); }

/* ===========================
   ANIMATIONS
=========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes blink {
  0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; }
}
@keyframes spinRing {
  from { transform: rotate(0deg); } to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes scrollMove {
  0% { left: -8px; } 100% { left: 100%; }
}
@keyframes marquee {
  from { transform: translateX(0); } to { transform: translateX(-50%); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ===========================
   RESPONSIVE
=========================== */

/* --- Tablet / small laptop --- */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .about-photo-wrap { order: -1; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .timeline::before { left: 20px; }
  .timeline-item { grid-template-columns: 1fr; padding-left: 50px; }
  /* Keep translateX(-50%) so the dot stays centred on the rail - the rail
     itself is also -50% shifted, so dropping it here offsets the dot by ~8px */
  .timeline-node { left: 20px; }
  .timeline-item[data-side="right"] .timeline-card,
  .timeline-item[data-side="left"] .timeline-card { grid-column: 1; }
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .project-card.featured { grid-template-columns: 1fr; }
  .project-card.featured .project-info { padding: 1.8rem; }
}

/* --- Phone landscape / large phone --- */
@media (max-width: 768px) {
  :root { --nav-height: 64px; }

  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }

  .section { padding: 80px 0; }
  .section-title { margin-bottom: 2.5rem; }
  .section-sub { margin: -1.75rem 0 2.5rem; font-size: 1rem; }

  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: 1; }
  .project-card.featured .project-img { min-height: 0; aspect-ratio: 16/10; }
  .project-card.featured .project-info h3 { font-size: 1.25rem; }
  .project-card.featured .project-info p { font-size: 0.92rem; }

  .hero-name { letter-spacing: -2px; }
  .hero-sub { font-size: 1rem; }
  .hero-cta { flex-direction: column; align-items: stretch; margin-bottom: 2.5rem; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  /* The indicator sits on top of hero content once the viewport shortens */
  .scroll-indicator { display: none; }

  .achievements-grid { grid-template-columns: 1fr; }
  .about-photo-card { width: 240px; height: 290px; }
  .about-bio h3 { font-size: 1.35rem; }

  .submit-btn { align-self: stretch; justify-content: center; }
}

/* --- Phone portrait --- */
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 1rem; padding-top: 2.5rem; }
  .stat-card { padding: 1.4rem 0.75rem; }
  .stat-card p { font-size: 0.78rem; }
  .certs-grid { flex-direction: column; }
  .cert-card { min-width: 0; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 0.25rem; }

  /* Tuned so all three tabs fit without scrolling from 360px up - the
     overflow-x scroller stays as the fallback below that. */
  .skills-tabs { width: 100%; }
  .tab-btn { flex: 1 0 auto; padding: 10px 15px; font-size: 0.85rem; }

  /* Grid rather than flex so every card is exactly the same width -
     flex would let a lone last card stretch out of proportion. */
  .skill-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .skill-card { max-width: none; padding: 1.35rem 0.85rem 1.1rem; gap: 0.7rem; }
  .skill-icon { width: 48px; height: 48px; font-size: 1.2rem; border-radius: 14px; }
  .skill-name { font-size: 0.92rem; }

  /* An odd card out spans the row and turns horizontal, so it reads as a
     deliberate wide card instead of a stretched leftover. */
  .skill-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
  }
  .skill-card:last-child:nth-child(odd) .skill-tier { margin-top: 0; }
  .skill-card:last-child:nth-child(odd) .skill-icon { width: 42px; height: 42px; font-size: 1.05rem; }

  .skill-extras { margin-top: 2.25rem; padding-top: 2rem; }

  .timeline-card { padding: 1.4rem 1.2rem; }
  /* Meta reads as a left-aligned row under the job title on narrow cards */
  .card-header { flex-direction: column; gap: 0.75rem; }
  .card-meta {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: 0;
  }

  .project-info { padding: 1.25rem; }
  .project-card.featured .project-info { padding: 1.25rem; }
  .project-header { flex-wrap: wrap; gap: 0.5rem; }

  .achievements-grid.single-item { grid-template-columns: 1fr; }

  .contact-item { gap: 1rem; }
  .contact-form { gap: 1.25rem; }

  .marquee-track { gap: 2rem; }
  .marquee-track span { font-size: 0.82rem; }
}

/* --- Small phones (iPhone SE and below) --- */
@media (max-width: 400px) {
  .hero-name { letter-spacing: -1px; }
  .hero-greeting { font-size: 0.85rem; }
  .hero-socials { gap: 0.75rem; }

  .timeline-item { padding-left: 38px; }
  .timeline::before { left: 14px; }
  .timeline-node { left: 14px; }
  .timeline-card { padding: 1.2rem 1rem; }
  .job-bullets li { font-size: 0.86rem; }

  .skills-tabs { gap: 4px; }
  .tab-btn { padding: 10px 12px; font-size: 0.78rem; }
  .skill-grid { gap: 0.6rem; }
  .skill-card { padding: 1.2rem 0.6rem 1rem; }
  .skill-name { font-size: 0.85rem; }
  .skill-tier { font-size: 0.6rem; letter-spacing: 1px; padding: 3px 9px; }
  .skill-card:last-child:nth-child(odd) { gap: 0.7rem; padding: 0.9rem; }
  .about-photo-card { width: 210px; height: 255px; }
  .photo-badge { font-size: 0.72rem; padding: 7px 14px; }
  .section-tag { letter-spacing: 1.5px; font-size: 0.72rem; }
}

/* --- Short viewports (phone landscape) ---
   Vertical space is the scarce resource here, so the hero drops its
   full-height behaviour and the CTAs go back to a single row. */
@media (max-height: 520px) and (orientation: landscape) {
  #hero { min-height: auto; padding: calc(var(--nav-height) + 1.5rem) 0 2.5rem; }
  .hero-content { padding-top: 0; }
  .scroll-indicator { display: none; }

  .hero-name { font-size: clamp(2.5rem, 8vw, 4rem); margin-bottom: 0.6rem; }
  .hero-greeting { margin-bottom: 0.5rem; }
  .hero-typewriter { margin-bottom: 0.8rem; }
  .hero-sub { margin-bottom: 1.5rem; }
  .hero-cta {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
  }
  .hero-cta .btn { width: auto; }
  .hero-socials { gap: 0.75rem; }
}

/* ===========================
   TOUCH / COARSE POINTER
   :hover never fires reliably on touch - and when it does, it sticks
   after the tap. Neutralise the movement-based hover states and give
   real :active feedback instead.
=========================== */
@media (hover: none), (pointer: coarse) {
  .btn-primary:hover,
  .btn-ghost:hover,
  .stat-card:hover,
  .skill-tag:hover,
  .achievement-card:hover,
  .cert-card:hover,
  .hero-socials a:hover,
  .social-links a:hover,
  .proj-link:hover { transform: none; box-shadow: none; }

  .project-card:hover { transform: none; }
  .project-card:hover .project-img img { transform: none; }
  .mobile-menu a:hover { padding-left: 0; }

  .skill-card:hover,
  .skill-grid.js-reveal .skill-card.in:hover { transform: translateY(0); box-shadow: none; }
  .skill-card:hover .skill-icon {
    background: var(--primary-glow-soft);
    color: var(--primary);
    box-shadow: none;
    transform: none;
  }
  .skill-card:hover::before { opacity: 0; }

  .btn:active { transform: scale(0.98); opacity: 0.9; }
  .tab-btn:active,
  .filter-btn:active,
  .proj-link:active { opacity: 0.75; }
  .hero-socials a:active,
  .social-links a:active { border-color: var(--primary); color: var(--primary); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cursor-dot, .cursor-ring { display: none !important; }
  .marquee-track { animation: none; }
  /* The entrance states are JS-driven; make sure nothing stays invisible */
  .hero-greeting, .hero-name, .hero-typewriter,
  .hero-sub, .hero-cta, .hero-socials, .scroll-indicator { opacity: 1; }
}
