/* Base */
* { box-sizing: border-box; }
html:focus-within { scroll-behavior: smooth; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial; line-height: 1.55; color: var(--fg); background: var(--bg); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* Theme vars (light default; .light is applied on <body>) */
:root {
  --bg: #0b1220;       /* dark fallback values */
  --fg: #e5e7eb;
  --muted: #9ca3af;
  --card: #111827;
  --border: #1f2937;
  --accent: #1f3ef7;
  --shadow: 0 8px 24px rgba(0,0,0,.18);
}
.light {
  --bg: #ffffff;
  --fg: #0b1220;
  --muted: #4b5563;
  --card: #f9fafb;
  --border: #e5e7eb;
  --shadow: 0 8px 24px rgba(2,6,23,.06);
}

/* Layout */
.container { width: min(840px, 92vw); margin: 48px auto; }
.header { display: grid; grid-template-columns: 112px 1fr auto; gap: 16px; align-items: center; margin-bottom: 28px; }
.headshot { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); background: #ddd; }
.title { margin: 0 0 4px; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2rem); line-height: 1.15; }
.subtitle { margin: 0 0 6px; color: var(--muted); }
.quicklinks { display: flex; flex-wrap: wrap; gap: 8px; color: var(--accent); }
.theme-toggle { all: unset; cursor: pointer; font-size: 18px; border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; }

h2 { font-size: 1.25rem; margin: 26px 0 12px; }
.meta { color: var(--muted); font-size: .95rem; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.card.flat { background: transparent; box-shadow: none; }
.stack { display: grid; gap: 10px; }
.intro p { margin: 0 0 .6rem; }

/* Projects */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.grid.equal { align-items: stretch; }
.project-card { display: flex; flex-direction: column; height: 100%; }
.project-card header { margin-bottom: 6px; }
.project-card h3 { margin: 0 0 2px; font-size: 1.05rem; }
.project-card .meta { font-size: .9rem; }
.project-card p { margin: 0; }
.tight { margin: 8px 0 0; padding-left: 18px; }
.tight li { margin-bottom: 4px; }
.project-card .spacer { margin-top: auto; }
.project-card .tech { color: var(--muted); font-size: .9rem; margin-top: 8px; }

/* Profiles */
.profiles-grid .profile-card { display: block; text-align: left; }

/* Footer */
.footer { text-align: center; color: var(--muted); margin: 24px 0 10px; }

/* Mobile */
@media (max-width: 640px) {
  .header { grid-template-columns: 80px 1fr auto; }
  .headshot { width: 80px; height: 80px; }
}
