:root {
  color-scheme: light;
  --paper: #f6f5f1;
  --ink: #202421;
  --muted: #505853;
  --accent: #365866;
  --line: #d3d6cf;
  --subtle: #e9ece7;
  --button: #293b3d;
  --button-hover: #365354;
  --button-text: #fbfaf6;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16191c;
  --ink: #eeeee8;
  --muted: #b3bbba;
  --accent: #b0cbd4;
  --line: #3a4345;
  --subtle: #252c2e;
  --button: #dae7e7;
  --button-hover: #f0f5f3;
  --button-text: #192426;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #16191c;
    --ink: #eeeee8;
    --muted: #b3bbba;
    --accent: #b0cbd4;
    --line: #3a4345;
    --subtle: #252c2e;
    --button: #dae7e7;
    --button-hover: #f0f5f3;
    --button-text: #192426;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-underline-offset: 0.27em; }
a:hover { color: var(--accent); }
:where(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
p, h1, h2, h3, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
section[id] { scroll-margin-top: 1.5rem; }

.frame { width: min(100% - 2 * clamp(1.125rem, 5vw, 4.5rem), 69rem); margin-inline: auto; }
.skip {
  position: absolute;
  inset: 0.5rem auto auto 0.5rem;
  z-index: 1;
  padding: 0.75rem;
  transform: translateY(-160%);
  background: var(--paper);
}
.skip:focus { transform: none; }

.masthead {
  min-height: 4.7rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.wordmark { width: fit-content; font-weight: 650; letter-spacing: -0.015em; text-decoration: none; }
.section-nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.section-nav a { color: var(--muted); font-size: 0.925rem; text-decoration: none; }
.section-nav a:hover { color: var(--ink); text-decoration: underline; }
.preferences { display: flex; align-items: center; justify-self: end; gap: 0.55rem; }
.languages { display: flex; }
.languages a, .theme-toggle {
  display: grid;
  place-items: center;
  min-width: 2.35rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font: 600 0.8125rem/1 "Segoe UI", Arial, sans-serif;
}
.languages [aria-current="page"] { color: var(--ink); text-decoration: underline; }
.languages a:hover, .theme-toggle:hover { background: var(--subtle); color: var(--ink); }
.theme-toggle { position: relative; min-width: 2.75rem; cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle::before {
  position: absolute;
  inset: 0.72rem auto 0.72rem -0.3rem;
  width: 1px;
  background: var(--line);
  content: "";
}
.theme-toggle span {
  width: 1.05rem;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.theme-toggle[aria-pressed="true"] span { transform: rotate(180deg); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: end;
  padding-block: clamp(3rem, 6.5vw, 5.8rem);
}

.hero h1, h2, .employer h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.052em;
}
.hero h1 { font-size: clamp(3.35rem, 7.7vw, 6.9rem); line-height: 0.93; }
.role { margin-top: clamp(1.5rem, 3vw, 2.15rem); color: var(--accent); font-size: clamp(1rem, 1.65vw, 1.25rem); font-weight: 650; line-height: 1.45; }
.role span { margin-inline: 0.12em; }
.intro { max-width: 48ch; margin-top: 0.85rem; color: var(--muted); font-size: clamp(1rem, 1.32vw, 1.125rem); line-height: 1.65; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 1.3rem; margin-top: 1.65rem; }
.actions a { display: inline-flex; min-height: 2.8rem; align-items: center; font-size: 0.9375rem; font-weight: 600; }
.primary { padding: 0.6rem 1.1rem; background: var(--button); color: var(--button-text); border-radius: 0.25rem; text-decoration: none; }
.primary:hover { background: var(--button-hover); color: var(--button-text); }
.resume span { margin-left: 0.4rem; color: var(--muted); font-size: 0.75rem; }
.toolkit { max-width: 27rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.toolkit h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.6rem, 2.7vw, 2.25rem);
}
.toolkit p + p { margin-top: 0.8rem; }

.section, .closing { margin-bottom: clamp(3.2rem, 6vw, 5.5rem); }
.experience, .ruled { padding-top: clamp(1.75rem, 4vw, 2.8rem); border-top: 1px solid var(--line); }
h2 { margin-bottom: 1.5rem; font-size: clamp(2.05rem, 4.5vw, 3.4rem); line-height: 1.05; }
h3 { font-size: clamp(1.1rem, 1.7vw, 1.3rem); font-weight: 650; letter-spacing: -0.022em; line-height: 1.25; }
.experience-panel, .project-list li {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.45fr);
  column-gap: clamp(1.5rem, 5vw, 4rem);
}
.experience-panel { align-items: start; padding-top: 0.75rem; }
.employer h3 { font-size: clamp(1.7rem, 3.3vw, 2.65rem); }
.employer p { margin-top: 0.45rem; color: var(--accent); font-weight: 550; line-height: 1.45; }
.work-copy { display: grid; gap: 1rem; padding-left: clamp(1.25rem, 3.5vw, 2.6rem); border-left: 1px solid var(--line); }
.toolkit p, .work-copy p, .project-list p, .closing p { color: var(--muted); line-height: 1.65; }

.project-list li { align-items: baseline; row-gap: 0.35rem; padding-block: 1.05rem; }
.project-list li + li { border-top: 1px solid var(--line); }
.closing { display: grid; grid-template-columns: 1.45fr 0.85fr; gap: clamp(1.5rem, 5vw, 4rem); }
.closing h2 { font-size: clamp(1.8rem, 3.5vw, 2.65rem); }
.closing p { margin-top: 0.4rem; }
.contact-list { display: flex; flex-wrap: wrap; gap: 0.75rem 1.1rem; }
.contact-list a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--accent); font-weight: 600; }

@media (max-width: 45rem) {
  .masthead { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.2rem; padding-block: 0.45rem 0.2rem; }
  .preferences { grid-column: 2; grid-row: 1; }
  .section-nav { grid-column: 1 / -1; gap: clamp(0.75rem, 4vw, 1.5rem); flex-wrap: wrap; }
  .section-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.9rem; }
  .hero { grid-template-columns: 1fr; gap: 2.4rem; padding-block: 2.4rem 2.2rem; }
  .hero h1 { font-size: clamp(3.2rem, 11vw, 5.1rem); }
  .experience-panel, .project-list li, .closing { grid-template-columns: 1fr; }
  .experience-panel { row-gap: 1.2rem; }
  .work-copy { padding-left: 1rem; }
  .closing { row-gap: 2rem; }
}

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