/* Custom Properties / Tokens */
:root {
  /* Colors - Dark Theme (Default) */
  --bg-color: #0d0d0d;
  --surface-color: #171717;
  --surface-hover: #222222;
  --border-color: #2a2a2a;
  
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  
  --primary: #FF5400;
  --primary-hover: #e04a00;
  --primary-transparent: rgba(255, 84, 0, 0.15);

  /* Layout */
  --container-max: 1200px;
  --container-sm: 800px;
  
  /* Fonts */
  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='light'] {
  --bg-color: #f7f7f8;
  --surface-color: #ffffff;
  --surface-hover: #f1f1f1;
  --border-color: #e5e5e5;
  
  --text-primary: #171717;
  --text-secondary: #525252;
}

/* Reset & Accessibility */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

::selection {
  background: var(--primary);
  color: #fff;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* Base Utility Classes */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-sm {
  max-width: var(--container-sm);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 0.875rem; }

.pt-xl { padding-top: 8rem; }
.pb-xl { padding-bottom: 8rem; }
.pt-lg { padding-top: 5rem; }
.pb-md { padding-bottom: 3rem; }
.pt-md { padding-top: 3rem; }
.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 2rem; }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(13, 13, 13, 0.7);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
  padding: 1rem 0;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme='light'] .navbar {
  background-color: rgba(247, 247, 248, 0.7);
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.brand:hover {
  color: var(--text-primary);
}

/* Animating Logo Icon slightly on hover */
.brand:hover .brand-icon {
  transform: rotate(180deg);
  transition: transform var(--transition-slow);
}

.brand-icon {
  transition: transform var(--transition-slow);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background-color: var(--surface-hover);
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon.hidden {
  display: none;
}

/* Typography Gradient Effect */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), #ffa37a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Fallback */
}

[data-theme='light'] .text-gradient {
  background: linear-gradient(135deg, var(--primary), #cc4300);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero Section */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-transparent) 0%, transparent 70%);
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
}

.badge-hero {
  display: inline-block;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.35rem 1rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
}

/* Projects Section */
.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

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

.card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #ffa37a);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

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

.card:hover::before {
  transform: scaleX(1);
}

[data-theme='light'] .card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

.badge {
  display: inline-block;
  background-color: var(--primary-transparent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
  align-self: flex-start;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
}
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.footer-brand svg {
  width: 24px;
  height: 24px;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  opacity: 0;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero {
    min-height: 60vh;
  }
  .card {
    padding: 2rem 1.5rem;
  }
}
