:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-primary: #1e40af;
  --color-primary-hover: #1d4ed8;
  --color-accent: #0ea5e9;
  --color-border: #e2e8f0;
  --color-header-bg: rgba(255, 255, 255, 0.92);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.1);

  --max-width: 72rem;
  --header-height: 4rem;
}

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

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

.scroll-anchor {
  height: 0;
  width: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

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

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

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hero */
.hero {
  padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-2xl);
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.hero-content {
  max-width: 42rem;
}

.hero-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

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

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Sections */
.section {
  padding: var(--space-2xl) 0;
}

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

.section-header {
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);
  align-items: start;
}

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

.about-credentials {
  font-size: 0.875rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 12rem;
}

.highlight-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.highlight-number {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.highlight-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Expertise */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-md);
}

.expertise-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.expertise-card:hover {
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.expertise-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.expertise-icon svg {
  width: 100%;
  height: 100%;
}

.expertise-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.expertise-card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 40rem;
}

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

.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: var(--space-lg);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0.375rem;
  width: 1rem;
  height: 1rem;
  background: var(--color-primary);
  border: 3px solid var(--color-bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.section-alt .timeline-marker {
  border-color: var(--color-bg-alt);
}

.timeline-content time {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.timeline-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.timeline-content p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-md);
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.project-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  background: rgba(30, 64, 175, 0.08);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  width: fit-content;
}

.project-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  line-height: 1.35;
}

.project-card > p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: var(--space-md);
}

.project-details {
  list-style: none;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-sm);
}

.project-details li {
  padding: 0.125rem 0;
}

.projects-error {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.connect-section {
  text-align: center;
}

.connect-content {
  max-width: 32rem;
  margin: 0 auto;
}

.connect-content > p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.social-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

.social-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* Footer */
.site-footer {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.back-to-top {
  font-weight: 500;
  color: var(--color-text-muted);
}

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

/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md);
    gap: var(--space-sm);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    box-shadow: var(--shadow-md);
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-highlights {
    flex-direction: row;
    min-width: unset;
  }

  .highlight-card {
    flex: 1;
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .about-highlights {
    flex-direction: column;
  }

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

  .btn {
    width: 100%;
  }
}
