/* ---------- tokens ---------- */
:root {
  --ink: #2b2e33;        /* page background */
  --ink-2: #24272b;      /* header, footer, lightbox */
  --line: #3b3f46;       /* rules */
  --teal: #3f9a9a;       /* portrait background, matches the image */
  --teal-bright: #7fd6d2;/* links, accents, caret */
  --text: #e9ecef;
  --muted: #a7aeb6;
  --panel: clamp(280px, 34vw, 560px);
  --gutter: clamp(20px, 5vw, 72px);
  --measure: 62ch;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.7;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--teal-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 3px; }
h1, h2, h3 { font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--teal-bright); color: var(--ink); padding: 8px 14px; border-radius: 6px; font-weight: 500;
}
.skip:focus { top: 12px; }

/* ---------- layout: portrait left, page right ---------- */
.layout { display: grid; grid-template-columns: var(--panel) 1fr; min-height: 100vh; }

.portrait {
  position: sticky; top: 0; height: 100vh;
  background: var(--teal);
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

.page { min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--ink-2) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 500; white-space: nowrap; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 22px; margin-left: auto; }
.top nav a { color: var(--muted); font-weight: 400; font-size: 0.95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--text); text-decoration: none; }
.top nav a[aria-current="true"] { color: var(--text); border-bottom-color: var(--teal-bright); }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 999px;
  background: var(--teal-bright); color: var(--ink);
  font-weight: 500; font-size: 0.95rem; letter-spacing: 0.01em;
  border: 2px solid var(--teal-bright);
  transition: background 150ms ease, color 150ms ease;
}
.button:hover { text-decoration: none; background: #a3e5e1; border-color: #a3e5e1; }
.button-outline { background: transparent; color: var(--teal-bright); }
.button-outline:hover { background: color-mix(in srgb, var(--teal-bright) 14%, transparent); border-color: var(--teal-bright); }
.cv { padding: 9px 18px; font-size: 0.9rem; white-space: nowrap; }

/* ---------- hero ---------- */
.hero {
  padding: clamp(56px, 12vh, 140px) var(--gutter) clamp(48px, 8vh, 96px);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(3.2rem, 7.5vw, 6rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.role {
  margin-top: 22px;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 400;
  color: var(--teal-bright);
  min-height: 1.6em;
}
.caret {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 4px; vertical-align: -0.15em;
  background: var(--teal-bright);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
.lede { margin-top: 28px; max-width: 40ch; font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 400; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 9vh, 104px) var(--gutter); border-bottom: 1px solid var(--line); }
.section h2 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -0.02em; margin-bottom: 40px; }
.section-note { color: var(--muted); margin: -24px 0 32px; max-width: var(--measure); }

/* work */
.job {
  display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 36px;
  padding: 36px 0; border-top: 1px solid var(--line);
}
.job:last-child { padding-bottom: 0; }
.job-brand { display: flex; flex-direction: column; gap: 18px; }
.job-brand .logo { width: min(100%, 220px); height: auto; }
.job-brand .product { width: min(100%, 240px); height: auto; }
.job-brand .product-tall { width: min(100%, 160px); }
.job-body h3 { font-size: 1.35rem; margin-bottom: 14px; }
.job-body h3 span { display: block; font-weight: 400; color: var(--muted); font-size: 1rem; margin-top: 4px; }
.job-body ul { list-style: none; max-width: var(--measure); }
.job-body li { position: relative; padding-left: 22px; margin-bottom: 10px; }
.job-body li::before {
  content: ""; position: absolute; left: 0; top: 0.75em;
  width: 10px; height: 2px; background: var(--teal-bright);
}

/* timelines (education, early career): years are the markers because the content is chronological */
.timeline { list-style: none; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 36px 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 0.55em;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--teal-bright);
}
.timeline time { display: block; color: var(--teal-bright); font-size: 0.9rem; font-weight: 500; margin-bottom: 6px; }
.timeline h3 { font-size: 1.2rem; margin-bottom: 8px; }
.timeline p { max-width: var(--measure); color: #d4d8dd; }

/* interests */
.interests { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 40px; margin: 0; max-width: 60rem; }
.interests dt { font-weight: 500; font-size: 1.1rem; margin-bottom: 4px; }
.interests dd { margin: 0; color: var(--muted); }

/* portfolio tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile {
  position: relative; display: block; padding: 0; margin: 0;
  border: 0; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--ink-2); color: var(--text); font: inherit; text-align: left;
  aspect-ratio: 4 / 3;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }
.tile-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 36px 16px 14px;
  background: linear-gradient(to top, rgba(20, 22, 25, 0.9), rgba(20, 22, 25, 0));
  font-weight: 500; font-size: 1.05rem; line-height: 1.3;
}
.tile-label small { display: block; font-weight: 300; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

/* contact */
.contact { border-bottom: 0; }
.contact-lede { color: var(--muted); max-width: var(--measure); }
.contact-email { margin-top: 18px; }
.contact-email a { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -0.01em; word-break: break-all; }
.contact-links { list-style: none; display: flex; flex-wrap: wrap; gap: 24px; margin-top: 28px; }
.contact-links a { font-weight: 400; }

.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9rem;
}

/* ---------- lightbox ---------- */
.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(24, 26, 29, 0.97); color: var(--text);
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-top { display: flex; align-items: center; gap: 16px; padding: 14px 20px; }
.lb-title { font-weight: 500; }
.lb-count { color: var(--muted); font-size: 0.9rem; }
.lb-close, .lb-nav {
  background: transparent; border: 0; color: var(--text); cursor: pointer;
  font: inherit; line-height: 1; border-radius: 50%;
}
.lb-close { margin-left: auto; font-size: 2rem; width: 44px; height: 44px; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.1); }
.lb-stage {
  flex: 1; min-height: 0; margin: 0; position: relative;
  display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 0 64px 16px;
}
.lb-img { max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain; border-radius: 4px; }
.lb-img.loading { opacity: 0.4; }
.lb-caption { color: var(--muted); font-size: 0.95rem; padding-top: 12px; text-align: center; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 2.4rem; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .brand span { display: none; }
  .top { gap: 18px; }
  .top nav { gap: 16px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .portrait { position: relative; height: min(70vw, 420px); }
  .portrait img { object-position: center 20%; }
  .top { padding: 10px var(--gutter); gap: 16px; }
  .top nav { gap: 16px; overflow-x: auto; }
  .cv { display: none; }
  .hero { padding-top: 48px; }
  .job { grid-template-columns: 1fr; gap: 20px; }
  .job-brand { flex-direction: row; align-items: center; gap: 24px; }
  .job-brand .logo { width: 150px; }
  .job-brand .product { width: 120px; }
  .job-brand .product-tall { width: 80px; }
  .lb-stage { padding: 0 8px 12px; }
  .lb-nav { width: 40px; height: 40px; background: rgba(0, 0, 0, 0.35); }
}
@media (max-width: 520px) {
  .top { gap: 12px; padding-left: 16px; padding-right: 16px; }
  .brand img { width: 32px; height: 32px; }
  .top nav { margin-left: 0; gap: 14px; }
  .top nav a { font-size: 0.9rem; }
}
