:root {
  --ink: #171717;
  --muted: #8996a9;
  --pill: #f1f5f9;
  --line: #e2e8f0;
  --bg: #ffffff;
  --side: 270px;
  --gut: 24px;
  --radius: 12px;
  --font: "Google Sans Flex", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; text-decoration-thickness: .5px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 16px; height: 16px; flex: none; }
.muted { color: var(--muted); }
.u { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: .5px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 24px 24px 32px 64px;
}
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--pill); }
.latest { margin-top: 40px; }
.latest-label { font-size: 10px; line-height: 14px; letter-spacing: .2px; color: var(--muted); margin-bottom: 9px; }
.latest li { margin-bottom: 8px; }
.latest a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: .5px; text-decoration-color: rgba(23,23,23,.5); transition: text-decoration-color .2s; }
.latest a:hover { text-decoration-color: var(--ink); }
.year { font-size: 12px; line-height: 16px; letter-spacing: .2px; color: var(--muted); margin-left: 4px; }
.side-nav { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-nav a { color: var(--muted); transition: color .2s; }
.side-nav a:hover, .side-nav a[aria-current="page"] { color: var(--ink); }

.main { padding: 0 var(--gut); min-width: 0; }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 2fr 1fr auto; align-items: start;
  padding: 28px 0 20px;
  background: linear-gradient(var(--bg) 78%, rgba(255,255,255,0));
}
.hero { font-size: 24px; line-height: 32px; font-weight: 300; }
.hero span { display: block; }
.hero-sub { transition: opacity .35s ease, transform .35s ease; }
.is-scrolled .hero-sub { opacity: 0; transform: translateY(-6px); }

.clock { display: flex; align-items: center; gap: 8px; padding-top: 6px; white-space: nowrap; }
.clock-time { font-variant-numeric: tabular-nums; letter-spacing: .4px; }
.clock-zone { color: var(--muted); }
.spinner { width: 14px; height: 14px; color: var(--muted); }

/* Spinner ticks light up one at a time, clockwise, like a clock hand (1 tick per second) */
.ticker path { stroke: var(--tick-off, #d3dae4); animation: tick-on 8s step-end infinite; }
.ticker path:nth-child(2) { animation-delay: 1s; }
.ticker path:nth-child(3) { animation-delay: 2s; }
.ticker path:nth-child(4) { animation-delay: 3s; }
.ticker path:nth-child(5) { animation-delay: 4s; }
.ticker path:nth-child(6) { animation-delay: 5s; }
.ticker path:nth-child(7) { animation-delay: 6s; }
.ticker path:nth-child(8) { animation-delay: 7s; }
@keyframes tick-on { 0% { stroke: var(--ink); } 12.5% { stroke: var(--tick-off, #d3dae4); } }
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 12px; border-radius: 9999px;
  background: var(--pill); color: var(--ink);
  transition: transform .2s ease, background-color .2s;
}
.btn:hover { background: #e7edf4; }
.btn:active { transform: scale(.97); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2b2b2b; }
.btn .icon { width: 18px; height: 18px; }

/* ---------- Work grid ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 8px 0 28px; scroll-margin-top: 120px; }
.tab {
  position: relative; padding: 4px 0;
  font-size: 18px; line-height: 26px; font-weight: 300; color: var(--muted);
  transition: color .2s;
}
.tab sup { font-size: 10px; line-height: 0; margin-left: 3px; vertical-align: super; font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.tab[aria-selected="true"]::after { transform: scaleX(1); }
/* ---------- Offline (Instagram) ---------- */

.ig-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; padding: 8px 0 32px; }
.ig-avatar { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; background: var(--pill); padding: 3px; box-shadow: 0 0 0 1px var(--line); display: block; }
.ig-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ig-info { min-width: 0; }
.ig-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.ig-user { font-size: 20px; line-height: 28px; }
.ig-follow { height: 32px; padding: 0 16px; }
.ig-stats { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 14px; }
.ig-stats strong { font-weight: 400; font-variant-numeric: tabular-nums; }
.ig-name { margin-top: 14px; font-weight: 400; }
.ig-bio { margin-top: 2px; white-space: pre-line; max-width: 52ch; }
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.ig-tile { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--pill); }
.ig-tile img { width: 100%; height: 100%; object-fit: cover; }
.ig-badge { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.ig-badge svg { width: 100%; height: 100%; }
.ig-hover {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 24px;
  background: rgba(0,0,0,.32); color: #fff; font-weight: 400; opacity: 0; transition: opacity .2s ease;
}
.ig-hover > span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ig-hover svg { width: 18px; height: 18px; }
.ig-all { display: flex; justify-content: center; margin-top: 24px; }
.ig-tile:hover .ig-hover, .ig-tile:focus-visible .ig-hover { opacity: 1; }
.panel-intro { color: var(--muted); margin: -12px 0 20px; max-width: 52ch; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 8px; }
.item { min-width: 0; }
.item.is-new { animation: cardIn .45s ease both; }
.caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; line-height: 18px; }
.card {
  position: relative; aspect-ratio: 557 / 418;
  border-radius: var(--radius); overflow: hidden; background: var(--pill);
}
.card > video, .card > img { width: 100%; height: 100%; object-fit: cover; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.details {
  position: absolute; left: 50%; bottom: 16px; transform: translate(-50%, 6px);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 80px;
  background: linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.48));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 2px 10px rgba(15,23,42,.08);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.details .icon { width: 14px; height: 14px; }
.card:hover .details, .details:focus-visible { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .details { opacity: 1; transform: translate(-50%, 0); } }

.load-more { display: flex; justify-content: center; margin-top: 32px; }
.load-more[hidden] { display: none; }
.empty { grid-column: 1 / -1; padding: 64px 0; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Works grid (Instagram-style) ---------- */
.ig-grid--works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ig-tile--work { aspect-ratio: 557 / 418; border: 0; padding: 0; cursor: pointer; font: inherit; text-align: left; }
.ig-tile--work > video, .ig-tile--work > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-tile.is-new { animation: cardIn .45s ease both; }
.ig-hover--work { flex-direction: column; gap: 2px; padding: 16px; text-align: center; background: rgba(0,0,0,.45); }
.ig-hover--work strong { font-weight: 400; font-size: 16px; line-height: 22px; }
.ig-hover--work span { font-size: 13px; opacity: .8; }

/* ---------- Lightbox ---------- */
.lb { width: min(1100px, calc(100vw - 96px)); max-height: calc(100vh - 64px); padding: 0; border: 0; border-radius: 12px; overflow: visible; background: var(--bg); color: var(--ink); }
.lb::backdrop { background: rgba(0,0,0,.72); }
.lb-inner { display: grid; grid-template-columns: minmax(0, 1fr) 280px; max-height: calc(100vh - 64px); border-radius: 12px; overflow: hidden; }
.lb-media { background: #000; display: grid; place-items: center; min-height: 0; }
.lb-media video, .lb-media img { width: 100%; height: 100%; max-height: calc(100vh - 64px); object-fit: contain; display: block; }
.lb-side { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-left: 1px solid var(--line); }
.lb-title { font-size: 20px; line-height: 28px; }
.lb-link { align-self: flex-start; margin-top: 16px; }
.lb-link[hidden] { display: none; }
.lb-count { margin-top: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.lb-btn { position: fixed; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.12); transition: background-color .2s; }
.lb-btn:hover { background: rgba(255,255,255,.24); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-btn[hidden] { display: none; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Case studies index ---------- */
.cs-index { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.cs-preview { position: sticky; top: 140px; padding-top: 4px; }
.cs-pv-period { color: var(--muted); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.cs-pv-card { position: relative; aspect-ratio: 644 / 501; overflow: hidden; background: var(--pill); }
.cs-pv-card img, .cs-pv-card video { width: 100%; height: 100%; object-fit: cover; display: block; animation: pvIn .35s ease both; }
@keyframes pvIn { from { opacity: 0; } to { opacity: 1; } }
.cs-pv-label {
  position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px);
  display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px; border-radius: 0;
  background: linear-gradient(rgba(255,255,255,.86), rgba(255,255,255,.7));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.7); box-shadow: 0 2px 10px rgba(15,23,42,.08);
}
.cs-pv-code { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.cs-pv-title { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-pv-file { margin-top: 12px; font-size: 12px; line-height: 16px; letter-spacing: .02em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-pv-file .cs-caret { opacity: 1; }
.cs-caret { width: 16px; height: 16px; flex: none; }

.cs-rows { display: grid; gap: 4px; }
.cs-item { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.cs-item:last-child { border-bottom: 0; }
.cs-row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) 64px;
  gap: 12px; align-items: center; padding: 12px; transition: background-color .2s;
}
.cs-client { color: var(--muted); }
.cs-name { color: var(--ink); }
.cs-caret, .cs-num, .cs-field, .cs-period { opacity: 0; transition: opacity .2s; color: var(--muted); }
.cs-period { text-align: right; font-variant-numeric: tabular-nums; }
.cs-num { font-variant-numeric: tabular-nums; }
.cs-item.is-active .cs-row { background: var(--pill); }
.cs-item.is-active .cs-row > * { opacity: 1; }
.cs-item.is-active .cs-caret { color: var(--ink); }

.cs-outcome { display: none; margin: 0; padding: 10px 12px 8px 56px; font-size: 15px; line-height: 1.45; color: var(--muted); max-width: 62ch; }
.cs-item.is-active .cs-outcome { display: block; }
.cs-strip { display: none; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: thin; }
.cs-item.is-active .cs-strip { display: flex; }
.cs-shot { flex: none; height: 200px; overflow: hidden; background: var(--pill); }
.cs-shot img { height: 100%; width: auto; display: block; transition: transform .4s ease; }
.cs-shot:hover img { transform: scale(1.03); }

.cs-cursor {
  position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none;
  padding: 6px 12px; border-radius: 0; font-size: 14px; line-height: 20px; white-space: nowrap; color: var(--ink);
  background: linear-gradient(rgba(255,255,255,.86), rgba(255,255,255,.7));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.7); box-shadow: 0 2px 10px rgba(15,23,42,.12);
  opacity: 0; transition: opacity .15s;
}
.cs-cursor.is-on { opacity: 1; }

/* ---------- Case study page (editorial, centered column) ---------- */
.cs-page { --pad: max(24px, 2.2vw); --col-l: 17vw; --col-w: 57.5vw; }
.csp-bar {
  position: fixed; inset: 0 0 auto; z-index: 40; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px var(--pad); background: linear-gradient(var(--bg) 70%, rgba(255,255,255,0));
}
.csp-home { display: inline-flex; align-items: center; gap: 10px; }
.csp-home .avatar { width: 36px; height: 36px; }  /* same height as the buttons */
.csp-bar .clock { padding: 0; position: absolute; left: calc(var(--col-l) + var(--col-w) * .58 + 24px); }  /* lines up with the Role column */
.csp-bar .actions { grid-column: 3; justify-self: end; }
.csp-bar-link:hover, .csp-home:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: .5px; }

.csp { padding: 112px 0 18vh var(--col-l); width: calc(var(--col-l) + var(--col-w)); }  /* bottom room for the fixed "next project" bar */
.csp-head { display: grid; grid-template-columns: 58% 1fr auto; gap: 24px; align-items: start; margin-bottom: 80px; }
.csp-title { font-size: 16px; line-height: 24px; font-weight: 400; }
.csp-desc { margin-top: 12px; color: var(--muted); max-width: 44ch; }
.csp-role h2 { font-size: 16px; line-height: 24px; font-weight: 400; }
.csp-role p { margin-top: 12px; color: var(--muted); }
.csp-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: .5px; }
.csp-link .icon { transition: transform .25s ease; }
.csp-link:hover .icon { transform: translate(2px, 2px); }

.csp-gallery { display: grid; gap: 12px; }
.csp-panel { background: var(--pill); }
.csp-panel img, .csp-panel video { width: 100%; height: auto; display: block; }
.csp-panel--embed { aspect-ratio: 16 / 9; background: #000; }
.csp-panel--embed iframe { width: 100%; height: 100%; border: 0; display: block; }

.csp-rail { position: fixed; top: 112px; right: 9vw; width: 4.8vw; min-width: 64px; height: min(62vh, 560px); overflow: hidden; z-index: 30; cursor: pointer;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent); }
.csp-rail-track { position: relative; display: grid; gap: 3px; padding: calc(min(62vh, 560px) * .14) 0; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.csp-rail-track span { display: block; background: var(--pill); background-size: cover; background-position: center; }
.csp-rail-view { position: absolute; left: 0; right: 0; top: 0; background: none !important; border: 1px solid var(--ink); pointer-events: none; transition: opacity .2s; }

.cs-page .site-footer { margin-top: 96px; }
.cs-page .life { margin: 0; }

.csp-corners { position: fixed; inset: auto 0 0; z-index: 40; display: flex; justify-content: space-between; padding: 16px var(--pad); pointer-events: none; }
.csp-corners a { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--ink);
  background: linear-gradient(rgba(255,255,255,.86), rgba(255,255,255,.7)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.csp-corners a:hover span { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: .5px; }

.ph { color: #a3aec0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 120px; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cta h2 { font-size: 28px; line-height: 32px; font-weight: 300; }
/* "Say helo": hand only with a thin line under it; on hover the hand straightens up
   and the label slides out, the line growing with it (as on the original site). */
.hello { display: inline-flex; align-items: center; height: 40px; font-size: 16px; line-height: 24px; border-bottom: 1px solid #dce4ee; }
.hello .icon { flex: none; width: 28px; height: 28px; margin: 0 6px; transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.hello-label { display: inline-block; max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; filter: blur(2px);
  transition: max-width .45s cubic-bezier(.2,.7,.2,1), opacity .3s ease, filter .3s ease, padding .45s cubic-bezier(.2,.7,.2,1); }
.hello:hover .icon, .hello:focus-visible .icon { transform: rotate(-12deg); }
.hello:hover .hello-label, .hello:focus-visible .hello-label { max-width: 120px; opacity: 1; filter: none; padding: 0 6px 0 4px; }
@keyframes wave { 0%,100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-8deg); } 60% { transform: rotate(10deg); } 80% { transform: rotate(-4deg); } }

.footer-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  margin-top: 28px; padding-bottom: 32px;
}
.socials { display: flex; gap: 8px; }
.socials a {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  display: grid; place-items: center; transition: background-color .2s, border-color .2s;
}
.socials a:hover { background: var(--pill); border-color: var(--pill); }
.socials .icon { width: 15px; height: 15px; }
.quote { color: var(--muted); text-align: center; }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 12px; color: var(--muted); }
.meta a { color: var(--ink); }
.meta a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: .5px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

.life { margin: 0 calc(var(--gut) * -1); overflow: hidden; border-top: 1px solid var(--line); padding-top: 2px; }
.life-track { display: flex; width: max-content; animation: marquee 80s linear infinite; }
.life:hover .life-track { animation-play-state: paused; }
.life-track img { height: 220px; width: auto; object-fit: cover; flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- About ---------- */
.about-intro { margin-top: 48px; max-width: 560px; }
.statement { font-size: 20px; line-height: 30px; }
.about-intro .muted { font-size: 16px; line-height: 28px; margin-top: 32px; }
.contact-list { margin-top: 12px; display: grid; gap: 10px; font-size: 16px; line-height: 24px; }
.contact-list a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: .5px; }
.contact-list a:hover { text-decoration-color: var(--ink); }
.contact-list span { color: var(--muted); margin-left: 6px; }

.portrait { position: relative; margin: 96px 0 0 calc(var(--gut) * -1); width: 290px; aspect-ratio: 580 / 632; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption {
  position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px;
  color: #fff; font-size: 12px; line-height: 16px;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.55));
}

.label { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; letter-spacing: .3px; color: var(--muted); }
.label .icon { width: 12px; height: 12px; }

.approach { margin-top: 96px; max-width: 520px; }
.approach .label { margin-bottom: 32px; }
.approach p { font-size: 18px; line-height: 30px; margin-bottom: 24px; }
.reveal .w { white-space: nowrap; }
.reveal .c { opacity: 0; transition: opacity .18s ease; }
.reveal .c.on { opacity: 1; }
.reveal .c.caret { box-shadow: 2px 0 0 var(--ink); animation: caret 1s steps(1) infinite; }
.is-typing .reveal .c.caret { animation: none; }
@keyframes caret { 50% { box-shadow: 2px 0 0 transparent; } }

.experiences { margin-top: 96px; }
.experiences .label { margin-bottom: 32px; }
.job { display: grid; grid-template-columns: 400px 1fr; align-items: center; padding: 14px 0 22px; }
.job-title { font-size: 16px; line-height: 24px; }
.job-date { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--muted); margin-top: 2px; }
.job-date .icon { width: 12px; height: 12px; }
.job-company { font-size: 16px; line-height: 24px; }
.job-company a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: .5px; }

/* ---------- Mobile top bar + menu (hidden on desktop) ---------- */
.topbar, .menu { display: none; }

@media (max-width: 1100px) {
  .cs-index { grid-template-columns: 1fr; }
  .cs-preview { display: none; }
  .masthead { grid-template-columns: 1fr auto; }
  .masthead .clock { display: none; }
  .job { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 809px) {
  :root { --gut: 20px; }
  .layout { display: block; }
  .sidebar { display: none; }

  .topbar {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px var(--gut); background: var(--bg);
  }
  .topbar .avatar { width: 40px; height: 40px; }
  .topbar .clock { padding: 0; }
  .menu-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
    display: grid; place-items: center;
  }
  .menu-btn .icon { width: 18px; height: 18px; }
  .menu-btn .i-close { display: none; }
  .menu-open .menu-btn .i-close { display: block; }
  .menu-open .menu-btn .i-menu { display: none; }

  .menu {
    position: fixed; inset: 0; z-index: 50; background: var(--bg);
    flex-direction: column; align-items: center; text-align: center;
    padding: 112px var(--gut) 32px; overflow-y: auto;
  }
  .menu-open .menu { display: flex; animation: fadeIn .2s ease; }
  .menu-open { overflow: hidden; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .menu .latest { margin-top: 0; }
  .menu .latest li { font-size: 18px; line-height: 26px; margin-bottom: 10px; }
  .menu-nav { margin-top: auto; display: grid; gap: 12px; font-size: 18px; line-height: 26px; }
  .menu-nav a { color: var(--muted); }
  .menu-nav a[aria-current="page"] { color: var(--ink); }
  .menu-foot { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 56px; }
  .menu-foot .hello { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .menu-copy { margin-top: 32px; color: var(--muted); }

  .masthead { position: static; display: block; padding: 20px 0 0; background: none; }
  .hero { font-size: 28px; line-height: 36px; }
  .is-scrolled .hero-sub { opacity: 1; transform: none; }
  .actions { margin-top: 20px; }
  .btn { height: 40px; font-size: 16px; }
  /* All four tabs on one line; if a screen is too narrow, the row scrolls sideways instead of wrapping */
  .tabs { margin-top: 40px; gap: 18px; scroll-margin-top: 80px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-left: calc(var(--gut) * -1); margin-right: calc(var(--gut) * -1); padding: 0 var(--gut) 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { font-size: 17px; line-height: 26px; flex: none; }
  .cs-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px; }
  .cs-caret, .cs-field { display: none; }
  .cs-num { opacity: 1; color: var(--muted); grid-row: 1 / 3; }
  .cs-client { grid-column: 2; grid-row: 2; font-size: 13px; }
  .cs-name { grid-column: 2; grid-row: 1; font-size: 16px; }
  .cs-period { grid-column: 3; grid-row: 1 / 3; opacity: 1; color: var(--muted); }
  .cs-outcome { padding: 8px 12px 6px 52px; font-size: 14px; }
  .cs-shot { height: 150px; }
  .cs-strip { gap: 8px; margin: 0 calc(var(--gut) * -1); padding: 8px var(--gut); }
  .cs-page { --pad: 20px; }
  .csp-bar { grid-template-columns: 1fr auto; }
  .csp-bar .actions { grid-column: auto; margin-top: 0; }  /* the homepage pushes .actions down on phones; not here */
  .csp-home .avatar { width: 40px; height: 40px; }
  .csp-bar .clock { display: none; }
  .csp { padding: 96px var(--pad) 96px; width: auto; }
  .csp-head { grid-template-columns: 1fr auto; margin-bottom: 40px; }
  .csp-intro { grid-column: 1 / -1; }
  .csp-gallery { gap: 8px; }
  .csp-rail { display: none; }

  .grid { grid-template-columns: 1fr; }
  .ig-head { grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; }
  .ig-avatar { width: 77px; height: 77px; }
  .ig-user { font-size: 18px; }
  .ig-follow { height: 32px; font-size: 14px; }
  .ig-stats { gap: 4px 16px; font-size: 13px; }
  .ig-grid { gap: 2px; margin: 0 calc(var(--gut) * -1); }
  .ig-hover--work { display: none; }
  .ig-grid--works { grid-template-columns: 1fr; }
  .lb { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .lb-inner { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; height: 100%; max-height: none; border-radius: 0; }
  .lb-side { border-left: 0; border-top: 1px solid var(--line); padding: 16px 20px 24px; }
  .lb-count { margin-top: 8px; }
  .lb-close { top: 12px; right: 12px; background: rgba(0,0,0,.45); }
  .lb-prev, .lb-next { top: 40%; background: rgba(0,0,0,.45); }
  .ig-badge { width: 16px; height: 16px; top: 6px; right: 6px; }

  .site-footer { margin-top: 80px; }
  .cta h2 { font-size: 24px; }
  .footer-row { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 20px; }
  .meta { justify-content: center; }
  .life-track img { height: 160px; }

  .about-intro { margin-top: 40px; }
  .portrait { width: calc(100% + var(--gut) * 2); max-width: none; margin-top: 64px; }
  .approach, .experiences { margin-top: 72px; }
  .job { grid-template-columns: 1fr; gap: 6px; padding: 12px 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal .c { opacity: 1; }
  .ticker path { stroke: currentColor; }
}

/* ---------- Motion (see js/motion.js) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

:root { --ease-out: cubic-bezier(.2, .7, .2, 1); --ease-io: cubic-bezier(.7, 0, .2, 1); }

/* Page enters: blurred, then sharp */
.js-motion body { transition: filter 1s var(--ease-out), opacity 1s var(--ease-out); }
.js-motion:not(.is-ready) body { filter: blur(18px); opacity: 0; }
.js-motion.from-pt:not(.is-ready) body { opacity: .6; }

/* First visit: a small square fills in the center */
.js-motion.is-loading::before, .js-motion.is-loading::after {
  content: ""; position: fixed; top: 50%; left: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; z-index: 200; pointer-events: none;
}
.js-motion.is-loading::before { border: 1px solid var(--ink); }
.js-motion.is-loading::after { background: var(--ink); transform: scale(0); animation: loader-fill .65s var(--ease-io) forwards; }
@keyframes loader-fill { to { transform: scale(1); } }

/* Arriving from another page: the dark panel lifts away */
.js-motion.from-pt::before {
  content: ""; position: fixed; inset: 0; z-index: 200; background: var(--ink); pointer-events: none;
  transform-origin: top; transition: transform .75s var(--ease-io);
}
.js-motion.from-pt.is-ready::before { transform: scaleY(0); }

/* Leaving: the dark panel sweeps down over the page */
.pt { position: fixed; inset: 0; z-index: 200; background: var(--ink); pointer-events: none; transform: scaleY(0); transform-origin: top; transition: transform .6s var(--ease-io); }
.is-leaving .pt { transform: scaleY(1); }
.is-leaving main { filter: blur(8px); transition: filter .6s var(--ease-io); }

/* Content sharpens into view */
.rv { opacity: 0; filter: blur(10px); transform: translateY(14px);
  transition: opacity .9s var(--ease-out) var(--rv-delay, 0ms), filter .9s var(--ease-out) var(--rv-delay, 0ms), transform .9s var(--ease-out) var(--rv-delay, 0ms); }
.rv.in { opacity: 1; filter: none; transform: none; }
.js-motion .ig-tile.is-new { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .js-motion body, .rv { filter: none !important; opacity: 1 !important; transform: none !important; transition: none !important; }
  .js-motion::before, .js-motion::after, .pt { display: none !important; }
}

/* ---------- Case study: next / previous project (see main.js) ---------- */
.csp-shade { position: fixed; inset: 0; z-index: 50; background: #000; opacity: 0; pointer-events: none; }
.csp-nav { position: fixed; z-index: 55; pointer-events: none; opacity: 0; transition: opacity .3s ease .1s; }
.csp-nav.is-on { opacity: 1; transition-delay: 0s; }
.csp-nav-label { white-space: nowrap; transform: translateY(50%); filter: blur(2px);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), filter .4s cubic-bezier(.2,.7,.2,1); }
.csp-nav.is-on .csp-nav-label { transform: none; filter: none; transition-duration: .6s; transition-delay: .1s; }
.csp-nav--next { left: var(--col-l); width: var(--col-w); bottom: 0; height: 18vh; display: flex; align-items: center; gap: 24px; }
.csp-nav-line { position: relative; flex: 1; height: 1px; background: rgba(23,23,23,.2); }
.csp-nav-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); }
.csp-nav-name { color: var(--muted); white-space: nowrap; }
.csp-nav--prev { left: var(--col-l); top: 16px; height: 36px; display: flex; align-items: center; }
.csp-nav--prev .csp-nav-label { transform: translateY(-50%);
  background-image: linear-gradient(to right, var(--ink) 0%, var(--ink) var(--p, 0%), #a3aec0 var(--p, 0%), #a3aec0 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.csp-nav--prev.is-on .csp-nav-label { transform: none; }
/* Phones: same bar, full width inside the side margins; the top one sits under the header */
@media (max-width: 809px) {
  .csp { padding-top: 120px; padding-bottom: 16vh; }  /* room for "Scroll up to previous project" under the header */
  .csp-nav--next { left: var(--pad); width: auto; right: var(--pad); height: 16vh; gap: 16px; }
  .csp-nav--prev { left: var(--pad); top: 72px; }
}
/* Touch screens have no hover: show "Say helo" with the hand upright, like the original's mobile version */
@media (hover: none) {
  .hello .hello-label { max-width: 120px; opacity: 1; filter: none; padding: 0 6px 0 4px; }
  .hello .icon { transform: rotate(-12deg); }
}
/* Small phones (≤380px): a touch tighter so all four tabs still fit */
@media (max-width: 380px) { .tabs { gap: 14px; } .tab { font-size: 16px; } }

/* Plain text link, underlined only on hover (same as "Back to top") */
.text-link { color: var(--ink); text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: .5px; }

/* ---------- Quote photo peeks ---------- */
.peek { color: inherit; cursor: default; }
.peek-pop { position: fixed; left: 0; top: 0; z-index: 60; width: 180px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; pointer-events: none; box-shadow: 0 12px 32px rgba(0,0,0,.18); opacity: 0; transform: scale(.9) rotate(var(--rot, -3deg)); transition: opacity .2s ease, transform .25s ease; }
.peek-pop.is-on { opacity: 1; transform: scale(1) rotate(var(--rot, -3deg)); }
.peek-pop.is-wide { width: 220px; aspect-ratio: 16 / 10; object-position: top; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .peek-pop { transition: none; } }

.lb[open] { transform-origin: center; }

/* Lightbox: media only, no side panel */
.lb-inner { grid-template-columns: minmax(0, 1fr); }
.lb-side { display: none; }
@media (min-width: 810px) {
  /* Fit the popup to the media, so there are no black bars */
  .lb { width: auto; max-width: calc(100vw - 96px); background: transparent; }
  .lb-inner { display: block; background: transparent; }
  .lb-media { display: block; background: transparent; }
  .lb-media video, .lb-media img { width: auto; height: auto; max-width: min(1100px, calc(100vw - 96px)); max-height: calc(100vh - 64px); border-radius: 12px; }
}

/* Case study page: structured sections (label left, content right) */
.csp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: -40px 0 64px; padding-top: 20px; border-top: 1px solid var(--line); }
.csp-facts dt { color: var(--muted); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.csp-facts dd { margin: 6px 0 0; }
.csp-sec { display: grid; grid-template-columns: 28% 1fr; gap: 24px; padding: 64px 0; border-top: 1px solid var(--line); }
.csp-gallery + .csp-sec { margin-top: 64px; }
.csp-sec + .csp-gallery { margin-bottom: 0; }
.csp-label { font-size: 16px; line-height: 24px; font-weight: 400; color: var(--muted); }
.csp-body > * + * { margin-top: 16px; }
.csp-body p { max-width: 60ch; }
.csp-quote { margin: 0; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.3; max-width: 30ch; }
.csp-lead { font-size: clamp(20px, 1.9vw, 26px); line-height: 1.35; max-width: 32ch; }
.csp-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; counter-reset: csp; }
.csp-list li { counter-increment: csp; }
.csp-list li::before { content: counter(csp, decimal-leading-zero); display: block; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.csp-list h3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.csp-list p { margin-top: 6px; color: var(--muted); }
.csp-points { display: grid; gap: 12px; }
.csp-points li { color: var(--muted); max-width: 60ch; }
.csp-points strong { display: block; font-weight: 400; color: var(--ink); }
.csp-note { font-size: 13px; color: var(--muted); }
@media (max-width: 809px) {
  .csp-facts { grid-template-columns: 1fr 1fr; margin: -16px 0 40px; }
  .csp-sec { grid-template-columns: 1fr; gap: 16px; padding: 40px 0; }
  .csp-gallery + .csp-sec { margin-top: 40px; }
  .csp-list { grid-template-columns: 1fr; gap: 20px; }
}
