/* =============================================================
   MOHAMED ZOUBIR PORTFOLIO — FULL REDESIGN
   Dark Dev Aesthetic · Electric Blue · Glassmorphism
   ============================================================= */

/* ---------- FONTS ---------- */
/* Imported via HTML <link> — Inter, JetBrains Mono, Space Grotesk */

/* ---------- TOKENS ---------- */
:root {
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --font-head:  'Space Grotesk', sans-serif;

  --blue:       #4f8ef7;
  --blue-dim:   #3a6fd4;
  --blue-glow:  rgba(79, 142, 247, 0.18);
  --blue-glow2: rgba(79, 142, 247, 0.06);
  --cyan:       #00c2ff;

  --t-fast:   0.18s ease;
  --t-med:    0.32s cubic-bezier(0.4,0,0.2,1);
  --t-slow:   0.55s cubic-bezier(0.4,0,0.2,1);

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --radius-pill: 999px;
}

/* ---- DARK THEME ---- */
[data-theme="dark"] {
  --bg:          #0d0d0f;
  --bg-2:        #111115;
  --bg-3:        #16161c;
  --bg-card:     rgba(22, 22, 30, 0.7);

  --text:        #f0f0f4;
  --text-2:      #9a9ab0;
  --text-3:      #5a5a70;

  --border:      rgba(255,255,255,0.08);
  --border-2:    rgba(255,255,255,0.14);
  --shadow:      rgba(0,0,0,0.5);
  --glass-blur:  blur(18px);
}

/* ---- LIGHT THEME ---- */
[data-theme="light"] {
  --bg:          #f4f5f9;
  --bg-2:        #ffffff;
  --bg-3:        #ebedf5;
  --bg-card:     rgba(255,255,255,0.75);

  --text:        #0e0e14;
  --text-2:      #555570;
  --text-3:      #9a9ab0;

  --border:      rgba(0,0,0,0.08);
  --border-2:    rgba(0,0,0,0.14);
  --shadow:      rgba(0,0,0,0.08);
  --glass-blur:  blur(18px);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--t-med), color var(--t-med);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }
svg { display: block; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ---- SELECTION ---- */
::selection { background: var(--blue-glow); color: var(--text); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
  position: relative;
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  background: transparent;
  transition: background var(--t-med), box-shadow var(--t-med), height var(--t-med);
}

.navbar.scrolled {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px var(--shadow);
  height: 58px;
}

.nav-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  transition: color var(--t-fast);
}
.nav-logo:hover { color: var(--blue); }
.logo-bracket { color: var(--blue); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  position: relative;
  padding: 4px 0;
  transition: color var(--t-fast);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--blue);
  transition: width var(--t-med);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after, .nav-link:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.nav-btn:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-glow2);
}

.nav-btn svg { width: 16px; height: 16px; }

/* Sun/moon icon toggling */
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all var(--t-med);
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  position: relative;
  overflow: hidden;
}

/* Grid lines background */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  pointer-events: none;
}

/* Glowing orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}
.hero-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(79,142,247,0.12) 0%, transparent 70%);
  top: -100px; right: -100px;
}
.hero-orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(0,194,255,0.08) 0%, transparent 70%);
  bottom: 0; left: 10%;
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-20px); }
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
  padding-top: 40px;
  padding-bottom: 40px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--blue); }
  50%       { opacity: 0.6; box-shadow: 0 0 16px var(--blue); }
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  color: var(--text);
}
.hero-title-accent {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-typewriter {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-2);
  margin-bottom: 24px;
  min-height: 1.6rem;
  display: flex;
  align-items: center;
}
.typewriter-prefix { color: var(--text-3); margin-right: 2px; }
.typewriter-cursor {
  display: inline-block;
  color: var(--blue);
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-desc {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }

.hero-socials { display: flex; gap: 12px; }
.social-link {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--t-fast);
}
.social-link:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-glow2);
  transform: translateY(-2px);
}
.social-link svg { width: 18px; height: 18px; }

/* Hero card */
.hero-card {
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 64px var(--shadow), 0 0 0 1px var(--border);
  animation: float 7s ease-in-out infinite;
  animation-delay: -2s;
}

.hero-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.card-dots { display: flex; gap: 6px; }
.card-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.card-dots span:nth-child(1) { background: #ff5f56; }
.card-dots span:nth-child(2) { background: #ffbd2e; }
.card-dots span:nth-child(3) { background: #27c93f; }
.card-title-bar {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  flex: 1;
  text-align: center;
}

.hero-card-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.code-line {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.code-key   { color: var(--blue); }
.code-colon { color: var(--text-3); }
.code-string, .code-array { color: #7dd3a8; }
.code-links { display: flex; gap: 8px; }
.code-link  { color: var(--cyan); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color var(--t-fast); }
.code-link:hover { text-decoration-color: var(--cyan); }
.code-comma { color: var(--text-3); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}
.hero-stat {
  padding: 16px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.hero-stat:last-child { border-right: none; }
.hero-stat-num {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue);
  display: block;
  letter-spacing: -0.03em;
}
.hero-stat-label {
  font-size: 0.65rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  animation: fadeInUp 1s 1.5s both;
  z-index: 1;
}
.scroll-mouse {
  width: 20px; height: 32px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-pill);
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-wheel {
  width: 3px; height: 6px;
  background: var(--blue);
  border-radius: var(--radius-pill);
  animation: scroll-anim 1.8s ease-in-out infinite;
}
@keyframes scroll-anim {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--t-med);
  cursor: pointer;
  border: 1.5px solid transparent;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 4px 20px rgba(79,142,247,0.25);
}
.btn-primary:hover {
  background: var(--blue-dim);
  border-color: var(--blue-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(79,142,247,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-2);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-glow2);
  transform: translateY(-2px);
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--blue);
  transition: all var(--t-fast);
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--cyan); gap: 10px; }

.btn-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--t-fast);
}
.btn-icon-link:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-glow2);
}

/* ============================================================
   SECTION LABELS & TITLES
   ============================================================ */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  padding: 3px 10px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-pill);
  background: var(--blue-glow2);
}
.section-line {
  flex: 0 0 32px;
  height: 1px;
  background: var(--border-2);
}
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  color: var(--text);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.65;
  margin-bottom: 56px;
}

/* ============================================================
   REVEAL ANIMATIONS
   Only applied after JS confirms it is running (.js-loaded on body).
   Without JS, all elements are visible by default.
   ============================================================ */
.js-loaded .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-loaded .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 60px;
  align-items: start;
  margin-bottom: 60px;
}

/* Avatar */
.about-avatar-col { position: relative; }
.avatar-wrapper {
  position: relative;
  width: 260px;
  height: 280px;
  margin: 0 auto 20px;
  padding: 2px;
  border-radius: calc(var(--radius-xl) + 2px);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}
.avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: var(--radius-xl);
  filter: grayscale(10%);
  transition: filter var(--t-slow);
}
.avatar-wrapper:hover .avatar-img { filter: grayscale(0%) brightness(1.05); }
.avatar-initials {
  width: 100%; height: 100%;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border);
}
.avatar-initials-text {
  font-family: var(--font-head);
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.04em;
}
.avatar-ring { display: none; }
.avatar-badge {
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  backdrop-filter: var(--glass-blur);
  white-space: nowrap;
}
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #27c93f;
  box-shadow: 0 0 6px #27c93f;
  animation: pulse-green 2s ease infinite;
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 6px #27c93f; }
  50%       { box-shadow: 0 0 14px #27c93f; }
}

.avatar-info { text-align: center; margin-top: 20px; }
.avatar-name { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--text); }
.avatar-role { font-family: var(--font-mono); font-size: 0.78rem; color: var(--blue); margin-top: 4px; }

/* About content */
.about-sub {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.about-text {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 32px;
}
.about-text strong { color: var(--blue); font-weight: 600; }

/* Tabs */
.tabs { margin-top: 28px; }
.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  position: relative;
  transition: color var(--t-fast);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.skill-group {}
.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-badge {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--t-fast);
}
.skill-badge:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-glow2); }

/* Languages */
.lang-list { display: flex; flex-direction: column; gap: 16px; }
.lang-row { display: grid; grid-template-columns: 90px 1fr 80px; align-items: center; gap: 12px; }
.lang-name { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.lang-bar-wrap { height: 4px; background: var(--bg-3); border-radius: var(--radius-pill); overflow: hidden; }
.lang-bar { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: var(--radius-pill); width: 0; transition: width 1s ease 0.3s; }
.lang-level { font-size: 0.78rem; color: var(--text-3); font-family: var(--font-mono); text-align: right; }

/* Metrics bar */
.metrics-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 0;
}
.metric-card {
  padding: 28px 24px;
  text-align: center;
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px var(--shadow), 0 0 30px var(--blue-glow);
}
.metric-num {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.metric-label {
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 500;
  font-family: var(--font-mono);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 44px;
  margin-top: 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 2px;          /* thin line on far left */
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue), transparent);
  border-radius: var(--radius-pill);
}

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

.tl-dot {
  position: absolute;
  left: -36px;  /* item at 44px → dot left edge at 44-36=8px (line right edge=4px) ✔️ */
  top: 22px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--blue-glow);
  border: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--blue-glow);
  z-index: 1;
}
.tl-dot svg { width: 11px; height: 11px; stroke: var(--blue); }

.tl-card {
  padding: 24px 28px;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.tl-card:hover {
  transform: translateX(6px);
  border-color: var(--border-2);
  box-shadow: 0 8px 32px var(--shadow), 0 0 20px var(--blue-glow);
}

.tl-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  padding: 2px 10px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-pill);
  background: var(--blue-glow2);
}
.tl-org {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
}

.tl-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.tl-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 14px;
}

.tl-list {
  margin-bottom: 14px;
}
.tl-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 6px;
}
.tl-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-size: 0.75rem;
  top: 2px;
}

.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tl-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-3);
}

/* ============================================================
   PROJECTS
   ============================================================ */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.filter-btn {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79,142,247,0.3);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px var(--shadow), 0 0 30px var(--blue-glow);
  border-color: var(--border-2);
}

.project-img-wrap {
  position: relative;
  overflow: hidden;
  height: 210px;
}
.project-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.project-card:hover .project-img-wrap img { transform: scale(1.06); }

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

.overlay-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(79,142,247,0.2);
  border: 1.5px solid var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  transform: scale(0.8);
}
.project-card:hover .overlay-btn { transform: scale(1); }
.overlay-btn:hover { background: var(--blue); transform: scale(1.1) !important; }
.overlay-btn svg { width: 20px; height: 20px; }

.project-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.p-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--blue-glow2);
  border: 1px solid var(--blue);
  color: var(--blue);
}

.project-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.project-desc {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}
.project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.private-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-3);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  cursor: default;
  user-select: none;
}
.private-badge.large {
  font-size: 0.78rem;
  padding: 6px 14px;
}

/* ============================================================
   STACK SECTION
   ============================================================ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.stack-card {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.stack-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med);
}
.stack-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-2);
  box-shadow: 0 16px 40px var(--shadow), 0 0 24px var(--blue-glow);
}
.stack-card:hover::after { transform: scaleX(1); }

.stack-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--blue-glow2);
  border: 1px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.stack-card:hover .stack-card-icon {
  background: var(--blue);
  box-shadow: 0 4px 16px rgba(79,142,247,0.4);
}
.stack-card-icon svg { width: 20px; height: 20px; stroke: var(--blue); transition: stroke var(--t-fast); }
.stack-card:hover .stack-card-icon svg { stroke: #fff; }

.stack-card-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.stack-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.s-tag {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--t-fast);
}
.s-tag:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-glow2); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
  align-items: start;
}

.contact-info-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.contact-info-text {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 28px;
}

.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  transition: all var(--t-fast);
  color: inherit;
}
.contact-link-card:hover { border-color: var(--blue); transform: translateX(4px); }
.clc-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--blue-glow2);
  border: 1px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.clc-icon svg { width: 18px; height: 18px; stroke: var(--blue); }
.clc-label { font-size: 0.72rem; color: var(--text-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.clc-value { font-size: 0.88rem; font-weight: 600; color: var(--text); }

/* Form */
.contact-form-wrap { position: relative; }

.form-success-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  gap: 14px;
  border-radius: var(--radius-lg);
}
.form-success-overlay.active { display: flex; animation: fadeIn 0.4s ease; }
.success-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(39,201,63,0.15);
  border: 2px solid #27c93f;
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-icon svg { width: 28px; height: 28px; stroke: #27c93f; }
.form-success-overlay h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.form-success-overlay p { font-size: 0.9rem; color: var(--text-2); }

#contact-form {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-2); font-family: var(--font-mono); }
.form-input {
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.form-input::placeholder { color: var(--text-3); }
.form-textarea { min-height: 120px; resize: vertical; }

.form-error {
  font-size: 0.82rem;
  color: #ff5f56;
  font-family: var(--font-mono);
  min-height: 1.2em;
}

/* ============================================================
   FOOTER — ENHANCED
   ============================================================ */
.footer {
  padding: 48px 0 28px;
  border-top: 1px solid var(--border);
}
.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.footer-brand {}
.footer-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-2);
  transition: color var(--t-fast);
  display: inline-block;
  margin-bottom: 6px;
}
.footer-logo:hover { color: var(--blue); }
.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-fast);
}
.footer-nav-link:hover { color: var(--blue); }
.footer-socials { display: flex; gap: 10px; }
.footer-social {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--t-fast);
}
.footer-social:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-glow2); }
.footer-social svg { width: 16px; height: 16px; }
.footer-bottom { text-align: center; }
.footer-copy { font-size: 0.78rem; color: var(--text-3); }

/* ============================================================
   PAGE LOADER
   ============================================================ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-logo {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
  animation: loader-pulse 1s ease-in-out infinite;
}
@keyframes loader-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50%      { opacity: 1; transform: scale(1); }
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 800;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity var(--t-med), transform var(--t-med), color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: all;
}
.back-to-top:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-glow2);
}

/* ============================================================
   KEYBOARD FOCUS STYLES
   ============================================================ */
*:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}
.btn:focus-visible,
.nav-btn:focus-visible,
.filter-btn:focus-visible {
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--blue-glow);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med);
}
.modal.open { opacity: 1; pointer-events: all; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--t-med);
  scrollbar-width: thin;
}
.modal.open .modal-box { transform: none; }

.modal-close {
  position: sticky;
  top: 16px;
  float: right;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 16px 0 0;
  transition: all var(--t-fast);
  z-index: 2;
}
.modal-close:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-glow2); }

.modal-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-top: -50px;
}

.modal-content { padding: 20px 28px 28px; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.modal-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.modal-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--bg-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.modal-meta > div { display: flex; align-items: center; gap: 10px; }
.meta-key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 56px;
  flex-shrink: 0;
}
.meta-val { font-size: 0.88rem; color: var(--text-2); font-weight: 500; }
.modal-link { color: var(--blue); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color var(--t-fast); }
.modal-link:hover { text-decoration-color: var(--blue); }

.modal-content > p { font-size: 0.92rem; color: var(--text-2); line-height: 1.7; margin-bottom: 16px; }

.modal-sub {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.modal-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
}
.modal-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-size: 0.72rem;
  top: 3px;
}

.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ============================================================
   ANIMATIONS — BASE
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   PREMIUM ANIMATION LAYER
   ============================================================ */

/* --- SCROLL PROGRESS BAR --- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  z-index: 9999;
  pointer-events: none;
  transition: none;
  will-change: width;
}

/* --- CUSTOM CURSOR --- */
.custom-cursor {
  position: fixed;
  width: 12px; height: 12px;
  background: var(--blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  mix-blend-mode: difference;
  opacity: 0;
  will-change: transform;
}
.custom-cursor.visible { opacity: 1; }
.custom-cursor.hovering {
  width: 40px; height: 40px;
  background: #fff;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  .custom-cursor { display: none !important; }
}

/* --- LOGO SHIMMER ON HOVER --- */
.nav-logo {
  background-image: linear-gradient(90deg, var(--text), var(--blue), var(--cyan), var(--text));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-position: 0% 50%;
}
.nav-logo:hover {
  animation: shimmer 1.2s ease forwards;
}
.nav-logo .logo-bracket {
  -webkit-text-fill-color: var(--blue);
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* --- SECTION NUMBER DRAW ANIMATION --- */
.section-num {
  position: relative;
  overflow: hidden;
}
.js-loaded .section-num::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--blue);
  border-radius: inherit;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s cubic-bezier(0.4,0,0.2,1);
}
.js-loaded .reveal.visible .section-num::before {
  clip-path: inset(0 0 0 0);
}

/* --- STAGGERED TIMELINE ITEMS --- */
.js-loaded .tl-item.reveal {
  transform: translateX(-30px);
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js-loaded .tl-item.reveal:nth-child(even) {
  transform: translateX(30px);
}
.js-loaded .tl-item.reveal.visible {
  opacity: 1;
  transform: translateX(0);
}
.tl-item:nth-child(1) { transition-delay: 0s; }
.tl-item:nth-child(2) { transition-delay: 0.1s; }
.tl-item:nth-child(3) { transition-delay: 0.2s; }
.tl-item:nth-child(4) { transition-delay: 0.3s; }
.tl-item:nth-child(5) { transition-delay: 0.4s; }
.tl-item:nth-child(6) { transition-delay: 0.5s; }

/* --- STAGGERED PROJECT CARDS --- */
.js-loaded .project-card.reveal {
  transform: translateY(40px) scale(0.97);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.js-loaded .project-card.reveal.visible {
  opacity: 1;
  transform: none;
}
.project-card:nth-child(1) { transition-delay: 0s; }
.project-card:nth-child(2) { transition-delay: 0.12s; }
.project-card:nth-child(3) { transition-delay: 0.24s; }
.project-card:nth-child(4) { transition-delay: 0.36s; }
.project-card:nth-child(5) { transition-delay: 0.48s; }
.project-card:nth-child(6) { transition-delay: 0.6s; }

/* --- SKILL BADGE POP-IN --- */
.js-loaded .skill-badge,
.js-loaded .s-tag {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.js-loaded .reveal.visible .skill-badge,
.js-loaded .reveal.visible .s-tag,
.js-loaded .stack-card.reveal.visible .s-tag {
  opacity: 1;
  transform: scale(1);
}
/* Stagger badges */
.skill-badge:nth-child(1), .s-tag:nth-child(1) { transition-delay: 0.05s; }
.skill-badge:nth-child(2), .s-tag:nth-child(2) { transition-delay: 0.1s; }
.skill-badge:nth-child(3), .s-tag:nth-child(3) { transition-delay: 0.15s; }
.skill-badge:nth-child(4), .s-tag:nth-child(4) { transition-delay: 0.2s; }
.skill-badge:nth-child(5), .s-tag:nth-child(5) { transition-delay: 0.25s; }
.skill-badge:nth-child(6), .s-tag:nth-child(6) { transition-delay: 0.3s; }
.skill-badge:nth-child(7), .s-tag:nth-child(7) { transition-delay: 0.35s; }
.skill-badge:nth-child(8), .s-tag:nth-child(8) { transition-delay: 0.4s; }

/* --- METRIC COUNT-UP --- */
.metric-num {
  will-change: opacity;
}
.js-loaded .metric-num.counting {
  animation: countPulse 0.6s ease;
}
@keyframes countPulse {
  0%   { opacity: 0.5; transform: scale(0.9); }
  50%  { opacity: 1;   transform: scale(1.05); }
  100% { opacity: 1;   transform: scale(1); }
}

/* --- BUTTON RIPPLE EFFECT --- */
.btn {
  position: relative;
  overflow: hidden;
}
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* --- HERO EYEBROW GLOW PULSE --- */
.hero-eyebrow {
  animation: eyebrow-glow 3s ease-in-out infinite;
}
@keyframes eyebrow-glow {
  0%, 100% { filter: drop-shadow(0 0 0px var(--blue)); }
  50%      { filter: drop-shadow(0 0 10px var(--blue)); }
}

/* --- PROJECT CARD HOVER ENHANCEMENTS --- */
.project-card:hover .p-tag {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-ghost svg {
  transition: transform var(--t-fast);
}
.btn-ghost:hover svg {
  transform: translateX(4px);
}

/* --- STACK CARD TILT ON HOVER --- */
.stack-card {
  perspective: 1000px;
}
.stack-card:hover {
  transform: translateY(-5px) rotateX(-2deg) rotateY(2deg);
}

/* --- STACK CARD ICON BOUNCE ON HOVER --- */
.stack-card:hover .stack-card-icon svg {
  animation: icon-bounce 0.5s ease;
}
@keyframes icon-bounce {
  0%   { transform: translateY(0); }
  30%  { transform: translateY(-6px); }
  50%  { transform: translateY(2px); }
  70%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

/* --- MODAL ENHANCED ANIMATION --- */
.modal-box {
  transform: translateY(20px) scale(0.85);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
}
.modal.open .modal-box {
  transform: none;
  opacity: 1;
}
.modal-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal.open .modal-backdrop {
  opacity: 1;
}

/* Modal close rotate on hover */
.modal-close {
  transition: all var(--t-fast), transform var(--t-med);
}
.modal-close:hover {
  transform: rotate(90deg);
}

/* Modal scroll fade mask */
.modal-box::after {
  content: '';
  position: sticky;
  bottom: 0; left: 0;
  display: block;
  width: 100%;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bg-card));
  pointer-events: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* --- FORM INPUT ANIMATED BORDER --- */
.form-input {
  position: relative;
  border-bottom: 2px solid transparent;
  background-image: linear-gradient(var(--bg-3), var(--bg-3)), linear-gradient(90deg, var(--blue), var(--cyan));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 100% 100%, 0% 2px;
  background-position: 0 0, 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s ease, border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input:focus {
  background-size: 100% 100%, 100% 2px;
  border-color: transparent;
}

/* --- CONTACT SUBMIT BUTTON STATES --- */
.btn-primary.loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}
@keyframes spinner {
  to { transform: rotate(360deg); }
}
.btn-primary.success {
  background: #27c93f !important;
  border-color: #27c93f !important;
  pointer-events: none;
}

/* --- CONTACT INFO SLIDE-IN --- */
.js-loaded .contact-info.reveal {
  transform: translateX(-40px);
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-loaded .contact-info.reveal.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- SMOOTH SCROLL OFFSET FOR STICKY NAVBAR --- */
html {
  scroll-padding-top: 80px;
}

/* ============================================================
   PREFERS REDUCED MOTION — KILL ALL ANIMATIONS
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .custom-cursor { display: none !important; }
  .hero-orb { animation: none !important; }
  .hero-card { animation: none !important; }
  .js-loaded .reveal { opacity: 1 !important; transform: none !important; }
  .js-loaded .tl-item.reveal { opacity: 1 !important; transform: none !important; }
  .js-loaded .project-card.reveal { opacity: 1 !important; transform: none !important; }
  .js-loaded .skill-badge, .js-loaded .s-tag { opacity: 1 !important; transform: none !important; }
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding-top: 20px; }
  .hero-card { max-width: 480px; }
  .hero-desc { max-width: 100%; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-avatar-col { max-width: 300px; margin: 0 auto; }

  .contact-layout { grid-template-columns: 1fr; }

  .modal-box { max-width: 100%; }
}

@media (max-width: 768px) {
  .section { padding: 80px 0; }

  /* Nav mobile */
  .nav-links {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--t-med);
    z-index: 800;
    margin: 0;
  }
  .nav-links.open {
    transform: none;
    opacity: 1;
    pointer-events: all;
  }
  .nav-link {
    display: block;
    padding: 10px 24px;
    width: 100%;
    font-size: 0.95rem;
  }
  .nav-link::after { display: none; }

  .hamburger { display: flex; }
  .navbar { padding: 0 16px; }

  .hero-title { font-size: clamp(2.4rem, 8vw, 3.5rem); }
  .section-title { font-size: clamp(1.6rem, 5vw, 2.2rem); }

  .timeline { padding-left: 32px; }
  .timeline::before { left: 2px; }
  .tl-dot { left: -24px; width: 18px; height: 18px; } /* dot at 32-24=8px → right of line ✔️ */
  .tl-dot svg { width: 9px; height: 9px; }

  .form-row { grid-template-columns: 1fr; }

  .metrics-bar { grid-template-columns: 1fr; gap: 12px; }

  .hero-cta { flex-direction: column; align-items: flex-start; }
  .footer-top { flex-direction: column; align-items: center; text-align: center; }
  .footer-nav { justify-content: center; }

  .projects-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }

  .back-to-top { bottom: 16px; right: 16px; width: 38px; height: 38px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-stat-num { font-size: 1.2rem; }
  .modal-img { height: 160px; }
  .lang-row { grid-template-columns: 70px 1fr; }
  .lang-level { display: none; }
}
