/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin-top: 0; color: #0f172a; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.75rem; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
code { background: #f1f5f9; padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.9em; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}
.brand {
  font-weight: 700;
  color: #0f172a;
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.site-nav a {
  margin-left: 1.25rem;
  color: #475569;
  font-size: 0.95rem;
}
.site-nav a:hover { color: #2563eb; text-decoration: none; }
.site-nav a { white-space: nowrap; }
.site-nav .nav-cv { color: #2563eb; font-weight: 600; }

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: center;
}
.hero-photo img {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border: 4px solid #fff;
}
.hero-text h1 { margin-bottom: 0.5rem; }
.hero-role {
  font-size: 1.15rem;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.hero-sub {
  color: #334155;
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.hero-location {
  color: #64748b;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.hero-tagline {
  font-size: 1.05rem;
  color: #334155;
  max-width: 640px;
}
.hero-open { color: #0f172a; font-weight: 600; }
.hero-cta { margin-top: 1.25rem; }
.btn {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-right: 0.5rem;
  transition: transform 0.1s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary {
  background: #fff;
  color: #2563eb;
  border: 1px solid #cbd5e1;
}
.btn-secondary:hover { border-color: #2563eb; }

/* Sections */
.section {
  padding: 3.5rem 0;
}
.section-alt {
  background: #f8fafc;
}
.section-lead {
  color: #475569;
  margin-bottom: 1.5rem;
}

/* Metrics */
.metrics {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.75rem 0;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem;
}
.metric { display: flex; flex-direction: column; }
.metric-value { font-size: 1.9rem; font-weight: 700; color: #93c5fd; line-height: 1.1; }
.metric-label { font-size: 0.85rem; color: #cbd5e1; }

/* Experience */
.job { margin-bottom: 2rem; }
.job:last-child { margin-bottom: 0; }
.job-head h3 { margin-bottom: 0.15rem; }
.job-context { font-weight: 400; color: #64748b; font-size: 0.95rem; }
.job-meta { color: #2563eb; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
.job ul { margin: 0; padding-left: 1.2rem; }
.job li { margin-bottom: 0.35rem; }

/* Skills */
.skill-list {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0;
}
.skill-list dt { font-weight: 600; color: #0f172a; }
.skill-list dd { margin: 0; color: #475569; }

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
}
.project-card h3 {
  margin: 0 0 0.75rem;
  color: #1e40af;
}
.project-card .tech {
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
  margin: 0.5rem 0 0;
}

/* Upstream */
.subhead { margin: 2rem 0 0.5rem; }
.upstream { margin: 0; padding-left: 1.2rem; }

/* Contact */
.contact-fields {
  margin: 0;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem 1rem;
  max-width: 560px;
}
.contact-fields dt { font-weight: 600; color: #64748b; }
.contact-fields dd { margin: 0; }

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.9rem;
  text-align: center;
}
.site-footer p { margin: 0; }

/* Mobile */
@media (max-width: 700px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .site-header .container { flex-direction: column; height: auto; padding: 0.75rem 1.25rem; gap: 0.5rem; }
  .site-nav a { margin: 0 0.5rem; font-size: 0.85rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
  .hero-photo img { margin: 0 auto; width: 180px; height: 180px; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .skill-list, .contact-fields { grid-template-columns: 1fr; gap: 0.2rem; }
  .skill-list dt, .contact-fields dt { margin-top: 0.6rem; }
  .project-grid { grid-template-columns: 1fr; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  body { color: #cbd5e1; background: #0b1220; }
  h1, h2, h3, .brand, .hero-open, .skill-list dt, .job-head h3 { color: #f1f5f9; }
  a, .job-meta, .hero-role, .site-nav .nav-cv { color: #60a5fa; }
  .site-header { background: #0b1220; border-color: #1e293b; }
  .site-nav a { color: #94a3b8; }
  .hero { background: linear-gradient(135deg, #0f172a 0%, #172554 100%); }
  .hero-sub, .hero-tagline { color: #cbd5e1; }
  .hero-photo img { border-color: #1e293b; }
  .section-alt, .metrics { background: #0f172a; }
  .project-card { background: #111a2e; border-color: #1e293b; }
  .project-card h3 a { color: #93c5fd; }
  .skill-list dd, .section-lead, .job-context { color: #94a3b8; }
  .btn-secondary { background: transparent; color: #93c5fd; border-color: #334155; }
  code { background: #1e293b; }
  .site-footer { border-color: #1e293b; }
}
