:root {
  --bg: #030712;
  --bg-surface: rgba(17, 24, 39, 0.4);
  --border: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(139, 92, 246, 0.3);
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --primary: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.6);
  --secondary: #0ea5e9;
  --secondary-glow: rgba(14, 165, 233, 0.6);
  --accent: #ec4899;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --container: min(1200px, 90vw);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="hyper"] {
  --bg: #000000;
  --primary: #f87171;
  --primary-glow: rgba(248, 113, 113, 0.8);
  --secondary: #34d399;
  --secondary-glow: rgba(52, 211, 153, 0.8);
  --accent: #fbbf24;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* Background Effects */
.glow-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 20s infinite alternate ease-in-out;
}

.glow-1 {
  top: -10%; left: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.glow-2 {
  bottom: -10%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
  animation-delay: -5s;
}

.glow-3 {
  top: 40%; left: 50%;
  width: 40vw; height: 40vw;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation-delay: -10s;
  opacity: 0.2;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Utilities */
.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
}

.text-gradient {
  background: linear-gradient(to right, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: gradientText 5s linear infinite;
}

.text-center { text-align: center; }
.w-full { width: 100%; }

/* Layout */
.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

.section {
  width: var(--container);
  margin: 0 auto;
  padding: 100px 0;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--container);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  z-index: 100;
  transition: var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  box-shadow: 0 0 15px var(--primary-glow);
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
  border-radius: 2px;
}

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

.nav a:hover::after, .nav a.active::after {
  width: 100%;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--primary);
}

.toggle-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  transition: var(--transition);
}

[data-theme="hyper"] .toggle-icon {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* Hero Section */
.hero {
  width: var(--container);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding-top: 80px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: #c4b5fd;
  margin-bottom: 24px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary-glow);
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(3rem, 5vw, 4.5rem);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 10px 20px -10px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -10px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-card h3 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.portrait-container {
  position: relative;
  width: 400px;
  height: 500px;
  border-radius: var(--radius-lg);
  padding: 10px;
  transition: transform 0.1s;
  transform-style: preserve-3d;
}

.portrait-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  opacity: 0.5;
  filter: blur(20px);
  animation: rotate 10s linear infinite;
  z-index: -1;
}

.portrait-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 5px);
  border: 1px solid var(--border);
}

.floating-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.9rem;
  animation: float 6s infinite ease-in-out;
  transform: translateZ(30px);
}

.badge-1 {
  top: 10%;
  left: -10%;
  animation-delay: 0s;
}

.badge-2 {
  bottom: 15%;
  right: -5%;
  animation-delay: 2s;
}

/* Ticker */
.ticker {
  width: 100%;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.6);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
}

.ticker-content {
  display: flex;
  width: 200%;
  animation: tickerScroll 30s linear infinite;
}

.ticker-track {
  display: flex;
  justify-content: space-around;
  width: 100%;
}

.ticker span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

/* Section Common */
.section-header {
  margin-bottom: 60px;
}

.section-subtitle {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 16px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.about-card {
  padding: 40px;
  border-radius: var(--radius-lg);
}

.card-icon {
  width: 50px;
  height: 50px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.highlight-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.8), rgba(31, 41, 55, 0.6));
  border-color: var(--border-highlight);
}

.highlight-card .card-icon {
  background: rgba(14, 165, 233, 0.1);
  color: var(--secondary);
}

.about-card h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.about-card p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Projects Section */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
  font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

.project-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.project-content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.icon-link {
  color: var(--text-muted);
  transition: var(--transition);
}

.icon-link:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.project-type {
  font-size: 0.85rem;
  color: var(--secondary);
  font-weight: 600;
}

.project-title {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.project-desc {
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 24px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.skills-bars {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skill-item {
  width: 100%;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 500;
}

.skill-percent {
  color: var(--primary);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-stack {
  padding: 40px;
  border-radius: var(--radius-lg);
}

.tech-stack h3 {
  margin-bottom: 24px;
  font-size: 1.4rem;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stack-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stack-icon {
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.stack-item h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

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

/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 40px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 14px;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.timeline-content {
  padding: 30px;
  border-radius: var(--radius-lg);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.timeline-title {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.timeline-company {
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 16px;
}

.timeline-desc {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-tags span {
  font-size: 0.8rem;
  color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Contact Section */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px;
  border-radius: var(--radius-lg);
}

.contact-info {
  display: flex;
  flex-direction: column;
}

.contact-desc {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.method-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
}

.method-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.method-details {
  display: flex;
  flex-direction: column;
}

.method-details span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.method-details strong {
  font-weight: 500;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.form-status {
  min-height: 24px;
  font-size: 0.9rem;
  color: var(--secondary);
  text-align: center;
}

/* Footer */
.footer {
  padding: 30px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Animations & Interactions */
.hover-card {
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.hover-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--border-highlight);
}

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

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

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

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 1000;
}

.scroll-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  transition: width 0.1s;
}

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

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

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

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

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

/* Responsive */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 120px;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .lede {
    margin: 0 auto 32px;
  }
  
  .hero-visual {
    margin-top: 40px;
  }
  
  .about-grid, .skills-grid, .contact-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topbar {
    top: 0;
    width: 100%;
    border-radius: 0;
    padding: 15px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
  }
  
  .nav {
    display: none; /* Hide nav on mobile for simplicity, or implement hamburger */
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .section {
    padding: 60px 0;
  }
}
