:root {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: dark light;

  /* Common Variables */
  --primary-color: hsl(210, 100%, 50%);
  --accent-color: hsl(180, 100%, 50%);
  --glass-blur: blur(12px);

  /* Dark Mode (Default) */
  --bg-color: hsl(220, 20%, 5%);
  --surface-color: hsla(220, 20%, 12%, 0.7);
  --surface-border: hsla(220, 20%, 30%, 0.3);
  --text-main: hsl(210, 10%, 95%);
  --text-muted: hsl(210, 10%, 70%);
  --primary-glow: hsla(210, 100%, 50%, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[data-theme="light"] {
  --bg-color: hsl(220, 20%, 98%);
  --surface-color: hsla(220, 20%, 100%, 0.8);
  --surface-border: hsla(220, 20%, 80%, 0.5);
  --text-main: hsl(220, 20%, 10%);
  --text-muted: hsl(220, 10%, 40%);
  --primary-glow: hsla(210, 100%, 50%, 0.15);
  --glass-bg: rgba(0, 0, 0, 0.02);
  --glass-border: rgba(0, 0, 0, 0.08);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Gradients */
.bg-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 80% 20%, var(--primary-glow) 0%, transparent 40%),
    radial-gradient(circle at 10% 80%, hsla(180, 100%, 50%, 0.1) 0%, transparent 40%);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header & Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4rem;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

.logo-link {
  text-decoration: none;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-main);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* Hero Section */
.hero {
  padding-top: 180px;
  padding-bottom: 100px;
  text-align: center;
}

h1 {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

.gradient-text {
  background: linear-gradient(to right, var(--text-main) 30%, var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Horizontal Experience Carousel */
.experience-carousel {
  display: flex;
  overflow-x: auto;
  gap: 1.5rem;
  padding: 1rem 0 3rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

.experience-carousel::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.org-card {
  flex: 0 0 320px;
  scroll-snap-align: center;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  padding: 2.5rem 2rem;
  border-radius: 24px;
  transition: all 0.4s ease;
  cursor: default;
}

.org-card:hover {
  border-color: var(--primary-color);
  background: hsla(220, 20%, 15%, 0.8);
  transform: scale(1.02);
}

/* Fix text contrast in light mode hover */
[data-theme="light"] .org-card:hover {
  background: var(--bg-color);
}

.org-card h3 {
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.org-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.org-card:hover p {
  color: var(--text-main);
}

.scroll-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -2rem;
  margin-bottom: 2rem;
  opacity: 0.6;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 850px;
  margin: 0 auto 2.5rem;
  text-align: justify;
  line-height: 1.7;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.social-icon {
  width: 44px;
  height: 44px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.social-icon:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
  border-color: var(--primary-color);
  box-shadow: 0 5px 15px var(--primary-glow);
}

.social-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px var(--primary-glow);
  background: hsl(210, 100%, 60%);
}

/* Development Section */
.section {
  padding: 100px 0;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* Project Cards */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-color);
  background: hsla(220, 20%, 15%, 0.9);
}

.card:hover h3, .card:hover p {
  color: white;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, var(--primary-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.card-icon {
  width: 50px;
  height: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: hsla(210, 100%, 50%, 0.1);
  color: var(--primary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

/* Toggles & Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toggle-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-btn:hover {
  background: var(--glass-border);
  transform: translateY(-2px);
}

.lang-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
}

/* Responsive */
@media (max-width: 900px) {
  nav { padding: 0 2rem; }
  .nav-links { display: none; } /* Mobile menu logic can be added later */
  h1 { font-size: 3rem; }
  .grid { grid-template-columns: 1fr; }
}
