/* ==========================================================================
   KARBAN LAB — events · spaces · light
   Mobile first: base = phone, then ≥600, ≥861 (desktop nav), ≥1101 (wide).
   Hover effects exist only for real pointers: @media (hover: hover) and (pointer: fine).
   Motion is deliberately limited to the light: cursor light, colour under the light,
   the wordmark's shadow, a small hover on photos and a short fade on scroll.
   ========================================================================== */

/* ---------- Fonts: 3 self-hosted files, subset to Latin + Czech/Slovak/Polish ---------- */
@font-face { font-family: "Jost"; src: url(../fonts/jost.woff2) format("woff2"); font-weight: 300 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url(../fonts/bodoni-moda.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url(../fonts/bodoni-moda-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* Animatable custom properties */
@property --r  { syntax: "<length>"; inherits: true; initial-value: 0px; }      /* spotlight radius */
@property --la { syntax: "<angle>";  inherits: true; initial-value: 78deg; }    /* direction the shadow falls */
@property --ld { syntax: "<number>"; inherits: true; initial-value: 140; }      /* shadow length (logo units) */

/* ---------- Tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #0c0b0a;
  --bg-2: #161412;
  --ink: #efe8e1;
  --muted: #8f877f;
  --line: rgba(239, 232, 225, .2);
  --logo: #e9d8cc;
  --logo-hi: #fbf1e8;
  --logo-lo: #dcc9bc;
  --cast: #000;
  --panel: #e8ddd4;
  --panel-ink: #0c0b0a;
  --torch: rgba(255, 236, 214, .065);
  --beam: rgba(255, 238, 220, .075);
  --head-bg: rgba(12, 11, 10, .74);
  --bg-fade: rgba(12, 11, 10, .8);
  --pad: 20px;
  /* 1 % of the screen height with the browser's toolbars shown. site.js pins it on phones whose browser resizes
     the page while its toolbars slide away (Brave on iPhone), so the hero and the covers never grow while scrolling. */
  --svh: 1svh;
  /* Where the first line of a subpage sits (eyebrow above the page title) – one value for every subpage */
  --page-top: calc(96px + env(safe-area-inset-top));
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: 180ms;
  /* Type scale – every large heading uses one of these */
  --fs-display: clamp(40px, 3vw + 26px, 72px);     /* page titles */
  --fs-feature: clamp(44px, 3.4vw + 30px, 84px);   /* selected project (FABINI in the draft) */
  --fs-project: clamp(40px, 3.6vw + 24px, 84px);   /* project detail title */
  --fs-statement: clamp(34px, 2.6vw + 24px, 62px); /* "Good spaces for good people.", next project */
  --fs-card: clamp(24px, 1vw + 20px, 36px);        /* reference titles */
  --fs-num: clamp(48px, 2.6vw + 40px, 80px);       /* service numbers */
  --fs-caps-title: clamp(22px, 1.2vw + 18px, 36px);/* EVENTS / SPACES … on the services page */
  /* Text: body copy and the small uppercase labels (menu, buttons, captions) – one scale for the whole site */
  --fs-body: 17px;
  --fs-label: 12.5px;    /* navigation, labels, arrow links, the claim */
  --fs-label-s: 12px;    /* numbers, filter chips, word lists */
  --fs-label-xs: 11px;   /* service taglines and footer on phones */
  --ls-label: .2em;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ece4dc;
  --bg-2: #e2d8ce;
  --ink: #0c0b0a;
  --muted: #6c635b;
  --line: rgba(20, 18, 16, .2);
  --logo: #0c0b0a;
  --logo-hi: #2b2622;
  --logo-lo: #000;
  --cast: #5a4636;
  --panel: #0c0b0a;
  --panel-ink: #ece4dc;
  --torch: rgba(255, 250, 240, .45);
  --beam: rgba(255, 255, 255, .35);
  --head-bg: rgba(236, 228, 220, .8);
  --bg-fade: rgba(236, 228, 220, .82);
  color-scheme: light;
}
@media (min-width: 600px) { :root { --pad: clamp(24px, 4vw, 56px); } }
@media (min-width: 861px) { :root { --page-top: clamp(108px, 6vw + 32px, 132px); } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* scroll-padding-top: anchor jumps (#services, #s1 …) and keyboard focus never end up under the fixed header */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; scrollbar-gutter: stable; cursor: default; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 300 var(--fs-body)/1.6 var(--sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  /* short pages (Kontakt on a big screen): the footer stays at the bottom of the window, not halfway up */
  min-height: calc(100 * var(--svh)); display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
/* The arrow everywhere (no text cursor over headings), the hand only where something happens */
a, button, [role="button"], summary, select, label[for] { cursor: pointer; }
input, textarea, [contenteditable="true"] { cursor: text; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--logo); color: var(--bg); }
/* Keyboard focus is always clearly visible; mouse clicks don't draw rings */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 12px 18px; background: var(--ink); color: var(--bg); outline-color: var(--ink); }

.caps { font: 500 var(--fs-label)/1.9 var(--sans); letter-spacing: var(--ls-label); text-transform: uppercase; text-wrap: balance; }
.muted { color: var(--muted); }
.num { font: 500 var(--fs-label-s)/1 var(--sans); letter-spacing: .16em; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }

.rule { width: 42px; height: 1px; border: 0; margin: 28px 0; background: currentColor; opacity: .75; transform-origin: left; transition: transform .35s var(--ease); }
.rule.short { width: 26px; margin: 18px 0; }
.rule.tiny { width: 16px; margin: 14px 0; }

/* ---------- Arrows: one small, consistent language ---------- */
.arrow-link { display: inline-flex; align-items: center; gap: 16px; font: 500 var(--fs-label)/1 var(--sans); letter-spacing: var(--ls-label); text-transform: uppercase; padding-block: 8px; }
.arrow { width: 46px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1; transition: transform .35s var(--ease); }
.arrow-back { width: 28px; }
.arrow-down { width: 13px; height: 13px; }                          /* "Prozkoumat" – goes down into the page */
.arrow-ext { display: inline-block; width: 8px; height: 8px; margin-left: 6px; vertical-align: .08em; opacity: .7; }   /* leaves the site */
.arrow-link.dash::before { content: ""; width: 26px; height: 1px; background: currentColor; }

/* ---------- Reveal on scroll: a short fade and a 12 px lift ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .8s var(--ease) var(--d, 0ms), transform .8s var(--ease) var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
/* Safety net: if site.js never runs (blocked, offline, error), everything still appears */
.js:not(.fx) .reveal { animation: kbl-show .6s var(--ease) 2.5s forwards; }
@keyframes kbl-show { to { opacity: 1; transform: none; } }

/* Photos fade in once they have arrived, over the neutral background of their frame (only when site.js is
   running). A photo that fails is asked for once more; meanwhile the frame stays plain – the browser's
   broken-image icon and the photo's description (alt text) never show, with or without JavaScript. */
.fx img:not(.is-loaded) { opacity: 0; }
img { position: relative; }
img::after { content: ""; position: absolute; inset: 0; background: var(--bg-2); }   /* drawn only for a photo that failed */

/* ---------- Torch: soft light following the cursor (desktop) ---------- */
.torch {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 30%), var(--torch), transparent 62%);
  transition: opacity .8s;
}
.has-pointer .torch { opacity: 1; }
[data-theme="dark"] .torch { mix-blend-mode: screen; }
[data-theme="light"] .torch { mix-blend-mode: soft-light; }

/* ==========================================================================
   HEADER + MENU
   ========================================================================== */
.site-head {
  position: fixed; z-index: 30; inset: 0 0 auto; display: flex; align-items: center; gap: 48px;
  padding: calc(18px + env(safe-area-inset-top)) var(--pad) 18px;
  transition: background .4s, padding .4s;
}
.site-head.scrolled { background: var(--head-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.menu-open .site-head { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.brand { display: block; padding: 15px 12px; margin: -15px -12px; color: var(--logo); }   /* 44 px target, same layout */
.brand svg { display: block; height: 14px; width: auto; fill: currentColor; }
.nav { display: none; }
.nav a, .langs { font: 500 var(--fs-label)/1 var(--sans); letter-spacing: var(--ls-label); text-transform: uppercase; }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.head-tools .langs { display: none; }
.langs { display: flex; gap: 7px; }
.langs > span { opacity: .6; }
/* Current language: full strength + a line. The other one is dimmed (still ≥ 4.5:1 contrast). */
.langs a { position: relative; opacity: .6; transition: opacity var(--fast); }
.langs a[aria-current] { opacity: 1; }
.langs a[aria-current]::after { content: ""; position: absolute; left: 0; right: .24em; bottom: -5px; height: 1px; background: currentColor; }

/* Light switch – a half-lit circle; the lit half swings round when the light is switched */
.switch { width: 44px; height: 44px; margin: -13px; display: grid; place-items: center; border-radius: 50%; }
.switch svg { width: 20px; height: 20px; overflow: visible; color: var(--logo); transition: transform .6s var(--ease), filter .4s; }
.switch circle { fill: none; stroke: currentColor; stroke-width: 1.25; }
.switch path { fill: currentColor; }
[data-theme="dark"] .switch svg { filter: drop-shadow(0 0 5px rgba(255, 236, 214, .45)); }
[data-theme="light"] .switch svg { transform: rotate(180deg); }

.burger { position: relative; width: 44px; height: 44px; margin: -10px -12px -10px 0; }
.burger i { position: absolute; left: 10px; right: 10px; height: 1px; background: currentColor; transition: transform .35s var(--ease), top .35s var(--ease); }
.burger i:first-of-type { top: 18px; } .burger i:last-of-type { top: 25px; }
.menu-open .burger i:first-of-type { top: 21.5px; transform: rotate(45deg); }
.menu-open .burger i:last-of-type { top: 21.5px; transform: rotate(-45deg); }

/* Full-screen mobile menu – outside the header so it always covers the whole screen */
.menu {
  position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column;
  padding: calc(96px + env(safe-area-inset-top)) var(--pad) calc(28px + env(safe-area-inset-bottom));
  background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
}
.menu::before { content: ""; position: absolute; inset: 0 0 auto; height: 60%; pointer-events: none; background: radial-gradient(70% 60% at 50% 0%, var(--beam), transparent 70%); }
.menu-open .menu { opacity: 1; visibility: visible; }
.menu-open { overflow: hidden; }
.menu-nav { display: flex; flex-direction: column; margin-block: auto; }
.menu-nav a {
  display: flex; align-items: baseline; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line);
  font: 300 clamp(28px, 8.4vw, 40px)/1.15 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  opacity: 0; transform: translateY(8px);
  transition: opacity .4s var(--ease), transform .4s var(--ease), color .25s;
  transition-delay: calc(var(--i) * 40ms + 40ms);
}
.menu-nav a:first-child { border-top: 1px solid var(--line); }
.menu-nav a[aria-current] { color: var(--logo); }
.menu-nav a[aria-current] .num { color: inherit; }
.menu-nav .num { min-width: 2.4em; }
.menu-open .menu-nav a { opacity: 1; transform: none; }
.menu-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 28px; }
.menu-foot .langs, .menu-social { flex-direction: column; gap: 0; font: 500 var(--fs-label)/1 var(--sans); letter-spacing: var(--ls-label); text-transform: uppercase; }
.menu-foot .langs a, .menu-social a { padding-block: 17px; min-width: 44px; }           /* 44 px touch targets */
.menu-foot .langs a[aria-current]::after { bottom: 11px; }
.menu-social { display: flex; align-items: flex-end; text-align: right; }

/* Without JavaScript: plain navigation instead of the menu button */
html:not(.js) .burger, html:not(.js) .switch { display: none; }

/* ==========================================================================
   HERO — photo + KAR/BAN/LAB, symmetric
   ========================================================================== */
.hero {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "stage stage" "left right";
  gap: 28px 16px; align-items: start;
  padding: calc(84px + env(safe-area-inset-top)) var(--pad) 44px;
  overflow: hidden; isolation: isolate;
  /* Idle light: a slow, narrow sweep of the wordmark's shadow (the cursor takes over on desktop) */
  animation: kbl-sweep 22s ease-in-out infinite alternate, kbl-reach 31s ease-in-out infinite alternate;
}
.hero.steer { animation: none; }
.hero.paused { animation-play-state: paused; }
@keyframes kbl-sweep { from { --la: 66deg; } to { --la: 114deg; } }
@keyframes kbl-reach { from { --ld: 115; } to { --ld: 165; } }

.hero-side { position: relative; z-index: 3; }
.hero-left { grid-area: left; justify-self: start; }
.hero-right { grid-area: right; justify-self: end; text-align: right; }
.hero-side .rule { margin: 20px 0; }
.hero-right .rule { margin-left: auto; }
.hero-lead span, .claim span { display: block; }
.hero-lead { font: 300 clamp(24px, 7vw, 34px)/1.1 var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.caps-list li { font: 500 var(--fs-label-s)/1.9 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.claim { font: 500 var(--fs-label)/1.9 var(--sans); letter-spacing: var(--ls-label); text-transform: uppercase; }

/* Geometry: photo 4:5, wordmark 16 % taller than the photo (8 % over each edge).
   On phones the stage is also limited by the screen height, so the whole hero fits one screen. */
.hero-stage {
  grid-area: stage; justify-self: center; position: relative;
  width: min(72vw, calc(38 * var(--svh)), 420px); aspect-ratio: .68966;
  display: grid; place-items: center;
}
.hero-photo {
  position: absolute; inset: 6.897% 0; overflow: hidden; background: var(--bg-2);
  box-shadow: 0 40px 80px -34px rgba(0, 0, 0, .75);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.bw { filter: grayscale(1) contrast(1.08) brightness(.82); }
[data-theme="light"] .bw { filter: grayscale(1) contrast(1.02) brightness(1.02); }
/* Dark theme: the photo behind the wordmark is dimmed, so KAR BAN LAB stays the brightest thing on stage */
.hero-photo .bw { filter: grayscale(1) contrast(1.08) brightness(.62); transition: filter .6s, opacity .6s var(--ease); }
[data-theme="light"] .hero-photo .bw { filter: grayscale(1) invert(1) contrast(.72) brightness(1.18); }
[data-theme="light"] .hero-photo { box-shadow: 0 40px 80px -40px rgba(60, 40, 25, .45); }
/* Warm light patch on the photo, on the side the light comes from */
.wash {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: radial-gradient(circle at calc(50% - cos(var(--la)) * 46%) calc(22% - sin(var(--la)) * 26%), rgba(255, 240, 222, .55), transparent 58%);
}
.hero-logo { position: relative; z-index: 2; width: 74.586%; margin: 0; line-height: 0; }

/* Wordmark + two-layer cast shadow (near = crisp contact shadow, far = soft penumbra) */
.kbl { position: relative; display: block; width: 100%; container-type: inline-size; --u: calc(100cqi / var(--kbl-w)); }
.kbl svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kbl-face { transition: opacity 1s var(--ease), transform 1s var(--ease); }
.kbl-shade { fill: var(--cast); pointer-events: none; will-change: transform; transition: opacity 1.4s var(--ease) .3s; }
.kbl-shade--near { opacity: .62; filter: blur(calc(var(--u) * 12)); transform: translate(calc(cos(var(--la)) * var(--ld) * .36 * var(--u)), calc(sin(var(--la)) * var(--ld) * .36 * var(--u))); }
.kbl-shade--far  { opacity: .56; filter: blur(calc(var(--u) * 44)); transform: translate(calc(cos(var(--la)) * var(--ld) * var(--u)), calc(sin(var(--la)) * var(--ld) * var(--u))); }
/* Entrance: the wordmark fades up once site.js is ready (with a fallback if it never runs) */
.js:not(.ready) .kbl-face { opacity: 0; transform: translateY(1%); }
.js:not(.ready) .kbl-shade { opacity: 0; }
.js:not(.fx):not(.ready) .kbl-face { animation: kbl-show .6s var(--ease) 1.5s forwards; }

/* Two mirrored stage beams – still, just light falling on the scene.
   Dark: warm white light. Light theme: two soft coloured gels (amber and rose) that tint the cream wall. */
.beams { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.beams i {
  position: absolute; top: -6%; width: 70vw; height: 125%;
  background: linear-gradient(to bottom, var(--beam-l, var(--beam)), transparent 85%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  filter: blur(18px); transform-origin: 50% 0; mix-blend-mode: screen;
}
.beams i:first-child { left: 4%; transform: rotate(-16deg); }
.beams i:last-child { right: 4%; transform: rotate(16deg); background: linear-gradient(to bottom, var(--beam-r, var(--beam)), transparent 85%); }
[data-theme="light"] .beams { --beam-l: rgba(214, 150, 84, .27); --beam-r: rgba(205, 120, 128, .23); }
[data-theme="light"] .beams i { mix-blend-mode: multiply; }

/* ==========================================================================
   SPOT — black & white; colour appears where the light falls
   ========================================================================== */
.spot { position: relative; display: block; overflow: hidden; background: var(--bg-2); }
.spot img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .5s var(--ease); }
.spot .lit {
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x, 50%) var(--y, 50%), #000 0, #000 30%, transparent 100%);
          mask-image: radial-gradient(circle var(--r) at var(--x, 50%) var(--y, 50%), #000 0, #000 30%, transparent 100%);
  transition: --r .9s var(--ease), transform .7s var(--ease), opacity .5s var(--ease);
}
.spot.is-lit { --r: 520px; }       /* touch screens: the photo in the middle of the screen lights up */
a:focus-visible .spot { --r: 520px; }   /* keyboard: the focused project is lit */
.spot::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, .35)); }

/* ==========================================================================
   SERVICES tiles (draft: 01 EVENTS / image / caption / rule)
   ========================================================================== */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 16px; padding: 32px var(--pad) 56px; }
.tile { display: block; }
.tile .num { display: block; margin-bottom: 8px; }
.tile-title { font: 300 clamp(17px, 5vw, 22px)/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.tile .spot { aspect-ratio: 4 / 3; }
.tile-text { display: block; margin-top: 12px; max-width: 24ch; font-size: var(--fs-label-xs); line-height: 1.8; letter-spacing: .16em; }
.tile .rule.short { margin: 14px 0 0; }

/* ==========================================================================
   FEATURE — photo + cream panel with window light
   ========================================================================== */
.feature { display: grid; }
.feature-img { aspect-ratio: 4 / 3; }
.feature-panel { position: relative; overflow: hidden; background: var(--panel); color: var(--panel-ink); display: flex; align-items: center; padding: 56px var(--pad) 64px; isolation: isolate; }
.feature-copy { position: relative; z-index: 2; }
.feature-title { font: 400 var(--fs-feature)/.95 var(--serif); letter-spacing: -.02em; margin-top: 18px; }
.feature-title small { font-size: .28em; letter-spacing: 0; white-space: nowrap; vertical-align: .45em; }

/* Gobo: sunlight through a window falling on the wall (still) */
.gobo {
  position: absolute; inset: -30%; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 38% 46% at 70% 42%, rgba(255, 232, 200, .55), transparent 70%),
    repeating-linear-gradient(98deg, transparent 0 9%, rgba(40, 26, 14, .13) 9% 10.4%),
    linear-gradient(8deg, transparent 49.2%, rgba(40, 26, 14, .14) 49.2% 51.3%, transparent 51.3%);
  filter: blur(5px); transform: rotate(-4deg);
  mix-blend-mode: multiply;
}
[data-theme="light"] .feature-panel .gobo { mix-blend-mode: screen; background:
    radial-gradient(ellipse 38% 46% at 70% 42%, rgba(255, 232, 200, .16), transparent 70%),
    repeating-linear-gradient(98deg, transparent 0 9%, rgba(255, 240, 220, .06) 9% 10.4%); }

/* ==========================================================================
   CTA — "Good spaces for good people."
   ========================================================================== */
.cta { display: grid; gap: 36px; padding: 72px var(--pad); }
.cta-title { font: 400 var(--fs-statement)/1.04 var(--serif); letter-spacing: -.02em; }
.cta-title em { font-style: italic; }
.cta-link { display: block; justify-self: start; }                  /* the whole question is the link */
.cta-q { display: block; margin-bottom: 22px; transition: transform .35s var(--ease); }
.cta-link .arrow-link { padding-block: 0; margin-block: 0; }
.cta-photo { aspect-ratio: 1 / .88; max-width: 420px; }
.cta-social { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.cta-social a { padding-block: 6px; transition: opacity var(--fast); }
.cta-social .rule { display: none; }
.cta-social span { flex-basis: 100%; margin-top: 10px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-foot { padding: 0 var(--pad) calc(26px + env(safe-area-inset-bottom)); }
.foot-inner { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; border-top: 1px solid var(--line); font: 500 var(--fs-label-xs)/1.8 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.foot-words { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 6px; font-size: 10px; letter-spacing: .12em; }

/* ==========================================================================
   SUBPAGES
   ========================================================================== */
.page-head { position: relative; padding: var(--page-top) var(--pad) 36px; }
.display {
  font: 400 var(--fs-display)/1 var(--serif); letter-spacing: -.02em; color: var(--logo);
  margin: 14px 0 0 -.03em; max-width: 16ch;
  text-shadow: calc(cos(var(--la)) * var(--ld) * .05px) calc(sin(var(--la)) * var(--ld) * .05px) calc(var(--ld) * .09px) rgb(from var(--cast) r g b / .55);
}
/* Filters: one swipeable row on phones (padding leaves room for the focus ring) */
.filters {
  display: flex; gap: 8px; margin: 26px calc(-1 * var(--pad)) 0; padding: 8px var(--pad);
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad);
}
.filters::-webkit-scrollbar { display: none; }
html:not(.js) .filters { display: none; }
.chip { flex: none; scroll-snap-align: start; font: 500 var(--fs-label-s)/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; padding: 13px 16px; border: 1px solid var(--line); border-radius: 40px; transition: background var(--fast), color var(--fast), border-color var(--fast); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:focus-visible { outline-color: var(--ink); }

/* Work grid – every card is one link; the title comes first for screen readers, CSS keeps the look */
.grid { display: grid; gap: 52px; padding: 16px var(--pad) 40px; transition: opacity .2s var(--ease); }
.grid.is-switching { opacity: 0; }
.card { display: flex; flex-direction: column; }
.card[hidden] { display: none; }
.card-img { order: 0; aspect-ratio: 4 / 3; margin-bottom: 18px; }
.card-meta { order: 1; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.card-title { order: 2; display: block; font: 400 var(--fs-card)/1.1 var(--serif); letter-spacing: -.01em; margin-top: 6px; text-wrap: balance; }
.card-client { order: 3; display: block; margin-top: 8px; color: var(--muted); }
.empty { padding: 40px var(--pad) 100px; }

/* Project detail */
.draft-bar { position: fixed; z-index: 60; bottom: 20px; left: 50%; transform: translateX(-50%); background: #c7462c; color: #fff; padding: 10px 18px; font: 500 12px/1 var(--sans); letter-spacing: .1em; }
.project-hero { position: relative; height: calc(86 * var(--svh)); min-height: 480px; overflow: hidden; }
/* A dark stage until the cover arrives – in both themes, because the header over the cover is always light */
.project-cover { position: absolute; inset: 0; background: #161412; }
.project-cover img::after { background: #161412; }
/* The lights come up on the cover as soon as it has arrived */
.project-cover img { width: 100%; height: 100%; object-fit: cover; animation: lights-up 1.4s var(--ease) both; transition: opacity .5s var(--ease); }
.fx .project-cover img:not(.is-loaded) { animation: none; }
@keyframes lights-up { from { filter: brightness(.3); } }
/* Dark at the top for the header, fading into the page at the bottom where the title sits (both themes) */
.project-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,11,10,.5) 0%, transparent 26%, transparent 40%, var(--bg-fade) 78%, var(--bg) 100%); }
/* Light theme: the header stays light over the photo until the page scrolls */
html[data-theme="light"]:not(.menu-open) .page-work-detail .site-head:not(.scrolled) { color: #efe8e1; --logo: #efe8e1; }
[data-theme="light"] .project-title { text-shadow: none; }
.project-hero-copy { position: absolute; z-index: 2; left: var(--pad); right: var(--pad); bottom: 28px; }
/* Breadcrumb above the project title: ← Reference / Project */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; gap: 12px; padding-block: 8px; opacity: .85; transition: opacity var(--fast); }
.crumb-sep { opacity: .45; }
.crumb-here { opacity: .7; }
.project-title { font: 400 var(--fs-project)/1 var(--serif); letter-spacing: -.02em; max-width: 18ch; text-shadow: 0 10px 50px rgba(0,0,0,.45); }
.project-title small { font-size: .24em; letter-spacing: 0; vertical-align: .5em; white-space: nowrap; }
.project-body { display: grid; gap: 34px; padding: 44px var(--pad); max-width: 1500px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-content: start; }
.facts dt { color: var(--muted); }
.facts dd { font-size: var(--fs-body); }
.prose { font-size: 18px; line-height: 1.75; max-width: 64ch; }
.prose p + p { margin-top: 1.1em; }
.prose a { border-bottom: 1px solid var(--line); transition: border-color var(--fast); }
.lead { font: 300 clamp(20px, 5.4vw, 28px)/1.5 var(--sans); margin-bottom: 1.2em; }
.credits { margin-top: 2.4em; color: var(--muted); }
.video { margin: 0 var(--pad) 48px; aspect-ratio: 16 / 9; }
.video iframe { width: 100%; height: 100%; border: 0; }
/* Gallery – nothing is cropped: every photo keeps its proportions (--ar = width/height). Rows come from the
   server (gallery_rows); in a row all photos share one height. Phones: one photo per line. */
.gallery, .g-row { display: grid; gap: 12px; }
.gallery { padding: 0 var(--pad) 56px; }
.g-item { display: block; overflow: hidden; background: var(--bg-2); aspect-ratio: var(--ar, 3 / 2); cursor: zoom-in; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .5s var(--ease); }
.next { display: grid; gap: 24px; padding: 56px var(--pad); border-top: 1px solid var(--line); }
.next-copy { display: block; }
.next-title { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font: 400 var(--fs-statement)/1.05 var(--serif); letter-spacing: -.02em; margin-top: 12px; }
.next-img { aspect-ratio: 4 / 3; }

/* Lightbox – a native modal <dialog>: focus stays inside, Esc closes, the page behind is inert */
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  background: rgba(8, 7, 6, .96); color: #efe8e1;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lb-open { overflow: hidden; }
.lb-stage { display: grid; justify-items: center; gap: 14px; margin: 0; padding: 64px 12px 84px; max-width: 100%; max-height: 100%; }
.lb-img { max-width: 100%; max-height: calc(100 * var(--svh) - 160px); width: auto; height: auto; object-fit: contain; box-shadow: 0 40px 100px rgba(0, 0, 0, .6); transition: opacity .3s var(--ease); }
.lb-img:not(.is-loaded) { opacity: 0; }
.lb-count { font: 500 var(--fs-label-s)/1 var(--sans); letter-spacing: .2em; color: rgba(239, 232, 225, .7); }
.lightbox button { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; color: #efe8e1; opacity: .8; transition: opacity var(--fast); }
.lightbox svg { fill: none; stroke: currentColor; stroke-width: 1.2; }
.icon-close { width: 24px; height: 24px; }
.lb-close { top: calc(8px + env(safe-area-inset-top)); right: 8px; }
.lb-prev { left: 6px; bottom: 16px; } .lb-next { right: 6px; bottom: 16px; }
.lb-prev .arrow, .lb-next .arrow { width: 36px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.single .lb-count { display: none; }

/* Services page */
.service { display: grid; gap: 28px; padding: 36px var(--pad); }
.service-img { aspect-ratio: 4 / 5; }
/* line-height 1 + margin -.1125em: the flat top of the figures (0.75 em, Bodoni Moda metrics) lands on the box top */
.num.big { display: block; font: 400 var(--fs-num)/1 var(--serif); letter-spacing: -.01em; color: var(--logo); margin: -.1125em 0 14px; }
.service-title { font: 300 var(--fs-caps-title)/1.05 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.service .prose { margin-top: 8px; }
.page-head + .service { padding-top: 8px; }   /* the first service follows the page title as closely as the text on O nás */
.related { margin-top: 36px; }
.related ul { margin-top: 10px; border-top: 1px solid var(--line); }
.related li a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font: 400 20px/1.3 var(--serif); }

/* About */
.about { display: grid; gap: 34px; padding: 0 var(--pad) 72px; }
.about-img { aspect-ratio: 4 / 5; }
.steps { padding: 0 var(--pad) 48px; }
.steps ol { display: grid; gap: 36px; margin-top: 24px; border-top: 1px solid var(--line); padding-top: 30px; }
.step-title { font: 300 24px/1.1 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-top: 14px; }

/* Contact – starts where every subpage starts; on a laptop the e-mail, phone and profiles sit next to the
   statement (not under it), so everything is on the first screen */
.contact { display: grid; padding: var(--page-top) var(--pad) 72px; }
.contact .cta-title { grid-area: title; font-size: var(--fs-display); margin: 14px 0 26px; }
.contact .lead { grid-area: lead; max-width: 36ch; margin-bottom: 0; }
.contact-list { grid-area: list; display: grid; gap: 24px; align-content: start; margin-top: 34px; }
.contact-list dt { color: var(--muted); }
.big-link { font: 400 clamp(22px, 1vw + 18px, 34px)/1.25 var(--serif); border-bottom: 1px solid transparent; transition: border-color var(--fast); overflow-wrap: anywhere; }
.socials { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.socials a { transition: opacity var(--fast); }
.contact-photo { grid-area: photo; aspect-ratio: 4 / 5; margin-top: 48px; }
.contact { grid-template-areas: "eyebrow" "title" "lead" "list" "photo"; }
.contact > h1 { grid-area: eyebrow; }

/* 404 */
.notfound { min-height: calc(90 * var(--svh)); display: grid; place-content: center; text-align: center; gap: 18px; padding: 140px var(--pad) 80px; }
.notfound .display { margin: 0 auto; }
.notfound .arrow-link { justify-self: center; }

/* ==========================================================================
   Phones
   ========================================================================== */
/* Phones and short screens: no second word list – the hero fits one screen
   and the services already show below it */
@media (max-width: 599px), (max-width: 860px) and (max-height: 760px) {
  .caps-list { display: none; }
}
@media (max-width: 599px) {
  .hero { padding-bottom: 32px; }
  .services { padding-top: 24px; }
}
/* Phones held sideways: the desktop arrangement, scaled to the height */
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {
  .hero { grid-template-columns: 1fr auto 1fr; grid-template-areas: "left stage right"; align-items: center; padding-top: 72px; }
  .hero-stage { width: min(34vw, calc(62 * var(--svh))); }
}
/* Without JavaScript: the four links in the header instead of the menu button */
@media (max-width: 860px) {
  html:not(.js) .nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
  html:not(.js) .nav a { font-size: var(--fs-label-xs); letter-spacing: .14em; }
}

/* Touch screens: every small link gets a 44 px tall target without changing the layout */
@media (pointer: coarse) {
  .arrow-link, .back { padding-block: 17px; margin-block: -9px; }
  .cta-social a, .socials a { padding: 17px 4px; margin: -11px -4px; }
  .chip { padding-block: 17px; }
  .big-link { display: inline-block; padding-block: 8px; }
}

/* ==========================================================================
   ≥ 600 px
   ========================================================================== */
@media (min-width: 600px) {
  .hero-lead { font-size: clamp(28px, 4.2vw, 40px); }
  .caps-list li { font-size: var(--fs-label); letter-spacing: .24em; }
  .claim { font-size: 13.5px; }
  .tile-text { font-size: var(--fs-label); letter-spacing: var(--ls-label); line-height: 1.9; }
  .services { gap: 60px clamp(20px, 3vw, 48px); padding-block: 40px 72px; }
  .gallery, .g-row { gap: clamp(14px, 2vw, 28px); }
  .g-row { display: flex; }
  .g-item { flex: var(--ar) 1 0; min-width: 0; }
  /* a photo alone in its row: centred, never taller than the screen */
  .g-row.solo .g-item { flex: none; width: min(100%, calc(var(--ar) * 82 * var(--svh))); margin-inline: auto; }
  .steps ol { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .facts { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .foot-inner { flex-direction: row; justify-content: space-between; }
  .foot-words { justify-content: flex-end; gap: 0 10px; font-size: var(--fs-label-xs); letter-spacing: .2em; }
}

/* ==========================================================================
   ≥ 861 px — desktop navigation and layouts
   ========================================================================== */
@media (min-width: 861px) {
  .site-head { padding-block: calc(26px + env(safe-area-inset-top)) 26px; }
  .site-head.scrolled { padding-block: 16px; }
  .brand svg { height: 15px; }
  .nav { display: flex; gap: clamp(24px, 4.2vw, 64px); }
  /* Current page: full strength + a line under it; the other pages dimmed */
  .nav a { position: relative; padding: 8px 0; opacity: .6; transition: opacity var(--fast); }
  .nav a[aria-current] { opacity: 1; }
  .nav a::after { content: ""; position: absolute; left: 0; right: .24em; bottom: 2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
  .nav a[aria-current]::after { transform: none; }
  .head-tools { gap: 24px; }
  .head-tools .langs { display: flex; }
  .burger, .menu { display: none; }

  .hero {
    min-height: calc(100 * var(--svh)); align-items: center;
    grid-template-columns: 1fr auto 1fr; grid-template-areas: "left stage right";
    gap: clamp(16px, 3vw, 48px);
    padding: 110px var(--pad) 64px;
  }
  .hero-side .rule { margin: 28px 0; }
  .hero-right .rule { margin-left: auto; }
  .hero-stage { width: clamp(240px, min(29vw, calc(50 * var(--svh))), 440px); }
  .hero-lead { font-size: clamp(30px, 3.1vw, 48px); }
  .caps-list li { line-height: 2.1; }
  .beams i { width: 34vw; }
  .beams i:first-child { left: 8%; } .beams i:last-child { right: 8%; }

  .feature { grid-template-columns: 47fr 53fr; min-height: clamp(420px, 38vw, 640px); }
  .feature-img { aspect-ratio: auto; min-height: 100%; }
  .feature-panel { padding: 60px clamp(28px, 7vw, 120px); }

  .cta { grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; padding-block: clamp(80px, 8vw, 120px); }
  .cta-photo { grid-row: span 2; }

  .page-head { padding-bottom: clamp(40px, 4vw, 60px); }
  .filters { margin: 40px -8px 0; padding: 8px; flex-wrap: wrap; overflow: visible; }
  .grid { grid-template-columns: 1fr 1fr; gap: clamp(60px, 6vw, 100px) clamp(24px, 4vw, 70px); padding-top: 0; }

  .project-hero { height: calc(92 * var(--svh)); min-height: 560px; }
  .project-hero-copy { bottom: clamp(30px, 5vw, 70px); }
  .project-body { grid-template-columns: 1fr 2fr; gap: clamp(30px, 6vw, 110px); padding-block: clamp(56px, 6vw, 90px); }
  .facts { grid-template-columns: 1fr; gap: 22px; }
  .prose { font-size: 19px; }
  .video { margin-bottom: clamp(40px, 6vw, 90px); }
  .next { grid-template-columns: 1fr minmax(240px, 34vw); align-items: center; gap: 40px; padding-block: clamp(60px, 7vw, 110px); }
  .lb-stage { padding: 56px 96px 64px; }
  .lb-img { max-height: calc(100 * var(--svh) - 140px); }
  .lb-prev { left: 14px; bottom: auto; top: 50%; transform: translateY(-50%); }
  .lb-next { right: 14px; bottom: auto; top: 50%; transform: translateY(-50%); }

  .service { grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 110px); align-items: start; padding-block: clamp(48px, 6vw, 90px); }
  .service.flip .service-img { order: 2; }
  .about { grid-template-columns: .9fr 1.1fr; gap: clamp(30px, 6vw, 110px); align-items: start; padding-bottom: clamp(72px, 8vw, 120px); }
  /* two columns: statement + text | contact details; the photo under the text */
  .contact {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "eyebrow eyebrow" "title list" "lead list" "photo list";
    column-gap: clamp(32px, 5vw, 80px); align-items: start;
  }
  .contact .lead { font-size: clamp(19px, 1vw + 8px, 22px); }
  .contact-list { margin-top: 14px; }
  .contact-photo { max-width: 360px; }
}

/* ==========================================================================
   ≥ 1101 px
   ========================================================================== */
@media (min-width: 1101px) {
  .services { grid-template-columns: repeat(4, 1fr); padding-block: clamp(56px, 6vw, 90px) clamp(70px, 7vw, 110px); }
  .tile-title { font-size: clamp(20px, 1.7vw, 26px); }
  .cta { grid-template-columns: 1.6fr 1.1fr 1.3fr .7fr; }
  .cta-photo { grid-row: auto; max-width: none; }
  .cta-social { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 4px; }
  .cta-social .rule { display: block; }
  .cta-social span { flex-basis: auto; margin-top: 0; color: inherit; }
  .steps ol { grid-template-columns: repeat(4, 1fr); }
  /* three columns, like the contact row of the draft: statement + text | contact details | photo */
  .contact {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .8fr); grid-template-rows: auto auto 1fr;
    grid-template-areas: "eyebrow eyebrow eyebrow" "title list photo" "lead list photo";
  }
  .contact-photo { max-width: none; margin-top: 22px; }   /* top edge level with the tops of the letters beside it */
}

/* Very small phones (320 px): same composition, a little tighter */
@media (max-width: 359px) {
  .hero { column-gap: 12px; }
  .hero-lead { font-size: 22px; }
  .claim { font-size: 11.5px; letter-spacing: .12em; }
  .arrow-link { gap: 12px; }
}

/* ==========================================================================
   HOVER – only for a real mouse/trackpad (no "sticky" hover after a tap on phones).
   Small and consistent: dim what you can leave, move the arrow, 1.025× on photos.
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  .nav a:hover, .langs a:hover { opacity: 1; }
  .nav a:hover::after { transform: none; }
  .switch:hover svg { transform: rotate(-35deg); }
  [data-theme="light"] .switch:hover svg { transform: rotate(145deg); }

  .arrow-link:hover .arrow, a:hover > .arrow, a:hover .next-title .arrow { transform: translateX(6px); }
  .go-down:hover .arrow-down { transform: translate(3px, 3px); }
  a:hover > .arrow-back { transform: translateX(-6px); }
  .back:hover { opacity: 1; }
  .ext:hover .arrow-ext { transform: translate(2px, -2px); }

  .spot:hover { --r: 340px; }
  a:hover .spot img, .spot:hover img, .g-item:hover img { transform: scale(1.025); }
  .tile:hover .rule { transform: scaleX(1.7); }

  .cta-link:hover .cta-q { transform: translateX(6px); }
  .cta-link:hover .arrow { transform: translateX(10px); }
  .cta-social a:hover, .socials a:hover, .menu-social a:hover { opacity: .6; }
  .big-link:hover, .prose a:hover { border-color: currentColor; }
  .chip:hover { border-color: var(--ink); }
  .lightbox button:hover { opacity: 1; }
}

/* ==========================================================================
   Reduced motion: no animation at all, content shown immediately
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
