:root {
  color-scheme: dark;
  --bg: #14171c;
  --card: #1b1f26;
  --text: #c4cad3;
  --muted: #838b97;
  --heading: #eef1f5;
  --accent: #e5a663;
  --tag-bg: rgba(229, 166, 99, 0.1);
  --line: #262b33;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 5rem 1.25rem 3rem;
}

h1, h2, h3 { color: var(--heading); margin: 0; line-height: 1.3; }
p { margin: 0 0 1rem; }
ul, ol { list-style: none; margin: 0; padding: 0; }

a { color: var(--heading); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Header */
.intro { margin-bottom: 4.5rem; }
.intro h1 { font-size: clamp(2.25rem, 7vw, 3rem); letter-spacing: -0.02em; }
.role { color: var(--heading); font-size: 1.25rem; font-weight: 500; margin: 0.25rem 0 0.75rem; }
.tagline { color: var(--muted); max-width: 32rem; }
.meta { font-size: 0.9375rem; color: var(--muted); }

/* Sections */
section { margin-bottom: 4rem; }
h2 {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.375rem; }
.where { color: var(--muted); font-weight: 400; font-size: 0.875rem; margin-left: 0.25rem; }

/* Lists: experience, education, projects */
.list { display: grid; gap: 0.5rem; }
.item {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0 1.25rem;
  padding: 1rem;
  margin: 0 -1rem;
  border-radius: 8px;
  transition: background-color 0.15s;
}
.item:hover { background: var(--card); }
.item p:last-child { margin-bottom: 0; }
.card { display: block; }

.when {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.25rem;
  margin: 0;
  white-space: nowrap;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.tags li {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
}

.skills { margin: 0; display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.75rem 1.25rem; }
.skills dt { color: var(--heading); font-weight: 600; font-size: 0.9375rem; }
.skills dd { margin: 0; }

.note { color: var(--muted); font-size: 0.9375rem; margin-top: 1rem; }

footer { border-top: 1px solid var(--line); padding-top: 1.5rem; font-size: 0.8125rem; color: var(--muted); }

@media (max-width: 600px) {
  main { padding-top: 3rem; }
  .item, .skills { grid-template-columns: 1fr; }
  .item { margin: 0; padding: 0.75rem 0; }
  .item:hover { background: none; }
  .when { padding: 0 0 0.25rem; }
  .skills dd { margin-bottom: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .item { transition: none; }
}

/* Section nav: sticky bar under the header */
html { scroll-behavior: smooth; }
section { scroll-margin-top: 4rem; }
.navbar {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -2.5rem -1.25rem 2.5rem;
  padding: 0 1.25rem;
  background: rgba(20, 23, 28, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  padding: 0.875rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a:focus-visible { color: var(--accent); }

/* Phones: wrap to two short rows so every link stays visible */
@media (max-width: 600px) {
  .nav { flex-wrap: wrap; gap: 0.375rem 1rem; padding: 0.625rem 0; font-size: 0.75rem; }
  section { scroll-margin-top: 5.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Experience: company as heading, role line below */
.title { color: var(--muted); font-size: 0.875rem; margin: -0.125rem 0 0.5rem; }
.arrow { color: var(--muted); padding: 0 0.125rem; }

/* Education: earlier schooling, quieter than degrees */
.minor h3 { color: var(--muted); font-weight: 400; font-size: 0.9375rem; }
