* {
  box-sizing: border-box;
}

html {
  --black: #111216;
  --white: #e8e9ed;
  --background: var(--black);
  --text: var(--white);
  --muted: #a9adb6;
  --accent: #8cdbce;
  --warm: #eeb58d;
  --line: #34383f;
  background: var(--background);
  color-scheme: dark;
  scroll-padding-top: 2rem;
}

html[data-theme="light"] {
  --background: #f8f6f1;
  --text: #22282a;
  --muted: #596469;
  --accent: #12685e;
  --warm: #ad4e29;
  --line: #d7dad2;
  color-scheme: light;
}

body {
  margin: 0;
  padding: 0 2rem;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 68rem;
  margin: 0 auto;
}

h1, h2, h3, p, ul, dl, dd {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25rem;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0.3rem;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--background);
  z-index: 1;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 2rem;
  padding-top: 4.5rem;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.75rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

#theme {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 50%;
}

#theme:hover {
  color: var(--accent);
}

.theme-icon {
  width: 1.25rem;
  height: 1.25rem;
  background: currentColor;
  mask: url("icons/day-sunny-icon.svg") center / contain no-repeat;
  -webkit-mask: url("icons/day-sunny-icon.svg") center / contain no-repeat;
}

html[data-theme="light"] .theme-icon {
  mask-image: url("icons/moon-icon.svg");
  -webkit-mask-image: url("icons/moon-icon.svg");
}

.intro {
  grid-column: 1 / -1;
  padding: 1.5rem 0 2.75rem;
}

.profession {
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1.4;
}

.accent-dot {
  color: var(--warm);
}

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

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
}

.contact-links a {
  text-decoration-color: var(--line);
}

.contact-links a:hover {
  text-decoration-color: var(--accent);
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--muted);
}

.section-nav a {
  text-decoration: none;
}

.cv-section {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 3rem;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.section-number {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--warm);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
}

.entry + .entry {
  margin-top: 2.75rem;
  padding-top: 2.75rem;
  border-top: 1px solid var(--line);
}

.entry-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
}

.dates {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

.entry-meta span:first-child {
  color: var(--accent);
}

.entry-meta span:last-child {
  color: var(--muted);
}

.entry > ul {
  margin-top: 1.25rem;
}

ul {
  padding-left: 1.1rem;
  font-size: 0.9375rem;
}

li {
  padding-left: 0.25rem;
}

li + li {
  margin-top: 0.55rem;
}

li::marker {
  color: var(--accent);
  font-size: 0.75rem;
}

li ul {
  margin-top: 0.55rem;
}

.skills-list > div {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}

.skills-list > div:first-child {
  padding-top: 0;
}

.skills-list > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

dt {
  color: var(--accent);
  font-size: 0.875rem;
}

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 60rem) {
  .cv-section {
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 2rem;
  }

  .entry-heading {
    flex-direction: column;
    gap: 0.25rem;
  }

  .skills-list > div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (max-width: 42rem) {
  body {
    padding: 0 1.5rem;
  }

  .site-header {
    column-gap: 0.75rem;
    row-gap: 0.35rem;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }

  h1 {
    grid-column: 1 / -1;
    margin-bottom: 0.65rem;
    font-size: 2.75rem;
  }

  /* Share the header grid so the same button sits beside the role. */
  .intro {
    display: contents;
  }

  .profession {
    grid-column: 1;
    grid-row: 2;
    font-size: 1.65rem;
  }

  #theme {
    grid-column: 2;
    grid-row: 2;
  }

  .location {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .contact-links {
    grid-column: 1 / -1;
  }

  .section-nav {
    gap: 0.5rem 1.25rem;
  }

  .cv-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    padding: 2rem 0;
  }

  .section-label {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
  }

  .section-number {
    margin-bottom: 0;
  }

  .entry-meta {
    flex-direction: column;
  }

  .entry + .entry {
    margin-top: 2rem;
    padding-top: 2rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    transition: background-color 0.25s ease;
  }

  /* Animate colors where they are set; descendants inherit the same fade. */
  body, #theme, .profession, .accent-dot, .location, .section-nav,
  .section-number, .dates, .entry-meta span, dt, footer, li::marker {
    transition: color 0.25s ease,
                border-color 0.25s ease;
  }

  .cv-section, .entry, .skills-list > div {
    transition: border-color 0.25s ease;
  }
}
