:root {
  --bg: #FAFAF8;
  --ink: #1A1A1A;
  --text: #2B2B2B;
  --muted: #6B6B66;
  --line: #E6E4DF;
  --accent: #2F6FEB;
  --card: #FFFFFF;
  --max: 960px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; letter-spacing: -0.01em; margin-bottom: 1.2em; }
h3 { font-size: 1.1rem; }

.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--max); margin: 0 auto; padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
}
.brand { font-weight: 700; color: var(--ink); }
.nav nav a { color: var(--text); margin-left: 24px; font-size: .95rem; }

main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; border-top: 1px solid var(--line); }
section.hero { border-top: 0; padding: 96px 0 80px; }

.eyebrow, .tag { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 1em; }
.lead { font-size: 1.2rem; max-width: 40em; color: var(--text); }
.cta { margin-top: 2em; display: flex; gap: 12px; flex-wrap: wrap; }
.button {
  display: inline-block; padding: 12px 22px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-weight: 600;
}
.button:hover { text-decoration: none; background: var(--accent); }
.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button.ghost:hover { border-color: var(--ink); background: transparent; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card p:not(.tag) { margin: 0 0 1em; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline p { margin: 0; }
.when { color: var(--muted); font-size: .95rem; padding-top: 2px; }

.links { list-style: none; padding: 0; margin: 1.5em 0 0; display: flex; gap: 24px; flex-wrap: wrap; font-weight: 600; }

footer { max-width: var(--max); margin: 0 auto; padding: 40px 24px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .nav nav a { margin-left: 14px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  section { padding: 56px 0; }
}

/* ---- photos & layout additions ---- */
.cover {
  height: 38vh; min-height: 220px; max-height: 420px;
  background: #0b1220 url("img/cover-medra.jpg") center 35% / cover no-repeat;
}
section.hero { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: center; padding: 64px 0 72px; }
.headshot { width: 200px; height: 240px; object-fit: cover; border-radius: 14px; margin-top: -120px; border: 4px solid var(--bg); box-shadow: 0 6px 24px rgba(0,0,0,.12); }
h2.sub { margin-top: 64px; }
.role { display: block; font-weight: 500; color: var(--muted); font-size: .98rem; margin-top: 2px; }
.where { color: var(--muted); font-size: .92rem; margin: 0 0 .4em !important; }
.timeline p + p { margin-top: .2em; }
.card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--line); }
.card .body { padding: 20px 22px 24px; }
.card .body p { font-size: .95rem; }
.grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
footer { line-height: 1.5; }

@media (max-width: 640px) {
  section.hero { grid-template-columns: 1fr; gap: 20px; padding-top: 40px; }
  .headshot { width: 150px; height: 180px; margin-top: -110px; }
  .nav nav a { margin-left: 12px; font-size: .9rem; }
}

/* ---- clickable experience tiles ---- */
a.tile { color: inherit; text-decoration: none; }
a.tile:hover { text-decoration: none; }
a.tile .more { color: var(--accent); font-weight: 600; font-size: .95rem; margin-top: auto; padding: 0 22px 22px; }
a.tile .body { padding-bottom: 12px; }
a.tile:hover h3 { color: var(--accent); }
.tile .when-tag { color: var(--muted); font-size: .88rem; margin: -.3em 0 .6em; }
.placeholder {
  aspect-ratio: 4 / 3; display: grid; place-items: center;
  background: linear-gradient(135deg, #1f2a44, #2F6FEB); color: #fff;
  font-size: 1.9rem; font-weight: 700; letter-spacing: .02em;
}
.placeholder.alt { background: linear-gradient(135deg, #12343b, #2b7a78); }
.card video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #000; }

/* ---- detail pages ---- */
.banner { height: 30vh; min-height: 200px; max-height: 360px; background: #0b1220 center / cover no-repeat; }
.page-head { padding: 48px 0 8px; border-top: 0; }
.back { display: inline-block; margin-bottom: 1.2em; font-weight: 600; }
.page-head h1 { margin-bottom: .2em; }
.meta { color: var(--muted); margin: 0 0 1.4em; }
.prose { max-width: 44em; }
.prose p { margin: 0 0 1em; }
.block { padding: 40px 0; }
.block h2 { margin-bottom: .6em; }
.block h3.sub-role { color: var(--muted); font-weight: 500; margin-top: -.4em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.gallery figure { margin: 0; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--line); }
.gallery figcaption { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.next { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-weight: 600; }

.grid.small { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* ---- lightbox: click a photo to see it larger ---- */
.gallery img { cursor: zoom-in; }
.gallery img:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
body.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, .92); padding: 56px 64px 24px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 6px; display: block; }
.lightbox figcaption { color: #d8d8d4; font-size: .95rem; margin-top: 12px; text-align: center; max-width: 48em; cursor: auto; }
.lightbox figcaption a { color: #8fb4ff; }
.lightbox button {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0;
  width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(255,255,255,.28); outline: none; }
.lightbox button[hidden] { display: none; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox { padding: 56px 8px 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
  .lightbox img { max-height: calc(100vh - 200px); }
}
.banner[role="button"] { cursor: zoom-in; }
.banner[role="button"]:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.timeline .loc { display: block; font-size: .9rem; margin-top: 2px; }
