/* ============================================================
   CSS VARIABLES & RESET
   ============================================================ */
:root {
  /* Background */
  --bg: #060612;
  --bg-2: #0b0b1a;
  --bg-3: #0f0f22;
  --card-bg: rgba(255, 255, 255, 0.025);
  --card-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* Accent Colors */
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;
  --pink: #ec4899;
  --amber: #f59e0b;
  --green: #10b981;

  /* Gradients */
  --grad: linear-gradient(135deg, var(--purple) 0%, var(--cyan) 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,58,237,0.12) 0%, rgba(6,182,212,0.12) 100%);

  /* Text */
  --t1: #f1f0ff;
  --t2: #9b99cc;
  --t3: #4d4b7d;

  /* Glows */
  --glow-p: 0 0 60px rgba(124,58,237,0.2);
  --glow-c: 0 0 60px rgba(6,182,212,0.12);

  /* Radii */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Fonts */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Layout */
  --nav-h: 70px;
  --max-w: 1200px;

  /* Easing */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--t1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 96px 0; }

.section-alt {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
}

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.25);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--t1);
  margin-bottom: 12px;
}

.section-desc {
  font-size: 16px;
  color: var(--t2);
  line-height: 1.7;
  max-width: 480px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  border: none;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  line-height: 1;
}

.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--r); }
.btn-xl { padding: 17px 36px; font-size: 17px; border-radius: var(--r); }
.btn-sm { padding: 7px 15px; font-size: 14px; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124,58,237,0.45);
}

.btn-outline {
  background: transparent;
  color: var(--t1);
  border: 1px solid var(--border-hover);
}
.btn-outline:hover {
  background: var(--card-hover);
  border-color: var(--purple-light);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--purple-light);
  border: 1px solid rgba(124,58,237,0.25);
}
.btn-ghost:hover {
  background: rgba(124,58,237,0.1);
  border-color: var(--purple-light);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 900;
  transition: background 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(6, 6, 18, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-bottom-color: var(--border);
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.75; }
.logo-bracket { color: var(--purple); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--t2);
  padding: 6px 14px;
  border-radius: var(--r-sm);
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--t1);
  background: var(--card-hover);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--t1);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

#starsCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(124,58,237,0.6) 0%, transparent 70%);
  top: -200px; right: -150px;
  animation: orbFloat 9s ease-in-out infinite;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(6,182,212,0.45) 0%, transparent 70%);
  bottom: -100px; left: -50px;
  animation: orbFloat 11s ease-in-out infinite reverse;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(236,72,153,0.3) 0%, transparent 70%);
  top: 40%; left: 30%;
  animation: orbFloat 13s ease-in-out infinite 2s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(25px, -35px) scale(1.06); }
  66%  { transform: translate(-15px, 18px) scale(0.96); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 60px 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.28);
  color: var(--purple-light);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  margin-bottom: 32px;
  animation: fadeInDown 0.7s var(--ease) both;
}

.badge-pulse {
  width: 7px; height: 7px;
  background: var(--purple-light);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(167,139,250,0.4); }
  50%  { opacity: 0.7; transform: scale(0.85); box-shadow: 0 0 0 6px rgba(167,139,250,0); }
}

.hero-title {
  font-size: clamp(50px, 8vw, 88px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.03;
  margin-bottom: 22px;
  animation: fadeInUp 0.7s 0.1s var(--ease) both;
}

.title-line {
  display: block;
  font-size: 0.45em;
  font-weight: 500;
  color: var(--t2);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.hero-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(17px, 2.2vw, 22px);
  color: var(--t2);
  margin-bottom: 28px;
  height: 34px;
  animation: fadeInUp 0.7s 0.2s var(--ease) both;
}

.typewriter { color: var(--cyan-light); font-weight: 600; }
.cursor {
  color: var(--cyan);
  font-weight: 300;
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.hero-desc {
  font-size: 17px;
  line-height: 1.75;
  color: var(--t2);
  max-width: 580px;
  margin-bottom: 40px;
  animation: fadeInUp 0.7s 0.3s var(--ease) both;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
  animation: fadeInUp 0.7s 0.4s var(--ease) both;
}

.hero-stats {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: fit-content;
  padding: 20px 28px;
  backdrop-filter: blur(12px);
  animation: fadeInUp 0.7s 0.5s var(--ease) both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 28px;
}
.stat-item:first-child { padding-left: 0; }
.stat-item:last-child  { padding-right: 0; }

.stat-num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-lbl {
  font-size: 12px;
  color: var(--t3);
  white-space: nowrap;
}
.stat-divider {
  width: 1px;
  height: 44px;
  background: var(--border);
  flex-shrink: 0;
}

.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--t3);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.scroll-arrow-anim { animation: bounce 2s ease-in-out infinite; color: var(--purple); }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-body p {
  color: var(--t2);
  font-size: 16px;
  line-height: 1.82;
  margin-bottom: 16px;
}

.skills-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--t3);
  margin-bottom: 12px;
  margin-top: 24px;
}
.tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.tag {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 100px;
  background: var(--grad-soft);
  border: 1px solid rgba(124,58,237,0.22);
  color: var(--purple-light);
  transition: all 0.2s;
}
.tag:hover {
  background: rgba(124,58,237,0.18);
  border-color: rgba(124,58,237,0.4);
}

.about-visual {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

/* Code card */
.code-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 28px 64px rgba(0,0,0,0.55), var(--glow-p);
  margin-bottom: 16px;
}
.code-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.win-dots { display: flex; gap: 7px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.code-fname { font-family: var(--mono); font-size: 13px; color: var(--t2); margin-left: 4px; }

.code-card-body { padding: 24px 28px; }
.code-card-body pre {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  overflow-x: auto;
}
.ck  { color: #c4b5fd; } /* key */
.cs  { color: #6ee7b7; } /* string */
.cb  { color: #f9a8d4; } /* boolean */
.cp  { color: #e2e8f0; } /* punctuation */
.cc  { color: var(--t3); } /* comment */

.deco-cards { display: flex; flex-direction: column; gap: 12px; }
.deco-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: all 0.2s;
}
.deco-card:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}
.deco-emoji {
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--grad-soft);
  color: var(--purple-light);
  flex-shrink: 0;
}
.deco-emoji svg { display: block; }
.deco-title { font-size: 14px; font-weight: 600; color: var(--t1); margin-bottom: 2px; }
.deco-sub   { font-size: 13px; color: var(--t2); }

/* ============================================================
   CARDS (shared)
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  border-radius: inherit;
}
.card:hover {
  border-color: rgba(124,58,237,0.35);
  transform: translateY(-5px);
  box-shadow: 0 22px 60px rgba(0,0,0,0.35), var(--glow-p);
}
.card:hover::after { opacity: 1; }

.card-icon-wrap {
  width: 46px; height: 46px;
  background: var(--grad-soft);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--purple-light);
  margin-bottom: 18px;
  flex-shrink: 0;
}

.card-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 7px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.3;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.72;
  flex: 1;
  margin-bottom: 20px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tech-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 100px;
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.2);
  color: var(--cyan-light);
}

.card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-light);
  white-space: nowrap;
  transition: color 0.2s;
}
.card-link:hover { color: var(--cyan-light); }

/* ============================================================
   PROJECTS GRID (homepage)
   ============================================================ */
.projects-home-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.card-project-featured .proj-visual {
  margin: -28px -28px 22px;
  height: 188px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  overflow: hidden;
}

.proj-visual-sm {
  width: 46px; height: 46px;
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.proj-bg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-weight: 900;
  color: rgba(255,255,255,0.25);
  letter-spacing: -0.05em;
}
.proj-bg-1 { background: linear-gradient(135deg, #7c3aed, #06b6d4); font-size: 36px; }
.proj-bg-2 { background: linear-gradient(135deg, #06b6d4, #10b981); font-size: 36px; }
.proj-bg-3 { background: linear-gradient(135deg, #ec4899, #f59e0b); font-size: 36px; }
.proj-bg-sm { font-size: 14px; }

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.contact-wrap::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -5%;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(124,58,237,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.contact-content .section-title { margin-bottom: 10px; }
.contact-content > p { color: var(--t2); font-size: 16px; margin-bottom: 28px; max-width: 460px; }

.contact-links { display: flex; flex-direction: column; gap: 10px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: all 0.22s;
}
.contact-item:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  transform: translateX(5px);
}
.ci-icon {
  font-size: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--purple-light);
  transition: all 0.2s var(--ease);
}
.contact-item:hover .ci-icon {
  border-color: var(--border-hover);
  color: var(--cyan-light);
}
.ci-icon svg { display: block; }
.ci-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t3);
  margin-bottom: 2px;
}
.ci-val { font-size: 14px; font-weight: 500; color: var(--t1); }

.contact-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.resp-time { font-size: 13px; color: var(--t2); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 28px;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-tagline { font-size: 14px; color: var(--t3); max-width: 220px; margin-top: 8px; }
.footer-links { display: flex; gap: 56px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t3);
  margin-bottom: 2px;
}
.footer-col a { font-size: 14px; color: var(--t2); transition: color 0.2s; }
.footer-col a:hover { color: var(--t1); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--t3);
}

/* ============================================================
   PAGE HERO (inner pages)
   ============================================================ */
.page-hero {
  padding: calc(var(--nav-h) + 64px) 0 80px;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}
.page-hero-orb {
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(6,182,212,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero-orb-2 {
  position: absolute;
  bottom: -100px; left: 100px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(124,58,237,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero-content { max-width: 640px; position: relative; z-index: 1; }
.page-hero-content .section-title {
  font-size: clamp(34px, 5.5vw, 54px);
  margin-bottom: 16px;
}
.page-hero-desc {
  font-size: 17px;
  color: var(--t2);
  line-height: 1.7;
  max-width: 520px;
}

/* ============================================================
   TEACHING PAGE
   ============================================================ */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.filter-btn {
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--t2);
  transition: all 0.2s;
  cursor: pointer;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--grad-soft);
  border-color: rgba(124,58,237,0.3);
  color: var(--t1);
}

/* Courses grid (larger cards) */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}
.course-card:hover {
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3), var(--glow-p);
}
.course-cover {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.course-cover-icon {
  font-size: 56px;
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.85);
  display: inline-flex;
  filter: drop-shadow(0 4px 18px rgba(255,255,255,0.15));
}
.course-cover-icon svg { display: block; }
.course-cover-bg {
  position: absolute; inset: 0;
  opacity: 0.15;
}
.course-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.course-level {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
}
.course-duration {
  font-size: 12px;
  color: var(--t3);
}
.course-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.3;
  margin-bottom: 10px;
}
.course-desc {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 18px;
}
.course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.course-tags { display: flex; gap: 6px; }
.course-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-light);
  transition: color 0.2s;
}
.course-link:hover { color: var(--cyan-light); }

/* Handouts list */
.handouts-list { display: flex; flex-direction: column; gap: 10px; }
.handout-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: all 0.22s;
}
.handout-item:hover {
  background: var(--card-hover);
  border-color: rgba(124,58,237,0.25);
  transform: translateX(5px);
}
.hi-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--grad-soft);
  border: 1px solid rgba(124,58,237,0.2);
  color: var(--purple-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hi-icon svg { display: block; }
.hi-info { flex: 1; }
.hi-title { font-size: 15px; font-weight: 600; color: var(--t1); margin-bottom: 3px; }
.hi-meta { font-size: 13px; color: var(--t2); }
.hi-tags { display: flex; gap: 6px; }
.hi-action { flex-shrink: 0; }

/* ============================================================
   PROJECTS PAGE
   ============================================================ */
.projects-full-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.proj-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  position: relative;
}
.proj-card:hover {
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-5px);
  box-shadow: 0 22px 60px rgba(0,0,0,0.35), var(--glow-p);
}
.proj-card-cover {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 900;
  font-size: 48px;
  color: rgba(255,255,255,0.2);
  letter-spacing: -0.05em;
  overflow: hidden;
}
.proj-card-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.proj-status {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--green);
}
.proj-status.wip {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.3);
  color: var(--amber);
}

/* Services section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.service-card {
  padding: 32px 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.3s;
}
.service-card:hover {
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.service-card:hover::before { opacity: 1; }

.service-num {
  font-family: var(--mono);
  font-size: 52px;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.25;
  line-height: 1;
  margin-bottom: 18px;
  position: relative;
}
.service-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 10px;
  position: relative;
}
.service-desc {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.75;
  position: relative;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-right { transform: translateX(28px); }
.reveal-right.visible { transform: translateX(0); }

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.stagger.visible > * { opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-visual { position: static; }
  .projects-home-grid { grid-template-columns: 1fr 1fr; }
  .card-project-featured { grid-column: span 2; }
  .contact-wrap { grid-template-columns: 1fr; padding: 40px; }
  .contact-cta { align-items: flex-start; }
}

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

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    background: rgba(6,6,18,0.96);
    backdrop-filter: blur(28px);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px 24px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-link { display: block; padding: 10px 14px; font-size: 16px; }
  .mobile-menu-btn { display: flex; }

  .cards-grid { grid-template-columns: 1fr; }
  .projects-home-grid { grid-template-columns: 1fr; }
  .card-project-featured { grid-column: auto; }
  .courses-grid { grid-template-columns: 1fr; }
  .projects-full-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }

  .hero-stats {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 16px 20px;
  }
  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 0;
  }
  .stat-divider { width: 100%; height: 1px; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .section-header { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; gap: 28px; }
  .footer-links { gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }

  .contact-wrap { padding: 28px 24px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(38px, 11vw, 54px); }
}

/* ============================================================
   JOURNEY / 心得區
   ============================================================ */
.journey-preface {
  max-width: 860px;
  margin: 28px auto 48px;
  padding: 32px 36px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.journey-preface::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--grad);
  opacity: 0.6;
}
.jp-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--t3);
  text-transform: uppercase;
  margin-bottom: 14px;
  text-align: center;
}
.journey-preface p {
  color: var(--t2);
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 14px;
}
.journey-preface p:last-child { margin-bottom: 0; }
.journey-preface strong {
  color: var(--t1);
  background: var(--grad-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.journey-timeline {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}

.journey-marker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0 20px;
}
.jm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 16px rgba(124,58,237,0.5);
  flex-shrink: 0;
}
.jm-year {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: 0.08em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.jm-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-hover) 0%, transparent 100%);
}

.journey-entry {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.journey-entry:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
}
.journey-entry[open] {
  border-color: var(--border-hover);
  background: var(--card-hover);
}
.journey-entry summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 26px;
  user-select: none;
}
.journey-entry summary::-webkit-details-marker { display: none; }

.je-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.je-head-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.je-kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--cyan-light);
  text-transform: uppercase;
}
.je-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.3;
}
.je-chev {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 300;
  color: var(--t3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.journey-entry:hover .je-chev {
  color: var(--t1);
  border-color: var(--border-hover);
}
.journey-entry[open] .je-chev {
  transform: rotate(45deg);
  color: var(--purple-light);
  border-color: var(--purple);
}

.je-body {
  padding: 4px 26px 26px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 20px;
}
.je-body p {
  color: var(--t2);
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 14px;
}
.je-body p:last-child { margin-bottom: 0; }
.je-body strong {
  color: var(--t1);
  font-weight: 600;
}
.je-sub {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--purple-light);
  text-transform: uppercase;
  margin-top: 18px;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--purple);
}
.je-sub:first-child { margin-top: 0; }
.je-placeholder {
  color: var(--t3);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.journey-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 40px auto 0;
  padding: 18px;
  max-width: 860px;
  color: var(--t3);
  font-size: 14px;
  font-family: var(--mono);
  border-top: 1px dashed var(--border);
}
.jm-asterisk {
  color: var(--purple-light);
  font-size: 16px;
}

@media (max-width: 640px) {
  .journey-preface { padding: 24px 22px; }
  .journey-preface p { font-size: 14px; line-height: 1.8; }
  .journey-entry summary { padding: 16px 18px; }
  .je-body { padding: 4px 18px 20px; padding-top: 18px; }
  .je-title { font-size: 16px; }
  .je-head { gap: 12px; }
  .je-chev { width: 28px; height: 28px; font-size: 20px; }
}
