:root {
  --bg: #FAFAF8;
  --text: #202124;
  --text-secondary: #555B61;
  --border: #E0E0DC;
  --tag-border: #C4C4BE;
  --accent: #244A63;
  --accent-contrast: #FFFFFF;
  --tag-bg: #F0F0EC;
  --tag-active-bg: #244A63;
  --tag-active-text: #FFFFFF;
  --header-bg: rgba(250, 250, 248, 0.94);
  --measure: 800px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark tokens are listed twice on purpose: once for the system preference, once for the manual override. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17191B;
    --text: #E8E8E4;
    --text-secondary: #A9AFB5;
    --border: #33373B;
  --tag-border: #4A5058;
    --accent: #8FB8D6;
    --accent-contrast: #0F1A22;
    --tag-bg: #23272B;
    --tag-active-bg: #8FB8D6;
    --tag-active-text: #0F1A22;
    --header-bg: rgba(23, 25, 27, 0.94);
  }
}

:root[data-theme="dark"] {
  --bg: #17191B;
  --text: #E8E8E4;
  --text-secondary: #A9AFB5;
  --border: #33373B;
  --tag-border: #4A5058;
  --accent: #8FB8D6;
  --accent-contrast: #0F1A22;
  --tag-bg: #23272B;
  --tag-active-bg: #8FB8D6;
  --tag-active-text: #0F1A22;
  --header-bg: rgba(23, 25, 27, 0.94);
}

* { box-sizing: border-box; }

html {
  font-size: 112.5%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 2.75rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 1.85rem); font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.25rem; font-weight: 650; }

p { margin: 0 0 1rem; }
ul { margin: 0; padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }
em { font-style: italic; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.site-header__name {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.site-header__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-left: auto;
  max-width: 100%;
}
.text-size { display: flex; gap: 0.25rem; }
.text-size button {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0 0.5rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.text-size button:hover:not(:disabled) { border-color: var(--accent); }
.text-size button:disabled { opacity: 0.4; cursor: default; }

.theme-toggle {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 2.4rem;
  padding: 0 0.8rem;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { background: var(--accent); color: var(--accent-contrast); }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 4px;
  text-align: center;
  max-width: 100%;
}
.button:hover { filter: brightness(1.1); }

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem 3rem;
}
section { padding: 2.5rem 0 0.5rem; }

.hero { padding-top: 3rem; }
.kicker {
  color: var(--accent);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.facts { color: var(--text-secondary); margin: 0.6rem 0 1.4rem; }
.summary { font-size: 1.1rem; max-width: 42rem; }
.hero-label {
  font-size: 0.85rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 1.4rem 0 0.4rem;
}
.top-skills {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}
.top-skills li { margin: 0; }
.tag.top-skill {
  font-size: 1rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-weight: 600;
}
.highlight { max-width: 42rem; margin-bottom: 1.4rem; }
.job { scroll-margin-top: 5rem; }
.contact {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.2rem;
}
.contact li { margin: 0; }
.contact a, .site-footer a, .site-footer p { overflow-wrap: anywhere; }

.job { padding: 1.25rem 0 0.75rem; border-bottom: 1px solid var(--border); }
.job:last-of-type { border-bottom: 0; }
.meta { color: var(--text-secondary); margin: 0.3rem 0 0; }
.company {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.company:hover { text-decoration-thickness: 2px; }
.company-description { color: var(--text-secondary); font-size: 0.95rem; margin: 0 0 0.6rem; }

/* Pinned to the viewport so the feedback stays visible wherever the clicked tag was. */
.filter-status {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.filter-status[hidden] { display: none; }
.filter-clear {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 2rem;
  padding: 0 0.7rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
}
.filter-clear:hover { background: var(--accent); color: var(--accent-contrast); }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.2rem 0.15rem 0.6rem;
  background: var(--tag-active-bg);
  color: var(--tag-active-text);
  border-radius: 999px;
  font-weight: 600;
}
.filter-chip__remove {
  font: inherit;
  line-height: 1;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.filter-chip__remove:hover { background: rgba(0, 0, 0, 0.18); }
.positions { list-style: none; padding: 0; color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 0.6rem; }
.positions li { margin: 0; }

.tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}
.tags li { margin: 0; }
.tag {
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.3;
  padding: 0.25rem 0.6rem;
  background: var(--tag-bg);
  color: var(--text);
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  cursor: pointer;
}
.tag:hover { border-color: var(--accent); }
.tag.is-active, .tag[aria-pressed="true"] {
  background: var(--tag-active-bg);
  color: var(--tag-active-text);
}
.job.is-dimmed { opacity: 0.45; }
.job.is-dimmed .tag { cursor: pointer; }

.highlights li { margin-bottom: 0.6rem; }

.soft-skills { list-style: none; padding: 0; }
.soft-skills li { margin-bottom: 0.8rem; }
.soft-skills strong::after { content: "."; }

.skill-groups { margin: 0; }
.skill-group { display: grid; grid-template-columns: 12rem 1fr; gap: 0.5rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.skill-group:last-child { border-bottom: 0; }
.skill-group dt { font-weight: 650; }
.skill-group dd { margin: 0; }

.education { list-style: none; padding: 0; }
.also { color: var(--text-secondary); margin-top: 1rem; }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.site-footer p { margin-bottom: 0.4rem; }

@media (max-width: 600px) {
  .site-header__inner { padding: 0.5rem 1rem; }
  .site-header__name { font-size: 0.95rem; }
  .button { padding: 0.45rem 0.75rem; font-size: 0.9rem; }
  .skill-group { grid-template-columns: 1fr; gap: 0.2rem; }
  .hero { padding-top: 2rem; }
}

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

@media print {
  .site-header, .skip-link, .filter-status, .site-footer, .text-size { display: none; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
  section { padding-top: 1rem; }
  .tag { border: 1px solid #999; background: none; color: #000; }
  .job { page-break-inside: avoid; }
}
