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

:root {
    --background: hsl(222, 47%, 4%);
    --foreground: hsl(210, 100%, 98%);
    --card: hsl(222, 47%, 6%);
    --primary: hsl(190, 100%, 50%);
    --primary-foreground: hsl(222, 47%, 4%);
    --primary-glow: hsl(190, 100%, 60%);
    --secondary: hsl(270, 70%, 60%);
    --secondary-glow: hsl(270, 80%, 70%);
    --accent: hsl(330, 80%, 60%);
    --accent-glow: hsl(330, 90%, 70%);
    --muted: hsl(222, 30%, 15%);
    --muted-foreground: hsl(215, 20%, 65%);
    --border: hsl(222, 30%, 18%);
    --glass-bg: hsl(222, 47%, 8%);
    --glass-border: hsl(210, 50%, 30%);
}

/* Light Mode Theme Variables */
.light-mode {
    --background: hsl(0, 0%, 98%);
    --foreground: hsl(222, 47%, 4%);
    --card: hsl(0, 0%, 100%);
    --primary: hsl(190, 100%, 50%);
    --primary-foreground: hsl(0, 0%, 100%);
    --primary-glow: hsl(190, 100%, 40%);
    --secondary: hsl(270, 70%, 60%);
    --secondary-glow: hsl(270, 80%, 50%);
    --accent: hsl(330, 80%, 60%);
    --accent-glow: hsl(330, 90%, 50%);
    --muted: hsl(0, 0%, 95%);
    --muted-foreground: hsl(215, 20%, 35%);
    --border: hsl(0, 0%, 90%);
    --glass-bg: hsl(0, 0%, 100%);
    --glass-border: hsl(0, 0%, 85%);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--foreground);
    overflow-x: hidden;
    line-height: 1.6;
}

.glass {
    background: hsla(222, 47%, 8%, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(210, 50%, 30%, 0.2);
}

.glow-primary {
    box-shadow: 0 0 20px hsla(190, 100%, 50%, 0.5), 0 0 40px hsla(190, 100%, 50%, 0.3);
}

.text-glow-primary {
    text-shadow: 0 0 20px hsla(190, 100%, 60%, 0.8);
}

.text-glow-secondary {
    text-shadow: 0 0 20px hsla(270, 80%, 70%, 0.8);
}

.text-glow-accent {
    text-shadow: 0 0 20px hsla(330, 90%, 70%, 0.8);
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, hsl(222, 47%, 4%) 0%, hsl(240, 50%, 8%) 50%, hsl(270, 40%, 10%) 100%);
}

.hero-bg {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&q=80') center/cover;
}

.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 6s infinite ease-in-out;
}

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

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

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

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 900px;
    padding: 2rem;
    animation: fadeIn 1s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: hsla(222, 47%, 8%, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(210, 50%, 30%, 0.2);
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 1s ease-out 0.2s backwards;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, hsl(190, 100%, 50%), hsl(270, 70%, 60%), hsl(330, 80%, 60%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 1s ease-out 0.4s backwards;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    animation: fadeIn 1s ease-out 0.6s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeIn 1s ease-out 0.8s backwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: hsla(190, 100%, 50%, 0.9);
    box-shadow: 0 0 20px hsla(190, 100%, 50%, 0.5), 0 0 40px hsla(190, 100%, 50%, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: hsla(222, 47%, 8%, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(210, 50%, 30%, 0.2);
    color: var(--foreground);
}

.btn-secondary:hover {
    background: hsla(222, 47%, 12%, 0.6);
    border-color: var(--primary);
}

/* Section Styles */
section {
    padding: 6rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

#hero {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, hsl(190, 100%, 50%), hsl(270, 70%, 60%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.125rem;
    color: var(--muted-foreground);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: hsla(222, 47%, 8%, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(210, 50%, 30%, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(40px);
}

.project-card.visible {
    animation: fadeIn 0.6s ease-out forwards;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 0 20px hsla(190, 100%, 50%, 0.5), 0 0 40px hsla(190, 100%, 50%, 0.3);
}

.project-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, hsl(190, 100%, 50%), hsl(270, 70%, 60%));
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--foreground);
}

.project-description {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-badge {
    padding: 0.25rem 0.75rem;
    background: hsla(190, 100%, 50%, 0.1);
    border: 1px solid hsla(190, 100%, 50%, 0.3);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--primary);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.project-link:hover {
    color: var(--primary-glow);
    transform: translateX(4px);
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: hsla(222, 47%, 8%, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(210, 50%, 30%, 0.2);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(40px);
}

.skill-card.visible {
    animation: fadeIn 0.6s ease-out forwards;
}

.skill-card:hover {
    transform: translateY(-8px) rotateY(5deg);
    border-color: var(--secondary);
    box-shadow: 0 0 20px hsla(270, 70%, 60%, 0.5);
}

.skill-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, hsl(270, 70%, 60%), hsl(330, 80%, 60%));
    border-radius: 1rem;
    font-size: 2rem;
}

.skill-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.skill-description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Contact Form */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    background: hsla(222, 47%, 8%, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(210, 50%, 30%, 0.2);
    border-radius: 1rem;
    padding: 3rem;
    margin-bottom: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--foreground);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--foreground);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(190, 100%, 50%, 0.1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: hsla(222, 47%, 8%, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(210, 50%, 30%, 0.2);
    border-radius: 0.75rem;
    color: var(--foreground);
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    transform: translateY(-4px);
    box-shadow: 0 0 20px hsla(190, 100%, 50%, 0.5);
}

/* Footer */
footer {
    padding: 3rem 2rem;
    border-top: 1px solid hsla(222, 30%, 18%, 0.5);
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-heart {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--muted-foreground);
}

.heart-icon {
    color: var(--accent);
    fill: var(--accent);
    animation: heartbeat 1s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.footer-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

    .contact-form {
        padding: 2rem;
    }
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  /* Use foreground as button background and background as icon color to auto-invert */
  background: var(--foreground);
  color: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.08);
  transition: transform 0.12s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 100;
  -webkit-tap-highlight-color: transparent;
}

/* subtle hover/active states that respect the color variables */
.theme-toggle:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 26px rgba(0,0,0,0.28);
}

.theme-toggle:active {
  transform: translateY(-1px) scale(0.99);
}

/* Focus styles for accessibility */
.theme-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(100, 150, 255, 0.15), 0 10px 26px rgba(0,0,0,0.18);
}

/* Make the icon slightly larger on larger screens */
@media (min-width: 900px) {
  .theme-toggle {
    width: 52px;
    height: 52px;
    font-size: 20px;
    border-radius: 0.85rem;
  }
}

.light-mode .theme-toggle {
  border-color: var(--glass-border);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
}

/* Light Mode Specific Overrides */
.light-mode .glass {
    background: hsla(0, 0%, 100%, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid hsla(0, 0%, 85%, 0.3);
}

.light-mode #hero {
    background: url('https://images.unsplash.com/photo-1464802686167-b939a6910659?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2650') center/cover;
}

.light-mode .hero-bg {
    opacity: 0.1;
}

/* Ensure hero texts are readable on the light-mode image */
.light-mode #hero .hero-title {
    background: linear-gradient(135deg, hsl(0, 0%, 100%), hsla(190, 100%, 85%, 0.95));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.light-mode #hero .hero-subtitle {
    color: hsl(0, 0%, 100%);
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.light-mode #hero .hero-badge {
    color: hsl(0, 0%, 100%);
    background: linear-gradient(180deg, hsla(0,0%,100%,0.25), hsla(0,0%,100%,0.15));
    border: 1px solid hsla(0, 0%, 100%, 0.25);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.light-mode .hero-badge {
    background: hsla(0, 0%, 100%, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid hsla(0, 0%, 85%, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.light-mode .btn-secondary {
    background: hsla(0, 0%, 100%, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid hsla(0, 0%, 85%, 0.4);
    color: var(--foreground);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.light-mode .btn-secondary:hover {
    background: hsla(0, 0%, 95%, 0.9);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.light-mode .project-card,
.light-mode .skill-card,
.light-mode .contact-form {
    background: hsla(0, 0%, 100%, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid hsla(0, 0%, 85%, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.light-mode .social-link {
    background: hsla(0, 0%, 100%, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid hsla(0, 0%, 85%, 0.4);
    color: var(--foreground);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.light-mode .social-link:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    transform: translateY(-4px);
    box-shadow: 0 0 20px hsla(190, 100%, 50%, 0.5);
}

/* Enhanced hover effects for light mode cards */
.light-mode .project-card:hover,
.light-mode .skill-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.light-mode .project-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 20px hsla(190, 100%, 50%, 0.3);
}

.light-mode .skill-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 20px hsla(270, 70%, 60%, 0.3);
}

.light-mode footer {
    border-top: 1px solid hsla(0, 0%, 90%, 0.5);
}

.theme-toggle[data-has-tooltip="true"] {
  position: fixed;
}
.theme-toggle[data-has-tooltip="true"]::after {
  content: attr(data-label);
  position: absolute;
  top: 60px;
  right: 50%;
  transform: translateX(50%);
  background: var(--card);
  color: var(--foreground);
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform-origin: top center;
}
.theme-toggle[data-has-tooltip="true"]:hover::after {
  opacity: 1;
  transform: translateX(50%) translateY(6px);
}
