/* Redesign 2026 — built from Figma "elsdolezalovacz" (Section 2, node 54:12488) */
:root {
  /* Light: yellow page, dark ink, dark floating UI (dock, sheet, search) */
  --bg: #fae58c;
  --ink: #1d1d1d;
  --card: #fdf5ce;
  --card-hover: #fffbe6;
  --text: var(--ink);
  --text-2: rgba(29, 29, 29, 0.6);
  --line: rgba(29, 29, 29, 0.16);
  --pill-line: rgba(29, 29, 29, 0.3);
  --tint: rgba(29, 29, 29, 0.06);
  --tint-2: rgba(29, 29, 29, 0.1);
  --img-line: rgba(29, 29, 29, 0.1);
  --img-bg: #efeae3;
  --scrim: rgba(29, 29, 29, 0.4);
  --chip: #fff;
  --on-dark: #fff;                      /* text on the inverted surfaces */
  --on-dark-2: rgba(255, 255, 255, 0.6);
  --on-dark-tint: rgba(255, 255, 255, 0.08);
  --on-dark-tint-2: rgba(255, 255, 255, 0.14);
  --on-dark-line: rgba(255, 255, 255, 0.2);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: 24px;
  --r-img: 16px; /* one corner radius for every image on the site */
  /* Type system (after jakub.kr): one body size, one small size, one display size;
     two weights (400/500); two text colours per surface. Hierarchy comes from colour and weight. */
  --fs-display: 32px;
  --fs-body: 16px;
  --fs-small: 14px;
  --lh-body: 26px;
  --lh-small: 20px;
  color-scheme: light;
}
/* Dark: the same design inverted — near-black page, yellow ink, yellow floating UI */
:root[data-theme="dark"] {
  --bg: #1d1d1d;
  --ink: #fae58c;
  --card: #2a2924;
  --card-hover: #33322b;
  --text-2: rgba(250, 229, 140, 0.6);
  --line: rgba(250, 229, 140, 0.16);
  --pill-line: rgba(250, 229, 140, 0.3);
  --tint: rgba(250, 229, 140, 0.08);
  --tint-2: rgba(250, 229, 140, 0.14);
  --img-line: rgba(250, 229, 140, 0.12);
  --img-bg: #2a2924;
  --scrim: rgba(0, 0, 0, 0.55);
  --chip: #3a3832;
  --on-dark: #1d1d1d;
  --on-dark-2: rgba(29, 29, 29, 0.65);
  --on-dark-tint: rgba(29, 29, 29, 0.08);
  --on-dark-tint-2: rgba(29, 29, 29, 0.14);
  --on-dark-line: rgba(29, 29, 29, 0.2);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; font-weight: inherit; font-size: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.u { text-decoration: underline; text-decoration-skip-ink: none; text-underline-position: from-font; }
.i { display: inline-block; flex: none; width: var(--s, 16px); height: var(--s, 16px); background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.u { color: var(--text); }
.u:hover { color: var(--text-2); }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* ---------- Column pages (Index, About, Work) ---------- */
.col {
  width: 100%;
  max-width: calc(560px + 2 * var(--pad));
  margin: 0 auto;
  padding: 120px var(--pad) 200px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}
.medium { font-weight: 500; }
.muted { color: var(--text-2); }

.identity { display: flex; align-items: center; gap: 16px; }
.avatar { flex: none; border-radius: 50%; object-fit: cover; object-position: 60% 38%; background: var(--img-bg); }
.identity .avatar { width: 48px; height: 48px; }

.bio { display: flex; flex-direction: column; gap: 16px; color: var(--text-2); }

.block { display: flex; flex-direction: column; gap: 16px; }
.block-title { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); margin-bottom: 8px; }
/* Section labels sit quieter than the content they label: small grey label, ink entries */
/* Lists (Experience, Education, What I do): two-line items after jakub.kr —
   title in ink at 450, detail underneath in grey, count inline after the title */
.block { gap: 24px; }
.li-t { font-weight: 500; }
.li-s { color: var(--text-2); }

/* Experience / Education as columns: name · role · years */
.block--rows { gap: 16px; --name-col: 152px; }
.block--edu { --name-col: 232px; }
.row { display: grid; grid-template-columns: var(--name-col) minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline; }
.li-n { color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.links { display: flex; flex-wrap: wrap; gap: 24px; color: var(--text-2); }
.links a:hover { color: var(--ink); }


/* Selected work: three stacks of tilted cards */
.sel-head { display: flex; align-items: baseline; justify-content: space-between; }
.sel-head { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); }
.sel-head a:hover { color: var(--ink); }
.stacks { display: grid; grid-template-columns: repeat(3, 176px); justify-content: space-between; padding-top: 24px; }
.stack { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.stack-cards { position: relative; width: 176px; height: 150px; }
.stack-cards img {
  position: absolute;
  width: 152px;
  height: 104px;
  object-fit: cover;
  border: 1px solid var(--img-line);
  border-radius: var(--r-img);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  background: var(--img-bg);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.stack-cards img:nth-child(1) { left: 3px; top: 34px; transform: rotate(5deg); }
.stack-cards img:nth-child(2) { left: 28px; top: 0; transform: rotate(-5deg); }
.stack-cards img:nth-child(3) { left: 12px; top: 16px; }
.stack:hover .stack-cards img:nth-child(1) { transform: rotate(9deg) translate(4px, 4px); }
.stack:hover .stack-cards img:nth-child(2) { transform: rotate(-9deg) translate(4px, -4px); }
.stack:hover .stack-cards img:nth-child(3) { transform: translateY(-4px); }
.stack-label { display: flex; flex-direction: column; align-items: center; white-space: nowrap; }
.stack-label b { font-weight: 500; }
.stack-label span { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); }

/* Page header (About, Work categories) */
.page-head { display: flex; flex-direction: column; gap: 16px; }
.back { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); align-self: flex-start; }
.back:hover { color: var(--ink); }
.h1 { font-size: var(--fs-display); font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.intro { color: var(--text-2); }
.crumb { display: none; }

/* Work entries */
.entries { display: flex; flex-direction: column; }
.entry { display: flex; flex-direction: column; gap: 16px; padding: 40px 0; border-top: 1px solid var(--line); }
.entry-img { display: block; width: 100%; aspect-ratio: 3 / 2; border-radius: var(--r-img); overflow: hidden; background: var(--fill, var(--img-bg)); }
.entry-img img, .entry-img video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.entry-img:hover img, .entry-img:hover video { transform: scale(1.02); }
.entry-img--figma { aspect-ratio: 560 / 413; background: none; }
.entry-img--figma img { width: 100%; height: 100%; object-fit: cover; }
.entry-img--figma:hover img { transform: none; }
.entry-img--shot { aspect-ratio: 560 / 413; background: #cecece; display: flex; align-items: flex-start; justify-content: center; padding: 10% 14.5% 0; }
.entry-img--shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 4px 4px 0 0; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
.entry-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.entry-title a, .entry-title h2 { font-weight: 500; }
.entry-title a:hover { color: var(--text-2); }
.entry-title span { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); white-space: nowrap; }
.entry-title .num { display: none; }
.entry-desc { color: var(--text-2); }
.btn-details {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: var(--tint);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: var(--lh-small);
  transition: transform 150ms ease-out, background-color 150ms;
}
.btn-details::after { content: ""; position: absolute; inset: -2px; }
.btn-details:hover { background: var(--tint-2); }
.btn-details:active { transform: scale(0.96); }
.btn-details .i { width: 20px; height: 20px; }

/* ---------- Contact card ---------- */
.contact-wrap { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 120px var(--pad) 160px; }
.card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border-radius: 24px;
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card-top { display: flex; align-items: center; gap: 16px; padding: 0 16px 8px; }
.card-top .avatar { width: 56px; height: 56px; }
.card-id { flex: 1 1 0; min-width: 0; }
.card-id h1 { font-weight: 500; }
.card-id p { color: var(--text-2); }
.card-time { font-size: var(--fs-small); color: var(--text-2); font-variant-numeric: tabular-nums; }
.card-rows { display: flex; flex-direction: column; }
.card-row { position: relative; display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 8px; text-align: left; width: 100%; transition: background-color 150ms; }
.card-row:hover, .card-row.is-copied { background: var(--tint); }
.card-row .k { width: 96px; flex: none; color: var(--text-2); }
.card-row .v { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.card-row .i { width: 16px; height: 16px; flex: none; }
.tooltip {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-dark);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
}
.tooltip .i { width: 14px; height: 14px; }
.card-row.is-copied .tooltip { opacity: 1; }

/* ---------- Project detail ---------- */
.detail { width: 100%; max-width: calc(1120px + 2 * var(--pad)); margin: 0 auto; padding: 80px var(--pad) 200px; }
.hero { display: grid; grid-template-columns: 456px 600px; justify-content: space-between; align-items: start; }
.hero-text { display: flex; flex-direction: column; gap: 32px; }
.hero-top { display: flex; flex-direction: column; gap: 24px; }
.hero-top .back { color: var(--ink); }
.hero-top .back:hover { color: var(--text-2); }
.lead { color: var(--text); }
.more { color: var(--text-2); }
.facts { display: flex; flex-direction: column; gap: 24px; }
.meta-row { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.meta-row .k { width: 120px; flex: none; color: var(--text-2); }
.pills-block { display: flex; flex-direction: column; gap: 16px; }
.pills-block > p { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 8px 16px; border: 1px solid var(--pill-line); border-radius: 999px; font-size: var(--fs-small); line-height: var(--lh-small); white-space: nowrap; }
a.pill:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* Cover and Work images: one 3:2 frame everywhere (the middle of the mockups' 4:3–16:9 range),
   filled edge to edge so there are never side bars; the most any image loses is ~16% of its width */
.cover { width: 600px; aspect-ratio: 3 / 2; border-radius: var(--r-img); overflow: hidden; background: #000; }
.cover img, .cover video { width: 100%; height: 100%; object-fit: cover; }
/* Flat graphics with type to the edges (e.g. KVIFF slides): show whole, solid edge colour fills the frame */
.cover.is-contain { background: var(--fill); aspect-ratio: auto; }
.cover.is-contain img { height: auto; }
.cover.is-contain img, .entry-img.is-contain img { object-fit: contain; }

.gallery { display: flex; flex-direction: column; gap: 24px; margin-top: 120px; }
/* Justified rows: width share = aspect ratio, so all pictures in a row end up the same height */
.g-row { display: flex; gap: 24px; align-items: flex-start; }
.g-row > .g-img { flex: var(--r, 1.5) 1 0; min-width: 0; }
.g-panel { padding: 40px; border-radius: var(--r-img); background: var(--fill); }
.g-panel > .g-row { margin: 0 auto; }
@media (max-width: 640px) { .g-panel { padding: 16px; } }
.g-row--screens > .screen { flex: 1 1 0; min-width: 0; }
.g-img { display: block; width: 100%; border-radius: var(--r-img); overflow: hidden; cursor: zoom-in; }
.g-img img, .g-img video { width: 100%; height: auto; }
.g-vid { cursor: default; }
.screen { position: relative; height: 720px; border-radius: var(--r-img); overflow: hidden; background: var(--tint); }
.screen-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.screen-scroll::-webkit-scrollbar { display: none; }
.screen-scroll img { width: 100%; height: auto; }
.hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  white-space: nowrap;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.hint b { font-weight: 500; color: var(--on-dark); }
.hint i { font-style: normal; color: var(--on-dark-2); }
.hint button { color: var(--on-dark); font-weight: 500; }
.hint button::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.hint button:hover { color: var(--on-dark-2); }

.outro { margin-top: 80px; padding-top: 40px; border-top: 1px solid var(--line); }
.sentence { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; padding: 40px 0; font-size: var(--fs-display); font-weight: 500; line-height: 1.5; letter-spacing: -0.02em; }
.sentence > span { color: var(--text-2); }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 150ms ease-out;
}
.cta:active { transform: scale(0.96); }
/* Hover/focus reveals the address or number above the button */
.cta[data-tip] { position: relative; }
.cta[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-dark);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.cta[data-tip]:hover::after, .cta[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.cta:hover { background: var(--card-hover); }
.cta--dark { background: var(--ink); color: var(--on-dark); padding-left: 8px; }
.cta--dark:hover { background: var(--ink); opacity: 0.9; }
.cta--dark .avatar { width: 40px; height: 40px; }
.cta--icon { padding-left: 16px; }
.cta--icon .i { width: 28px; height: 28px; }

/* ---------- Dock (desktop nav) ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  width: max-content;
}
.dock > * { flex: none; }
.dock .avatar { width: 32px; height: 32px; }
.d-item, .d-sub, .d-cmd { transition: color 150ms ease-out, background-color 150ms ease-out, box-shadow 150ms ease-out, transform 150ms ease-out; }
.d-item:active, .d-sub:active, .d-cmd:active { transform: scale(0.96); }
.d-item { padding: 8px 16px; border-radius: 999px; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--on-dark-2); }
.d-item:hover { color: var(--on-dark); }
.d-item.is-on { background: var(--bg); color: var(--ink); font-weight: 500; }
/* Work group: one yellow segment; the current category is a raised light chip inside it
   (elevation by shadow, not a dark fill that merges into the dark bar at the group's ends) */
/* Inset 4px so the chip sits inside the group with even air on all sides (concentric pills).
   Exception to the 8px spacing scale: 8px here would make the bar taller than its other items. */
.d-work { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg); }
.d-work .d-item, .d-work .d-sub { padding-top: 4px; padding-bottom: 4px; }
.d-work .d-item.is-on { background: none; }
.d-work .sep { flex: none; width: 1px; height: 16px; margin: 0 8px; background: var(--pill-line); }
.d-sub { display: flex; gap: 8px; align-items: baseline; padding: 8px 16px; border-radius: 999px; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); }
.d-sub small { font-size: inherit; color: var(--text-2); font-variant-numeric: tabular-nums; }
.d-sub:hover { color: var(--ink); background: var(--tint); }
.d-sub.is-on { background: var(--chip); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.08); }
.d-div { width: 1px; height: 24px; background: var(--on-dark-line); }
.d-cmd { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--on-dark-tint); color: var(--on-dark-2); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 500; }
.d-cmd:hover { background: var(--on-dark-tint-2); color: var(--on-dark); }
.d-cmd .i { width: 18px; height: 18px; }
.d-cmd.icon-only { padding: 8px 16px; }

/* Mobile context pill + sheet */
.ctx {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 50;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-dark);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  white-space: nowrap;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.ctx > * { flex: none; }
.ctx .avatar { width: 32px; height: 32px; }
.ctx span { color: var(--on-dark-2); }
.ctx b { font-weight: 500; }
.ctx .i { width: 18px; height: 18px; }
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 200ms; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 24px 40px;
  border-radius: 24px 24px 0 0;
  background: var(--ink);
  color: var(--on-dark);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 300ms;
}
.sheet-open .scrim { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; visibility: visible; transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1); }
.grab { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--on-dark-line); }
.s-group { display: flex; flex-direction: column; }
.s-label { padding: 0 0 8px 16px; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--on-dark-2); }
.s-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; }
.s-item > :first-child { flex: 1 1 0; }
.s-item small { font-size: var(--fs-small); color: var(--on-dark-2); }
.s-item .i { display: none; }
.s-item.is-on { background: var(--bg); color: var(--ink); font-weight: 500; }
.s-item.is-on small { color: var(--text-2); font-weight: 400; }
.s-item.is-on .i { display: block; }

/* Command palette (opened from the dock's search button) */
.cmdk { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-start; justify-content: center; padding: 15vh var(--pad) var(--pad); background: var(--scrim); }
.cmdk.is-open { display: flex; }
.cmdk-box { width: 100%; max-width: 560px; border-radius: 24px; background: var(--ink); color: var(--on-dark); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18); overflow: hidden; }
.cmdk-input { display: flex; align-items: center; gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--on-dark-tint-2); }
.cmdk-input .i { width: 18px; height: 18px; }
.cmdk-input input { flex: 1; background: none; border: 0; outline: 0; color: var(--on-dark); font: inherit; }
.cmdk-input input::placeholder { color: var(--on-dark-2); }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.cmdk-list a { display: flex; justify-content: space-between; gap: 16px; padding: 8px 16px; border-radius: 999px; }
.cmdk-list a small { font-size: var(--fs-small); color: var(--on-dark-2); }
.cmdk-list a.is-active { background: var(--bg); color: var(--ink); }
.cmdk-empty { margin: 0; padding: 8px 16px; color: var(--on-dark-2); }
.cmdk-list a.is-active small { color: var(--text-2); }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 80; display: none; overflow-y: auto; background: rgba(29, 29, 29, 0.92); padding: 64px var(--pad); }
.lb.is-open { display: block; }
.lb img { width: min(1200px, 100%); height: auto; margin: 0 auto; border-radius: var(--r-img); }
.lb-close { position: fixed; top: 16px; right: 16px; padding: 8px 16px; border-radius: 999px; background: var(--bg); color: var(--ink); font-size: var(--fs-small); font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 1220px) {
  .hero { grid-template-columns: minmax(0, 456px) minmax(0, 600px); gap: 64px; }
  .cover { width: 100%; }
}
@media (min-width: 961px) { .sheet, .scrim { display: none; } }
@media (max-width: 960px) {
  .dock { display: none; }
  .ctx { display: flex; width: max-content; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .cover { order: -1; }
  .gallery { margin-top: 80px; gap: 16px; }
  .g-row { gap: 16px; }
  .g-row--screens { flex-direction: column; }
  .g-row--screens > .screen { flex: none; width: 100%; }
  .screen { height: min(720px, 120vw); }
}
@media (max-width: 640px) {
  .col { padding-top: 24px; gap: 56px; padding-bottom: 160px; }
  .stacks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stack-cards { width: 100%; height: auto; aspect-ratio: 176 / 150; }
  .stack-cards img { width: 86%; height: auto; aspect-ratio: 152 / 104; }
  .stack-cards img:nth-child(1) { left: 2%; top: 23%; }
  .stack-cards img:nth-child(2) { left: 16%; top: 0; }
  .stack-cards img:nth-child(3) { left: 7%; top: 11%; }
  /* Work pages: page note (breadcrumb + short intro) instead of the big header */
  .page-head--work { gap: 16px; }
  .page-head--work .back, .page-head--work .h1 { display: none; }
  .page-head--work .crumb { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-2); }
  .page-head--work .crumb b { font-weight: 500; color: var(--ink); }
  .page-head--work .crumb .i { width: 14px; height: 14px; }
  .entry { padding: 16px 0 16px; border-top: 0; }
  .entry-title .client { display: none; }
  .entry-title .num { display: inline; }
  .detail { padding-top: 24px; }
  :root { --fs-display: 28px; }
  .sentence { gap: 8px; }
  .cta--dark .avatar { width: 28px; height: 28px; }
  .cta--icon .i { width: 20px; height: 20px; }
  .card { padding: 16px 8px 8px; }
  .card-top { padding: 0 8px 8px; }
  .card-row { padding: 16px 8px; }
  .card-row .k { width: 72px; }
  /* Columns collapse: name + years on top, role underneath */
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .li-s { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Theme toggle: moon in light mode, sun in dark mode */
.d-theme .i:last-child, :root[data-theme="dark"] .d-theme .i:first-child { display: none; }
:root[data-theme="dark"] .d-theme .i:last-child { display: inline-block; }
.s-theme-d, :root[data-theme="dark"] .s-theme-l { display: none; }
:root[data-theme="dark"] .s-theme-d { display: inline; }
.s-item { width: 100%; text-align: left; }

/* ---------- Entrance motion ----------
   Content arrives in semantic chunks: a short fade, 8px rise and 4px blur that clears, staggered
   ~70ms on load; further down the page each block reveals as it scrolls in. Images fade in once
   decoded. Only with JS (so nothing stays hidden without it) and never with reduced motion. */
.js .enter { opacity: 0; transform: translateY(8px); filter: blur(4px); }
.js .enter.is-in {
  opacity: 1; transform: none; filter: none;
  transition: opacity 600ms cubic-bezier(0.2, 0, 0, 1), transform 600ms cubic-bezier(0.2, 0, 0, 1), filter 600ms cubic-bezier(0.2, 0, 0, 1);
  transition-delay: var(--d, 0ms);
}
.js img.fade { opacity: 0; transition: opacity 500ms cubic-bezier(0.2, 0, 0, 1); }
.js img.fade.is-loaded { opacity: 1; }
/* The dock rises in once per visit, not on every page */
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.first-visit .dock, .first-visit .ctx { animation: dockIn 700ms cubic-bezier(0.2, 0, 0, 1) 300ms both; }
@media (prefers-reduced-motion: reduce) {
  .js .enter, .js img.fade { opacity: 1; transform: none; filter: none; }
  .first-visit .dock, .first-visit .ctx { animation: none; }
}

/* ---------- Work overview: photo tiles ---------- */
.overview { width: 100%; max-width: calc(1120px + 2 * var(--pad)); margin: 0 auto; padding: 120px var(--pad) 200px; display: flex; flex-direction: column; gap: 80px; }
.overview .page-head { max-width: 560px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-img); overflow: hidden; background: var(--img-bg); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms cubic-bezier(0.2, 0, 0, 1); }
.tile.is-contain { background: var(--fill); }
.tile.is-contain img { object-fit: contain; }
.tile:hover img, .tile:hover video { transform: scale(1.03); }
.tile-label {
  position: absolute; left: 8px; bottom: 8px;
  display: flex; align-items: baseline; gap: 8px;
  max-width: calc(100% - 16px);
  padding: 8px 16px; border-radius: 999px;
  background: var(--ink); color: var(--on-dark);
  font-size: var(--fs-small); line-height: var(--lh-small); white-space: nowrap;
  opacity: 0; transform: translateY(4px);
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.tile-label b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.tile-label span { color: var(--on-dark-2); }
.tile:hover .tile-label, .tile:focus-visible .tile-label { opacity: 1; transform: none; }
@media (hover: none) { .tile-label { opacity: 1; transform: none; } .tile-label span { display: none; } }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .overview { padding-top: 24px; gap: 40px; } .tiles { gap: 8px; } .tile-label { left: 4px; bottom: 4px; padding: 4px 8px; font-size: 12px; line-height: 16px; } }

/* Home client list: one colour, spacing instead of commas; hover shows the project image */
.clients { display: flex; flex-wrap: wrap; gap: 0 16px; color: var(--text); }
.clients > * { white-space: nowrap; }
.clients a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color 150ms ease-out; }
.clients a:hover, .clients a:focus-visible { text-decoration-color: currentColor; }
.peek {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: 280px; border-radius: var(--r-img); overflow: hidden;
  background: var(--img-bg); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  opacity: 0; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(0.96);
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.peek.is-on { opacity: 1; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1); }
.peek img { width: 100%; height: auto; }
@media (hover: none), (prefers-reduced-motion: reduce) { .peek { display: none; } }

/* Clients / Disciplines / Industries: three equal groups, label tight to its list, 40px between groups */
.lists { display: flex; flex-direction: column; gap: 40px; }
.list-group { display: flex; flex-direction: column; gap: 8px; }
.list-group .block-title { margin-bottom: 0; }
.clients { gap: 0 16px; }

/* Services — rows: icon, name, description; hover lifts the row onto a soft panel */
.services { display: flex; flex-direction: column; margin: 0 -16px; }
.svc { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 16px; align-items: start;
  padding: 16px; border-radius: var(--r-img); transition: background-color 150ms ease-out; }
.svc .i { grid-row: 1; margin-top: 1px; }
.svc h3 { grid-column: 2; font-weight: 500; }
.svc p { grid-column: 2; color: var(--text-2); }
.svc:hover { background: var(--tint); }
