/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #fbfbf8;
  --bg-alt: #f1f3ee;
  --surface: #ffffff;
  --ink: #15211c;
  --ink-2: #44524b;
  --ink-3: #6b7871;
  --line: #dde3dc;
  --brand: #0f6b57;
  --brand-ink: #ffffff;
  --brand-soft: #e2f1ec;
  --accent: #c2410c;
  --media: radial-gradient(120% 90% at 30% 20%, #e2f1ec 0%, #f1f3ee 70%);
  /* always-dark surfaces: hero, services, contact, nav */
  --night: #071512;
  --night-2: #0c201b;
  --night-ink: #f2f6f3;
  --night-ink-2: #b4c6bd;
  --night-line: rgba(242, 246, 243, .12);
  --mint: #6fd3b3;
  --hot: #f97316;
  --hot-ink: #1c0d02;
  --shadow: 0 1px 2px rgba(16, 33, 28, .05), 0 8px 24px rgba(16, 33, 28, .06);
  --shadow-lg: 0 2px 4px rgba(16, 33, 28, .05), 0 18px 40px rgba(16, 33, 28, .10);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1513;
    --bg-alt: #131c19;
    --surface: #18221f;
    --ink: #eef3f0;
    --ink-2: #bccac3;
    --ink-3: #8d9c95;
    --line: #26332e;
    --brand: #4fc3a1;
    --brand-ink: #06231b;
    --brand-soft: #173a31;
    --accent: #f59a62;
    --media: radial-gradient(120% 90% at 30% 20%, #1d3a32 0%, #141e1b 70%);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 40px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1513;
  --bg-alt: #131c19;
  --surface: #18221f;
  --ink: #eef3f0;
  --ink-2: #bccac3;
  --ink-3: #8d9c95;
  --line: #26332e;
  --brand: #4fc3a1;
  --brand-ink: #06231b;
  --brand-soft: #173a31;
  --accent: #f59a62;
  --media: radial-gradient(120% 90% at 30% 20%, #1d3a32 0%, #141e1b 70%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 40px rgba(0, 0, 0, .35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease, border-color .15s ease, filter .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-hot { background: var(--hot); color: var(--hot-ink); }
.btn-hot:hover { filter: brightness(1.08); }
.btn-light { background: var(--night-ink); color: var(--night); }
.btn-light:hover { background: #fff; }
.hero .btn-ghost { color: var(--night-ink); border-color: rgba(242, 246, 243, .3); }
.hero .btn-ghost:hover { border-color: var(--mint); color: var(--mint); }

/* ---------- Nav (always dark, sits on the map hero) ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 21, 18, .82);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--night-line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; color: var(--night-ink); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 18px; }
.brand svg { width: 28px; height: 28px; color: var(--mint); }
#navMenu { display: flex; align-items: center; gap: 4px; }
#navMenu a { white-space: nowrap; color: var(--night-ink-2); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
#navMenu a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
#navMenu a.nav-cta { color: var(--hot-ink); background: var(--hot); margin-left: 6px; }
#navMenu a.nav-cta:hover { filter: brightness(1.08); }
.theme-toggle { margin-left: 6px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--night-line); background: transparent; color: var(--night-ink-2); cursor: pointer; display: grid; place-items: center; }
.theme-toggle:hover { color: #fff; border-color: rgba(242, 246, 243, .3); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--night-ink); border-radius: 2px; transition: transform .2s ease; }
.nav-toggle span + span { margin-top: 7px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- Hero ----------
   Two columns: the pitch on the left, the portrait standing on the hero's bottom edge on the right.
   Both columns end together, so there is no empty space under the photo. */
.hero {
  position: relative; color: var(--night-ink); overflow: hidden;
  background:
    radial-gradient(ellipse 45% 70% at 76% 42%, #123a33 0%, rgba(13, 42, 37, .6) 45%, rgba(7, 21, 18, 0) 75%),
    var(--night);
}
.hero-contours {
  position: absolute; inset: 0; pointer-events: none; opacity: .13;
  background: url(assets/img/contours.svg) center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35) 0%, #000 55%, #000 100%);
  mask-image: linear-gradient(90deg, rgba(0,0,0,.35) 0%, #000 55%, #000 100%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: end;
}
.hero-text { align-self: center; padding: 64px 0 76px; }
.hero-text > * { max-width: 600px; }
.hero-id { margin-bottom: 22px; }
.available {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 22px;
  font-size: 13.5px; font-weight: 500; color: var(--night-ink);
  padding: 6px 14px 6px 12px; border-radius: 999px;
  background: rgba(111, 211, 179, .1); border: 1px solid rgba(111, 211, 179, .3);
}
.available span { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }
.hero-roles { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 30px; }
.hero-roles li {
  font-size: 13px; font-weight: 600; color: var(--night-ink); letter-spacing: .01em;
  padding: 5px 12px; border-radius: 8px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(242, 246, 243, .14);
}
/* portrait: sized by the column, but never taller than the screen, so the face is always in view */
.hero-figure {
  position: relative; justify-self: end; align-self: end; pointer-events: none;
  width: min(100%, 580px, calc((100vh - 96px) * .89)); aspect-ratio: 820 / 921;
}
.hero-figure::before {   /* studio key light behind the head, warm rim from the right */
  content: ""; position: absolute; inset: -10% -45% -10% -45%;
  background:
    radial-gradient(closest-side at 60% 24%, rgba(249, 140, 60, .15) 0%, rgba(249, 115, 22, .04) 50%, rgba(249, 115, 22, 0) 100%),
    radial-gradient(closest-side at 50% 32%, #1f4d45 0%, #163c35 35%, rgba(13, 40, 35, .7) 65%, rgba(7, 21, 18, 0) 100%);
}
.hero-figure img { position: relative; width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45)); }
.hero-name { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: #fff; }
.hero-role { font-size: 15px; color: var(--mint); font-weight: 500; margin-top: 2px; }
.hero h1 { font-size: clamp(2.2rem, 4.3vw, 3.5rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.025em; margin-bottom: 22px; color: #fff; }
.hero h1 em { font-style: normal; color: var(--hot); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--night-ink-2); margin-bottom: 32px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- At a glance strip (facts recruiters scan for) ---------- */
.glance { background: var(--surface); border-bottom: 1px solid var(--line); }
.glance-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
.glance-grid div { padding: 26px 18px; border-left: 1px solid var(--line); }
.glance-grid div:first-child { border-left: 0; padding-left: 0; }
.glance-grid dt { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.glance-grid dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.glance-grid dd strong { display: block; font-family: var(--display); font-size: 1.6rem; line-height: 1.1; margin-bottom: 2px; }
.glance-grid dd span { display: block; font-weight: 500; color: var(--ink-3); font-size: 14px; }
.glance-clients { border-top: 1px solid var(--line); padding: 16px 0 18px; font-size: 14px; color: var(--ink-2); }
.glance-clients span { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-right: 10px; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 44px; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.section-head h2 { font-size: clamp(2rem, 3.8vw, 2.8rem); letter-spacing: -0.02em; margin-bottom: 12px; }
.section-head > p:last-child { color: var(--ink-2); font-size: 1.05rem; }

/* ---------- Selected work ---------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.proj {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.proj:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.proj-media { position: relative; display: block; height: 330px; padding: 22px 22px 58px; background: var(--media); border-bottom: 1px solid var(--line); text-decoration: none; }
.proj-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s ease; filter: drop-shadow(0 10px 18px rgba(16, 33, 28, .18)); }
.proj:hover .proj-media img { transform: scale(1.02); }
.map-legend { position: absolute; left: 22px; right: 22px; bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.map-legend strong { font-weight: 600; color: var(--ink); margin-right: 2px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.proj-body { padding: 24px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.proj-body h3 { font-size: 1.3rem; margin-bottom: 10px; }
.proj-body > p:not(.tagline):not(.note) { color: var(--ink-2); font-size: 15px; }
.role-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.role-tags li { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 6px; padding: 3px 8px; }
.tagline { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .02em; margin-bottom: 8px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 14px; }
.metrics li { background: var(--brand-soft); border-radius: 12px; padding: 11px 12px; }
.metrics strong { display: block; font-family: var(--display); font-size: 1.25rem; color: var(--ink); white-space: nowrap; }
.metrics span { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.35; margin-top: 2px; }
.note { font-size: 13.5px; color: var(--ink-3); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags li { font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 20px; }

/* lead project: full width, map beside the text */
.proj-lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
.proj-lead .proj-media { height: auto; min-height: 560px; border-bottom: 0; border-right: 1px solid var(--line); padding: 28px 28px 64px; }
.proj-lead .proj-media img { max-height: 640px; }
.proj-lead .proj-body { padding: 40px; }
.proj-lead .proj-body h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.proj-lead .proj-body > p:not(.tagline):not(.note) { font-size: 16px; }
.proj-lead .metrics { gap: 12px; margin: 24px 0 16px; }
.proj-lead .metrics li { padding: 14px; }
.proj-lead .metrics strong { font-size: 1.5rem; }
.proj-lead .metrics span { font-size: 12.5px; }
.proj-lead .links { margin-top: 0; padding-top: 24px; }

/* ---------- More projects ---------- */
.more-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 72px 0 24px; }
.more-head h3 { font-size: 1.6rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease;
}
.card[hidden] { display: none; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #ffffff; border-bottom: 1px solid var(--line); }
.card-media.fit { padding: 10px; }
.card-media.fit img { object-fit: contain; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-media-diagram { display: grid; place-items: center; padding: 14px; background: #f4f6f2; }
.card-media-diagram svg { width: 100%; height: 100%; }
.d-box { fill: #ffffff; stroke: #c9d3cc; stroke-width: 1.5; }
.d-accent { fill: #0f6b57; stroke: #0f6b57; }
.d-txt { fill: #15211c; font-weight: 600; }
.d-sub { fill: #5c6b63; font-size: 11.5px; }
.d-on { fill: #ffffff; }
.d-line { stroke: #8fa39a; }
.d-head { fill: #8fa39a; }
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card-body > p:not(.tagline) { color: var(--ink-2); font-size: 15px; }
.text-link { margin-top: auto; padding-top: 18px; font-weight: 600; font-size: 15px; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Services (dark band) ---------- */
.section-dark { background: var(--night); color: var(--night-ink); }
.section-dark .kicker { color: var(--hot); }
.section-dark .section-head h2 { color: #fff; }
.section-dark .section-head > p:last-child { color: var(--night-ink-2); }
.expertise { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.expertise .service { grid-column: span 2; }
.expertise .service:nth-child(n+4) { grid-column: span 3; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tools li { font-size: 12.5px; font-weight: 500; color: var(--night-ink); background: rgba(111, 211, 179, .08); border: 1px solid rgba(111, 211, 179, .22); border-radius: 999px; padding: 3px 10px; }
.service { background: var(--night-2); border: 1px solid var(--night-line); border-radius: 18px; padding: 26px 24px; display: flex; flex-direction: column; }
.s-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(249, 115, 22, .12); color: var(--hot); margin-bottom: 18px; }
.s-icon svg { width: 24px; height: 24px; }
.service h3 { font-size: 1.15rem; color: #fff; margin-bottom: 10px; }
.service p { color: var(--night-ink-2); font-size: 15px; }
.service .proof { margin-top: auto; padding-top: 18px; font-size: 13.5px; color: rgba(242, 246, 243, .55); }
.service .proof a { color: var(--mint); text-decoration: none; font-weight: 500; }
.service .proof a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Client work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.work { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.work::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 3px; border-radius: 0 3px 3px 0; background: var(--hot); }
.client { font-size: 13px; font-weight: 600; color: var(--brand); margin-bottom: 8px; }
.work h3 { font-size: 1.12rem; margin-bottom: 8px; }
.work p:last-child { color: var(--ink-2); font-size: 15px; }
.clients-head p a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.clients-head p a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Map gallery ---------- */
.section-maps { border-top: 1px solid var(--line); }
.map-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -16px 0 24px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.map-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease;
}
.map-card[hidden] { display: none; }
.map-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.map-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 11; padding: 10px; margin: 0;
  background: #ffffff; border: 0; border-bottom: 1px solid var(--line); cursor: zoom-in;
}
.map-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s ease; }
.map-card:hover .map-thumb img { transform: scale(1.03); }
.map-thumb:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.map-count {
  position: absolute; right: 10px; bottom: 10px; font-size: 12px; font-weight: 600;
  color: #fff; background: rgba(7, 21, 18, .78); border-radius: 999px; padding: 3px 10px;
}
.map-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.map-client { font-size: 13px; font-weight: 600; color: var(--brand); margin-bottom: 6px; }
.map-client.own { color: var(--accent); }
.map-body h3 { font-size: 1.1rem; margin-bottom: 8px; }
.map-body > p:not(.map-client) { color: var(--ink-2); font-size: 14.5px; }
.map-body .tags { margin-top: auto; padding-top: 14px; }
.map-note { margin-top: 22px; }

/* lightbox */
.viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--night); color: var(--night-ink);
}
.viewer::backdrop { background: rgba(7, 21, 18, .6); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; font-size: 14px; }
.viewer-count { color: var(--night-ink-2); }
.viewer-open { margin-left: auto; color: var(--mint); font-weight: 600; text-decoration: none; }
.viewer-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.viewer-close {
  font: inherit; font-size: 28px; line-height: 1; width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid var(--night-line); cursor: pointer;
}
.viewer-fig { flex: 1; min-height: 0; margin: 0; padding: 0 64px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.viewer-fig img { min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; border-radius: 6px; }
.viewer-fig figcaption { font-size: 15px; text-align: center; color: var(--night-ink); }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px;
  font: inherit; font-size: 34px; line-height: 1; color: #fff; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--night-line); border-radius: 12px;
}
.viewer-nav:hover, .viewer-close:hover { background: rgba(255, 255, 255, .16); }
.viewer-prev { left: 12px; }
.viewer-next { right: 12px; }
.viewer-nav[hidden] { display: none; }
@media (max-width: 760px) {
  .map-grid { grid-template-columns: 1fr; }
  .viewer-fig { padding: 0 8px 72px; }
  .viewer-nav { top: auto; bottom: 12px; transform: none; }
}

/* ---------- Experience & education ---------- */
.career { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr); gap: 56px; align-items: stretch; }
.career-main { display: grid; gap: 40px; align-content: start; }
.work-photo { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); min-height: 420px; }
.work-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 33% 30%; }
.work-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 20px 18px;
  font-size: 13.5px; font-weight: 500; color: #fff; line-height: 1.45;
  background: linear-gradient(180deg, rgba(7, 21, 18, 0) 0%, rgba(7, 21, 18, .82) 100%);
}
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline > li { position: relative; padding-bottom: 34px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before { content: ""; position: absolute; left: -28px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg-alt); border: 3px solid var(--brand); }
.timeline > li:first-child::before { border-color: var(--hot); background: var(--hot); }
.when { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.timeline h3 { font-size: 1.2rem; margin-bottom: 10px; }
.timeline h3 span { font-family: var(--font); font-weight: 500; color: var(--ink-2); font-size: 1rem; }
.timeline p:last-child:not(.when) { color: var(--ink-2); font-size: 15px; }
.duties { display: grid; gap: 6px; }
.duties li { position: relative; padding-left: 16px; color: var(--ink-2); font-size: 15px; }
.duties li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 2px; background: var(--brand); }
.clients-head { margin: 72px 0 24px; max-width: 680px; }
.clients-head h3 { font-size: 1.6rem; margin-bottom: 8px; }
.clients-head p { color: var(--ink-2); }
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.edu-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; gap: 18px; align-items: flex-start; }
.edu-icon { flex: 0 0 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.edu-icon svg { width: 24px; height: 24px; }
.edu-card .when { margin-bottom: 6px; }
.edu-card h3 { font-size: 1.2rem; margin-bottom: 4px; }
.edu-card .school { color: var(--ink-2); font-weight: 500; margin-bottom: 10px; }
.edu-card p.focus { color: var(--ink-2); font-size: 15px; }
.status { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); margin-left: 6px; vertical-align: middle; }

/* ---------- Research & skills ---------- */
.research { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 56px; align-items: start; }
.pubs { display: grid; gap: 16px; }
.pubs li { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; background: var(--surface); }
.pubs h3 { font-size: 1.05rem; margin-bottom: 8px; font-family: var(--font); font-weight: 600; line-height: 1.45; }
.pubs p { color: var(--ink-3); font-size: 15px; }
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.skill h3 { font-size: 1.05rem; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.skill .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--hot); flex: 0 0 auto; }
.pubs-wrap { margin-top: 56px; }
.pubs-title { font-size: 1.6rem; margin-bottom: 20px; }
.pubs-wrap .pubs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill ul { display: flex; flex-wrap: wrap; gap: 6px; }
.skill li { font-size: 13.5px; color: var(--ink-2); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }

/* ---------- Contact ---------- */
.contact { background: var(--night); color: var(--night-ink); position: relative; overflow: hidden; padding: 110px 0; }
.contact-map { position: absolute; left: 50%; top: 50%; width: max(100%, 1200px); max-width: none; transform: translate(-50%, -50%); opacity: .35; pointer-events: none; }
.contact::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 70% at 50% 50%, rgba(7, 21, 18, .92) 0%, rgba(7, 21, 18, .6) 100%); z-index: 1; }
.contact-inner { position: relative; z-index: 2; text-align: center; max-width: 720px; }
.contact .kicker { color: var(--hot); }
.contact h2 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); letter-spacing: -0.02em; margin-bottom: 14px; color: #fff; }
.contact-inner > p:not(.kicker) { color: var(--night-ink-2); font-size: 1.1rem; margin-bottom: 30px; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 26px; }
.social { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; font-size: 15px; color: var(--night-ink-2); }
.social a { color: var(--mint); text-decoration: none; font-weight: 600; }
.social a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer { padding: 26px 0; background: var(--night); border-top: 1px solid var(--night-line); font-size: 14px; color: rgba(242, 246, 243, .55); }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { color: rgba(242, 246, 243, .55); text-decoration: none; }
.footer a:hover { color: var(--mint); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card, .proj, .btn, .card-media img, .proj-media img { transition: none; }
}

/* ---------- Responsive ---------- */
/* short laptop screens (e.g. 1366x768 at 125-150% scaling): compact the pitch so the face stays above the fold */
@media (max-height: 780px) and (min-width: 961px) {
  .hero-text { padding: 36px 0 44px; }
  .available { margin-bottom: 14px; }
  .hero-id { margin-bottom: 14px; }
  .hero h1 { font-size: clamp(2rem, 3.4vw, 2.7rem); margin-bottom: 14px; }
  .lede { font-size: 1rem; margin-bottom: 22px; }
  .hero-roles { display: none; }
  .hero-figure { width: min(100%, 560px, calc((100vh - 84px) * .89)); }
}
@media (max-width: 1100px) {
  .glance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glance-grid div:nth-child(4) { border-left: 0; padding-left: 0; }
  .glance-grid div:nth-child(n+4) { padding-top: 20px; }
  .glance-grid div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .expertise { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expertise .service, .expertise .service:nth-child(n+4) { grid-column: span 1; }
  .expertise .service:last-child { grid-column: 1 / -1; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1060px) {
  .nav-toggle { display: block; }
  #navMenu {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 16px 18px; background: var(--night); border-bottom: 1px solid var(--night-line);
    display: none;
  }
  #navMenu.open { display: flex; }
  #navMenu a.nav-cta { margin: 6px 0 0; text-align: center; }
  .theme-toggle { margin: 8px 0 0; }
}
@media (max-width: 1240px) {
  .hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}
@media (max-width: 960px) {
  .hero { background: radial-gradient(ellipse 90% 40% at 50% 14%, #123a33 0%, rgba(7, 21, 18, 0) 75%), var(--night); }
  .hero-inner { grid-template-columns: 1fr; gap: 0; }
  .hero-figure { order: -1; justify-self: center; width: min(76%, 360px); margin-top: 20px; }
  .hero-text { padding: 8px 0 60px; }
  .hero-text > * { max-width: 640px; }
  .proj-lead { grid-template-columns: 1fr; }
  .proj-lead .proj-media { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .proj-lead .proj-media img { max-height: 520px; margin-inline: auto; }
  .career, .research { grid-template-columns: 1fr; gap: 40px; }
  .work-photo { min-height: 0; aspect-ratio: 4 / 3; }
}
@media (max-width: 760px) {
  .section { padding: 72px 0; }
  .projects { grid-template-columns: 1fr; }
  .proj-lead .proj-body { padding: 26px 22px; }
  .expertise, .skills, .pubs-wrap .pubs { grid-template-columns: 1fr; }
  .expertise .service:last-child { grid-column: auto; }
  .glance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance-grid div { padding: 18px 16px 18px 0; border-left: 0; border-top: 1px solid var(--line); }
  .glance-grid div:nth-child(-n+2) { border-top: 0; }
  .hero-stats { grid-template-columns: 1fr; gap: 14px; }
  .hero-stats div { display: flex; align-items: baseline; gap: 12px; }
  .hero-stats dt { white-space: nowrap; min-width: 3.6em; }
  .hero-stats dd { margin: 0; }
  .more-head { margin-top: 56px; }
  .cards, .work-grid, .edu { grid-template-columns: 1fr; }
  .work-photo { aspect-ratio: 4 / 5; }
  .cta .btn, .contact-links .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
  .metrics li { display: flex; align-items: baseline; gap: 10px; }
}
