/* Design system in one line: tokens (:root) > type roles (.h2 .h2m .display .eyebrow .lead) > patterns (.bar/.topbar, .cover, .pcover, .cards/.card, .row/.block/.split/.slider, .rules, .tabs, .edgrid, .upnext, .contact).
   Leonaldo Jovian portfolio.
   One look, taken from the PDF: charcoal and off-white, a very light grotesque, slash labels, hairline rules, arrow links.
   Accessibility notes live next to the rules they belong to (contrast, target size, motion, focus). */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 200 400;
  font-display: swap;
  src: url(/assets/inter-tight-latin.4179443c.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f9f9f9;
  --ink: #0d0d0d;
  --grey: #626262;            /* 5.8:1 on paper (the PDF's #8f8f8f is only 3.1:1) */
  --rule: #cfcfcf;
  --charcoal: #292929;
  --on-dark: #f4f4f4;
  --on-dark-grey: #a8a8a8;    /* 6.1:1 on charcoal */
  --rule-dark: #4a4a4a;
  --surface: #e9e9e7;        /* image placeholders on paper */
  --surface-dark: #1d1d1d;   /* image placeholders on charcoal */
  --ctl-bg: rgba(17,17,17,.8); /* controls sitting on photographs */
  --font: "Inter Tight", "Neue Montreal", "Helvetica Neue", Arial, sans-serif;
  --gutter: max(clamp(16px, 2.6vw, 40px), env(safe-area-inset-left, 0px));
  --gutter-r: max(clamp(16px, 2.6vw, 40px), env(safe-area-inset-right, 0px));
  --indent: 80px;             /* the PDF's margin column: monogram (56) + gap (24) */
  --max: 1400px;
  --ease: cubic-bezier(.7, 0, .2, 1);          /* ease-in-out: things moving across the screen */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);    /* entrances, hovers, presses */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1); /* the cover curtain */
}
@media (max-width: 760px) { :root { --indent: 0px; } }

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 300 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
::selection { background: var(--ink); color: var(--paper); }
.dark ::selection { background: var(--on-dark); color: var(--charcoal); }

main:focus { outline: none; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--gutter); top: 12px; z-index: 100; padding: 12px 18px; background: #fff; color: #0d0d0d; font-size: 15px; border: 2px solid #0d0d0d; transform: translateY(-300%); }
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; }
.indent { padding-left: var(--indent); }
.dark { background: var(--charcoal); color: var(--on-dark); }
.grey { color: var(--grey); }
.dark .grey { color: var(--on-dark-grey); }
.eyebrow { font-size: 15px; line-height: 1.3; color: var(--grey); }
.dark .eyebrow { color: var(--on-dark-grey); }
.h2 { font-weight: 200; letter-spacing: -.025em; line-height: 1; font-size: clamp(40px, 6vw, 80px); text-wrap: balance; }
.h2m { font-weight: 200; letter-spacing: -.022em; line-height: 1.04; font-size: clamp(32px, 4.6vw, 60px); text-wrap: balance; }
.sub { margin-top: 18px; font-size: 18px; }

/* ---------- arrows (inline SVG, so they never fall back to another font) ---------- */
.ar { display: inline-block; width: 1em; height: 1em; flex: none; vertical-align: -.14em; overflow: visible; transition: transform 200ms var(--ease-out); }
.ar path { stroke-width: var(--arw, 1.4); }

/* ---------- links: arrow links keep the PDF's "click anything with an arrow" rule.
   The padding / negative margin gives a 44px tall hit area without changing the layout. ---------- */
.lk { display: inline-flex; align-items: center; gap: .4em; padding-block: 12px; margin-block: -12px; text-underline-offset: .28em; text-decoration-thickness: 1px; }
.lk:hover, .lk:focus-visible { text-decoration-line: underline; }
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .lk:hover .ar-r, .go-big:hover .ar-r, .next-link:hover .ar-r, .huge:hover .ar-r, .card:hover .ar-r { transform: translateX(4px); }
  .lk:hover .ar-l { transform: translateX(-4px); }
  .lk:hover .ar-d, .go-big:hover .ar-d { transform: translateY(4px); }
  .lk:hover .ar-u { transform: translateY(-4px); }
}

/* ---------- top bar (repeats on every "slide", like the PDF) ---------- */
.bar { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; column-gap: 24px; row-gap: 6px; align-items: start; }
.bar .mono { display: block; width: fit-content; padding: 6px; margin: -6px; }
.bar .mono svg { display: block; width: 38px; height: 33px; fill: currentColor; }
.bar .meta { font-size: 14px; line-height: 1.35; color: var(--grey); }
.bar .meta span { display: block; }
.dark .bar .meta { color: var(--on-dark-grey); }
/* text sits on photographs of any brightness: heavier weight, near-white, and a soft shadow on top of the scrim */
.pcover .bar, .pcover .eyebrow, .pcover .cue { font-weight: 400; text-shadow: 0 0 14px rgba(0,0,0,.55); }
.pcover .bar .meta, .pcover .bar .avail { color: rgba(250,250,250,.94); }
.bar .r { justify-self: end; display: grid; gap: 2px; justify-items: end; text-align: right; font-size: 15px; line-height: 1.35; }
.bar .avail { font-size: 14px; color: var(--grey); }
.dark .bar .avail { color: var(--on-dark-grey); }
.bar .links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 28px; }
@media (max-width: 760px) {
  .bar { grid-template-columns: 44px minmax(0, 1fr); }
  .bar .r { grid-column: 1 / -1; justify-self: start; justify-items: start; text-align: left; margin-top: 12px; }
  .bar .links { justify-content: flex-start; }
}

/* ---------- home cover: video, locked, opens onto the highlights ---------- */
.cover { position: relative; isolation: isolate; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-height: 100vh; min-height: 100svh; padding: 28px var(--gutter-r) 28px var(--gutter); background: #000; color: var(--on-dark); overflow: hidden; }
.cover > :not(.cover-media):not(.trail) { width: 100%; max-width: var(--max); margin-inline: auto; }
.cover-media { position: absolute; inset: 0; z-index: -2; background: #000; overflow: hidden; }
.cover-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* the monogram sits in the middle of the frame, so slide it right to leave the left for the title */
@media (min-aspect-ratio: 8/5) { .cover-media video { transform: translateX(24%); } }
@media (max-aspect-ratio: 8/5) and (min-aspect-ratio: 1/1) { .cover-media video { transform: translateX(12%); } }
/* portrait: the monogram sits right of the three-line title, a little larger than the screen, like a figure behind it */
@media (max-aspect-ratio: 1/1) {
  .cover-media video { inset: auto; top: 21%; left: 18vw; width: 105vw; max-width: none; height: auto; aspect-ratio: 16 / 9; object-fit: contain; transform: none; }
}
@media (max-aspect-ratio: 1/1) and (max-width: 600px) { .cover-media video { top: 23%; left: 0; width: 150vw; } }
.cover::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,0) 50%), linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,0) 22%), linear-gradient(0deg, rgba(0,0,0,.55), rgba(0,0,0,0) 32%); }
.cover-title { align-self: end; padding-top: 32px; }
.cover-title .eyebrow { margin-bottom: 14px; }
.cover .display { text-shadow: 0 0 28px rgba(0,0,0,.55); }
.display { font-weight: 200; letter-spacing: -.03em; line-height: .96; font-size: clamp(44px, min(8vw, 14svh), 132px); }
.enter { display: grid; justify-items: start; gap: 6px; margin-top: clamp(22px, 5svh, 56px); }
.go-big { display: inline-flex; align-items: center; gap: .35em; padding: 10px 0 12px; border-bottom: 1px solid rgba(244,244,244,.5); font-size: clamp(30px, 3.6vw, 48px); font-weight: 200; letter-spacing: -.02em; line-height: 1; transition: border-color .3s; }
.go-big:hover, .go-big:focus-visible { border-bottom-color: #fff; }
.go-big .ar { width: .8em; height: .8em; }
.cover-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; margin-top: clamp(24px, 6svh, 64px); font-size: 15px; }
.find { display: flex; flex-wrap: wrap; align-items: center; gap: 0 40px; }
.find .grey { padding-block: 12px; }

/* JS on: the cover becomes a fixed curtain and the page behind it is locked (no scrolling, not focusable) until opened.
   Without JS the cover is just a tall first section and the page scrolls normally. */
html.js.has-cover .cover { position: fixed; inset: 0; z-index: 40; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; transition: transform 700ms var(--ease-drawer), visibility 0s linear 0s; }
html.js.has-cover.is-open .cover { transform: translateY(-100%); visibility: hidden; transition: transform 700ms var(--ease-drawer), visibility 0s linear .7s; }
html.js.has-cover:not(.is-open), html.js.has-cover:not(.is-open) body { height: 100%; overflow: hidden; }
html.js.has-cover .after-cover { transition: visibility 0s linear .7s; }
html.js.has-cover:not(.is-open) .after-cover { visibility: hidden; }
html.js.has-cover.is-open .after-cover { visibility: visible; transition: visibility 0s; }
html.no-anim *, html.no-anim *::before, html.no-anim *::after { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  html.js.has-cover .cover, html.js.has-cover.is-open .cover, html.js.has-cover .after-cover { transition: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .cover-title, .enter, .cover-foot { animation: rise .9s var(--ease) both; }
  .enter { animation-delay: .12s; } .cover-foot { animation-delay: .22s; }
  .go-big .ar-d { animation: nudge 1.8s var(--ease) .9s 2; }    /* two nudges, then it stops */
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- highlights ---------- */
.highlights { padding: 28px var(--gutter-r) clamp(72px, 10vw, 140px) var(--gutter); }
.hl-head { margin-top: clamp(48px, 8vw, 104px); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: clamp(36px, 5vw, 64px); }
.card { position: relative; display: grid; gap: 14px; align-content: start; }
.card figure { overflow: hidden; background: var(--surface-dark); aspect-ratio: 5 / 4; }
.card img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter 400ms ease, transform 400ms var(--ease-out); }
.card:focus-within img { filter: none; }
@media (hover: hover) and (pointer: fine) { .card:hover img { filter: none; transform: scale(1.03); } }
@media (hover: none) { .card img { filter: none; } }
@media (prefers-reduced-motion: reduce) { .card img, .card:hover img { transition: none; transform: none; } }
.card-t { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline; }
.card h3 { grid-column: 1; font-weight: 300; font-size: clamp(22px, 2.3vw, 30px); letter-spacing: -.01em; line-height: 1.15; }
.card .type { grid-column: 1; font-size: 16px; color: var(--on-dark-grey); }
.card .go { grid-column: 2; grid-row: 1 / span 2; align-self: end; display: inline-flex; align-items: center; gap: .4em; font-size: 15px; }
.stretch::after { content: ""; position: absolute; inset: 0; }
.stretch:focus-visible { outline: none; }
.stretch:focus-visible::after { outline: 2px solid currentColor; outline-offset: 6px; }

/* ---------- about + services (home) ---------- */
.about, .services { padding: clamp(64px, 9vw, 128px) var(--gutter-r) 0 var(--gutter); }
.services { padding-bottom: clamp(72px, 10vw, 140px); }
.two-tone { margin-top: clamp(26px, 4vw, 44px); max-width: 38ch; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; color: var(--grey); }
.two-tone .ink { color: var(--ink); }
.svc { display: flex; flex-wrap: wrap; gap: 6px 40px; margin-top: clamp(28px, 4vw, 48px); font-weight: 200; letter-spacing: -.02em; line-height: 1.15; font-size: clamp(26px, 3.6vw, 48px); }
.svc sup { position: relative; top: .35em; margin-left: .3em; vertical-align: top; font-size: .3em; font-weight: 300; letter-spacing: 0; color: var(--grey); }
.services .rule { border-top: 1px solid var(--rule); margin-bottom: clamp(40px, 6vw, 72px); }

/* ---------- project pages ---------- */
.pcover { position: relative; isolation: isolate; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 100vh; min-height: 100svh; padding: 28px var(--gutter-r) clamp(24px, 4vw, 48px) var(--gutter); color: #f4f4f4; background: #151515 var(--bg) center / cover no-repeat; }
.pcover::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgba(0,0,0,.74), rgba(0,0,0,.5) 12%, rgba(0,0,0,0) 34%), linear-gradient(to top, rgba(0,0,0,.8), rgba(0,0,0,.42) 36%, rgba(0,0,0,0) 64%); }
.pcover-body { align-self: end; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-top: 48px; }
.pcover-copy { padding-left: var(--indent); }
.pcover .eyebrow { color: rgba(244,244,244,.86); margin-bottom: 12px; }
.ptitle { font-weight: 200; letter-spacing: -.03em; line-height: .98; font-size: clamp(44px, 7.6vw, 116px); text-wrap: balance; }
.ptag { margin-top: 12px; font-weight: 200; letter-spacing: -.01em; font-size: clamp(20px, 2.6vw, 34px); color: rgba(244,244,244,.92); }
.cue { font-size: 15px; }
.overview { padding: clamp(56px, 8vw, 112px) var(--gutter-r) clamp(32px, 5vw, 64px) var(--gutter); }
.lead { margin-top: 14px; max-width: 52ch; font-size: clamp(20px, 2vw, 26px); line-height: 1.45; letter-spacing: -.005em; color: var(--grey); }
.lead .ink { color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 32px; margin-top: clamp(40px, 6vw, 80px); padding-top: 22px; border-top: 1px solid var(--rule); }
.facts dt { margin-bottom: 6px; font-size: 15px; color: var(--grey); }
.facts dd { max-width: 30ch; font-size: 18px; }

/* image run: rows keep each picture's own proportion (flex = aspect ratio), so heights match and nothing is cropped */
.run { background: var(--paper); padding-bottom: 32px; }
.inner2 { display: grid; gap: 14px; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.row { display: flex; gap: 14px; align-items: flex-start; }
.row figure { position: relative; min-width: 0; background: var(--surface); }
.row img, .row video { width: 100%; height: auto; }
.row video { background: var(--surface-dark); }
.block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px 48px; padding-block: clamp(36px, 6vw, 80px); }
.block h2, .split h2 { font-weight: 200; letter-spacing: -.015em; line-height: 1.12; font-size: clamp(24px, 2.8vw, 36px); text-wrap: balance; }
.block .copy { display: grid; gap: 14px; }
.block p { max-width: 60ch; font-size: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 48px; align-items: center; }
.split .copy { display: grid; gap: 14px; padding: 0 clamp(0px, 3vw, 56px); }
.split p { max-width: 52ch; font-size: 18px; }
.sfig { background: var(--surface); }
.sfig img { width: 100%; height: auto; }

/* ---------- sliders ---------- */
.slider { position: relative; background: var(--surface); }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.sld { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: var(--ratio, 16 / 9); }
.sld img { width: 100%; height: 100%; object-fit: cover; }
/* controls sit on images, so they carry their own solid background (7:1 or better for the icon and text) */
.ctl { display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.6); background: var(--ctl-bg); color: #fff; cursor: pointer; }
.ctl:hover { background: rgba(17,17,17,.94); }
.ctl:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(0,0,0,.7); }
.nav { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; }
.nav .ar { width: 20px; height: 20px; --arw: 1.6; }
.prev { left: 14px; } .next { right: 14px; }
.count { position: absolute; left: 14px; bottom: 12px; padding: 3px 10px; font-size: 13px; color: #fff; background: var(--ctl-bg); border-radius: 99px; }
.mt { position: absolute; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 99px; font-size: 13px; line-height: 1; z-index: 2; }
.mt.tr { top: 12px; right: 12px; }
.mt.br { right: 12px; bottom: 12px; }
.mt.fl { position: static; }
.mt .i-play, .mt[data-state="paused"] .i-pause { display: none; }
.mt[data-state="paused"] .i-play { display: block; }

/* ---------- next project + back ---------- */
.upnext { padding: clamp(56px, 8vw, 104px) var(--gutter-r) clamp(56px, 8vw, 104px) var(--gutter); border-top: 1px solid var(--rule); }
.next-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px clamp(24px, 5vw, 72px); align-items: end; }
.next-copy { display: grid; gap: 10px; }
.upnext .type { font-size: 16px; }
.next-t { display: inline-flex; align-items: center; gap: .18em; font-weight: 200; letter-spacing: -.03em; line-height: 1; font-size: clamp(44px, 7vw, 104px); }
.next-t .ar { width: .7em; height: .7em; --arw: 1.1; }
.next-thumb { display: block; overflow: hidden; background: var(--surface); aspect-ratio: 5 / 4; }
.next-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .5s; }
.next-grid:hover .next-thumb img, .next-grid:focus-visible .next-thumb img { filter: none; }
.next-grid:focus-visible { outline-offset: 12px; }
@media (hover: none) { .next-thumb img { filter: none; } }
.back { margin-top: clamp(36px, 5vw, 56px); font-size: 16px; }

/* ---------- contact / footer ---------- */
.contact { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: min(100svh, 900px); padding: clamp(56px, 8vw, 96px) var(--gutter-r) 28px var(--gutter); background: var(--charcoal) var(--bg) center / cover no-repeat; }
.contact::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(20,20,20,.7), rgba(20,20,20,.15)); }
.contact > .wrap { flex: 1; display: grid; grid-template-rows: auto 1fr auto; }
.contact .h2m { font-size: clamp(36px, 5.2vw, 72px); line-height: 1.02; }
.contact-mid { align-self: end; padding-block: clamp(40px, 8vw, 96px) 0; }
.click { margin-bottom: 4px; font-size: 15px; color: var(--on-dark-grey); }
.huge { display: inline-flex; align-items: center; gap: .16em; padding-block: .04em; font-weight: 200; letter-spacing: -.035em; line-height: 1; font-size: clamp(56px, 12.5vw, 190px); }
.huge .ar { width: .6em; height: .6em; --arw: .9; }
.huge:hover, .huge:focus-visible { text-decoration: none; opacity: .85; }
.cfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 40px; margin-top: clamp(32px, 6vw, 80px); font-size: 15px; }
.cfoot .grey { padding-block: 12px; }
.cfoot .group { display: flex; flex-wrap: wrap; align-items: center; gap: 0 32px; }

/* ---------- 404 ---------- */
.nf { min-height: 100svh; padding: 28px var(--gutter-r) 56px var(--gutter); }
.nf .body { padding-top: clamp(80px, 18vw, 220px); }

/* ---------- small screens ---------- */
@media (max-width: 920px) {
  .block, .split, .next-grid { grid-template-columns: minmax(0, 1fr); }
  .row { flex-wrap: wrap; }
  .row figure { flex: 1 1 100% !important; }
  .split .copy { padding: 0; }
}
@media (max-width: 760px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .contact { min-height: 0; }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .nav { width: 40px; height: 40px; margin-top: -20px; }
}

/* ---------- no JS: hide controls that need it ---------- */
html:not(.js) .nav, html:not(.js) .mt, html:not(.js) .count { display: none; }

/* ---------- Windows high contrast ---------- */
@media (forced-colors: active) {
  .ctl { border-color: ButtonText; background: ButtonFace; color: ButtonText; }
  .go-big { border-bottom-color: LinkText; }
  .card figure, .next-thumb { border: 1px solid CanvasText; }
}

/* ---------- sticky header bar on a dark grey box; compact on phones ---------- */
.topbar { position: sticky; top: 0; z-index: 30; padding: 14px var(--gutter-r) 14px var(--gutter); background: var(--charcoal); border-bottom: 1px solid var(--rule-dark); }
.topbar .bar { align-items: center; }
.topbar .bar .mono svg { width: 32px; height: 28px; }
html { scroll-padding-top: 80px; }
@media (max-width: 760px) {
  .topbar { padding-block: 8px; }
  .topbar .bar { grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: 12px; }
  .topbar .bar .mono svg { width: 26px; height: 23px; }
  .topbar .bar .meta { font-size: 13px; }
  .topbar .bar .r { grid-column: auto; justify-self: end; justify-items: end; text-align: right; margin-top: 0; }
  .topbar .bar .avail { display: none; }
  .topbar .bar .links { justify-content: flex-end; gap: 0 16px; font-size: 14px; }
  html { scroll-padding-top: 56px; }
}

/* ---------- v6 additions ---------- */
.topbar { padding-block: 22px; }
@media (max-width: 760px) { .topbar { padding-block: 14px; } }
@media (max-width: 480px) { .topbar .bar .meta { display: none; } .topbar .bar { grid-template-columns: 32px minmax(0, 1fr); } }
.pcover { grid-template-rows: minmax(0, 1fr); min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.more { margin-top: clamp(32px, 4vw, 56px); font-size: 18px; }
.more .lk { font-size: 20px; }
/* rule lists (skills, experience): hairlines with "/ 01" indices in the margin, as in the PDF */
.rules { border-top: 1px solid var(--rule); margin-top: clamp(24px, 4vw, 44px); }
.rules li { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .8fr) minmax(0, 1.4fr); gap: 4px 24px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.rules .ix { position: absolute; left: calc(-1 * var(--indent)); top: 18px; color: var(--grey); font-size: 14px; }
.rules .nm { font-size: clamp(18px, 1.6vw, 22px); font-weight: 300; }
.rules .nm a { display: inline-flex; align-items: center; gap: .4em; }
.rules .sm { color: var(--grey); font-size: 15px; }
.rules .sub2 { display: block; color: var(--grey); font-size: 15px; margin-top: 2px; }
@media (max-width: 760px) { .rules li { grid-template-columns: minmax(0, 1fr); gap: 2px; } .rules .ix { position: static; } }
.pg { padding: clamp(40px, 6vw, 80px) var(--gutter-r) clamp(24px, 4vw, 56px) var(--gutter); }
.pg + .pg { padding-top: clamp(32px, 5vw, 64px); }
.edgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); margin-top: clamp(32px, 5vw, 64px); }
.edcard { position: relative; display: grid; grid-template-rows: auto auto; gap: 14px; align-content: start; }
.edcard figure { display: flex; align-items: flex-end; justify-content: center; height: 380px; padding: 24px; background: var(--surface); }
.edcard img { max-height: 320px; width: auto; max-width: 100%; box-shadow: 0 8px 28px rgba(0,0,0,.15); }
.edcard h3 { font-weight: 300; font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.01em; line-height: 1.15; }
.edcard .t { color: var(--grey); font-size: 16px; }
.edcard .go { display: inline-flex; align-items: center; gap: .4em; margin-top: 6px; font-size: 15px; }
@media (max-width: 1000px) { .edgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .edgrid { grid-template-columns: minmax(0, 1fr); } }
/* ---------- v7: menu, about photo, tabs ---------- */

.topbar .bar .links { gap: 0 clamp(14px, 2.2vw, 28px); }
.aboutgrid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.aphoto { background: #eceeed; }
.aphoto img { width: 100%; height: auto; }
.edu { margin-top: 6px; font-weight: 300; font-size: clamp(20px, 2vw, 26px); letter-spacing: -.01em; line-height: 1.3; max-width: 28ch; }
@media (max-width: 760px) { .aboutgrid { grid-template-columns: minmax(0, 1fr); } .aphoto { max-width: 420px; } }
[role="tablist"] { display: flex; gap: 8px; border-bottom: 1px solid var(--rule); }
[role="tab"] { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 14px 4px; min-height: 44px; margin-right: 24px; cursor: pointer; font-size: clamp(22px, 2.4vw, 32px); font-weight: 200; letter-spacing: -.015em; color: var(--grey); }
[role="tab"]:hover { color: var(--ink); }
[role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
[role="tabpanel"]:focus-visible { outline-offset: 8px; }
html:not(.js) [role="tablist"] { display: none; }
html:not(.js) [role="tabpanel"] + [role="tabpanel"] { margin-top: 56px; }
/* ---------- v8: centred menu, last-section room, tab motion, cover hover trail ---------- */
.topbar .bar.bar3 { grid-template-columns: 1fr auto 1fr; align-items: center; }
.bar3 .brand { display: flex; align-items: center; gap: 24px; min-width: 0; }
.bar3 .menu { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
.topbar .bar.bar3 .r { grid-column: auto; justify-self: end; justify-items: end; text-align: right; margin-top: 0; }
@media (max-width: 480px) {
  .topbar .bar.bar3 { grid-template-columns: auto 1fr auto; column-gap: 10px; }
  .bar3 .menu { justify-content: center; gap: 14px; font-size: 14px; }
  .bar3 .brand { gap: 0; }
}
main > .pg:last-child { padding-bottom: clamp(88px, 11vw, 160px); }
[role="tab"] { transition: color .25s ease, border-color .25s ease, transform 160ms var(--ease-out); }
@media (prefers-reduced-motion: no-preference) {
  html.js [role="tabpanel"]:not([hidden]) { animation: tabin 250ms var(--ease-out) both; }
  .tabs[data-instant] [role="tabpanel"] { animation: none; }   /* keyboard tab changes stay instant */
}
@keyframes tabin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.trail { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.trail-img { position: absolute; width: clamp(150px, 15vw, 230px); height: auto; opacity: 0; transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(.92); transition: opacity .35s ease, transform 500ms var(--ease-out); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.trail-img.in { opacity: .9; transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1); }
.trail-img.out { opacity: 0; transition: opacity .6s ease; }
/* ---------- v9: one header from cover to last page; scroll cue; full-display next project ---------- */
.topbar { z-index: 60; }
.cover { grid-template-rows: minmax(0, 1fr) auto; }
html.js.has-cover .cover { padding-top: 104px; }
html.js.has-cover .topbar { transition: background-color .7s var(--ease), border-color .7s var(--ease); }
html.js.has-cover:not(.is-open) .topbar { background: transparent; border-bottom-color: transparent; }
.cover-foot { margin-top: clamp(24px, 5svh, 56px); }
.cue { font-size: 15px; }
.topbar .bar.bar3 .r { display: flex; align-items: center; gap: 20px; }
.topbar .bar.bar3 .r > p { margin: 0; }
@media (max-width: 1100px) { .topbar .bar.bar3 .avail { display: none; } }
.upnext { position: relative; isolation: isolate; display: grid; align-content: end; min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); padding: 96px var(--gutter-r) clamp(32px, 5vw, 64px) var(--gutter); border-top: 0; background: #151515 var(--bg) center / cover no-repeat; color: #f4f4f4; }
.upnext::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.45) 45%, rgba(0,0,0,.2)); }
.upnext .next-grid { display: block; }
.upnext .next-grid::after { content: ""; position: absolute; inset: 0; }
.upnext .next-grid:focus-visible { outline: none; }
.upnext .next-grid:focus-visible::after { outline: 2px solid #fff; outline-offset: -8px; }
.upnext .next-t { font-size: clamp(52px, 10vw, 150px); }
.upnext .eyebrow, .upnext .type { color: rgba(244,244,244,.88); font-weight: 400; }
.upnext .type { font-size: clamp(18px, 2vw, 26px); font-weight: 200; }
.upnext .back { position: relative; z-index: 2; margin-top: clamp(28px, 4vw, 48px); }
[tabindex="-1"]:focus { outline: none; }
/* ---------- v10: work hub ---------- */
.wgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px) clamp(20px, 3vw, 40px); margin-top: clamp(28px, 4vw, 48px); }
.wcard { position: relative; display: grid; gap: 4px; align-content: start; }
.wcard figure { overflow: hidden; background: var(--surface); aspect-ratio: 5 / 4; margin-bottom: 10px; }
.wcard img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter 400ms ease, transform 400ms var(--ease-out); }
.wcard:focus-within img { filter: none; }
@media (hover: hover) and (pointer: fine) { .wcard:hover img { filter: none; transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .wcard img, .wcard:hover img { transition: none; transform: none; } }
@media (hover: none) { .wcard img { filter: none; } }
.wcard h3 { font-weight: 300; font-size: clamp(20px, 2vw, 26px); letter-spacing: -.01em; line-height: 1.15; }
.wcard .t { color: var(--grey); font-size: 15px; }
.wcard.ph figure, .phbox { display: grid; place-items: center; background: var(--surface); color: var(--grey); font-size: 14px; border: 1px dashed var(--rule); }
.ph-note { margin-top: 24px; }
@media (max-width: 1000px) { .wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .wgrid { grid-template-columns: minmax(0, 1fr); } }
/* ---------- v11: work hub as one page of categories ---------- */
.jump { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 28px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.jump .lk { font-size: clamp(20px, 2.2vw, 28px); font-weight: 200; letter-spacing: -.015em; color: var(--grey); padding-block: 14px; margin-block: 0; }
.jump .lk:hover { color: var(--ink); }
.wsec { padding-top: clamp(48px, 7vw, 96px); }
.wcard.ed img { object-fit: contain; padding: 18px; filter: none; }
/* ---------- v12: full-half portrait with parallax; current page in white, others greyed ---------- */
.topbar .menu .lk { color: var(--on-dark-grey); transition: color .25s; }
.topbar .menu .lk:hover, .topbar .menu .lk:focus-visible { color: #fff; }
.topbar .menu .lk[aria-current="page"] { color: #fff; }
/* ---------- v13: motion polish ---------- */
.ctl { transition: background-color .2s ease, transform 160ms var(--ease-out); }
.ctl:active, [role="tab"]:active { transform: scale(.97); }
.nav:active { transform: scale(.94); }
@media (prefers-reduced-motion: no-preference) {
  html.js.has-cover.is-open .cards .card { animation: cardin 300ms var(--ease-out) both; }
  html.js.has-cover.is-open .cards .card:nth-child(1) { animation-delay: 250ms; }
  html.js.has-cover.is-open .cards .card:nth-child(2) { animation-delay: 300ms; }
  html.js.has-cover.is-open .cards .card:nth-child(3) { animation-delay: 350ms; }
  html.js.has-cover.is-open .cards .card:nth-child(4) { animation-delay: 400ms; }
  html.js.has-cover.is-open .cards .card:nth-child(5) { animation-delay: 450ms; }
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 250ms; animation-timing-function: ease; }
  .topbar { view-transition-name: topbar; }
}
@keyframes cardin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }