/* ===========================
   CSS Variables & Reset
   =========================== */

:root {
  /* Dark mode colors (default) */
  --bg: #0a0a0a;
  --text: #f5f5f5;
  --muted: #888888;
  --accent: #4a9eff;
  --card: #1a1a1a;
  --border: #2a2a2a;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --line-height-base: 1.7;
  --line-height-heading: 1.2;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  /* Transitions */
  --transition-base: 0.3s ease;
  --transition-fast: 0.15s ease;
}

[data-theme="light"] {
  --bg: #fafafa;
  --text: #0a0a0a;
  --muted: #666666;
  --accent: #2563eb;
  --card: #ffffff;
  --border: #e5e5e5;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

body {
  font-family: var(--font-sans);
  line-height: var(--line-height-base);
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Typography
   =========================== */

h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-heading);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
  margin-bottom: var(--spacing-sm);
}

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

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ===========================
   Skip to Content
   =========================== */

.skip-to-content {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 4px;
  z-index: 10000;
  font-weight: 500;
}

.skip-to-content:focus {
  top: var(--spacing-sm);
}

/* ===========================
   Header & Navigation
   =========================== */

header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
}

.logo svg {
  display: block;
}

.logo-text {
  font-family: var(--font-sans);
  font-size: 18px;
  letter-spacing: 0.08em;
  fill: var(--text);
}

.logo-text .bold {
  font-weight: 700;
}

.logo-text .normal {
  font-weight: 400;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--spacing-md);
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-controls {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.control-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

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

.control-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-icon {
  width: 24px;
  height: 24px;
}

[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

[data-theme="light"] .sun-icon {
  display: block;
}

[data-theme="light"] .moon-icon {
  display: none;
}

/* ===========================
   Container & Sections
   =========================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

section {
  padding: var(--spacing-xl) 0;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: var(--spacing-lg);
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-title.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   Hero Section
   =========================== */

.hero-section {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-xl) 0;
}

.hero-content {
  max-width: 800px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  margin-bottom: var(--spacing-md);
}

.hero-title .name {
  display: block;
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.hero-title .role {
  display: block;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 400;
  color: var(--muted);
}

.hero-tagline {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--muted);
  margin-bottom: var(--spacing-lg);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
}

.hero-caption {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ===========================
   Buttons
   =========================== */

.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--text);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

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

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ===========================
   About Section
   =========================== */

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-lg);
  align-items: start;
}

.about-text {
  font-size: 1.1rem;
  line-height: 1.8;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--spacing-md);
  text-align: center;
  transition: all var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--muted);
}

.about-image {
  grid-column: 1 / -1;
  margin-top: var(--spacing-md);
}

.image-placeholder {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--card) 0%, var(--border) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

/* ===========================
   Experience Section
   =========================== */

.timeline {
  position: relative;
  padding-left: 0;
}

.timeline-item {
  position: relative;
  margin-bottom: var(--spacing-lg);
  padding-left: 0;
}

.timeline-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--spacing-md);
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
  cursor: pointer;
  padding: var(--spacing-md);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.timeline-header:hover {
  background: var(--card);
  border-color: var(--border);
  transform: translateX(4px);
}

.timeline-title h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
}

.timeline-meta {
  text-align: right;
  font-size: 0.9rem;
  color: var(--muted);
}

.timeline-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--spacing-sm);
  transition: transform var(--transition-fast);
  color: var(--accent);
}

.timeline-toggle.rotated {
  transform: rotate(180deg);
}

.timeline-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.timeline-content.expanded {
  max-height: 1000px;
}

.timeline-description {
  padding: var(--spacing-sm);
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.timeline-description ul {
  list-style: none;
  padding-left: 0;
}

.timeline-description li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: var(--spacing-xs);
  line-height: 1.6;
}

.timeline-description li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.tag {
  background: var(--border);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.linkedin-cta {
  text-align: center;
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border);
}

.linkedin-cta p {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: var(--spacing-md);
}

/* ===========================
   Work Section
   =========================== */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--spacing-lg);
}

.work-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all var(--transition-base);
}

.work-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.work-image {
  width: 100%;
  height: 250px;
  background: linear-gradient(135deg, var(--border) 0%, var(--card) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.work-image img,
.work-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-content {
  padding: var(--spacing-md);
}

.work-title {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
}

.work-problem,
.work-outcome {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: var(--spacing-xs);
  line-height: 1.6;
}

.work-problem strong,
.work-outcome strong {
  color: var(--text);
  font-weight: 600;
}

.work-action {
  margin-top: var(--spacing-md);
}

/* ===========================
   Skills Section
   =========================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.skill-category {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--spacing-md);
}

.skill-category h3 {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-md);
  color: var(--accent);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.skill-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.skill-tag:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ===========================
   Fun Facts Section
   =========================== */

.fun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.fun-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--spacing-md);
  text-align: center;
  transition: all var(--transition-base);
}

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

.fun-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--spacing-md);
  color: var(--accent);
}

.fun-icon svg {
  width: 48px;
  height: 48px;
  transition: all var(--transition-base);
}

.fun-card:hover .fun-icon svg {
  transform: scale(1.1);
  color: var(--accent);
}

.fun-text {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ===========================
   Contact Section
   =========================== */

.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-intro {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: var(--spacing-lg);
}

.contact-details {
  margin-bottom: var(--spacing-lg);
}

.contact-email,
.contact-phone {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-sm);
}

.contact-email a,
.contact-phone a {
  color: var(--text);
  font-weight: 500;
  position: relative;
}

.contact-email a::after,
.contact-phone a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
}

.contact-email a:hover::after,
.contact-phone a:hover::after {
  width: 100%;
}

.contact-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* ===========================
   Footer
   =========================== */

footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.footer-logo svg {
  display: block;
}

.logo-text-small {
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0.08em;
  fill: var(--text);
}

.logo-text-small .bold {
  font-weight: 700;
}

.logo-text-small .normal {
  font-weight: 400;
}

.footer-copyright {
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-controls {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.back-to-top {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.back-to-top:hover {
  color: var(--accent);
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .nav-links {
    display: none;
  }
  
  .about-content {
    grid-template-columns: 1fr;
  }
  
  .about-stats {
    flex-direction: row;
    gap: var(--spacing-sm);
  }
  
  .work-grid {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .fun-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .timeline {
    padding-left: 0;
  }
  
  .timeline-item {
    padding-left: 0;
  }
  
  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .timeline-meta {
    text-align: left;
    margin-top: var(--spacing-xs);
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
  }
  
  .nav-container {
    padding: var(--spacing-sm);
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
  }
}

