:root {
  --primary: #60a5fa; /* Soft Blue */
  --primary-dark: #3b82f6;
  --accent: #fbbf24;
  --bg-body: #0a0a0c;
  --bg-card: rgba(17, 17, 27, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --max-width: 1100px;
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* Light Mode Variables - Inspired by Reference */
body.light-mode {
  --bg-body: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(0, 0, 0, 0.02);
  --text-main: #1f2328; /* Deep GitHub Gray */
  --text-muted: #656d76; /* Muted Slate */
  --border: #d0d7de; /* Subtle Border */
  --primary: #0969da; /* Classic GitHub Blue */
  --primary-dark: #0550ae;
}

/* Theme Toggle Widget */
.theme-toggle-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  background: var(--text-main);
  color: var(--bg-body);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  font-size: 1.4rem;
}

.theme-toggle-widget:hover {
  transform: scale(1.1) rotate(12deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

body.light-mode .theme-toggle-widget {
  background: #ffffff;
  color: #1f2328;
}

/* Specific Light Mode Adjustments */
body.light-mode .card:hover {
  background: #f6f8fa;
  box-shadow: 0 8px 24px rgba(140, 149, 159, 0.2);
  border-color: var(--primary);
}

body.light-mode .skill-box {
  background: #f6f8fa;
  border-color: #d0d7de;
}

body.light-mode .skill-box:hover {
  background: #ffffff;
  border-color: var(--primary);
}

body.light-mode .bg-gradient {
  background: 
    radial-gradient(circle at 10% 20%, rgba(9, 105, 218, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(9, 105, 218, 0.03) 0%, transparent 40%);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Background Ornamentation */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(96, 165, 250, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ========== Navigation ========== */
header {
  height: 80px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 12, 0.05); /* Translucent base */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1300px; /* Wider than main container for more separation */
  margin: 0 auto;
  padding: 0 3rem;
}

body.light-mode header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid transparent;
}

/* Scrolled state with more opacity */
header.scrolled {
  height: 70px;
  background: rgba(10, 10, 12, 0.8);
  border-bottom: 1px solid var(--border);
}

body.light-mode header.scrolled {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-main);
  flex-shrink: 0;
}

nav {
  display: flex;
  gap: 2.5rem;
  margin-left: auto; /* Push nav to the right */
}

nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

nav a:hover, nav a.active {
  color: var(--primary);
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  color: var(--text-main);
  cursor: pointer;
  margin-left: 2rem;
}

/* ========== Hero Section ========== */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  gap: 4rem;
  padding: 4rem 0;
}

.hero-content {
  flex: 1;
}

.hero-image {
  flex: 0 0 350px;
  position: relative;
}

.profile-wrapper {
  width: 350px;
  height: 350px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.profile-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero .name {
  color: var(--primary);
  display: block;
}

.subtitle-wrapper {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 300;
}

.hero .desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2.5rem;
}

/* ========== Socials ========== */
.hero-socials {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.hero-socials a {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 1.5rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none !important;
}

.hero-socials a:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-5px) scale(1.1);
  background: rgba(96, 165, 250, 0.1);
  box-shadow: 0 10px 20px rgba(96, 165, 250, 0.2);
}

/* ========== Buttons ========== */
.cta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap; /* Prevents overlapping */
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-align: center;
  min-width: 180px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-glass);
  border-color: var(--primary);
}

/* ========== Skills Horizontal Layout ========== */
.skills-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.skill-group h3 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
}

.skills-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.skill-box {
  width: 120px;
  height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.skill-box i {
  font-size: 2.5rem;
}

.skill-box span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.skill-box:hover {
  transform: translateY(-10px) scale(1.05);
  border-color: var(--primary);
  background: rgba(96, 165, 250, 0.05);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3), 0 0 15px rgba(96, 165, 250, 0.2);
}

.skill-box:hover span {
  color: var(--primary);
}

/* ========== Grid Layouts ========== */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ========== Cards & Pop Animation ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-15px) scale(1.03);
  border-color: var(--primary);
  background: rgba(17, 17, 27, 0.9);
  box-shadow: 
    0 25px 50px rgba(0,0,0,0.5),
    0 0 20px rgba(96, 165, 250, 0.15);
  z-index: 10;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}

.card:hover::after {
  transform: scaleX(1);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.card .meta {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card .primary {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card .muted {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.tag {
  font-size: 0.75rem;
  background: var(--bg-glass);
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ========== Sections ========== */
section {
  padding: 8rem 0;
}

.section-header {
  margin-bottom: 4rem;
  text-align: center;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-header .line {
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin: 0 auto;
}

/* ========== Contact ========== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
}

.contact-info h3 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 2rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.info-item .icon {
  width: 50px;
  height: 50px;
  background: var(--bg-glass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.25rem;
  border: 1px solid var(--border);
}

.contact-form {
  background: var(--bg-card);
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* ========== Footer ========== */
footer {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer .brand {
  display: block;
  margin-bottom: 1rem;
}

footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========== Animations ========== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-up.show {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Responsive ========== */
@media (max-width: 968px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
  }
  .hero-image {
    flex: 0 0 auto;
  }
  .profile-wrapper {
    width: 280px;
    height: 280px;
    margin: 0 auto;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .cta {
    justify-content: center;
  }
  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: block;
  }

  nav {
    display: none;
    position: absolute;
    top: 100px;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 12, 0.95);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(15px);
  }

  nav.active {
    display: flex;
  }
}

@media (max-width: 480px) {
  .cta {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    width: 100%;
    margin-left: 0 !important;
  }
}
