/* ===== CSS Variables ===== */
:root {
  /* Dark mode (default) */
  --bg-primary: #0a0a0b;
  --bg-secondary: #141416;
  --bg-tertiary: #1a1a1d;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Sizing */
  --max-width: 1200px;
  --nav-height: 64px;
}

/* Light mode */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f4f4f5;
  --bg-tertiary: #e4e4e7;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: rgba(0, 0, 0, 0.1);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

ul {
  list-style: none;
}

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

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ===== Section ===== */
.section {
  padding: var(--space-24) 0;
}

.section-alt {
  background-color: var(--bg-secondary);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-12);
  text-align: center;
}

.subsection-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: var(--space-12);
  margin-bottom: var(--space-8);
  text-align: center;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background-color 0.3s ease;
}

[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.85);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-menu li a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-menu li a:hover {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

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

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

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

.hero-name {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-image img {
  width: 300px;
  height: 380px;
  border-radius: 16px;
  object-fit: cover;
  object-position: top;
  border: 4px solid var(--border);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

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

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

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

.btn-outline:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: var(--space-8);
  margin-bottom: var(--space-8);
}

.timeline-marker {
  position: absolute;
  left: -5px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.timeline-content {
  background: var(--bg-secondary);
  padding: var(--space-6);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.timeline-header {
  margin-bottom: var(--space-4);
}

.timeline-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.timeline-company {
  display: block;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.timeline-date {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.timeline-details {
  padding-left: var(--space-4);
}

.timeline-details li {
  position: relative;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  list-style: disc;
  margin-left: var(--space-4);
}

/* ===== Metrics Grid ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.metric-card {
  text-align: center;
  padding: var(--space-8);
  background: var(--bg-tertiary);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.metric-value {
  display: block;
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-2);
}

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

/* ===== Work Grid ===== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.work-card {
  background: var(--bg-tertiary);
  padding: var(--space-6);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.work-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.work-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ===== Books Grid ===== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.book-card {
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  color: inherit;
}

.book-cover {
  margin-bottom: var(--space-4);
}

.book-cover img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease;
}

.book-card:hover .book-cover img {
  box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.4);
}

.book-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.book-publisher {
  color: var(--accent);
  font-size: 0.875rem;
  margin-bottom: var(--space-2);
}

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

/* ===== Speaking Grid ===== */
.speaking-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.speaking-category h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--accent);
}

.speaking-list li {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.speaking-list li:last-child {
  border-bottom: none;
}

.speaking-title {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.speaking-event {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ===== Consulting ===== */
.consulting-content {
  max-width: 900px;
  margin: 0 auto;
}

.consulting-intro {
  text-align: center;
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-12);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.service-card {
  background: var(--bg-secondary);
  padding: var(--space-8);
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
}

.service-icon {
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.service-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.consulting-cta {
  text-align: center;
}

.consulting-cta p {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.skill-category h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--accent);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-tag {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  font-size: 0.875rem;
  border: 1px solid var(--border);
}

.education-info p {
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

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

.contact-intro {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--text-primary);
  font-size: 1.125rem;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.contact-link:hover {
  background: var(--bg-tertiary);
  color: var(--accent);
}

.contact-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.contact-resume {
  margin-top: var(--space-8);
}

/* ===== Footer ===== */
.footer {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-grid,
  .books-grid,
  .speaking-grid,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    width: 260px;
    height: 330px;
  }
}

@media (max-width: 768px) {
  :root {
    --space-24: 4rem;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-2);
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu li a {
    display: block;
    padding: var(--space-3);
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-name {
    font-size: 2.5rem;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .metrics-grid,
  .work-grid,
  .books-grid,
  .speaking-grid,
  .services-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .metric-value {
    font-size: 2.5rem;
  }

  .timeline::before {
    left: 0;
  }

  .timeline-item {
    padding-left: var(--space-6);
  }

  .timeline-marker {
    left: -5px;
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 2rem;
  }

  .hero-image img {
    width: 200px;
    height: 260px;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
