/* ==========================================================================
   home.css — Home-only styles (index.html)
   Load order: tokens.css → base.css → layout.css → home.css
   Tokens only; no new tokens. Breakpoints: 40em (640px) · 64em (1024px)
   ========================================================================== */

/* ---- Skip link: off-screen until focused ---- */
.skip-link {
  position: absolute;
  inset-block-start: var(--space-1);
  inset-inline-start: var(--space-1);
  z-index: 30; /* above the sticky header */
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-bg);
  color: var(--color-text);
  border: var(--border-strong);
  border-radius: var(--radius-1);
  font-size: var(--step--1);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* ---- Header & primary nav ----
   Sticky on every page. One row is 78px: the 40px controls plus 19px above
   and below. When it wraps on narrow screens it simply grows; js/site.js
   publishes the real height as --header-h for anything that sits under it. */
html {
  scroll-padding-block-start: var(--header-h, var(--size-header));
}

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 15;
  padding-block: calc((var(--size-header) - var(--space-5)) / 2);
  background-color: var(--color-bg);
  /* Hairline drawn outside the box, so it adds nothing to the 78px */
  box-shadow: 0 1px 0 var(--color-border);
}

.site-header > .container {
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
}

.site-name,
.site-nav a {
  font-size: var(--step-nav);
  line-height: var(--leading-snug);
  color: var(--color-text);
  text-decoration: none;
  /* Hairline underline that draws in from the left on hover/focus */
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  padding-block-end: 2px;
  transition:
    color var(--duration-fast) var(--ease-out),
    background-size var(--duration-base) var(--ease-out);
}

.site-name {
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

/* The name stays still on hover: no underline, no colour change */
.site-name:hover {
  color: var(--color-text);
}

/* Name + role read as one line: bold charcoal name, lighter muted role */
.site-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-2);
}

.site-role {
  font-size: var(--step-nav);
  line-height: var(--leading-snug);
  font-weight: var(--weight-regular);
  color: var(--color-text-muted);
}

.site-nav ul {
  --cluster-space: var(--space-3);
}

@media (min-width: 40em) {
  .site-nav ul { --cluster-space: var(--space-4); }
}

/* Nav links sit at body size and weight; the name carries the emphasis */
.site-nav a {
  font-size: var(--step-0);
  font-weight: var(--weight-regular);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--color-accent-ink);
  background-size: 100% 1px;
}

/* Letter lift: JS wraps nav letters in .ll spans (fine pointer, motion OK).
   Transform only, so link widths never change. */
.site-nav .ll {
  display: inline-block;
  transition: transform var(--duration-base) var(--ease-out);
}

.site-nav a.is-lifting .ll { transition-duration: 60ms; }

/* ---- Header right side: nav links, then language, theme and CTA ---- */
.site-header-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-5);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Shared control height: 40px */
.icon-button,
.pill-button,
.lang-switch {
  block-size: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background-color: transparent;
  color: var(--color-text);
  transition:
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

/* Theme toggle: circle with a moon (light mode) or sun (dark mode) */
.icon-button {
  display: inline-grid;
  place-items: center;
  inline-size: var(--space-5);
  padding: 0;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
  background-color: var(--color-accent-tint);
}

/* ---- Mobile menu (js/site.js adds .has-menu and the .nav-toggle) ----
   Under 1024px (phones + tablets): one 64px row — name left, hamburger right. The nav,
   language, theme and CTA drop down in a panel under the row. */
.nav-toggle { display: none; }

@media (max-width: 63.99em) {
  .site-header.has-menu {
    padding-block: 0;
  }

  .site-header.has-menu > .container {
    flex-wrap: nowrap;
    min-block-size: 4rem; /* 64px */
  }

  .site-header.has-menu .site-role { display: none; }

  .site-header.has-menu .site-name {
    font-size: 1.25rem; /* 20px */
  }

  .site-header.has-menu .nav-toggle {
    display: inline-grid;
    flex-shrink: 0;
    inline-size: 2.75rem; /* 44px touch target */
    block-size: 2.75rem;
  }

  .nav-toggle path {
    transform-origin: 12px 12px;
    transition: transform var(--duration-base) var(--ease-out);
  }
  .is-open .nav-toggle-top { transform: translateY(4px) rotate(45deg); }
  .is-open .nav-toggle-bottom { transform: translateY(-4px) rotate(-45deg); }

  /* Panel: hidden until opened, sits flush under the header row */
  .site-header.has-menu .site-header-end {
    position: absolute;
    inset-inline: 0;
    inset-block-start: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-5);
    padding: var(--space-3) var(--gutter) var(--space-5);
    background-color: var(--color-bg);
    box-shadow: 0 1px 0 var(--color-border);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition:
      opacity var(--duration-base) var(--ease-out),
      transform var(--duration-base) var(--ease-out),
      visibility 0s linear var(--duration-base);
  }

  .site-header.is-open .site-header-end {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }

  .site-header.has-menu .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .site-header.has-menu .site-nav a {
    font-size: 1.75rem; /* 28px: big, easy taps */
    font-weight: var(--weight-medium, 500);
    letter-spacing: var(--tracking-tight);
  }

  .site-header.has-menu .site-actions {
    flex-wrap: wrap;
  }

  /* Page behind the open menu doesn't scroll. Lock <html> only: overflow on
     <body> too would make body the scroll container, so the sticky header
     would re-anchor to the top of the page and vanish when scrolled down. */
  .menu-open { overflow: hidden; }
}

@media (max-width: 63.99em) and (prefers-reduced-motion: reduce) {
  .site-header.has-menu .site-header-end,
  .nav-toggle path { transition: none; }
}

.icon-sun { display: none; }

:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}

/* "Let's talk": outlined pill */
.pill-button {
  display: inline-flex;
  align-items: center;
  padding-inline: var(--space-3);
  border-color: var(--color-text);
  font-size: 1rem;
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.pill-button:hover {
  color: var(--color-accent-ink);
  border-color: var(--color-accent-ink);
  background-color: var(--color-accent-tint);
}

/* Language: EN / CS segmented pill (plain links to the same page in the
   other language; the current one carries aria-current) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
}

.lang-option {
  display: inline-flex;
  align-items: center;
  block-size: 100%;
  padding-inline: 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background-color: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.lang-option:hover {
  color: var(--color-accent-ink);
}

.lang-option[aria-current="true"] {
  background-color: var(--color-text);
  color: var(--color-bg);
}

/* ---- Hero ---- */
/* Statement on the left, tall panel on the right that sits close under the
   header; the text block is vertically centred against the panel. */
.hero {
  padding-block: var(--space-6) var(--space-8);
}

.hero > .container {
  row-gap: var(--space-6);
}

.hero-text {
  align-self: center;
}

/* Byline: [avatar] [● Open to roles] · [icon] place, as one row that reads
   as part of the headline group: 8px down to the H1 instead of the
   stack's 32px. Avatar to pill: 16px. */
.hero-byline {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-block-end: calc(var(--space-1) - var(--stack-space));
}

/* Avatar link to About, start of the byline. The box is fixed by CSS
   (56px), so there's no layout shift while the image loads. The hint is
   absolutely positioned, so it never pushes layout. */
.avatar-link {
  position: relative;
  display: block;
  flex: none;
  inline-size: var(--size-avatar);
  block-size: var(--size-avatar);
  border-radius: 50%;
  text-decoration: none;
}

.avatar-link img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  border-radius: 50%;
  /* 1px ring that doesn't add to the box */
  box-shadow: 0 0 0 1px var(--color-border);
  transition:
    box-shadow var(--duration-fast) var(--ease-out),
    transform 150ms var(--ease-out);
}

.avatar-link:hover img,
.avatar-link:focus-visible img {
  box-shadow: 0 0 0 1px var(--color-text);
  transform: scale(1.04);
}

.avatar-link:focus-visible {
  outline-offset: 4px;
  border-radius: 50%;
}

/* The pill now sits to the avatar's right, so the hint shows above it */
.avatar-hint {
  position: absolute;
  inset-block-end: calc(100% + var(--space-1));
  inset-inline-start: 0;
  translate: 0 var(--space-1);
  font-size: 0.8125rem; /* 13px */
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--duration-fast) var(--ease-out),
    translate var(--duration-fast) var(--ease-out);
}

.avatar-link:hover .avatar-hint,
.avatar-link:focus-visible .avatar-hint {
  opacity: 1;
  translate: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .avatar-link:hover img,
  .avatar-link:focus-visible img { transform: none; }
  .avatar-hint { translate: 0 0; }
}

/* ---- Status line beside the avatar: [● Open to roles] [icon] place ----
   14px in the header role's muted grey, so it never competes with the
   headline. It takes the rest of the row; when it's too narrow the place
   wraps under the pill (8px row gap). The first line is pushed down by
   half the avatar/pill difference so the pill always centres on the
   avatar, wrapped or not. */
.hero-status {
  display: flex;
  flex: 1 1 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-inline-size: 0;
  max-inline-size: none;
  margin-block-start: calc((var(--size-avatar) - var(--space-4)) / 2);
  /* Clip sideways only, so a "·" left at the start of a wrapped line is
     cut off. The 8px padding (cancelled by the margin) keeps focus rings
     inside the clip. */
  margin-inline: calc(-1 * var(--space-1));
  padding-inline: var(--space-1);
  overflow-x: clip;
  font-size: var(--text-meta);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

.status-place {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Same 32px height and pill radius as the active EN/CS option */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  block-size: var(--space-4);
  padding-inline: var(--space-2);
  border-radius: var(--radius-pill);
  background-color: var(--color-status-bg);
  color: var(--color-status);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.status-dot {
  inline-size: calc(var(--space-1) * 0.75); /* 6px */
  block-size: calc(var(--space-1) * 0.75);
  border-radius: 50%;
  background-color: currentColor;
}

/* Location: a button so it can be focused and tapped. Both places are in
   the markup; the aria-label names both. */
.loc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-block-size: var(--space-4);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-weight: var(--weight-medium);
  text-align: start;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.loc {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

/* The static "both places" label is the longest; let it wrap on phones */
.loc-static { white-space: normal; }

.loc-icon {
  flex: none;
  /* Twice the small icon size */
  inline-size: calc(var(--size-icon-sm) * 2);
  block-size: calc(var(--size-icon-sm) * 2);
}

.loc-sprite {
  position: absolute;
  inline-size: 0;
  block-size: 0;
  overflow: hidden;
}

/* Static by default (no JS, or reduced motion): "Michigan, USA · Prague, CZ".
   The two swap labels stay in the DOM, visually hidden. */
.loc-swap {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Live swap (js/location.js adds .is-live). Both labels share one grid
   cell, so the button is always as wide as the longer one: no layout
   shift. Opacity + transform only, ~200ms. */
@media (prefers-reduced-motion: no-preference) {
  .loc-switch.is-live .loc-static { display: none; }

  .loc-switch.is-live .loc-swap {
    position: static;
    display: inline-grid;
    inline-size: auto;
    block-size: auto;
    overflow: visible;
    clip-path: none;
  }

  .loc-swap > .loc {
    grid-area: 1 / 1;
    transition:
      opacity 200ms var(--ease-out),
      transform 200ms var(--ease-out);
  }

  .loc--cz {
    opacity: 0;
    transform: translateY(0.35em);
  }

  .loc-switch.is-live:is(.is-on, :focus-visible) { color: var(--color-text); }
  .loc-switch.is-live:is(.is-on, :focus-visible) .loc--us {
    opacity: 0;
    transform: translateY(-0.35em);
  }
  .loc-switch.is-live:is(.is-on, :focus-visible) .loc--cz {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .loc-switch.is-live:hover { color: var(--color-text); }
  .loc-switch.is-live:hover .loc--us {
    opacity: 0;
    transform: translateY(-0.35em);
  }
  .loc-switch.is-live:hover .loc--cz {
    opacity: 1;
    transform: none;
  }
}

/* Phones: pill and place stack as one tidy block, centred on the avatar
   (32px pill + 4px + 20px place = the 56px avatar), instead of the place
   wrapping into a stair-step under it. A bit more air before the H1 so
   the byline reads as a meta row, not part of the headline. */
@media (max-width: 47.99em) {
  .hero-byline {
    align-items: center;
    gap: var(--space-2);
    margin-block-end: calc(var(--space-2) - var(--stack-space));
  }

  .hero-status {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-half, 0.25rem);
    margin-block-start: 0;
  }

  .loc-switch { min-block-size: 1.25rem; }

  .loc { gap: 0.375rem; }

  .loc-icon {
    inline-size: 1.125rem; /* 18px */
    block-size: 1.125rem;
  }

  /* Line the icon up with the pill's dot, not the pill's edge */
  .status-place { padding-inline-start: calc(var(--space-2) - 0.25rem); }
}

/* ---- Display size: the home hero headline's size, shared ----------------
   Phones/tablets: 40 → 64px. Desktop: 10% of the hero's text column, which
   is the container's inner width minus the collage panel and the 80px gap.
   Any heading using var(--display-size) needs a .container ancestor with
   container-type: inline-size, so 100cqi is that same inner width.
   (The value is resolved on the element that uses it.) */
:root {
  --display-size: clamp(2.5rem, 1.6rem + 2.6vw, 4rem);
}

@media (min-width: 64em) {
  :root {
    --display-col: calc(100cqi - min((max(36rem, calc(100svh - var(--size-header))) - var(--space-3)) * 0.82, 40vw) - var(--space-10));
    --display-size: clamp(2.25rem, calc(var(--display-col) * 0.1), 5.5rem);
  }
  /* Czech lines run longer; same scale the hero uses */
  :root:lang(cs) {
    --display-size: clamp(1.75rem, calc(var(--display-col) * 0.084), 4.5rem);
  }
}

/* "Selected work" sets at the hero headline's size and voice */
#work > .container { container-type: inline-size; }

#work-title {
  font-family: var(--font-display);
  font-size: var(--display-size);
  font-weight: var(--weight-medium);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

/* One typeface for the whole headline: Geist, upright, no serif or italic */
.hero-title {
  font-family: var(--font-display);
  font-style: normal;
  font-size: clamp(2.5rem, 1.6rem + 2.6vw, 4rem); /* 40 → 64px */
  font-weight: var(--weight-medium);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-inline-size: 18ch;
  text-wrap: balance;
}

/* Key phrases in the lede (research / product thinking / visual design):
   links a touch heavier than the text around them, with a dotted underline
   so they read as interactive. js/peek.js shows a preview on hover/focus. */
.peek {
  font-weight: var(--weight-semibold);
  text-decoration-style: dotted;
  text-decoration-color: var(--color-grey);
  text-underline-offset: 0.2em;
}

.peek:hover,
.peek:focus-visible {
  color: var(--color-accent-ink);
  text-decoration-color: currentColor;
  text-underline-offset: 0.2em;
}

/* "research" → case-study-migration.html. Hover (fine pointers only) or
   keyboard focus shows a preview card (image, "16 experts · UX research",
   the case study's headline as a quote). Plain CSS: the card is out of
   flow (absolute) and only fades/moves, so nothing shifts. It sits above
   the word and centred; js/lede-link.js shifts it sideways near an edge
   and flips it below when there's no room above. Touch: no preview, tap navigates.
   Esc closes it (.is-dismissed, set by JS). The card text is the link's
   aria-describedby, so it is aria-hidden to avoid being read twice. */
.lede-link {
  font-weight: var(--weight-semibold);
  text-decoration-style: dotted;
  text-decoration-color: var(--color-grey);
  text-underline-offset: 0.2em;
}

.lede-link:hover,
.lede-link:focus-visible {
  color: var(--color-accent-ink);
  text-decoration-color: currentColor;
}

.lede-peek {
  position: relative;
}

.lede-card {
  position: absolute;
  z-index: 20;
  inset-block-end: calc(100% + var(--space-1));
  inset-inline-start: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  inline-size: min(18rem, 100vw - 2 * var(--gutter));
  padding: var(--space-2);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
  white-space: normal;
  pointer-events: none;
}

/* Hidden = display: none, so the card can never widen the page
   (a visibility: hidden card still counts towards horizontal overflow).
   The flex display comes from the show rules below. */
.lede-card { display: none; }

.lede-card[data-y="below"] {
  inset-block-end: auto;
  inset-block-start: calc(100% + var(--space-1));
}

/* Cover image on top of the card; width/height keep its space, so the
   card's size is known the moment it shows (no reflow as it decodes) */
.lede-card-img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 800 / 452;
  object-fit: cover;
  border-radius: var(--radius-2);
  background-color: var(--color-surface);
}

.lede-card-kicker {
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}

.lede-card-title {
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
}

/* "product thinking" card: the wide Stamp hero (same file as the home
   tile, so already cached), cropped to the shared ratio around the phone */
.lede-card-img--stamp {
  object-position: 50% 60%;
}

.lede-link:focus-visible + .lede-card { display: flex; }

@media (hover: hover) and (pointer: fine) {
  .lede-link:hover + .lede-card { display: flex; }
}

.lede-peek.is-dismissed .lede-card { display: none; }

/* Short fade + rise on appear; static under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .lede-card { animation: lede-card-in var(--duration-fast) var(--ease-out); }
  .lede-card[data-y="below"] { animation-name: lede-card-in-below; }
}

@keyframes lede-card-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes lede-card-in-below { from { opacity: 0; transform: translateY(-8px); } }

/* The break before the morphing word (.br-keep) stays at every width;
   any other headline break is for the desktop setting only. */
@media (max-width: 63.99em) {
  .hero-title br:not(.br-keep) { display: none; }
}

/* Morphing last word (js/morph.js). All words share one grid cell; the
   hidden ones reserve the longest width so nothing reflows. The threshold
   filter is on only while morphing, so edges stay crisp at rest. */
.morph {
  display: inline-grid;
  font-weight: var(--weight-bold);
  white-space: nowrap;
}
.morph > * { grid-area: 1 / 1; }
.morph-size { visibility: hidden; }

.hero-lede {
  font-size: 1.125rem; /* 18px */
  line-height: 1.5;
  max-inline-size: 40ch;
}

/* 1200px+: room for the role again (see the 64em block below) */
@media (min-width: 75em) {
  .site-header .site-role {
    display: inline;
  }
}

/* Desktop (1024px+): header + hero fill exactly one screen.
   The panel is as tall as the space under the header and keeps a ~4:5
   portrait shape, so it grows and shrinks with the viewport height;
   the text sits left, slightly above the panel's centre. */
@media (min-width: 64em) {
  .site-header {
    padding-block: 0;
  }

  .site-header > .container {
    min-block-size: var(--size-header); /* 78px header band */
  }

  /* 1024–1199px: name + role + nav + controls don't fit on one row, so
     the role steps aside and the header stays a single 78px row */
  .site-role {
    display: none;
  }

  .hero {
    /* Screen height minus the header; never shorter than 576px */
    --hero-h: max(36rem, calc(100svh - var(--size-header)));
    --panel-h: calc(var(--hero-h) - var(--space-3));
    block-size: var(--hero-h);
    padding-block: 0 var(--space-3);
    /* Hairline under the fold, inset to the content edges */
    background-image: linear-gradient(var(--color-border), var(--color-border));
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: calc(min(100%, var(--container-max)) - 2 * var(--gutter)) 1px;
  }

  .hero > .container {
    block-size: 100%;
    grid-template-columns:
      minmax(0, 1fr)
      min(calc(var(--panel-h) * 0.82), 40vw);
    column-gap: var(--space-10); /* 80px */
  }

  .hero > .container > * {
    grid-column: auto;
  }

  .hero-text {
    /* Nudge the statement above the panel's optical centre */
    padding-block-end: var(--space-12);
    /* Lets the headline size itself to this column (cqi units) */
    container-type: inline-size;
  }

  /* Headline scales with the text column so it always sets in 2 lines:
     Making complex / ideas feel thoughtful. (the morph reserves the
     widest word, so the line never reflows as the word changes) */
  .hero-title {
    font-size: clamp(2.25rem, 10cqi, 5.5rem); /* 36 → 88px */
    max-inline-size: none;
    text-wrap: nowrap;
  }

  /* On desktop the morphing word joins the "ideas feel" line */
  .hero-title .br-keep { display: none; }

  /* Czech lines run longer, so the same 2 lines need a smaller size */
  :root:lang(cs) .hero-title {
    font-size: clamp(1.75rem, 8.4cqi, 4.5rem); /* 28 → 72px */
  }

  /* Collage fills the panel column and sits centred against the text */
  .hero .signature {
    display: grid;
    align-items: center;
    block-size: 100%;
  }
}

/* Desktop: the lede grows from 18px at 1024 to 20px at 1440 and up */
@media (min-width: 64em) {
  .hero-lede {
    font-size: clamp(1.125rem, 0.8173rem + 0.4808vw, 1.25rem); /* 18 → 20px */
  }
}

/* ---- Hero collage: the four case-study covers as a 2×2 staggered grid,
   left column lowered by 40% of a tile. Square tiles crop the 4:3 covers
   (object-fit: cover). Reuses .tile / .tile-media below, so
   js/cursor-label.js drives the same pointer-following label.
   The offset is a transform; the last lowered tile reserves its space,
   so the panel's height never changes as images load. ---- */
.hero-tiles {
  --hero-gap: var(--space-2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--hero-gap);
  container-type: inline-size;
}

@media (min-width: 40em) {
  .hero-tiles { --hero-gap: var(--space-3); }
}

/* Column = (100cqi − gap) / 2, tile is square, so 40% of a tile is
   0.2 × (100cqi − gap). cqi resolves against .hero-tiles, so it lives
   on the children. */
.hero-tiles > li {
  --tile-offset: calc((100cqi - var(--hero-gap)) * 0.2);
  min-inline-size: 0;
}

.hero-tiles > li:nth-child(odd) {
  transform: translateY(var(--tile-offset));
}

.hero-tiles > li:nth-child(odd):nth-last-child(-n + 2) {
  margin-block-end: var(--tile-offset);
}

.hero-tiles .tile-media img {
  aspect-ratio: 1;
}

/* Topnatur tile: a wide 3400×1500 shot whose phone + laptop fill the
   middle 50% of its width. Shown at 180% of the square (55% visible) so
   both devices fit whole; the band above and below is the image's own
   flat pink, so the edges don't show. The square holds its own ratio. */
.hero-tiles :is(.tile-media--topnatur, .tile-media--rituals) {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}

.hero-tiles .tile-media--topnatur {
  background-color: var(--color-hero-topnatur);
}

.hero-tiles :is(.tile-media--topnatur, .tile-media--rituals) img {
  aspect-ratio: auto;
  inline-size: 180%;
  max-inline-size: none;
}

/* ---- Work tiles: staggered 2-column image grid (js/cursor-label.js) ----
   1 column on phones; from 40em two columns with the right column pushed
   down by 40% of a tile's height. The offset is a transform, so it never
   reflows; the last right-hand tile reserves the same space below it. Tile images
   carry width/height, so nothing shifts as they load. */
.tile-grid {
  --tile-gap: var(--space-3);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--tile-gap);
}

@media (min-width: 40em) {
  .tile-grid {
    container-type: inline-size;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* One column is (100cqi − gap) / 2 wide (cqi = the grid, so this is
     only valid on its children); a 4:3 tile is ¾ of that, and 40% of the
     tile height is 0.3 × column = 0.15 × (100cqi − gap). */
  .tile-grid > li {
    --tile-offset: calc((100cqi - var(--tile-gap)) * 0.15);
  }

  .tile-grid > li:nth-child(even) {
    transform: translateY(var(--tile-offset));
  }

  /* Only when a right-hand tile ends the grid. With an odd count the last
     tile is on the left and the lowered tile beside it needs no extra room. */
  .tile-grid > li:nth-child(even):last-child {
    margin-block-end: var(--tile-offset);
  }
}

.tile-grid > li {
  min-inline-size: 0;
}

/* Whole tile (cover + caption) is one link */
.tile {
  display: block;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md);
}

.tile:focus-visible {
  outline: 2px solid var(--color-accent-ink);
  outline-offset: 4px;
}

.tile-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
}

.tile-media img {
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: scale 300ms var(--ease-out);
}

/* Stamp tile: a wide 3500×1500 shot of a phone in hand, the phone in the
   middle 20% of the width. The default cover crop (centre) keeps the phone
   whole in both the square hero tile and the 4:3 work tile; the ground
   behind it is the image's own sand. */
.tile-media--stamp {
  background-color: var(--color-hero-stamp);
}

/* Atlas tile: a wide 2400×1029 laptop shot, the laptop in the middle 37%
   of the width. The default cover crop keeps it whole in the square hero
   tile (43% visible) and the 4:3 work tile (57%); the ground is the
   image's own grey-green. */
.tile-media--atlas {
  background-color: var(--color-hero-atlas);
}

/* Rituals tile: a wide 2400×1059 shot, phone + laptop in the middle 50% of
   the width, on the image's own lavender. The 4:3 work tile shows both
   whole; the square hero tile uses the Topnatur build (180%, centred). */
.tile-media--rituals {
  background-color: var(--color-hero-rituals);
}

/* Migration tile: a 1600×904 laptop shot on the image's own salmon. */
.tile-media--migration {
  background-color: var(--color-hero-migration);
}

.tile-caption {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-block-start: var(--space-2);
}

.tile-title {
  font-size: var(--step-1);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  transition: color var(--duration-fast) var(--ease-out);
}

.tile:hover .tile-title,
.tile:focus-visible .tile-title {
  color: var(--color-accent-ink);
}

/* Visible caption line: the same text the cursor label shows */
.tile-note {
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

/* ---- Cursor label (js/cursor-label.js) ----
   One shared fixed element. JS sets `transform` to the pointer every frame
   (never transitioned); `translate` centres it on that point. Hidden it is
   a 12px dot; .is-on morphs it to a pill (--w = measured text width) and
   fades the text in 60ms later. .is-static = keyboard focus, parked in the
   centre of the focused tile's cover. */
.cursor-label {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 101;
  display: grid;
  place-items: center;
  inline-size: 12px;
  block-size: 12px;
  overflow: hidden;
  border: 1px solid var(--color-bg);
  border-radius: var(--radius-pill);
  background-color: var(--color-text);
  color: var(--color-bg);
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  translate: -50% -50%;
  will-change: transform;
  transition:
    inline-size 200ms var(--ease-out),
    block-size 200ms var(--ease-out),
    border-radius 200ms var(--ease-out),
    opacity 200ms var(--ease-out);
}

.cursor-label > span {
  inline-size: max-content;
  opacity: 0;
  transition: opacity 120ms var(--ease-out);
}

.cursor-label.is-on {
  inline-size: calc(var(--w, 0px) + 2 * var(--space-2));
  block-size: 2.25em;
  opacity: 1;
}

.cursor-label.is-on > span {
  opacity: 1;
  transition-delay: 60ms;
}

/* Hero avatar: the pill sits above the pointer, clear of the sage dot,
   which stays visible underneath */
.cursor-label.is-above {
  translate: -50% calc(-100% - 20px);
}

.cursor-label.is-static {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: none !important;
}

/* The native cursor hides only over tiles, and only once the label exists */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor-label .tile[data-cursor],
  html.has-cursor-label .tile[data-cursor] * {
    cursor: none;
  }

  body:has(.tile[data-cursor]:hover) .cursor-dot {
    opacity: 0;
  }

  /* Over the avatar the pill replaces the inline hint (focus keeps it) */
  html.has-cursor-label .avatar-link[data-cursor]:hover:not(:focus-visible) .avatar-hint {
    opacity: 0;
  }
}

/* Touch: no label at all; the caption carries the text */
@media (hover: none) {
  .cursor-label:not(.is-static) {
    display: none;
  }
}

/* Mouse + motion OK: the cover eases up slightly */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .tile:hover .tile-media img,
  .tile:focus-visible .tile-media img {
    scale: 1.03;
  }
}

/* Reduced motion: no morph, no lerp (JS snaps); the pill only fades.
   (base.css zeroes every transition here, so the fade is restored.) */
@media (prefers-reduced-motion: reduce) {
  .cursor-label {
    inline-size: calc(var(--w, 0px) + 2 * var(--space-2));
    block-size: 2.25em;
    transition: opacity 150ms linear !important;
  }

  .cursor-label > span {
    opacity: 1;
  }
}

/* ---- Tags (non-interactive) ---- */
.tags {
  --cluster-space: var(--space-1);
  margin-block-start: auto;
  padding-block-start: var(--space-1);
}

.tag {
  padding: var(--space-1) var(--space-1);
  border: var(--border-hairline);
  border-radius: var(--radius-1);
  font-size: var(--step--1);
  line-height: 1;
  color: var(--color-text-muted);
}

.tag--impact {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  background-color: var(--color-accent-tint);
  border-color: transparent;
}

/* ---- Footer: "Let's chat" CTA + credit row ---- */
.site-footer {
  border-block-start: var(--border-hairline);
}

.footer-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-12);
}

/* Same type as the home hero headline (.hero-title): same face, weight,
   tracking and size. On desktop the footer copies the hero's two-column
   grid, so the 10cqi size resolves against an identical column width. */
.footer-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.6rem + 2.6vw, 4rem); /* 40 → 64px, as .hero-title */
  font-weight: var(--weight-medium);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

@media (min-width: 64em) {
  .footer-cta {
    --panel-h: calc(max(36rem, calc(100svh - var(--size-header))) - var(--space-3));
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      min(calc(var(--panel-h) * 0.82), 40vw);
    column-gap: var(--space-10);
  }

  .footer-text {
    container-type: inline-size;
  }

  .footer-title {
    font-size: clamp(2.25rem, 10cqi, 5.5rem); /* 36 → 88px, as .hero-title */
    text-wrap: nowrap;
  }

  :root:lang(cs) .footer-title {
    font-size: clamp(1.75rem, 8.4cqi, 4.5rem);
  }

  .footer-actions {
    justify-content: flex-end;
  }
}

.footer-title .footer-line,
.footer-title em {
  display: block;
}

/* Czech footer puts "něco" inline on the first line ("Pojďme něco / postavit.") */
.footer-title .footer-line em {
  display: inline;
}

.footer-title em {
  font-style: italic;
  font-weight: var(--weight-regular);
}

.footer-actions {
  --cluster-space: var(--space-1);
}

.footer-actions .pill-button {
  block-size: 3rem;
  padding-inline: var(--space-3);
}

.footer-bottom {
  padding-block: var(--space-4);
  border-block-start: var(--border-hairline);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
}

.footer-heart {
  display: inline-block;
  vertical-align: -1px;
  margin-inline: 2px;
  color: var(--color-accent);
}

/* Filled (primary) pill: "Email me" */
.pill-button--filled {
  background-color: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}

.pill-button--filled:hover {
  background-color: var(--color-accent-ink);
  border-color: var(--color-accent-ink);
  color: var(--color-bg);
}

/* ---- Peek preview (one shared <figure>, driven by js/peek.js) ----
   Fixed and out of flow, so it never shifts layout. `translate` places it
   (set by JS, no transition); `transform` runs the enter animation; the
   image's own transform eases the small sideways follow of the pointer. */
.peek-card {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 20;
  margin: 0;
  inline-size: min(400px, 100vw - 2 * var(--space-2));
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out),
    visibility 0s 180ms;
}

.peek-card.is-below { transform: translateY(-8px) scale(0.96); }

.peek-card.is-on {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

.peek-card img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 400 / 250;
  object-fit: cover;
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  transform: translateX(var(--dx, 0px));
  transition: transform 400ms var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .peek-card,
  .peek-card.is-below,
  .peek-card img { transform: none; }
}

/* Touch screens: no preview; the links just work. */
@media (hover: none) {
  .peek-card { display: none; }
}

/* ---- Hero grid: cells light up under the pointer and fade out behind it,
   like a trail. Built by js/site.js; it sits behind the hero content and
   never takes clicks. Lines use the text colour, the lit cell the sage
   accent, and a radial mask fades the grid out towards the edges. ---- */
.hero {
  position: relative;
  isolation: isolate;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
  color: var(--color-text);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 45%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 50% 45%, #000 20%, transparent 75%);
}

.hero-grid rect {
  fill: var(--color-accent);
  fill-opacity: 0;
  stroke: currentColor;
  stroke-opacity: 0.06;
  /* Fade out slowly once the pointer has left */
  transition: fill-opacity 1000ms var(--ease-out);
}

.hero-grid rect.is-lit {
  fill-opacity: 0.28;
  /* Light up at once */
  transition-duration: 0ms;
}

/* ---- Custom cursor: a small solid sage dot that grows into a larger
   solid circle over anything interactive. No outline, ring or shadow.
   Only switched on (by js/site.js) for a fine pointer that can hover and
   when reduced motion isn't requested; everyone else keeps the native
   cursor. Text fields keep the native I-beam. ---- */
html.has-custom-cursor,
html.has-custom-cursor * {
  cursor: none;
}

html.has-custom-cursor :is(input:not([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"]), textarea, [contenteditable="true"]) {
  cursor: text;
}

.cursor-dot {
  position: fixed;
  /* A real 30px box centred on the pointer, so the circle sits inside its
     own layer. A 0x0 layer with the circle overflowing it left stale paint
     fragments (a trail of tiny dashes) behind the dot in Chromium. */
  inset-block-start: -15px;
  inset-inline-start: -15px;
  inline-size: 30px;
  block-size: 30px;
  z-index: 100;
  pointer-events: none;
  contain: strict;
  /* Position only: updated every frame (translate3d), never transitioned */
}

/* The circle is drawn at its real size (no transform: scale), centred in
   the 30px box. A scaled-down layer left stray edge pixels behind on
   scaled Windows displays. */
.cursor-dot::before {
  --size: 9px;
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: var(--size);
  block-size: var(--size);
  margin: calc(var(--size) / -2);
  border-radius: 50%;
  background-color: var(--color-accent);
  opacity: 0;
  transition:
    inline-size 220ms var(--ease-out),
    block-size 220ms var(--ease-out),
    margin 220ms var(--ease-out),
    opacity 220ms var(--ease-out);
}

.cursor-dot.is-visible::before { opacity: 1; }

/* Over links, buttons, cards and other controls: 30px, a touch lighter */
.cursor-dot.is-visible.is-active::before {
  --size: 30px;
  opacity: 0.55;
}

/* Press feedback: a subtle shrink, released on pointer up */
.cursor-dot.is-pressed::before { --size: 7px; }
.cursor-dot.is-active.is-pressed::before { --size: 24px; }

/* Over text fields the native I-beam takes over */
.cursor-dot.is-text::before { opacity: 0; }
