:root {
  --bg: #0b0c0e;
  --card: #121419;
  --ink: #eef0f4;
  --muted: #b8bfcc;
  --accent: #7aa2ff;
  --rule: #1e2230;
  --chip: #191c23;
}
@media (prefers-color-scheme: light) {
  :root { --bg:#f8fafc; --card:#ffffff; --ink:#0b1220; --muted:#4b5563; --accent:#2746ff; --rule:#e5e7eb; --chip:#f1f5f9; }
}

/* Theme override classes */
[data-theme="dark"] {
  --bg: #0b0c0e;
  --card: #121419;
  --ink: #eef0f4;
  --muted: #b8bfcc;
  --accent: #7aa2ff;
  --rule: #1e2230;
  --chip: #191c23;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0b1220;
  --muted: #4b5563;
  --accent: #2746ff;
  --rule: #e5e7eb;
  --chip: #f1f5f9;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji";
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.nav-brand {
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.theme-toggle {
  background: var(--chip);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--accent);
  color: white;
}

/* Mobile nav */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 20px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-links a {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }
  
  .mobile-toggle {
    display: block;
  }
}

/* Main content adjustments */
.main-content {
  min-height: calc(100vh - 64px);
}

.sheet {
  max-width: 900px;
  margin: 40px auto;
  padding: 40px clamp(20px, 4vw, 48px);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* Hero section for index */
.hero {
  text-align: center;
  padding: 80px 0;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--muted);
  margin-bottom: 32px;
  font-weight: 500;
}

.hero .intro {
  max-width: 600px;
  margin: 0 auto 40px;
  font-size: 18px;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, black);
  transform: translateY(-1px);
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
}

.project-image {
  width: 100%;
  height: 200px;
  background: var(--chip);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.project-content {
  padding: 20px;
}

.project-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.project-content .project-type {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-content p {
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tags span {
  background: var(--chip);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

/* Keep all your existing styles */
header { display: grid; gap: 8px; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
.title { color: var(--muted); font-weight: 500; }

.meta { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 6px; }
.meta span { background: var(--chip); padding: 6px 10px; border-radius: 999px; font-size: 13px; color: var(--muted); }

.bio { margin-top: 14px; color: var(--ink); }

.section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); }
.section h2 { margin: 0 0 14px; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.job { display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 16px 0; }
.job + .job { border-top: 1px dashed var(--rule); }

.job .where { font-weight: 600; }
.job .role { font-weight: 600; }
.job .when, .job .where { color: var(--muted); }
.job .meta-col { color: var(--muted); font-size: 14px; }

.job ul { margin: 8px 0 0 0; padding-left: 20px; }
.job li { margin: 6px 0; }

.edu-item { display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 12px 0; }

.skills { display: grid; grid-template-columns: 1fr; gap: 10px; }
.skills .row { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.skills .label { color: var(--muted); font-weight: 600; }
.skills .items { display: flex; flex-wrap: wrap; gap: 8px; }
.skills .items span { background: var(--chip); border: 1px solid var(--rule); padding: 6px 10px; border-radius: 999px; }

.printbar { display: flex; gap: 10px; margin-top: 18px; }
.btn { appearance: none; border: 1px solid var(--rule); background: var(--chip); color: var(--ink); padding: 8px 12px; border-radius: 999px; font-weight: 600; cursor: pointer; }

a { color: var(--accent); text-decoration: none; }

@media (max-width: 760px) {
  .job, .edu-item, .skills .row { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  .navbar { display: none; }
  .sheet { box-shadow: none; border: none; margin: 0; max-width: 7.5in; padding: 0.5in; }
  .printbar { display: none; }
  a { color: inherit; }
}