:root {
  /* Accent shades chosen for WCAG AA contrast, including under simulated red-green color blindness. */
  --accent: #dc590e;       /* rules, underlines, markers: 3:1 */
  --accent-ink: #b0480c;   /* small orange text: 4.5:1 */
  --button: #f07a2c;       /* every button, both themes, matching the hero */
  --button-hover: #f38a42;
  --on-button: #15171c;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --ink: #1c1f26;
  --muted: #5b6270;
  --rule: #dfe1e5;
  --slate: #2f3542;
  --on-slate: #eef0f3;
  --radius: 10px;
  --wrap: 72rem;
  --font-display: Jost, "Futura", "Century Gothic", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #f07a2c;
    --accent-ink: #f59a5b;
    --bg: #15171c;
    --surface: #1e2129;
    --ink: #e7e9ee;
    --muted: #a2a8b4;
    --rule: #2e323c;
    --slate: #0e1014;
  }
}

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

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

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

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

img { display: block; max-width: 100%; height: auto; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.6em;
}

h2 {
  font-weight: 500;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  letter-spacing: -0.01em;
}

h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: 0.4rem;
  background: var(--accent);
}

p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }

/* Navigation: native sticky, no scroll handlers. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.links a:not(.button) {
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.links a:not(.button):hover { color: var(--ink); }
.links a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px var(--accent); border-radius: 0; }

@media (max-width: 40rem) {
  .brand { display: none; }
  .links { width: 100%; justify-content: space-between; gap: 0; }
  .links a:not(.button) { padding-inline: 0.45rem; }
  .links .button.small { display: none; } /* the hero and contact section both carry the résumé link */
}

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--button);
  border-radius: 999px;
  background: var(--button);
  color: var(--on-button);
  font-family: var(--font-display);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.button:hover { background: var(--button-hover); border-color: var(--button-hover); }
.button.small { padding: 0.3rem 0.9rem; margin-left: 0.4rem; }
.button.ghost { background: transparent; color: inherit; }
.button.ghost:hover { background: var(--button); color: var(--on-button); border-color: var(--button); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow span { color: var(--accent); }

/* Hero: a real <img> with object-fit, not a fixed background. */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(88vh, 52rem);
  overflow: hidden;
  color: #fff;
  background: #222;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 60%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgb(12 14 18 / 0.85), rgb(12 14 18 / 0.15) 55%, transparent),
    linear-gradient(to right, rgb(12 14 18 / 0.55), transparent 60%);
}

/* The hero photo and the contact band are dark in both themes, so their rules and eyebrow keep the bright orange. */
.hero, .contact {
  --accent: #f07a2c;
  --accent-ink: #f59a5b;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding-block: 4rem 3.5rem;
}

.hero .eyebrow { color: rgb(255 255 255 / 0.8); }

.hero h1 {
  font-weight: 400;
  font-size: clamp(2.5rem, 1.5rem + 5vw, 5rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.3em;
}

.lead {
  max-width: 34rem;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.45;
  color: rgb(255 255 255 / 0.92);
}

.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.credit {
  position: absolute;
  right: 0.75rem;
  bottom: 0.5rem;
  z-index: 1;
  margin: 0;
  font-size: 0.75rem;
  color: rgb(255 255 255 / 0.7);
}

/* About */
.about {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about p { max-width: 42rem; }

.portrait {
  width: 15rem;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--rule);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem 2rem;
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.facts dt {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd { margin: 0; font-weight: 600; }

@media (max-width: 48rem) {
  .about { grid-template-columns: 1fr; justify-items: center; }
  .portrait { width: 11rem; }
}

/* Experience timeline */
.experience { background: var(--surface); border-block: 1px solid var(--rule); }

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

.role {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 2rem;
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
}

.role:first-child { border-top: 0; padding-top: 0; }

.when {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--accent-ink);
  white-space: nowrap;
}

.what { max-width: 46rem; }

.role h3 {
  font-weight: 500;
  font-size: 1.45rem;
  margin-bottom: 0.4rem;
}

.role h3 span {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.what ul { margin: 0; padding-left: 1.1rem; }
.what li + li { margin-top: 0.4rem; }
.what li::marker { color: var(--accent); }

.earlier { list-style: none; padding-left: 0 !important; }

details { margin-top: 1rem; }

summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--accent-ink);
}

details p { margin-top: 0.75rem; color: var(--muted); }

.role-photo { margin: 1.5rem 0 0; }

.role-photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}

.role-photo figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.role-photo figcaption span {
  display: block;
  font-size: 0.8rem;
}

@media (max-width: 40rem) {
  .role { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* Projects */
.banner {
  position: relative;
  margin: 1rem 0 3rem;
}

.banner img {
  width: 100%;
  height: clamp(14rem, 40vw, 30rem);
  object-fit: cover;
  object-position: 50% 45%;
}

.feature {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.feature h3 { font-weight: 500; font-size: 1.8rem; }

.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.results caption {
  text-align: left;
  padding-bottom: 0.5rem;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--muted);
}

.results th, .results td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-top: 1px solid var(--rule);
}

.results tr:first-child th, .results tr:first-child td { border-top: 0; }
.results th { font-weight: 600; }
.results td { white-space: nowrap; }
.results td:last-child { color: var(--accent-ink); }

@media (max-width: 30rem) {
  .results th, .results td { padding: 0.5rem 0.55rem; }
}

@media (max-width: 48rem) {
  .feature { grid-template-columns: 1fr; }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 1.1rem 1.25rem 0.4rem; }
.card h3 { font-weight: 500; font-size: 1.2rem; margin-bottom: 0.35rem; }
.card p { color: var(--muted); font-size: 0.98rem; }
.card.text-only { border-top: 3px solid var(--accent); }

/* Contact */
.contact {
  background: var(--slate);
  color: var(--on-slate);
  text-align: center;
}

.contact h2 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); }
.contact h2::after { margin-inline: auto; }
.contact .cta { justify-content: center; }
.contact .button.ghost { color: var(--on-slate); }
