/* =============================================
   LOUIS WANG PORTFOLIO — styles.css
   ============================================= */

/* ---- Variables ---- */
:root {
  --bg:         #05050f;
  --bg2:        #0a0a1a;
  --card:       rgba(255,255,255,0.03);
  --card-hover: rgba(255,255,255,0.06);
  --cyan:    #00d4ff;
  --purple:  #7c3aed;
  --green:   #00ff88;
  --pink:    #f43f5e;
  --txt:     #e2e8f0;
  --txt2:    #8892b0;
  --muted:   #3d4a5c;
  --border:  rgba(0,212,255,0.13);
  --glow-c:  0 0 20px rgba(0,212,255,0.45);
  --glow-p:  0 0 20px rgba(124,58,237,0.45);
  --ease:    cubic-bezier(0.4,0,0.2,1);
  --nav-h:   68px;
  --ff-head: 'Orbitron', sans-serif;
  --ff-body: 'Inter', sans-serif;
  --ff-mono: 'Share Tech Mono', monospace;
}

/* ---- Reset ---- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 64px; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--ff-body);
  line-height: 1.7;
  overflow-x: hidden;
}
a { text-decoration: none; }
ul { list-style: none; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }

/* ---- Selection ---- */
::selection { background: rgba(0,212,255,0.25); color:#fff; }

/* ============================================================
   CANVAS
   ============================================================ */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  will-change: contents;
}

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
#navbar.scrolled {
  background: rgba(5,5,15,0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 40px rgba(0,212,255,0.08);
}
.nav-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-logo {
  font-family: var(--ff-head);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: auto;
  user-select: none;
}
.logo-bracket { color: var(--purple); font-size: 1.5rem; }
.logo-text {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links { display: flex; gap: 0.15rem; }
.nav-links a {
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  color: var(--txt2);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  transition: color 0.25s, background 0.25s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }
.nav-links a:hover::after, .nav-links a.active::after { width: 70%; }

.nav-social { display: flex; gap: 0.75rem; }
.nav-social a {
  color: var(--txt2);
  font-size: 1.05rem;
  transition: color 0.25s, text-shadow 0.25s;
}
.nav-social a:hover { color: var(--cyan); text-shadow: var(--glow-c); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--cyan); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  inset-inline: 0;
  background: rgba(5,5,15,0.97);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  transform: translateY(-105%);
  transition: transform 0.35s var(--ease);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu ul { padding: 0.75rem 2rem 1.5rem; }
.mobile-menu ul li a {
  display: block;
  padding: 0.9rem 0;
  color: var(--txt2);
  font-family: var(--ff-mono);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, padding-left 0.2s;
}
.mobile-menu ul li:last-child a { border-bottom: none; }
.mobile-menu ul li a:hover { color: var(--cyan); padding-left: 0.75rem; }

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
.section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem;
  scroll-margin-top: 64px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}
.section-number { font-family: var(--ff-mono); font-size: 1rem; color: var(--cyan); }
.section-header h2 {
  font-family: var(--ff-head);
  font-size: clamp(1.4rem,3vw,2rem);
  font-weight: 700;
  white-space: nowrap;
}
.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}
.sub-section-label {
  font-family: var(--ff-head);
  font-size: 0.9rem;
  color: var(--cyan);
  margin: 2.5rem 0 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--cyan);
  letter-spacing: 1px;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + 1rem) 2rem 3rem;
  gap: 2rem;
  scroll-margin-top: var(--nav-h);
}
.hero-content { max-width: 780px; }

.hero-greeting {
  font-family: var(--ff-mono);
  font-size: 1rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease) 0.3s forwards;
}
.hero-name {
  font-family: var(--ff-head);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg,#fff 0%, var(--cyan) 45%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 35px rgba(0,212,255,0.25));
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.5s forwards;
}
.hero-typing {
  font-family: var(--ff-mono);
  font-size: clamp(0.85rem,2.2vw,1.1rem);
  color: var(--txt2);
  min-height: 1.8em;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease) 0.7s forwards;
}
.typing-prefix { color: var(--green); }
.typing-text   { color: var(--cyan); }
.typing-cursor { color: var(--cyan); animation: blink 1s step-end infinite; }

.hero-tagline {
  color: var(--txt2);
  font-size: clamp(0.82rem,1.8vw,0.95rem);
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease) 0.9s forwards;
}
.hero-available {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  color: var(--green);
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease) 1.0s forwards;
}
.available-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease infinite;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease) 1.1s forwards;
}
.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  justify-content: center;
}
.stat-item {
  text-align: center;
  opacity: 0;
  animation: fadeUp 0.5s var(--ease) forwards;
}
.stat-item:nth-child(1) { animation-delay: 1.3s; }
.stat-item:nth-child(2) { animation-delay: 1.4s; }
.stat-item:nth-child(3) { animation-delay: 1.5s; }
.stat-item:nth-child(4) { animation-delay: 1.6s; }
.stat-value {
  display: block;
  font-family: var(--ff-head);
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.72rem; color: var(--muted); font-family: var(--ff-mono); text-transform: uppercase; letter-spacing: 1px; }

.hero-scroll {
  position: absolute;
  bottom: -3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-family: var(--ff-mono);
  opacity: 0;
  animation: fadeIn 1s var(--ease) 2s forwards;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  animation: scroll-pulse 2s ease infinite;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--ff-mono);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  transform: translateX(-110%);
  transition: transform 0.4s;
}
.btn-primary:hover::before { transform: translateX(110%); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,212,255,0.4); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: 8px;
  font-family: var(--ff-mono);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}
.btn-outline:hover { background: rgba(0,212,255,0.1); transform: translateY(-2px); box-shadow: var(--glow-c); }

.btn-ghost {
  background: transparent;
  color: var(--txt2);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--txt); border-color: var(--txt2); }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p { color: var(--txt2); margin-bottom: 1.25rem; line-height: 1.85; }
.contact-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.contact-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--txt2);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, color 0.2s;
}
.contact-chip:hover { border-color: rgba(0,212,255,0.35); }
.contact-chip i { color: var(--cyan); width: 14px; text-align: center; flex-shrink:0; }
.contact-chip a { color: var(--txt2); transition: color 0.2s; }
.contact-chip a:hover { color: var(--cyan); }

.about-affiliations h3 {
  font-family: var(--ff-head);
  font-size: 0.85rem;
  color: var(--cyan);
  margin-bottom: 1rem;
  letter-spacing: 1px;
}
.affil-list { display: flex; flex-direction: column; gap: 0.5rem; }
.affil-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  backdrop-filter: blur(6px);
}
.affil-item:hover { border-color: rgba(0,212,255,0.35); background: var(--card-hover); transform: translateX(4px); }
.affil-item i { color: var(--cyan); width: 16px; flex-shrink:0; }
.affil-item span { font-size: 0.83rem; color: var(--txt2); }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.skills-col h3 {
  font-family: var(--ff-mono);
  font-size: 1rem;
  color: var(--txt);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.skills-col h3 i { color: var(--cyan); }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.skill-tag {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-family: var(--ff-mono);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.skill-tag:hover { transform: translateY(-2px); }

.t1 { background: rgba(0,212,255,0.12); border:1px solid rgba(0,212,255,0.35); color:#a8eeff; }
.t1:hover { box-shadow: 0 0 14px rgba(0,212,255,0.3); }
.t2 { background: rgba(124,58,237,0.12); border:1px solid rgba(124,58,237,0.35); color:#c4b5fd; }
.t2:hover { box-shadow: 0 0 14px rgba(124,58,237,0.3); }
.t3 { background: rgba(0,255,136,0.08); border:1px solid rgba(0,255,136,0.25); color:#a7f3d0; }
.t3:hover { box-shadow: 0 0 14px rgba(0,255,136,0.25); }
.p1 { background: rgba(251,146,60,0.1); border:1px solid rgba(251,146,60,0.3); color:#fed7aa; }
.p2 { background: rgba(244,63,94,0.1); border:1px solid rgba(244,63,94,0.3); color:#fecdd3; }
.p3 { background: rgba(6,182,212,0.1); border:1px solid rgba(6,182,212,0.3); color:#a5f3fc; }
.p4 { background: rgba(139,92,246,0.1); border:1px solid rgba(139,92,246,0.3); color:#ddd6fe; }

/* ============================================================
   TIMELINE (Experience)
   ============================================================ */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--cyan), var(--purple), transparent);
}
.timeline-item { position: relative; margin-bottom: 3rem; }
.timeline-dot {
  position: absolute;
  left: -2.9rem; top: 10px;
  width: 12px; height: 12px;
  background: var(--cyan);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 12px var(--cyan);
}
.timeline-date {
  font-family: var(--ff-mono);
  font-size: 0.77rem;
  color: var(--cyan);
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.timeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  will-change: transform;
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.timeline-card:hover {
  border-color: rgba(0,212,255,0.35);
  background: var(--card-hover);
  transform: translateX(5px);
}
.timeline-card h3 {
  font-family: var(--ff-head);
  font-size: 1.05rem;
  color: var(--txt);
  margin-bottom: 0.2rem;
}
.timeline-card h4 { font-size: 0.88rem; color: var(--purple); font-weight: 400; margin-bottom: 1rem; }
.timeline-card ul { display: flex; flex-direction: column; gap: 0.45rem; }
.timeline-card ul li {
  font-size: 0.88rem;
  color: var(--txt2);
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.65;
}
.timeline-card ul li::before { content: '▹'; color: var(--cyan); position: absolute; left: 0; }

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px,1fr)); gap: 1.5rem; }
.edu-card {
  display: flex;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.edu-card:hover {
  border-color: rgba(124,58,237,0.45);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124,58,237,0.2);
}
.edu-icon { font-size: 1.8rem; color: var(--purple); flex-shrink: 0; padding-top: 0.1rem; }
.edu-year { font-family: var(--ff-mono); font-size: 0.73rem; color: var(--cyan); display: block; margin-bottom: 0.4rem; }
.edu-body h3 { font-family: var(--ff-head); font-size: 0.92rem; color: var(--txt); margin-bottom: 0.2rem; line-height: 1.4; }
.edu-body h4 { font-size: 0.83rem; color: var(--purple); font-weight: 400; margin-bottom: 0.75rem; }
.edu-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.edu-tags span {
  font-size: 0.73rem;
  font-family: var(--ff-mono);
  padding: 0.2rem 0.55rem;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 10px;
  color: #c4b5fd;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(320px,1fr)); gap: 1.75rem; }
.project-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  overflow: hidden;
  backdrop-filter: blur(8px);
  will-change: transform;
  transition: border-color 0.3s, transform 0.35s, box-shadow 0.35s;
}
.project-card:hover { transform: translateY(-6px); }

/* Featured card */
.project-card.featured { border-color: rgba(0,255,136,0.22); background: rgba(0,255,136,0.02); }
.project-card.featured:hover {
  border-color: rgba(0,255,136,0.55);
  box-shadow: 0 12px 55px rgba(0,255,136,0.18);
}

/* Portal ring on featured card */
.project-portal-ring {
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 2px solid rgba(0,255,136,0.15);
  animation: portal-spin 8s linear infinite;
  pointer-events: none;
}
.project-portal-ring::before {
  content: '';
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  border: 1px dashed rgba(0,255,136,0.2);
  animation: portal-spin 5s linear infinite reverse;
}
.project-card.featured:hover .project-portal-ring {
  border-color: rgba(0,255,136,0.45);
  box-shadow: 0 0 30px rgba(0,255,136,0.2);
}

.project-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  font-size: 0.68rem;
  font-family: var(--ff-mono);
  padding: 0.22rem 0.6rem;
  background: rgba(0,255,136,0.12);
  border: 1px solid rgba(0,255,136,0.35);
  border-radius: 20px;
  color: var(--green);
}
.project-icon { font-size: 2.4rem; margin-bottom: 0.85rem; }
.project-card h3 {
  font-family: var(--ff-head);
  font-size: 0.98rem;
  color: var(--txt);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}
.project-card p { color: var(--txt2); font-size: 0.88rem; line-height: 1.75; margin-bottom: 1.2rem; }
.project-tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.project-tech span {
  font-size: 0.72rem;
  font-family: var(--ff-mono);
  padding: 0.2rem 0.55rem;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.18);
  border-radius: 10px;
  color: #a8eeff;
}
.project-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.project-btn { font-size: 0.78rem; padding: 0.5rem 1rem; }

/* ============================================================
   CERTIFICATIONS
   ============================================================ */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 0.85rem; }
.cert-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.cert-card:hover { border-color: var(--cyan); background: var(--card-hover); transform: translateY(-2px); }
.cert-card i { color: var(--cyan); font-size: 1rem; flex-shrink: 0; }
.cert-card span { font-size: 0.8rem; color: var(--txt2); line-height: 1.3; }
.cert-card span em { color: var(--muted); font-style: normal; }

.events-list { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.event-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.1rem;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 8px;
  transition: border-color 0.2s, transform 0.2s;
}
.event-chip:hover { border-color: var(--purple); transform: translateY(-2px); }
.event-chip i { color: var(--purple); }
.event-chip span { font-size: 0.83rem; color: var(--txt2); }

/* ============================================================
   COMMUNITY
   ============================================================ */
.community-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.community-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, background 0.3s;
}
.community-card:hover { border-color: rgba(0,212,255,0.25); background: var(--card-hover); }
.community-card h3 { font-family: var(--ff-mono); font-size: 0.95rem; color: var(--txt); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.community-card h3 i { color: var(--cyan); }
.community-card ul { display: flex; flex-direction: column; gap: 0.65rem; }
.community-card ul li { font-size: 0.88rem; color: var(--txt2); padding-left: 1.2rem; position: relative; line-height: 1.65; }
.community-card ul li::before { content: '▹'; color: var(--green); position: absolute; left: 0; }
.hobbies-wrap { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.hobbies-wrap span {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  color: var(--txt2);
  transition: border-color 0.2s, color 0.2s;
}
.hobbies-wrap span:hover { border-color: var(--cyan); color: var(--cyan); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-section { text-align: center; }
.contact-intro {
  color: var(--txt2);
  max-width: 520px;
  margin: 0 auto 3rem;
  line-height: 1.85;
}
.contact-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(210px,1fr));
  gap: 1rem;
  max-width: 860px;
  margin: 0 auto;
  text-align: left;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, background 0.3s, transform 0.3s, box-shadow 0.3s;
  color: inherit;
}
.contact-link:hover {
  border-color: var(--cyan);
  background: var(--card-hover);
  transform: translateY(-4px);
  box-shadow: 0 10px 35px rgba(0,212,255,0.15);
}
.contact-link i { font-size: 1.4rem; color: var(--cyan); flex-shrink: 0; width: 26px; text-align: center; }
.cl-label { display: block; font-family: var(--ff-mono); font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.cl-value { display: block; font-size: 0.83rem; color: var(--txt2); margin-top: 0.1rem; word-break: break-all; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}
.footer-inner p { font-size: 0.83rem; color: var(--muted); }
.footer-sub { margin-top: 0.3rem; font-family: var(--ff-mono); font-size: 0.73rem; }
.glow { color: var(--cyan); text-shadow: var(--glow-c); }
.footer-icons { display: flex; gap: 1.2rem; justify-content: center; margin-top: 1.25rem; }
.footer-icons a { color: var(--muted); font-size: 1.2rem; transition: color 0.2s, text-shadow 0.2s; }
.footer-icons a:hover { color: var(--cyan); text-shadow: var(--glow-c); }

/* ============================================================
   MODAL / QUESTIONNAIRE
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3,3,12,0.88);
  backdrop-filter: blur(12px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-box {
  background: rgba(8,8,22,0.97);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 22px;
  padding: 2.5rem;
  max-width: 510px;
  width: 100%;
  box-shadow: 0 0 80px rgba(0,212,255,0.12), 0 0 150px rgba(124,58,237,0.08);
  animation: modal-appear 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header { text-align: center; margin-bottom: 2rem; }
.modal-icon { font-size: 3rem; margin-bottom: 0.75rem; animation: float 3s ease infinite; }
.modal-header h2 { font-family: var(--ff-head); font-size: 1.35rem; color: var(--txt); margin-bottom: 0.5rem; }
.modal-header p { color: var(--txt2); font-size: 0.88rem; }

.form-group { margin-bottom: 1.5rem; }
.form-group > label { display: block; font-size: 0.85rem; color: var(--txt2); font-family: var(--ff-mono); margin-bottom: 0.75rem; }
.radio-group { display: flex; flex-direction: column; gap: 0.45rem; }
.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.radio-option:hover { border-color: rgba(0,212,255,0.35); background: var(--card-hover); }
.radio-option input[type="radio"] {
  appearance: none;
  width: 15px; height: 15px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.radio-option input[type="radio"]:checked {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0,212,255,0.5);
}
.radio-option span { font-size: 0.83rem; color: var(--txt2); line-height: 1.45; }
.radio-option span em { color: var(--muted); font-style: normal; font-size: 0.77rem; }
.radio-option input:checked ~ span { color: var(--txt); }

.form-group textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: var(--txt);
  font-family: var(--ff-body);
  font-size: 0.88rem;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.form-group textarea::placeholder { color: var(--muted); }

.modal-actions { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; margin-top: 0.5rem; }

/* ============================================================
   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); }

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes fadeUp {
  from { opacity:0; transform: translateY(22px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; } to { opacity:1; }
}
@keyframes blink {
  0%,49% { opacity:1; } 50%,100% { opacity:0; }
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 8px var(--green); }
  50%     { box-shadow: 0 0 18px var(--green), 0 0 30px rgba(0,255,136,0.4); }
}
@keyframes scroll-pulse {
  0%,100% { opacity:1; transform: scaleY(1); }
  50%     { opacity:0.3; transform: scaleY(0.6); }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-9px); }
}
@keyframes modal-appear {
  from { opacity:0; transform: scale(0.86) translateY(18px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
@keyframes portal-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links, .nav-social { display: none; }
  .hamburger { display: flex; }
  .about-grid, .skills-grid, .community-grid { grid-template-columns: 1fr; }
  .contact-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-stats { gap: 1.75rem; }
  .stat-value { font-size: 1.8rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr 1fr; }
  .modal-box { padding: 1.75rem 1.25rem; }
  .section { padding: 4rem 1.25rem; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #bg-canvas { display: none; }
  .reveal { opacity: 1; transform: none; }
}
