:root {
  --bg: #07111f;
  --bg-2: #0b1729;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --text: #eef3ff;
  --muted: rgba(238, 243, 255, 0.72);
  --accent: #7c5cff;
  --accent-2: #1dd6a4;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --glow-accent: rgba(124, 92, 255, 0.5);
  --glow-accent-2: rgba(29, 214, 164, 0.4);
}

[data-theme="light"] {
  --bg: #eef3ff;
  --bg-2: #ffffff;
  --card: rgba(255, 255, 255, 0.8);
  --card-strong: rgba(255, 255, 255, 0.95);
  --border: rgba(10, 20, 40, 0.1);
  --text: #08111f;
  --muted: rgba(8, 17, 31, 0.68);
  --shadow: 0 20px 50px rgba(20, 40, 70, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(29, 214, 164, 0.16), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
}

img[loading="lazy"] {
  filter: blur(0px);
  transition: filter 0.4s ease;
}

img[loading="lazy"]:not([src]) {
  filter: blur(20px);
}

img.error,
img[src=""],
img:not([src]) {
  opacity: 0;
}

button {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

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

.section-alt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image:
    linear-gradient(to right, #fff 1px, transparent 1px),
    linear-gradient(to bottom, #fff 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
}

/* ── PAGE TRANSITION ── */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.page-transition.active {
  opacity: 1;
}

/* ── FLOATING GRADIENT ORBS ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 18s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: -10%; left: -8%;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: var(--accent-2);
  top: 30%; right: -10%;
  animation-delay: -6s;
  animation-duration: 22s;
}
.orb-3 {
  width: 350px; height: 350px;
  background: #5f8bff;
  bottom: 10%; left: 20%;
  animation-delay: -12s;
  animation-duration: 25s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-20px, 20px) scale(0.94); }
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(3, 10, 20, 0.56);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .topbar {
  background: rgba(238, 243, 255, 0.7);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: var(--shadow);
}

.brand-text {
  font-size: 1.02rem;
}

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

.nav a {
  color: var(--muted);
  font-weight: 600;
  transition: 0.25s ease;
}

.nav a:hover {
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

#langLabel {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.burger {
  display: none;
}

.hero {
  padding-top: 64px;
  overflow: hidden;
}

/* ── HERO SPOTLIGHT (follows mouse) ── */
.hero-spotlight {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-accent) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  z-index: 0;
  mix-blend-mode: screen;
}
.hero:hover .hero-spotlight {
  opacity: 0.18;
}

/* ── PARTICLE CANVAS ── */
.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Balanced hero layout */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
   gap: 100px; /* 🔥 from 28px → 60px */
  align-items: stretch; /* 🔥 ito ang key */
  position: relative;
  z-index: 1;
}

.hero-copy {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 12px;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
  margin: 14px 0 18px;
  white-space: nowrap;
}

/* ── SPOTLIGHT NAME ── */
.hero-name-line {
  display: block;
  animation: heroNameIn 0.8s cubic-bezier(.16,1,.3,1) both;
}

.hero-accent-name {
  font-size: 0.8em;
  display: block;
  margin-top: 10px;
  position: relative;
  background: linear-gradient(135deg, var(--accent), #5f8bff, var(--accent-2), var(--accent));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroNameIn 0.8s cubic-bezier(.16,1,.3,1) 0.15s both,
             gradientShift 6s ease-in-out infinite;
  filter: drop-shadow(0 0 30px var(--glow-accent));
}

@keyframes heroNameIn {
  from {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ── AVAILABILITY BADGE ── */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(29, 214, 164, 0.08);
  border: 1px solid rgba(29, 214, 164, 0.2);
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 18px;
  animation: heroNameIn 0.8s cubic-bezier(.16,1,.3,1) 0.3s both;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%      { opacity: 0.4; transform: scale(1); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  backdrop-filter: blur(12px);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  font-weight: 700;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5f8bff);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(124, 92, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(124, 92, 255, 0.5);
}

.btn-ghost {
  background: var(--card);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  border-color: rgba(124, 92, 255, 0.3);
  box-shadow: 0 4px 20px rgba(124, 92, 255, 0.15);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.stat-card,
.card,
.project-card,
.contact-card,
.hero-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card-strong), var(--card));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1),
              border-color 0.35s ease,
              box-shadow 0.35s ease;
}

.stat-card:hover,
.card:hover {
  border-color: rgba(124, 92, 255, 0.25);
  box-shadow: var(--shadow), 0 0 40px rgba(124, 92, 255, 0.08);
}

.stat-card {
  border-radius: 18px;
  padding: 18px;
}

.stat-card strong {
  font-size: 1.5rem;
  display: block;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Balanced hero card */
.hero-card {
  border-radius: 30px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  height: 100%;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

/* ── HERO CARD GLOW ── */
.hero-card-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), #5f8bff, var(--accent));
  opacity: 0;
  z-index: 0;
  transition: opacity 0.5s ease;
  animation: glowSpin 4s linear infinite;
}

.hero-card:hover .hero-card-glow {
  opacity: 0.35;
}

@keyframes glowSpin {
  to { transform: rotate(360deg); }
}

/* ── PROFILE ── */
.profile-panel {
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.profile-photo-wrap {
  aspect-ratio: 1 / 0.95;
  overflow: hidden;
  border-radius: 22px;
  flex-shrink: 0;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  padding: 18px 10px 4px;
  text-align: center;
}

.profile-info h2 {
  font-size: 1.4rem;
}

.profile-info p {
  color: var(--muted);
  margin-top: 4px;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.socials a {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.socials a:hover {
  transform: translateY(-3px) scale(1.1);
  background: linear-gradient(135deg, var(--accent), #5f8bff);
  color: white;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
  border-color: transparent;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mini-card {
  border-radius: 18px;
  padding: 14px 12px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.mini-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 92, 255, 0.3);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.12);
}

.mini-card i {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.mini-card:hover i {
  transform: scale(1.2);
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading span {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--accent-2);
  margin-bottom: 10px;
  font-weight: 800;
}

.section-heading h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.06;
  max-width: 760px;
}

.bento,
.projects-grid,
.skills-layout,
.timeline-grid {
  display: grid;
  gap: 18px;
}

.about-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.card,
.project-card {
  border-radius: var(--radius);
  padding: 22px;
}

.card.large {
  min-height: 100%;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head i {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(29, 214, 164, 0.18));
  color: var(--text);
}

.card-head h3 {
  font-size: 1.15rem;
}

.card p {
  color: var(--muted);
}

.project-card p {
  flex-grow: 1;
  color: var(--muted);
}

.timeline-item p {
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips span,
.tags span,
.project-badge {
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text);
}

.list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.list li {
  color: var(--muted);
  padding-left: 20px;
  position: relative;
}

.list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  position: absolute;
  left: 0;
  top: 11px;
}

.projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 210px;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1),
              border-color 0.35s ease,
              box-shadow 0.35s ease;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(124,92,255,0.06), transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: var(--shadow), 0 0 50px rgba(124, 92, 255, 0.1);
}

.project-card:hover::before {
  opacity: 1;
}

.project-top h3 {
  margin-top: 12px;
  font-size: 1.2rem;
}

.demo-link {
  color: #8bb3ff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: color 0.3s ease, gap 0.3s ease;
}

.demo-link:hover {
  color: var(--accent-2);
  gap: 12px;
}

.demo-link i {
  transition: transform 0.3s ease;
}

.demo-link:hover i {
  transform: translate(2px, -2px);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

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

.skill {
  margin-top: 18px;
}

.skill-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
}

.bar {
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.bar div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0 !important;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

.bar.animate div {
  width: var(--bar-width) !important;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stack-grid span {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  text-align: center;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.stack-grid span:hover {
  transform: translateY(-3px);
  background: rgba(124, 92, 255, 0.1);
  border-color: rgba(124, 92, 255, 0.3);
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.15);
}

.timeline-grid {
  grid-template-columns: 1fr 1fr;
}

.timeline-item {
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
}

.timeline-item + .timeline-item {
  margin-top: 18px;
}

.timeline-item h4 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

.meta {
  font-size: 0.9rem;
  margin: 4px 0 10px;
  color: #9db0ff;
  font-weight: 600;
}

.contact-card {
  border-radius: 30px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.contact-card h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  margin: 10px 0;
}

.contact-card p {
  color: var(--muted);
  max-width: 520px;
}

.contact-actions {
  display: grid;
  gap: 12px;
}

.contact-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: all 0.3s ease;
}

.contact-line:hover {
  border-color: rgba(124, 92, 255, 0.25);
  transform: translateX(4px);
}

.contact-line i {
  color: var(--accent-2);
}

.full {
  width: 100%;
}

.footer {
  padding: 28px 0 34px;
  border-top: 1px solid var(--border);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a:hover,
.nav a:hover {
  color: var(--text);
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(.16,1,.3,1),
              transform 0.8s cubic-bezier(.16,1,.3,1);
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

/* staggered children */
.reveal.show:nth-child(2) { transition-delay: 0.08s; }
.reveal.show:nth-child(3) { transition-delay: 0.16s; }
.reveal.show:nth-child(4) { transition-delay: 0.24s; }
.reveal.show:nth-child(5) { transition-delay: 0.32s; }
.reveal.show:nth-child(6) { transition-delay: 0.40s; }

@media (max-width: 1024px) {
  .hero-grid,
  .about-grid,
  .skills-layout,
  .timeline-grid,
  .contact-card,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-copy {
    justify-content: flex-start;
    padding-right: 0;
  }

  .hero-card {
    max-width: 560px;
    width: 100%;
  }
}

@media (max-width: 840px) {
  .nav {
    position: absolute;
    top: 78px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px;
    border-radius: 20px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 10px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
  }

  .burger {
    display: grid;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .footer-row {
    flex-direction: column;
    text-align: center;
  }
}

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

  .container {
    width: min(1180px, calc(100% - 24px));
  }

  .brand-text {
    display: none;
  }

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

  .mini-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-card {
    max-width: 100%;
    padding: 12px;
  }
}

/* ═══════════════════════════════════════════
   CHATBOT
   ═══════════════════════════════════════════ */
.chatbot {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
}

/* ── TOGGLE BUTTON ── */
.chat-toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #7c5cff, #1dd6a4);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(124, 92, 255, 0.4);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1),
              opacity 0.25s ease,
              visibility 0.25s ease;
  z-index: 2;
}

.chat-toggle:hover {
  transform: translateY(-3px) scale(1.08);
}

/* hide icon when chat is open */
.chat-toggle.hide {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.5);
  pointer-events: none;
}

/* ── CHAT WINDOW ── */
.chat-window {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 360px;
  height: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: var(--bg-2);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow),
              0 0 0 1px rgba(124, 92, 255, 0.12);
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(.4,0,.2,1),
              transform 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 1;
}

.chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── HEADER ── */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(29, 214, 164, 0.08));
  border-bottom: 1px solid var(--border);
}

.chat-title h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.chat-title span {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── CLOSE BUTTON ── */
.chat-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
}

.chat-close:hover {
  background: #ff4d4d;
  color: white;
}

/* ── MESSAGES ── */
.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

/* ── BUBBLES ── */
.message {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: bubbleIn 0.25s ease both;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #7c5cff, #5f8bff);
  color: white;
  border-bottom-right-radius: 4px;
}

.bot {
  align-self: flex-start;
  background: var(--card);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* ── INPUT ── */
.chat-input {
  display: flex;
  border-top: 1px solid var(--border);
}

.chat-input input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
}

.chat-input input::placeholder {
  color: var(--muted);
}

.chat-input button {
  padding: 12px 18px;
  background: linear-gradient(135deg, #7c5cff, #5f8bff);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: filter 0.2s;
}

.chat-input button:hover {
  filter: brightness(1.15);
}

/* ── SUGGEST BUTTONS ── */
.suggest-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--card);
  color: var(--text);
  text-align: left;
  font-size: 0.8rem;
  transition: background 0.2s, border-color 0.2s;
}

.suggest-btn:hover {
  background: rgba(124, 92, 255, 0.3);
  border-color: rgba(124, 92, 255, 0.4);
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .chatbot {
    right: 14px;
    bottom: 14px;
  }

  .chat-window {
    width: calc(100vw - 28px);
    height: 72vh;
    border-radius: 18px;
  }
}

/* ═══════════════════════════════════════════
   SMOOTH THEME TRANSITION
   ═══════════════════════════════════════════ */
body, .topbar, .hero-card, .card, .project-card, .contact-card,
.chat-window, .chat-toggle, .btn, .icon-btn {
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease,
              box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

/* ═══════════════════════════════════════════
   ROBOT TARGETING CURSOR
   ═══════════════════════════════════════════ */
.cursor {
  position: fixed;
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease;
}

/* Outer ring */
.cursor-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(124, 92, 255, 0.35);
  overflow: hidden;
}

/* Radar scan line rotating */
.cursor-ring::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent));
  transform-origin: 0 50%;
  animation: cursorScan 1.8s linear infinite;
  filter: drop-shadow(0 0 6px var(--accent));
}

@keyframes cursorScan {
  to { transform: rotate(360deg); }
}

/* Crosshair lines */
.cursor-crosshair::before,
.cursor-crosshair::after {
  content: '';
  position: absolute;
  background: var(--accent);
  opacity: 0.3;
}
.cursor-crosshair::before {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}
.cursor-crosshair::after {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

/* Corner brackets */
.cursor-crosshair {
  position: absolute;
  inset: 4px;
}
.cursor-crosshair::before,
.cursor-crosshair::after {
  background: transparent;
  opacity: 1;
}
.cursor-crosshair::before {
  width: 8px;
  height: 8px;
  left: 0;
  top: 0;
  transform: none;
  border-top: 1.5px solid var(--accent-2);
  border-left: 1.5px solid var(--accent-2);
  box-shadow:
    22px 0 0 0 var(--accent-2),
    0 22px 0 0 var(--accent-2),
    22px 22px 0 0 var(--accent-2);
}
.cursor-crosshair::after {
  display: none;
}

/* Center dot */
.cursor-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent-2), 0 0 20px rgba(29, 214, 164, 0.3);
  animation: cursorPulse 1.4s ease-in-out infinite;
}

@keyframes cursorPulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.5); }
}

.cursor.grow {
  width: 52px;
  height: 52px;
}

/* Trail ring dots */
.cursor-trail-dot {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
}

@media (hover: none) and (pointer: coarse) {
  .cursor { display: none; }
}

/* ═══════════════════════════════════════════
   TYPING ANIMATION
   ═══════════════════════════════════════════ */
.typing-line {
  display: inline-block;
  min-width: 1ch;
}

.typing-line::after {
  content: '|';
  display: inline-block;
  animation: cursorBlink 0.7s steps(1) infinite;
  color: var(--accent-2);
  font-weight: 100;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ═══════════════════════════════════════════
   BACK TO TOP
   ═══════════════════════════════════════════ */
.back-to-top {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease,
              background 0.4s ease, border-color 0.4s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--accent), #5f8bff);
  color: white;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}

/* ═══════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.filter-btn:hover {
  border-color: rgba(124, 92, 255, 0.3);
  color: var(--text);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), #5f8bff);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.3);
}

.project-card {
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
}

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

/* ═══════════════════════════════════════════
   PROJECT MODAL
   ═══════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 24px;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

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

.modal-content {
  position: relative;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 60px rgba(124, 92, 255, 0.1);
  padding: 32px;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(.16,1,.3,1);
}

.modal.open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #ff4d4d;
  color: white;
  border-color: transparent;
}

.modal-body h3 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.modal-body .project-badge {
  display: inline-block;
  margin-bottom: 14px;
}

.modal-body p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.modal-body .tags {
  margin-top: 16px;
}

.modal-body .modal-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   TESTIMONIALS
   ═══════════════════════════════════════════ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.testimonial-stars {
  color: #fbbf24;
  font-size: 0.9rem;
  display: flex;
  gap: 4px;
}

.testimonial-card p {
  flex: 1;
  font-style: italic;
  color: var(--muted);
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.testimonial-author strong {
  font-size: 0.95rem;
}

.testimonial-author span {
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 1024px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
   CONTACT FORM
   ═══════════════════════════════════════════ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-info h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  margin: 10px 0;
}

.contact-info p {
  color: var(--muted);
  max-width: 520px;
}

.contact-details {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
}

.form-status {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  min-height: 24px;
}

.form-status.success {
  color: var(--accent-2);
}

.form-status.error {
  color: #ff6b6b;
}

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .modal-content {
    padding: 24px;
  }
}

/* ═══════════════════════════════════════════
   📜 CERTIFICATES
   ═══════════════════════════════════════════ */
.cert-section {
  margin-top: 8px;
}

.cert-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.cert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.cert-item:hover {
  border-color: rgba(124, 92, 255, 0.25);
  transform: translateX(4px);
}

.cert-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(29, 214, 164, 0.1));
  color: var(--accent-2);
  font-size: 0.9rem;
}

.cert-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cert-info strong {
  font-size: 0.88rem;
  line-height: 1.4;
}

.cert-info span {
  font-size: 0.78rem;
  color: var(--muted);
}

.cert-toggle {
  width: 100%;
  margin-top: 14px;
}

.cert-gallery {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.cert-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.cert-gallery img:hover {
  transform: scale(1.03);
  border-color: var(--accent);
}

.cert-gallery.show {
  display: grid;
}

/* ═══════════════════════════════════════════
   📜 CERTIFICATE FULL-SCREEN GALLERY
   ═══════════════════════════════════════════ */
.cert-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cert-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cert-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 20, 0.88);
  backdrop-filter: blur(16px);
}

.cert-overlay-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 32px 32px;
  overflow-y: auto;
}

.cert-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-shrink: 0;
}

.cert-overlay-header h2 {
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cert-overlay-close {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.3s ease;
}

.cert-overlay-close:hover {
  background: #ff4d4d;
  color: white;
  border-color: transparent;
  transform: rotate(90deg);
}

.cert-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.cert-nav-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.cert-overlay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding-bottom: 32px;
}

.cert-overlay-grid .cert-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.16,1,.3,1),
              border-color 0.35s ease,
              box-shadow 0.35s ease;
}

.cert-overlay-grid .cert-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(124, 92, 255, 0.2);
}

.cert-overlay-grid .cert-card img {
  width: 100%;
  height: 240px;
  display: block;
  object-fit: contain;
}

.cert-overlay-grid .cert-card .cert-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 14px 12px;
  background: linear-gradient(transparent, rgba(3, 10, 20, 0.85));
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .cert-overlay-content {
    padding: 16px;
  }

  .cert-overlay-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .cert-overlay-header h2 {
    font-size: 1.2rem;
  }
}