:root {
  --bg: #050814;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-bg-hover: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.28);
  --accent-1: #38bdf8;
  --accent-2: #818cf8;
  --accent-3: #c084fc;
  --accent-4: #34d399;
  --radius: 22px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, .brand {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

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

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  z-index: 100;
  transition: width 0.08s linear;
}

/* Animated Background Canvas */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.45;
  will-change: transform;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, #38bdf8, transparent 70%);
  animation: floatA 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 600px;
  height: 600px;
  top: 20%;
  right: -180px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  animation: floatB 22s ease-in-out infinite alternate;
}

.orb-3 {
  width: 460px;
  height: 460px;
  bottom: -100px;
  left: 20%;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  animation: floatA 24s ease-in-out infinite alternate-reverse;
}

.orb-4 {
  width: 400px;
  height: 400px;
  bottom: 18%;
  right: 25%;
  background: radial-gradient(circle, #10b981, transparent 70%);
  opacity: 0.25;
  animation: floatB 20s ease-in-out infinite alternate-reverse;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.14), transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

@keyframes floatA {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(90px, 70px) scale(1.14); }
}

@keyframes floatB {
  0% { transform: translate(0, 0) scale(1.06); }
  100% { transform: translate(-80px, -60px) scale(0.92); }
}

/* Floating Glass Navbar */
.nav-wrapper {
  position: sticky;
  top: 18px;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

.glass-nav {
  width: min(1020px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(12, 18, 36, 0.58);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--glass-highlight);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  box-shadow: 0 0 14px var(--accent-1);
}

.accent {
  color: var(--accent-1);
}

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

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #fff;
}

.nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #fff !important;
  font-weight: 600;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Glass Surface Primitives */
.glass-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.28s ease,
    background 0.28s ease;
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.28);
}

.card-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.13),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.glass-card:hover .card-shine {
  opacity: 1;
}

.glass-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding: 88px 0 64px;
}

.status-pill {
  color: #cbd5e1;
  margin-bottom: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-4);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(120deg, #ffffff 10%, var(--accent-1) 45%, var(--accent-3) 90%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.hero-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.08rem;
  color: var(--accent-1);
  margin-bottom: 18px;
  min-height: 1.8em;
}

.mono-prefix {
  color: var(--accent-3);
  margin-right: 6px;
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 30px;
}

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

.btn-primary,
.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #040814;
  border: none;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(56, 189, 248, 0.45);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-2px);
}

/* Terminal Card */
.terminal-card {
  padding: 0;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
}

.dots {
  display: flex;
  gap: 7px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red { background: #fb7185; }
.dot.yellow { background: #fbbf24; }
.dot.green { background: #34d399; }

.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86rem;
  line-height: 1.7;
  overflow-x: auto;
}

.c-muted { color: #64748b; }
.c-purple { color: #c084fc; }
.c-blue { color: #60a5fa; }
.c-cyan { color: #38bdf8; }
.c-green { color: #34d399; }

.terminal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Sections */
.section {
  padding: 72px 0;
}

.section-header {
  margin-bottom: 36px;
}

.section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent-1);
  letter-spacing: 0.1em;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  margin: 6px 0 8px;
}

.section-header p {
  color: var(--text-muted);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.bento-item {
  padding: 28px;
}

.bento-wide {
  grid-column: span 2;
}

.icon-pill {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.bento-item h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.bento-item p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* Skills Filter */
.filter-bar {
  gap: 6px;
  padding: 6px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.filter-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-pill {
  padding: 11px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.skill-pill.hidden {
  display: none;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.project-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.project-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
}

.project-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.project-card h3 {
  font-size: 1.22rem;
  margin-bottom: 10px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
  flex: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.tech-tags span {
  font-size: 0.75rem;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-links {
  display: flex;
  gap: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-1);
}

.project-links a:hover {
  text-decoration: underline;
}

/* Contact */
.contact-box {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  padding: 40px;
}

.contact-info h2 {
  font-size: 2rem;
  margin: 8px 0 12px;
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent-1);
  background: rgba(255, 255, 255, 0.08);
}

.full-width {
  width: 100%;
}

/* Footer & Toast */
.footer {
  padding: 28px 0 42px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #fff;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 100;
}

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

/* Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }

/* Responsive */
@media (max-width: 920px) {
  .hero,
  .contact-box {
    grid-template-columns: 1fr;
  }

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

  .bento-wide {
    grid-column: span 1;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    padding: 20px;
    border-radius: 20px;
    background: rgba(10, 15, 32, 0.92);
    backdrop-filter: blur(22px);
    border: 1px solid var(--glass-border);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .gradient-text,
  .pulse-dot {
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
