/* ============================================================
   PARESH PUROHIT — PORTFOLIO CSS
   Premium dark theme, inspired by christoph-nagel.dev quality
   ============================================================ */

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

/* Prevent any horizontal scroll on every device */
html, body { max-width: 100%; overflow-x: hidden; }

:root {
  --bg:          #080a0e;
  --bg2:         #0d1117;
  --bg3:         #111827;
  --surface:     #161c27;
  --surface2:    #1c2536;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);
  --text:        #e8eaf0;
  --text-muted:  #8892a4;
  --text-dim:    #6b7280;   /* raised from #4b5563 — passes WCAG AA 4.5:1 on --bg */
  --accent:      #6366f1;
  --accent2:     #818cf8;
  --accent-glow: rgba(99,102,241,0.18);
  --green:       #22c55e;
  --white:       #ffffff;
  --font-main:   'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:   'Inter', system-ui, sans-serif;
  --nav-h:       70px;
  --radius:      12px;
  --radius-lg:   20px;
  --transition:  cubic-bezier(0.4, 0, 0.2, 1);
  --spring:      cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
}

/* ── SELECTION ── */
::selection { background: rgba(99,102,241,0.3); color: var(--white); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── CUSTOM CURSOR ── */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.1s, background 0.2s;
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid rgba(99,102,241,0.45);
  border-radius: 50%;
  transition: width 0.22s var(--transition), height 0.22s var(--transition),
              border-color 0.22s, background 0.22s, transform 0.08s;
}
.cursor-ring.hover {
  width: 60px; height: 60px;
  border-color: var(--accent);
  background: rgba(99,102,241,0.08);
}
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ── SCROLL PROGRESS BAR ── */
#scrollBar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #a78bfa 100%);
  z-index: 1001;
  transition: width 0.08s linear;
}

/* ============================================================
   NAVBAR  — transparent on hero, centred pill links
   ============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  transition: background 0.5s, backdrop-filter 0.5s, box-shadow 0.5s;
}
#navbar.scrolled {
  background: rgba(8,10,14,0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;   /* centre the pill nav */
  position: relative;
}

/* ── Centred pill nav (desktop) ── */
.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 5px 6px;
  backdrop-filter: blur(12px);
}
.nav-links a {
  display: block;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

/* Top-right Contact button handled in hero layer */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  position: absolute;
  right: 20px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--white);
  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; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  display: none;
  flex-direction: column;
  background: rgba(8,10,14,0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 12px 20px 20px;
}
.mobile-menu a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  display: block;
  transition: color 0.2s;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--white); }
.mobile-menu.open { display: flex; }

/* ============================================================
   HERO — Full-viewport photo background (christoph-nagel style)
   ============================================================ */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background: #0a0a0a;
  /* Desktop: name sits on the right side of the photo */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding-top: 22vh;   /* push name further down */
}

/* ── Background photo ── */
.hero-bg-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* WebP (22KB) preferred; PNG (1.2MB) auto-fallback via <picture> logic in JS */
  background: url('hero.webp') center 0% / cover no-repeat;
  filter: grayscale(30%) brightness(0.72) contrast(1.08);
  transform-origin: center;
  transition: transform 0.1s linear;
  will-change: transform;
}

/* Fallback gradient when no image */
.hero-bg-img.no-photo {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 40%, #0f0f23 100%);
  filter: none;
}

/* ── Dark overlay layers ── */
.hero-overlay-dark {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.05) 35%,
    rgba(0,0,0,0.05) 55%,
    rgba(0,0,0,0.55) 100%
  );
}
.hero-overlay-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(0deg,
    rgba(0,0,0,0.92) 0%,
    rgba(0,0,0,0.6)  35%,
    transparent      100%
  );
}
.hero-overlay-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 50%,
    transparent 40%,
    rgba(0,0,0,0.5) 100%
  );
}

/* ── Film grain canvas ── */
#heroGrain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: screen;
}

/* ── Top-right Contact button ── */
.hero-top-right {
  position: fixed;
  top: 16px;
  right: 32px;
  z-index: 600;
  opacity: 0;
  animation: fadeIn 0.6s 0.3s forwards;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 8px;
}
.htr-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
  letter-spacing: 0.3px;
}
.htr-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}

/* ── Identity block — right side on desktop, centered on mobile ── */
.hero-identity {
  position: relative;
  z-index: 8;
  text-align: right;
  padding-right: clamp(40px, 7vw, 120px);
  width: fit-content;
  max-width: 55vw;
  opacity: 0;
  animation: fadeUp 0.7s 0.6s var(--transition) forwards;
  /* Prevent mix-blend-mode bleed from grain canvas causing text doubling */
  isolation: isolate;
  will-change: opacity, transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Thin accent line above name */
.hero-identity::before {
  content: '';
  display: block;
  width: 56px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 22px;
  margin-left: auto;
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(99,102,241,0.65);
}

.hi-name {
  font-family: var(--font-main);
  font-size: clamp(32px, 5.2vw, 76px);
  font-weight: 700;
  letter-spacing: clamp(2px, 0.3vw, 5px);
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 16px 0; /* reset h1 browser default margins */
  padding: 0;
  /* No text-shadow during opacity animation — causes double-render ghost on Blink/WebKit */
  white-space: nowrap;
  display: block;
  text-align: right;
  line-height: inherit;
}
.hi-subtitle {
  font-size: clamp(12px, 1.5vw, 20px);
  font-weight: 400;
  color: rgba(255,255,255,0.82);
  letter-spacing: clamp(3px, 0.5vw, 6px);
  text-transform: uppercase;
  white-space: nowrap;
  display: block;
  text-align: right;
}

.hi-tagline {
  font-size: clamp(10px, 1.1vw, 14px);
  font-weight: 500;
  color: var(--accent2);
  letter-spacing: clamp(3px, 0.5vw, 6px);
  text-transform: uppercase;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  opacity: 0.85;
}
.hi-tagline::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--accent2);
  opacity: 0.6;
  flex-shrink: 0;
}



/* ── Massive display word ── */
.hero-display-word {
  position: absolute;
  bottom: 60px;   /* desktop: sits comfortably above social links */
  left: 0; right: 0;
  z-index: 7;
  text-align: center;
  line-height: 1;
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  animation: wordReveal 0.9s 0.9s var(--spring) forwards;
}
.hero-display-word span {
  display: block;
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: clamp(100px, 18vw, 260px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--white);
  line-height: 0.88;
  will-change: transform;
  /* Subtle text-shadow for depth */
  text-shadow: 0 4px 60px rgba(0,0,0,0.5);
}
@keyframes wordReveal {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: none; }
}

/* Word swap transition */
.hero-display-word span.swapping-out {
  animation: wordOut 0.35s var(--transition) forwards;
}
.hero-display-word span.swapping-in {
  animation: wordIn 0.45s var(--spring) forwards;
}
@keyframes wordOut {
  to { opacity: 0; transform: translateY(-30px); }
}
@keyframes wordIn {
  from { opacity: 0; transform: translateY(50px); }
  to   { opacity: 1; transform: none; }
}

/* ── Bottom-left: PP monogram + socials ── */
.hero-bottom-left {
  position: absolute;
  bottom: 28px;
  left: 32px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  opacity: 0;
  animation: fadeIn 0.6s 1.2s forwards;
}

/* PP monogram badge */
.hero-pp-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #818cf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 8px 24px rgba(99,102,241,0.5);
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* Shimmer sweep */
.hero-pp-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.35) 50%, transparent 80%);
  animation: ppShimmer 3s ease-in-out infinite;
}
@keyframes ppShimmer {
  0%   { left: -60%; }
  60%  { left: 130%; }
  100% { left: 130%; }
}
.hero-pp-badge:hover {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3), 0 12px 32px rgba(99,102,241,0.7);
}

/* Divider line */
.hero-bl-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
}

/* Social links */
.hbl-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.2s, transform 0.2s;
}
.hbl-link svg { width: 15px; height: 15px; }
.hbl-link:hover { color: rgba(255,255,255,0.95); transform: translateY(-2px); }

/* ── Bottom-right: progress line + arrows ── */
.hero-bottom-right {
  position: absolute;
  bottom: 24px;
  right: 32px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeIn 0.6s 1.2s forwards;
}
.hbr-arrow {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.hbr-arrow:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.4);
  color: var(--white);
}
.hbr-line {
  width: 80px;
  height: 1px;
  background: rgba(255,255,255,0.25);
  position: relative;
  overflow: hidden;
}
.hbr-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.8);
  animation: lineProgress 4s linear infinite;
}
@keyframes lineProgress {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* ── Scroll hint circle (top-left, like reference) ── */
.hero-scroll-hint {
  position: absolute;
  top: 80px;
  left: 32px;
  z-index: 10;
  opacity: 0;
  animation: fadeIn 0.7s 1.0s forwards;
}
.hsh-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  animation: rotateSlow 12s linear infinite;
}
.hsh-circle span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   SECTIONS COMMON
   ============================================================ */
.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg2); }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.section-eyebrow::before {
  content: '';
  display: block;
  width: 22px; height: 1.5px;
  background: var(--accent);
}
.section-h2 {
  font-family: var(--font-main);
  font-size: clamp(34px, 4.5vw, 58px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 60px;
}
.section-h2 .acc { color: var(--accent2); }

/* Reveal on scroll — only hide when JS has loaded (.js-ready on <html> or <body>).
   Without JS the sections remain fully visible, preventing blank pages. */
.js-ready [data-reveal],
body.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--transition), transform 0.7s var(--transition);
}
.js-ready [data-reveal].in,
body.js-ready [data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-d="1"] { transition-delay: 0.1s; }
[data-reveal][data-d="2"] { transition-delay: 0.2s; }
[data-reveal][data-d="3"] { transition-delay: 0.3s; }
[data-reveal][data-d="4"] { transition-delay: 0.4s; }
[data-reveal][data-d="5"] { transition-delay: 0.5s; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
  line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 24px rgba(99,102,241,0.25);
}
.btn-primary:hover {
  background: var(--accent2);
  box-shadow: 0 8px 32px rgba(99,102,241,0.4);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border2);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: var(--accent-glow);
}
.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.09);
  color: var(--text);
  border-color: var(--border2);
}
.btn-sm { font-size: 12px; padding: 8px 18px; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 64px;
  align-items: start;
}
.about-copy p {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.about-copy p:last-of-type { margin-bottom: 0; }
.about-copy strong { color: var(--text); font-weight: 500; }

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 40px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}
.stat-card:hover { border-color: rgba(99,102,241,0.3); transform: translateY(-4px); }
.stat-big {
  font-family: var(--font-main);
  font-size: 42px;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}
.stat-plus { color: var(--accent); font-size: 28px; font-weight: 700; }
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 6px;
  display: block;
}

.about-cards { display: flex; flex-direction: column; gap: 14px; }
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.3s, background 0.3s;
}
.info-card:hover { border-color: var(--border2); background: var(--surface2); }
.info-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.info-card strong { display: block; font-size: 13px; font-weight: 600; color: var(--white); margin-bottom: 2px; }
.info-card p { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ============================================================
   SKILLS SECTION
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.skills-col { display: flex; flex-direction: column; gap: 24px; }

.skill-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.3s;
}
.skill-block:hover { border-color: var(--border2); }

.skill-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 22px;
}
.skill-block-title svg { color: var(--accent2); flex-shrink: 0; }

.bar-list { display: flex; flex-direction: column; gap: 16px; }
.bar-item {}
.bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 7px;
}
.bar-meta span:first-child {
  /* label can truncate on very narrow screens */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.bar-pct { color: var(--accent2); font-weight: 600; }
.bar-track {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #a78bfa 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 1.3s cubic-bezier(0.34, 1, 0.64, 1);
}

.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: default;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: var(--accent-glow);
}
.chip.star {
  background: var(--accent-glow);
  border-color: rgba(99,102,241,0.3);
  color: var(--accent2);
}

/* ============================================================
   EXPERIENCE SECTION
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 44px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 16px; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, transparent 100%);
}

.tl-item {
  position: relative;
  margin-bottom: 44px;
}
.tl-item:last-child { margin-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -40px; top: 20px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
  z-index: 1;
}

.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.tl-card:hover {
  border-color: rgba(99,102,241,0.25);
  transform: translateX(5px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tl-role {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.tl-company { font-size: 14px; color: var(--accent2); font-weight: 500; }
.tl-badge {
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  color: var(--accent2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.tl-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.tl-list li {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.tl-list li::before {
  content: '▸';
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 3px;
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.3s, transform 0.35s var(--spring), box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}
.proj-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  opacity: 0;
  transition: opacity 0.3s;
}
.proj-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-8px);
  box-shadow: 0 28px 56px rgba(0,0,0,0.35);
}
.proj-card:hover::after { opacity: 1; }

.proj-card.featured-card {
  grid-column: span 2;
  background: linear-gradient(145deg, var(--surface), var(--surface2));
  border-color: rgba(99,102,241,0.15);
}

.proj-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.proj-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent2);
}
.proj-gh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.proj-gh:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-glow); }
.proj-gh svg { width: 16px; height: 16px; flex-shrink: 0; }

.proj-featured-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 2px;
}
.proj-title {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}
.proj-desc { font-size: 14px; color: var(--text-muted); line-height: 1.78; flex: 1; }
.proj-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.proj-stack span {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Menlo', 'Consolas', monospace;
  letter-spacing: 0.3px;
}


/* ── Project thumbnail (inline SVG chart) ── */
.proj-thumb {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(99,102,241,0.04);
  border: 1px solid var(--border);
  line-height: 0;
  flex-shrink: 0;
}
.proj-thumb svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── "View on GitHub" text label in proj-gh ── */
.proj-gh span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  color: var(--text-muted);
}
.proj-gh:hover span { color: var(--accent2); }

/* ── Outcome/impact line inside project description ── */
.proj-outcome {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  letter-spacing: 0.1px;
}

/* GitHub CTA below projects grid */
.proj-github-cta {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}
.proj-github-btn {
  font-size: 15px;
  padding: 14px 32px;
  gap: 10px;
}


/* ============================================================
   CERTIFICATIONS
   ============================================================ */
.certs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.cert-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.3s, background 0.3s, transform 0.2s, box-shadow 0.3s;
  text-decoration: none;   /* for <a> variant */
  color: inherit;
}
.cert-row:hover { border-color: var(--border2); background: var(--surface2); transform: translateX(5px); }
/* Clickable cert rows get accent border on hover */
.cert-row-link:hover {
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 4px 20px rgba(99,102,241,0.1);
}
.cert-abbr {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.2;
}
.cert-body { flex: 1; min-width: 0; }
.cert-body h4 { font-size: 14px; font-weight: 600; color: var(--white); margin-bottom: 3px; }
.cert-body p { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; }
/* Inline PDF + Verify buttons inside a cert row */
.cert-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cert-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface2);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  letter-spacing: 0.3px;
}
.cert-link-btn:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-glow); }
.cert-link-verify { border-color: rgba(34,197,94,0.25); color: var(--green); background: rgba(34,197,94,0.06); }
.cert-link-verify:hover { border-color: var(--green); color: #4ade80; background: rgba(34,197,94,0.12); }
.cert-tick {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent2);
  font-size: 14px;
  font-weight: 400;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.cert-row-link:hover .cert-tick {
  background: rgba(99,102,241,0.2);
  color: var(--white);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-lead {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 500px;
  margin-bottom: 60px;
}
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.contact-links-list { display: flex; flex-direction: column; gap: 12px; }
.c-link {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.3s, background 0.3s, transform 0.2s;
}
.c-link:hover { border-color: var(--accent); background: var(--surface2); transform: translateX(5px); }
.c-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent2);
  flex-shrink: 0;
}
.c-icon svg { width: 18px; height: 18px; }
.c-lbl { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 2px; }
.c-val { font-size: 14px; font-weight: 500; color: var(--text); }

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.fg { display: flex; flex-direction: column; gap: 7px; }
.fg label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px; }
.fg input, .fg textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  resize: vertical;
}
.fg input:focus, .fg textarea:focus { border-color: var(--accent); background: var(--surface2); }
.fg input::placeholder, .fg textarea::placeholder { color: var(--text-dim); }
.form-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  text-align: center;
  min-height: 20px;
  padding: 8px 0 2px;
  opacity: 0;                /* hidden until JS sets opacity:1 */
  transition: opacity 0.4s;
}

/* ============================================================
   RESUME MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(28px) scale(0.97);
  transition: transform 0.32s var(--spring);
}
.modal-overlay.open .modal-box { transform: none; }
.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-top h3 { font-family: var(--font-main); font-size: 18px; font-weight: 700; color: var(--white); }
.modal-top-actions { display: flex; align-items: center; gap: 10px; }
.modal-close-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.modal-close-btn:hover { background: var(--surface); color: var(--white); }
.modal-body { overflow: hidden; padding: 0; flex: 1; display: flex; flex-direction: column; }

/* Desktop: show iframe, hide mobile fallback */
.resume-iframe { display: block; }
.resume-mobile-fallback { display: none; }

/* Resume Document */
.resume-doc { color: var(--text); }
.rdoc-head { text-align: center; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.rdoc-head h1 { font-family: var(--font-main); font-size: 28px; font-weight: 700; color: var(--white); letter-spacing: -0.5px; margin-bottom: 6px; }
.rdoc-head p { font-size: 12px; color: var(--text-muted); margin: 3px 0; }
.rdoc-head a { color: var(--accent2); text-decoration: none; }
.rdoc-sec { margin-bottom: 22px; }
.rdoc-sec h2 {
  font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.rdoc-sec p { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin-bottom: 6px; }
.rdoc-sec ul { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.rdoc-sec li { display: flex; gap: 8px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.rdoc-sec li::before { content: '▸'; color: var(--accent); flex-shrink: 0; font-size: 11px; margin-top: 2px; }
.rdoc-sec strong { color: var(--text); font-weight: 600; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
/* PP badge in footer */
.footer-pp-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #818cf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 4px 18px rgba(99,102,241,0.4);
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.footer-pp-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.35) 50%, transparent 80%);
  animation: ppShimmer 3s ease-in-out infinite;
}
.footer-pp-badge:hover {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2), 0 8px 28px rgba(99,102,241,0.65);
}

.footer-copy { font-size: 13px; color: var(--text-dim); }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { font-size: 13px; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-nav a:hover { color: var(--accent2); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp   { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:none} }
@keyframes fadeLeft { from{opacity:0;transform:translateX(42px)} to{opacity:1;transform:none} }
@keyframes fadeIn   { from{opacity:0} to{opacity:1} }
@keyframes spin     { to { transform: rotate(360deg); } }

/* ============================================================
   ACCESSIBILITY — FOCUS STATES
   Visible keyboard focus ring on every interactive element.
   Uses :focus-visible so mouse users don't see the ring.
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
/* Nav links: pill shape */
.nav-links a:focus-visible,
.mobile-menu a:focus-visible,
.htr-btn:focus-visible { border-radius: 999px; }
/* Buttons */
.btn:focus-visible,
.hbr-arrow:focus-visible,
.modal-close-btn:focus-visible,
.hamburger:focus-visible { outline-offset: 4px; }
/* Form inputs get a colored border on focus (already done via border-color),
   add outline as extra signal for high-contrast mode */
.fg input:focus-visible,
.fg textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
/* Chat FAB */
#chatFab:focus-visible { outline-offset: 6px; }
/* Tab bar items */
.tab-item:focus-visible { outline-offset: -2px; border-radius: 8px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .skills-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-card.featured-card { grid-column: span 2; }
  .contact-layout { grid-template-columns: 1fr; gap: 40px; }
  /* Hero responsive adjustments */
  .hero-display-word span { font-size: clamp(80px, 16vw, 200px); }
  .hero-scroll-hint { top: 70px; left: 20px; }
}

/* ── TABLET / LARGE MOBILE (≤ 768px) ── */
@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
    --tab-bar-h: 62px; /* height of the bottom tab bar */
  }

  /* ── Sections — extra bottom padding so content clears tab bar ── */
  .section { padding: 64px 0 80px; }
  .container { padding: 0 18px; }
  .section-h2 { font-size: 28px; letter-spacing: -0.8px; margin-bottom: 40px; }

  /* ── Top Navbar: hide hamburger — replaced by bottom tab bar ── */
  .nav-inner { padding: 0 16px; justify-content: flex-start; }
  .nav-links { display: none; }
  .hamburger { display: none; }
  .mobile-menu { display: none !important; }

  /* ── Hero: switch to centered on mobile ── */
  #hero {
    height: 100svh;
    min-height: 560px;
    align-items: center;   /* override right-align — center on phone */
    padding-top: 0;        /* remove desktop down-shift */
  }
  .hero-display-word { bottom: calc(var(--tab-bar-h, 62px) + 44px); overflow: visible; }
  .hero-display-word span { font-size: clamp(56px, 17vw, 130px); }
  /* identity: centered, no padding, no accent line */
  .hero-identity {
    width: 90vw;
    max-width: 90vw;
    text-align: center;
    padding-right: 0;
  }
  .hero-identity::before { display: none; }  /* hide accent line on mobile */
  .hi-name {
    font-size: clamp(20px, 6.5vw, 44px);
    letter-spacing: clamp(2px, 0.8vw, 5px);
    text-align: center;
  }
  .hi-subtitle { font-size: 12px; letter-spacing: 2.5px; text-align: center; }
  .hi-tagline { font-size: 9px; letter-spacing: 2px; justify-content: center; margin-top: 10px; }

  /* Contact + CV buttons — small pill row top-right, well clear of the name */
  .hero-top-right {
    position: fixed;
    top: 10px;
    right: 14px;
    gap: 6px;
    flex-wrap: nowrap;
    z-index: 600;
  }
  .htr-btn { font-size: 11px; padding: 7px 14px; letter-spacing: 0; }

  /* Bottom social links: sit above tab bar */
  .hero-bottom-left { left: 14px; bottom: calc(var(--tab-bar-h, 62px) + 12px); gap: 12px; }
  .hbl-link { font-size: 11px; }
  .hbl-link svg { width: 13px; height: 13px; }

  /* Bottom-right arrows: sit above tab bar, left of WhatsApp float */
  .hero-bottom-right { right: 80px; bottom: calc(var(--tab-bar-h, 62px) + 10px); gap: 8px; }
  .hbr-arrow { width: 32px; height: 32px; }
  .hbr-line { width: 40px; }

  /* Scroll hint hidden on mobile */
  .hero-scroll-hint { display: none; }

  /* ── About ── */
  .about-stats { gap: 10px; }
  .stat-card { padding: 18px 10px; }
  .stat-big { font-size: 32px; }

  /* ── Timeline ── */
  .timeline { padding-left: 32px; }
  .timeline::before { left: 6px; }
  .tl-dot { left: -28px; width: 14px; height: 14px; top: 22px; }
  .tl-card { padding: 22px 20px; }
  .tl-role { font-size: 17px; }
  /* badge: allow wrap to prevent overflow */
  .tl-badge { white-space: normal; text-align: center; }

  /* ── Projects ── */
  .proj-grid { grid-template-columns: 1fr; }
  .proj-card.featured-card { grid-column: span 1; }

  /* ── Certifications ── */
  .certs-list { grid-template-columns: 1fr; }
  .cert-row { padding: 14px 16px; gap: 12px; }

  /* ── Contact ── */
  .contact-lead { font-size: 15px; margin-bottom: 36px; }
  .c-val { font-size: 13px; word-break: break-all; }

  /* ── Footer ── */
  .footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 14px; }
  .footer-nav { justify-content: center; gap: 16px; }

  /* ── Modal ── */
  .modal-overlay { padding: 12px; }
  .modal-box { height: 95vh; max-height: 95vh; border-radius: 14px; }
  .modal-top { padding: 14px 16px; }
  .modal-top h3 { font-size: 15px; }
  /* Mobile: hide the iframe (freezes on iOS/Android), show tap-to-open fallback */
  .resume-iframe { display: none !important; }
  .resume-mobile-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 20px;
  }
}

/* ── SMALL MOBILE (≤ 480px) ── */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .section { padding: 52px 0; }
  .section-h2 { font-size: 24px; margin-bottom: 32px; }

  /* Hero */
  #hero { min-height: 520px; }
  .hero-display-word { bottom: calc(var(--tab-bar-h, 62px) + 40px); overflow: visible; }
  .hero-display-word span { font-size: clamp(44px, 18vw, 96px); }
  .hero-identity { width: 88vw; max-width: 88vw; }
  .hi-name { font-size: clamp(18px, 6.2vw, 32px); letter-spacing: clamp(1.5px, 0.6vw, 3px); }
  .hi-subtitle { font-size: 10px; letter-spacing: 2px; }
  .hi-tagline { font-size: 8px; letter-spacing: 1.5px; margin-top: 8px; }
  .hero-top-right {
    top: 8px;
    right: 12px;
    gap: 4px;
  }
  .htr-btn { font-size: 10px; padding: 6px 10px; }
  .hero-bottom-left { gap: 10px; bottom: calc(var(--tab-bar-h, 62px) + 10px); left: 12px; }
  /* arrows stay left of WhatsApp float */
  .hero-bottom-right { bottom: calc(var(--tab-bar-h, 62px) + 10px); right: 80px; gap: 6px; }
  .hbr-arrow { width: 30px; height: 30px; }
  .hbr-line { width: 28px; }

  /* About stats */
  .about-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 14px 6px; }
  .stat-big { font-size: 26px; }
  .stat-plus { font-size: 20px; }
  .stat-label { font-size: 9px; }

  /* Skills */
  .skill-block { padding: 20px 16px; }
  .bar-meta { font-size: 11px; }

  /* Timeline */
  .timeline { padding-left: 26px; }
  .tl-dot { left: -22px; width: 12px; height: 12px; }
  .tl-card { padding: 18px 14px; }
  .tl-role { font-size: 15px; }
  .tl-list li { font-size: 13px; gap: 8px; }

  /* Projects */
  .proj-card { padding: 20px 16px; }
  .proj-title { font-size: 17px; }

  /* Certifications */
  .cert-body h4 { font-size: 13px; }
  .cert-abbr { width: 42px; height: 42px; font-size: 9px; }

  /* Contact form */
  .fg input, .fg textarea { font-size: 16px; } /* prevents iOS zoom */

  /* Modal */
  .modal-top { flex-wrap: wrap; gap: 8px; }
  .modal-top-actions { gap: 6px; }
  .btn-sm { font-size: 11px; padding: 7px 12px; }
}

/* ── VERY SMALL PHONES (≤ 360px) ── */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .hero-identity { width: 86vw; max-width: 86vw; }
  .hi-name { font-size: 15px; letter-spacing: 1px; }
  .hi-subtitle { font-size: 9px; letter-spacing: 1.5px; }
  .hi-tagline { font-size: 7px; letter-spacing: 1.5px; margin-top: 6px; }
  .hero-display-word span { font-size: 38px; }
  .hero-display-word { bottom: calc(var(--tab-bar-h, 62px) + 38px); overflow: visible; }
  /* buttons: full right edge, no hamburger */
  .htr-btn { font-size: 9px; padding: 5px 8px; }
  .hero-top-right { right: 12px; top: 9px; gap: 4px; }
  /* social/arrows above tab bar */
  .hero-bottom-left { bottom: calc(var(--tab-bar-h, 62px) + 8px); }
  .hero-bottom-right { right: 74px; bottom: calc(var(--tab-bar-h, 62px) + 8px); }
  .hbr-line { width: 20px; }
  .about-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-big { font-size: 22px; }
  .tl-card { padding: 14px 12px; }
  .section-h2 { font-size: 22px; }
  .cert-row { gap: 10px; padding: 12px 12px; }
  /* badge doesn't need extra space on tiny screens */
  .tl-badge { font-size: 9px; padding: 4px 10px; }
}

/* ============================================================
   AI CHAT WIDGET
   ============================================================ */

/* ── FAB (floating action button) ── */
#chatFab {
  position: fixed;
  right: 24px;
  bottom: 36px;
  z-index: 999;
  width: 58px;
  height: 58px;
  background: var(--accent);
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(99,102,241,0.55);
  transition: transform 0.25s var(--spring), box-shadow 0.25s ease, background 0.2s;
}
#chatFab::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(99,102,241,0.4);
  animation: chatFabPulse 2.4s ease-out infinite;
}
@keyframes chatFabPulse {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
#chatFab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(99,102,241,0.75);
  background: var(--accent2);
}
#chatFab.open { background: var(--surface2); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
#chatFab.open::before { display: none; }

/* FAB tooltip */
.chat-fab-tooltip {
  position: absolute;
  right: 70px;
  background: #1a1a2e;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.3px;
}
.chat-fab-tooltip::after {
  content: '';
  position: absolute;
  right: -5px; top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right: none;
  border-left-color: #1a1a2e;
}
#chatFab:hover .chat-fab-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* ── Chat panel ── */
#chatPanel {
  position: fixed;
  right: 24px;
  bottom: 108px;
  z-index: 998;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 1px rgba(99,102,241,0.1);
  /* hidden by default */
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.28s var(--transition), transform 0.28s var(--spring);
  transform-origin: bottom right;
}
#chatPanel.open {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

/* ── Header ── */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1.5px solid rgba(99,102,241,0.35);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2);
  flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name {
  display: block;
  font-family: var(--font-main);
  font-size: 14px; font-weight: 700;
  color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-header-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted);
}
.chat-status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.7);
  animation: statusPulse 2.5s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
.chat-header-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.chat-header-close:hover { background: var(--bg); color: var(--white); }

/* ── Messages area ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* Bubble */
.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-bubble.bot {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chat-bubble.user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* Typing indicator */
.chat-bubble.typing {
  display: flex; align-items: center; gap: 5px;
  padding: 12px 16px;
}
.chat-bubble.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s ease-in-out infinite;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Quick replies ── */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px 12px;
  flex-shrink: 0;
}
.chat-quick-replies:empty { padding: 0; }
.chat-qr-btn {
  background: transparent;
  border: 1px solid rgba(99,102,241,0.35);
  color: var(--accent2);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
}
.chat-qr-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--white);
}

/* ── Input row ── */
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
#chatInput {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  padding: 9px 16px;
  outline: none;
  transition: border-color 0.2s;
}
#chatInput:focus { border-color: var(--accent); }
#chatInput::placeholder { color: var(--text-dim); }
#chatSend {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
#chatSend:hover { background: var(--accent2); transform: scale(1.08); }
#chatSend:disabled { opacity: 0.45; cursor: default; transform: none; }

/* ── Mobile adjustments ── */
@media (max-width: 768px) {
  #chatFab {
    right: 16px;
    bottom: calc(var(--tab-bar-h, 62px) + 14px);
    width: 52px; height: 52px;
  }
  .chat-fab-tooltip { display: none; }
  #chatPanel {
    right: 0; left: 0;
    bottom: calc(var(--tab-bar-h, 62px) + 76px);
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    height: 60vh;
    max-height: 60vh;
  }
}

/* ============================================================
   BOTTOM TAB BAR  (mobile only, hidden on desktop)
   ============================================================ */
#bottomTabBar {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
  #bottomTabBar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 700;
    height: var(--tab-bar-h, 62px);
    background: rgba(8, 10, 14, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255,255,255,0.08);
    align-items: stretch;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* iPhone notch */
  }

  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,0.38);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 6px 4px 4px;
    position: relative;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }

  .tab-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
    transition: stroke 0.2s, transform 0.2s var(--spring);
  }

  /* Active indicator pill above icon */
  .tab-item::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 28px; height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
    transition: transform 0.25s var(--spring);
  }

  .tab-item:hover {
    color: rgba(255,255,255,0.72);
  }

  .tab-item.active {
    color: var(--accent2);
  }

  .tab-item.active::before {
    transform: translateX(-50%) scaleX(1);
  }

  .tab-item.active svg {
    transform: translateY(-2px);
    stroke: var(--accent2);
  }

  /* Ripple tap feedback */
  .tab-item:active {
    color: var(--white);
  }
  .tab-item:active svg {
    transform: scale(0.88) translateY(-1px);
  }
}
