:root {
  --paper: #f4f6f9;
  --surface: #ffffff;
  --ink: #16233b;
  --muted: #55627a;
  --line: #d3dae5;
  --accent: #0a6c99;
  --accent-soft: #e0eff6;

  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1828;
    --surface: #16233b;
    --ink: #e8edf5;
    --muted: #9aa8c0;
    --line: #2b3a56;
    --accent: #6cc3ec;
    --accent-soft: #1b3550;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* Layout: sticky identity column + reading column */
.layout {
  display: grid;
  grid-template-columns: minmax(16rem, 20rem) minmax(0, 46rem);
  gap: clamp(2rem, 6vw, 6rem);
  justify-content: center;
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3rem);
}

.side {
  position: sticky;
  top: clamp(1.5rem, 5vw, 4rem);
  align-self: start;
}

h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.role {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
  max-width: 18rem;
}

address { font-style: normal; margin-bottom: 1.75rem; }
address p { margin: 0.15rem 0; overflow-wrap: anywhere; }

nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-left: 2px solid var(--line);
  margin-bottom: 1.75rem;
}
nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.3rem 0 0.3rem 1rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
}
nav a:hover { border-left-color: var(--accent); color: var(--accent); }

.counter { font-size: 0.95rem; color: var(--muted); margin: 0; }

/* Sections */
main section { margin-bottom: 3.5rem; }

h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}

h3 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 0;
}

#summary p { margin: 0; max-width: 40rem; }

/* Timeline: experience is genuinely sequential */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.75rem;
  border-left: 2px solid var(--line);
}
.timeline > li {
  position: relative;
  padding-bottom: 2.25rem;
}
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 6px);
  top: 0.55rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--paper);
}
.timeline > li:first-child::before { box-shadow: 0 0 0 4px var(--accent-soft); }

.meta { margin: 0.15rem 0 0.75rem; color: var(--muted); }

.timeline ul { margin: 0; padding-left: 1.1rem; }
.timeline ul li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
.timeline ul li::marker { color: var(--accent); }
.timeline strong { font-weight: 600; }

/* Skills */
.skills { margin: 0; }
.skills > div {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.skills > div:last-child { border-bottom: 1px solid var(--line); }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; }

/* Certifications */
.certs { list-style: none; margin: 0; padding: 0; }
.certs li {
  display: inline-block;
  background: var(--accent-soft);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
}

footer { color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); padding-top: 1rem; }
footer p { margin: 0; }

/* Mobile */
@media (max-width: 52rem) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .side { position: static; }
  nav { flex-direction: row; flex-wrap: wrap; gap: 0.25rem 1.25rem; border-left: 0; }
  nav a { padding: 0.25rem 0; margin: 0; border-left: 0; }
  .skills > div { grid-template-columns: 1fr; gap: 0.1rem; }
}

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

@media print {
  .side nav, .counter, .skip { display: none; }
  .side { position: static; }
  .layout { display: block; padding: 0; }
  body { background: #fff; color: #000; }
}
