/* CV site. Theme "Blueprint": navy ink, steel-blue accent, serif headings, restrained.
   The dark palette exists twice (media query + data-theme) and must stay identical. */

:root {
  --bg: #ffffff;
  --surface: #f4f6f9;
  --surface-2: #eaeef4;
  --ink: #0d1726;
  --text: #2a3342;
  --muted: #5d6879;
  --line: #dde3eb;
  --accent: #1f5c94;
  --accent-ink: #ffffff;
  --accent-soft: #e6eef7;
  --grid: rgba(31, 92, 148, 0.07);
  --shadow: 0 1px 2px rgba(13, 23, 38, 0.05), 0 4px 16px rgba(13, 23, 38, 0.05);
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1726;
    --surface: #122036;
    --surface-2: #182a45;
    --ink: #eef2f8;
    --text: #c8d1de;
    --muted: #8e9bb0;
    --line: #22344f;
    --accent: #82b4e6;
    --accent-ink: #0d1726;
    --accent-soft: #173252;
    --grid: rgba(130, 180, 230, 0.06);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1726;
  --surface: #122036;
  --surface-2: #182a45;
  --ink: #eef2f8;
  --text: #c8d1de;
  --muted: #8e9bb0;
  --line: #22344f;
  --accent: #82b4e6;
  --accent-ink: #0d1726;
  --accent-soft: #173252;
  --grid: rgba(130, 180, 230, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.25;
  margin: 0;
}

p {
  margin: 0 0 0.75rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.muted {
  color: var(--muted);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  z-index: 10;
}

.skip:focus {
  left: 0.5rem;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 60px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.mark__badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font: 600 0.85rem/1 var(--serif);
  letter-spacing: 0.04em;
}

.sections {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  font-size: 0.9rem;
}

.sections a {
  color: var(--muted);
  text-decoration: none;
}

.sections a:hover {
  color: var(--ink);
}

.theme {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  font-size: 0.78rem;
  margin-left: auto;
}

.sections + .theme {
  margin-left: 0;
}

.theme a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

.theme a[aria-current] {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

/* Intro */

.intro {
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 3.5rem 0 2.25rem;
}

.intro__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: center;
}

.intro__photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow);
}

.intro__name {
  font: 600 clamp(2.2rem, 4.5vw, 3.2rem) / 1.1 var(--serif);
  letter-spacing: -0.01em;
}

.intro__headline {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0.4rem 0 0.75rem;
}

.intro__tagline {
  max-width: 62ch;
  font-size: 1.05rem;
}

.contacts {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.92rem;
}

.contacts__item,
.contacts__item a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.contacts__item a {
  color: var(--text);
  text-decoration: none;
}

.contacts__item a:hover {
  color: var(--accent);
}

.icon {
  width: 16px;
  height: 16px;
  fill: var(--accent);
  flex: none;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2.25rem 0 0;
}

.facts__item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.facts dt {
  font: 600 1.8rem/1 var(--serif);
  color: var(--ink);
}

.facts dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Two-column CV */

.cv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 3rem;
  padding: 2.5rem 0 4rem;
}

.section {
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.section__title {
  font: 600 1.55rem/1.2 var(--serif);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.section__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.prose-p {
  max-width: 70ch;
}

/* Services */

.services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.service {
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  background: var(--bg);
}

.service h3 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}

.service p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
}

/* Experience timeline */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.job {
  position: relative;
  padding: 0 0 1.75rem 1.75rem;
  border-left: 2px solid var(--line);
}

.job:last-child {
  padding-bottom: 0;
}

.job::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.job__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.job__company {
  font: 600 1.2rem/1.3 var(--serif);
}

.job__location {
  color: var(--muted);
  font-size: 0.85rem;
}

.role {
  margin-top: 0.6rem;
}

.role + .role {
  margin-top: 1.25rem;
}

.role__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.35rem;
}

.role__title {
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.role__dates {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.role__summary {
  margin-bottom: 0.5rem;
}

.role__highlights {
  margin: 0 0 0.6rem;
  padding-left: 1.1rem;
}

.role__highlights li {
  margin-bottom: 0.25rem;
}

.role__highlights li::marker {
  color: var(--accent);
}

.tags,
.chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tags li {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.45rem;
}

/* Projects */

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.project {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.project__context {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.project h3 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}

.project p:last-child {
  margin: 0;
  font-size: 0.93rem;
}

/* Recommendations */

.quote {
  margin: 0 0 1.25rem;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--accent-soft);
}

.quote blockquote {
  margin: 0;
  font: italic 1.02rem/1.6 var(--serif);
  color: var(--ink);
}

.quote figcaption {
  font-size: 0.88rem;
}

/* Sidebar */

.cv__side {
  padding-top: 1.5rem;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.panel__title {
  font: 600 1.15rem/1.2 var(--serif);
  margin-bottom: 0.75rem;
}

.panel__sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1rem 0 0.45rem;
}

.panel__title + .panel__sub {
  margin-top: 0;
}

.chips li {
  font-size: 0.82rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  color: var(--ink);
}

.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.93rem;
}

.plain li {
  padding: 0.2rem 0;
}

.pairs {
  margin: 0;
  font-size: 0.93rem;
}

.pairs div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--line);
}

.pairs div:last-child {
  border-bottom: 0;
}

.pairs dt {
  color: var(--ink);
  font-weight: 600;
}

.pairs dd {
  margin: 0;
  color: var(--muted);
}

.study {
  margin-bottom: 0.85rem;
  font-size: 0.93rem;
}

.study p {
  margin: 0;
}

.study__degree {
  color: var(--ink);
  font-weight: 600;
}

.study__years {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Simple pages */

.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0 2.25rem;
}

.page-head h1 {
  font: 600 clamp(1.9rem, 4vw, 2.6rem) / 1.15 var(--serif);
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.1rem;
  max-width: 60ch;
}

.prose {
  max-width: 72ch;
  padding: 2rem 0 4rem;
}

.prose h2 {
  font: 600 1.25rem/1.3 var(--serif);
  margin: 1.75rem 0 0.5rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Footer */

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

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.5rem 0;
}

.footer p {
  margin: 0;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer a {
  color: var(--muted);
}

/* Smaller screens */

@media (max-width: 960px) {
  .cv {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sections {
    display: none;
  }
}

@media (max-width: 640px) {
  .intro {
    padding-top: 2.25rem;
  }

  .intro__inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .intro__photo {
    width: 120px;
    height: 120px;
  }

  .facts,
  .services,
  .projects {
    grid-template-columns: 1fr;
  }

  .mark__name,
  .print-hint {
    display: none;
  }
}

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

/* Print: one clean A4 document in the light palette, nothing interactive. */

@page {
  size: A4;
  margin: 14mm 14mm 16mm;
}

@media print {
  :root,
  :root[data-theme="dark"] {
    --bg: #ffffff;
    --surface: #ffffff;
    --ink: #000000;
    --text: #1a1a1a;
    --muted: #4a4a4a;
    --line: #cccccc;
    --accent: #1f5c94;
    --accent-soft: #dfe7f0;
    --grid: transparent;
    --shadow: none;
    color-scheme: light;
  }

  body {
    font-size: 10pt;
    line-height: 1.45;
  }

  .topbar,
  .skip,
  .footer,
  #services {
    display: none;
  }

  .container {
    width: 100%;
  }

  .intro {
    padding: 0 0 1rem;
    border-bottom: 2px solid var(--ink);
  }

  .intro__inner {
    gap: 1.25rem;
  }

  .intro__photo {
    width: 90px;
    height: 90px;
    border: 0;
  }

  .intro__name {
    font-size: 24pt;
  }

  .contacts {
    margin-top: 0.5rem;
  }

  .facts {
    display: none;
  }

  .cv {
    grid-template-columns: minmax(0, 1fr) 54mm;
    gap: 7mm;
    padding: 0.5rem 0 0;
  }

  .section {
    padding-top: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .section__title {
    font-size: 13pt;
    margin-bottom: 0.5rem;
  }

  .job {
    padding-bottom: 0.9rem;
  }

  .role,
  .project,
  .quote,
  .panel,
  .study {
    break-inside: avoid;
  }

  .projects {
    gap: 0.4rem;
  }

  .project,
  .panel {
    padding: 0.4rem 0;
  }

  .panel {
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .chips li {
    border: 0;
    padding: 0;
    font-size: 8.5pt;
  }

  .chips li:not(:last-child)::after {
    content: " ·";
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

/* Intro without a photo */
.intro__inner--text {
  grid-template-columns: 1fr;
}
