/**
 * Professional Portfolio Design System
 * 
 * Target: Modern, Recruiter-focused, Minimalist, Fast
 * Colors: Onyx & Indigo (Dark Mode Only)
 * Typography: Inter (Primary), JetBrains Mono (Code/Accent)
 */

/* ==========================================================================
   CSS Variables (Design Tokens)
   ========================================================================== */
:root {
  /* Colors - Backgrounds (Light Theme) */
  --bg-primary: #ffffff;
  --bg-surface: #f9fafb;
  --bg-elevated: #f3f4f6;
  
  /* Colors - Text (Light Theme) */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  
  /* Colors - Accents (Blue, not purple) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-transparent: rgba(37, 99, 235, 0.15);
  
  /* Colors - Utility */
  --border: #e5e7eb;
  --success: #16a34a;
  
  /* Navbar Backgrounds */
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.95);
  --hero-shadow: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] {
  /* Colors - Backgrounds */
  --bg-primary: #0f0f12;
  --bg-surface: #18181c;
  --bg-elevated: #222228;
  
  /* Colors - Text */
  --text-primary: #f0f0f3;
  --text-secondary: #a0a0ab;
  --text-muted: #6b6b78;
  
  /* Colors - Accents (Blue, not purple) */
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-transparent: rgba(59, 130, 246, 0.15);
  
  /* Colors - Utility */
  --border: #2a2a32;
  --success: #22c55e;
  
  /* Navbar Backgrounds */
  --nav-bg: rgba(15, 15, 18, 0.85);
  --nav-bg-scrolled: rgba(15, 15, 18, 0.95);
  --hero-shadow: rgba(59, 130, 246, 0.2);
}

:root {
  /* Typography (Shared) */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', "Fira Code", Consolas, Monaco, monospace;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  
  /* Layout */
  --max-width: 1120px;
  --nav-height: 80px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height); /* For fixed header */
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

ul {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ==========================================================================
   Typography System
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem); /* 36px to 56px */
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem); /* 28px to 36px */
  margin-bottom: var(--space-xl);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem); /* 20px to 24px */
}

p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875rem; /* 14px */
}

.accent-text {
  color: var(--accent);
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ==========================================================================
   Components
   ========================================================================== */

/* Focus States (Accessibility) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition-fast);
  gap: var(--space-sm);
}

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

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-transparent);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--accent-transparent);
  transform: translateY(-2px);
}
.btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Tags / Chips */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
}

/* Cards */
.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-xl);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

/* ==========================================================================
   Section Styles
   ========================================================================== */

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background-color: var(--nav-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  background-color: var(--nav-bg-scrolled);
}

.nav-container {
  height: 100%;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  color: var(--text-primary);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
}

.hero-content {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.hero-greeting {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 1rem;
}

.hero-role {
  color: var(--text-secondary);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
  margin-top: calc(var(--space-sm) * -1);
}

.hero-desc {
  max-width: 600px;
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.hero-socials {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1/1;
  margin: 0 auto;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  transition: transform var(--transition-slow);
}

.hero-image-wrapper:hover .hero-image {
  transform: translateY(-4px);
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
}

.about-text p {
  margin-bottom: var(--space-md);
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.highlight-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.highlight-val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.highlight-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Skills Section */
.skills-list {
  display: flex;
  flex-direction: column;
}

.skill-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-xl);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}

.skill-row:last-child {
  border-bottom: none;
}

.skill-row h3 {
  font-size: 1.125rem;
  color: var(--text-primary);
  font-weight: 600;
}

.skill-row p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Experience Section */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 800px;
}

.timeline-item {
  position: relative;
  padding-left: var(--space-xl);
  border-left: 2px solid var(--border);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  border: 2px solid var(--accent);
}

.exp-header {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-md);
}

.exp-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.exp-company {
  color: var(--accent);
  font-weight: 500;
}

.exp-meta {
  display: flex;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  margin-top: var(--space-xs);
}

.exp-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.exp-details li {
  position: relative;
  padding-left: var(--space-md);
  color: var(--text-secondary);
}

.exp-details li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Projects Section */
.projects-featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.projects-other {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.project-desc {
  flex-grow: 1;
  margin-bottom: var(--space-lg);
}

.project-links {
  display: flex;
  gap: var(--space-md);
}

.project-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.project-link:hover {
  color: var(--accent);
}

.project-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Education Section */
.edu-card {
  max-width: 600px;
}

/* Contact Section */
.contact {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact h2 {
  margin-bottom: var(--space-md);
}

.contact p {
  margin-bottom: var(--space-xl);
}

/* Footer */
.footer {
  padding: var(--space-xl) 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ==========================================================================
   Animations (Scroll Reveal)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-text {
    align-items: center;
  }
  
  .hero-actions, .hero-socials {
    justify-content: center;
  }
  
  .hero-image-wrapper {
    order: -1; /* Move image above text on mobile */
    max-width: 250px;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --space-4xl: 64px; /* Less vertical padding on mobile */
  }
  
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: 0;
    background-color: var(--bg-surface);
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    overflow: hidden;
    transition: height var(--transition-normal);
    border-bottom: 1px solid var(--border);
  }
  
  .nav-links.open {
    height: 300px; /* Approximate height for links */
    padding: var(--space-lg) 0;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .nav-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
  }
  
  .exp-meta {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .projects-featured {
    grid-template-columns: 1fr;
  }
  
  .skill-row {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    padding: var(--space-md) 0;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
  }
  
  .highlight-card {
    padding: var(--space-md);
  }
  
  .highlight-val {
    font-size: 1.5rem;
  }
}
