:root {
  --bg: #0c0c0c;
  --bg-2: #141414;
  --ink: #f2efe9;
  --muted: #8d8a84;
  --line: rgba(242, 239, 233, .14);
  --accent: #b08463;
  --display: "Jost", "Helvetica Neue", sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 300; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.is-loading, body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
ol { list-style: none; }
em { font-style: normal; color: var(--accent); }
.center { text-align: center; }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .8s var(--ease), visibility .8s; }
.loader-logo { width: 88px; height: 88px; color: var(--ink); overflow: visible; }
.loader-logo .o { transform-box: view-box; transform-origin: center; animation: spin linear infinite; }
.loader-logo .o1 { animation-duration: 2s; }
.loader-logo .o2 { animation-duration: 3s; animation-direction: reverse; }
.loader-logo .o3 { animation-duration: 6s; }
.loader-logo .sat { animation-duration: 1.5s; }
@keyframes spin { to { transform: rotate(360deg); } }
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; }

/* ---------- Header ---------- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 1.5rem var(--gutter); mix-blend-mode: difference; }
.mark { width: 52px; height: 52px; display: grid; place-items: center; color: var(--ink); }
.mark svg { width: 100%; height: 100%; }
.mark .o { transform-box: view-box; transform-origin: center; transition: transform .4s var(--ease); }
.header-right { display: flex; align-items: center; gap: 1.5rem; }
.pill { display: inline-block; padding: .9rem 1.6rem; border-radius: 999px; background: rgba(242,239,233,.08); border: 1px solid var(--line); font: 500 .8rem var(--sans); letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(8px); transition: background .3s, color .3s; }
.pill:hover { background: var(--ink); color: var(--bg); }
.pill-lg { padding: 1.2rem 2.4rem; }
.burger { width: 44px; height: 24px; background: none; border: 0; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 0; right: 0; height: 1.5px; background: var(--ink); transition: transform .4s var(--ease), top .4s var(--ease); }
.burger span:first-child { top: 7px; }
.burger span:last-child { top: 15px; }
.menu-open .burger span:first-child { top: 11px; transform: rotate(45deg); }
.menu-open .burger span:last-child { top: 11px; transform: rotate(-45deg); }

/* ---------- Menu ---------- */
.menu { position: fixed; inset: 0; z-index: 40; background: var(--bg-2); display: flex; align-items: center; padding: 0 var(--gutter); clip-path: inset(0 0 100% 0); transition: clip-path .8s var(--ease); }
.menu-open .menu { clip-path: inset(0 0 0 0); }
.menu ol { display: grid; gap: .25rem; }
.menu a { display: flex; align-items: baseline; gap: 1.25rem; font: 200 clamp(2.4rem, 7vw, 5.5rem)/1.1 var(--display); text-transform: uppercase; transition: color .3s, padding .3s; }
.menu a:hover { color: var(--accent); padding-left: 1rem; }
.menu small { font: 400 .8rem var(--sans); color: var(--muted); width: 2rem; }

/* ---------- Chapter nav ---------- */
.chapters { position: fixed; left: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 30; display: grid; gap: 1rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity .5s; }
.chapters.show { opacity: 1; pointer-events: auto; }
.chapters ol { display: grid; gap: .5rem; border-left: 1px solid var(--line); padding-left: .9rem; }
.chapters a { transition: color .3s; }
.chapters a.active, .chapters a:hover { color: var(--ink); }
.chapters a.active::before { content: ""; position: absolute; margin-left: calc(-.9rem - 1px); width: 1px; height: 1.1em; background: var(--accent); }
.chapters-label { color: var(--ink); }
.chapters-back { font-size: .65rem; }
.chapters-back:hover { color: var(--accent); }

/* ---------- Type ---------- */
.display { font: 200 clamp(3.2rem, 11vw, 10rem)/.95 var(--display); text-transform: uppercase; letter-spacing: -.01em; }
.title { font: 200 clamp(2.6rem, 6vw, 5.2rem)/1 var(--display); text-transform: uppercase; }
.title.xl { font-size: clamp(3rem, 9vw, 8.5rem); max-width: 14ch; margin-bottom: clamp(3rem, 7vw, 6rem); }
.giant { font: 200 clamp(4rem, 17vw, 16rem)/.9 var(--display); text-transform: uppercase; letter-spacing: -.02em; }
.giant.outline { color: transparent; -webkit-text-stroke: 1px var(--ink); }
.small-caps { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.small-caps strong { color: var(--ink); font-weight: 500; }
.body { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.55; max-width: 38rem; margin-top: 1.5rem; }
.body.center { margin-inline: auto; }
.body.narrow { max-width: 44rem; margin-bottom: 3rem; }

/* Split words (filled by JS) */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; }
.w > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 60ms); }
.in .w > span { transform: none; }
/* Scroll highlight words (filled by JS) */
.hl { opacity: .18; transition: opacity .25s; }
.hl.on { opacity: 1; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 8rem var(--gutter) 2rem; overflow: hidden; }
.hero-bg { position: absolute; inset: -10% 0 0; z-index: -1; background:
  linear-gradient(180deg, rgba(12,12,12,.2) 0%, rgba(12,12,12,.9) 85%),
  repeating-linear-gradient(90deg, #1b1b1b 0 18px, #0f0f0f 18px 34px);
  will-change: transform; }
.hero .display { max-width: 12ch; }
.hero .display.hero-wide { max-width: 15ch; }
@media (max-width: 520px) { .hero .display.hero-wide { font-size: clamp(2rem, 9.4vw, 3.2rem); } }
.hero-foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 2rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1rem; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.hero-roles { text-align: right; color: var(--muted); }
.scroll-cue { padding: .6rem 1.2rem; border: 1px solid var(--line); border-radius: 999px; }
.scroll-cue span { display: inline-block; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ---------- Chapters ---------- */
.chapter { padding: clamp(6rem, 14vw, 11rem) var(--gutter) clamp(4rem, 10vw, 8rem) calc(var(--gutter) + clamp(0rem, 9vw, 9rem)); }
.chapter-tag { display: flex; gap: 1rem; align-items: center; margin-bottom: 2.5rem; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.chapter-tag span { color: var(--accent); }
.chapter-tag::after { content: ""; flex: 0 0 4rem; height: 1px; background: var(--line); }

/* Placeholder images */
.ph { position: relative; border-radius: 4px; overflow: hidden; display: flex; align-items: flex-end; padding: 1rem; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(242,239,233,.55); }
.ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.5)); }
.ph span { position: relative; z-index: 1; }
.ph-team { aspect-ratio: 4 / 5; background: linear-gradient(160deg, #3a3a3a, #121212); filter: grayscale(1); }
.ph-1 { background: linear-gradient(140deg, #2b2b2b, #6d5544); }
.ph-2 { background: linear-gradient(140deg, #d8d2c8, #8f877b); }
.ph-3 { background: linear-gradient(140deg, #1d2430, #4a5a73); }
.ph-4 { background: linear-gradient(140deg, #b08463, #4c3426); }
.ph-5 { background: linear-gradient(140deg, #353029, #8a7a62); }
.ph-6 { background: linear-gradient(140deg, #222, #555); }

/* Bab I */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.about-grid .ph-team { max-height: 78vh; max-height: 78svh; } /* keeps the whole block inside the screen while it is pinned */
.reach { margin-top: clamp(6rem, 14vw, 12rem); text-align: center; display: grid; gap: 1rem; justify-items: center; }
.reach .giant + .small-caps { margin-top: 2rem; }
.reach > .small-caps:nth-last-of-type(1) { margin-top: 2rem; }

/* Bab II */
.works-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 2.5rem; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.works-head .count { font: 200 3rem var(--display); color: var(--ink); letter-spacing: 0; }
.works { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2.5rem); }
.work:nth-child(even) { margin-top: clamp(0rem, 8vw, 8rem); }
.work .ph { aspect-ratio: 4 / 5; transition: transform .8s var(--ease); }
.work:hover .ph { transform: scale(.97); }
.work-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: 1rem; }
.work-meta h3 { font: 300 1.4rem var(--display); text-transform: uppercase; }
.work-meta p { font-size: .8rem; color: var(--muted); }
/* Three columns, middle column dropped: the arrangement used on the Work page and in the home "Selected work" */
.works-3 { grid-template-columns: repeat(3, 1fr); }
.works-3 .work:nth-child(even) { margin-top: 0; }
.works-3 .work:nth-child(3n+2) { margin-top: clamp(0rem, 6vw, 6rem); }
.work.hide { display: none; }
.works-3.filtered .work { margin-top: 0 !important; }
.statement { margin: clamp(6rem, 12vw, 10rem) 0 3rem; text-align: center; display: grid; gap: .5rem; }
.statement p[data-split] { font: 200 clamp(2.4rem, 7vw, 6rem)/1 var(--display); text-transform: uppercase; }
.statement .dim { color: var(--muted); }
.statement .small-caps { margin-top: 1.5rem; }

/* Bab III */
.services li { display: grid; grid-template-columns: 4rem 1.2fr 1fr; gap: 1.5rem; align-items: center; padding: 2rem 0; border-top: 1px solid var(--line); transition: padding .4s var(--ease), color .3s; }
.services li:last-child { border-bottom: 1px solid var(--line); }
.services li:hover { padding-left: 1rem; }
.services li:hover h3 { color: var(--accent); }
.s-num { font-size: .78rem; color: var(--muted); letter-spacing: .1em; }
.services h3 { font: 200 clamp(1.8rem, 4vw, 3.4rem)/1 var(--display); text-transform: uppercase; transition: color .3s; }
.services p { color: var(--muted); }
.trusted { margin-top: clamp(5rem, 10vw, 8rem); text-align: center; }
.logos { overflow: hidden; margin-top: 2rem; mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.logos-track { display: flex; width: max-content; gap: 5rem; animation: marquee 30s linear infinite; }
.logos-track span { font: 300 1.6rem var(--display); text-transform: uppercase; color: var(--muted); letter-spacing: .1em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Bab IV */
.split-statement { display: grid; gap: .9rem; margin-bottom: 2rem; }
.split-statement p { font-size: clamp(1.15rem, 2.6vw, 2.5rem); letter-spacing: .08em; line-height: 1.25; }
.split-statement p:nth-child(2) { padding-left: 8%; }
.split-statement p:nth-child(3) { padding-left: 16%; color: var(--ink); }
.loop { margin: clamp(3rem, 8vw, 6rem) 0; }
.loop-label { margin-bottom: 1.5rem; }
.process { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.process li { background: var(--bg); padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: .75rem; min-height: 18rem; position: relative; }
.process li:not(:last-child)::after { content: "→"; position: absolute; right: -.5rem; top: 2rem; z-index: 1; color: var(--accent); font-size: .9rem; background: var(--bg); }
.process span { font-size: .75rem; color: var(--accent); letter-spacing: .12em; }
.process h3 { font: 300 1.6rem var(--display); text-transform: uppercase; }
.process p { color: var(--muted); font-size: .92rem; }
.who { margin-top: auto; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; align-self: flex-start; }
/* Comparison table */
.compare { margin-top: clamp(6rem, 13vw, 11rem); border-top: 1px solid var(--line); }
.compare-head, .compare dl > div { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.compare-head p { font-size: clamp(.9rem, 1.7vw, 1.05rem); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.compare-head p:last-child { color: var(--accent); }
.compare dt, .compare dd { font-size: clamp(1.2rem, 2.3vw, 1.47rem); line-height: 1.35; }
.compare dt { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(242,239,233,.25); }

/* Bab V */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 3rem; }
.stats > div { padding: 2.5rem 1.5rem 2.5rem 0; display: flex; align-items: flex-end; gap: 1rem; }
.stats > div + div { border-left: 1px solid var(--line); padding-left: 1.5rem; }
.stats strong { font: 200 clamp(3.5rem, 8vw, 7rem)/.85 var(--display); }
.stats p { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { padding: clamp(7rem, 15vw, 12rem) var(--gutter) 4rem; text-align: center; display: grid; justify-items: center; gap: 3rem; overflow: hidden; }
.contact-title { font-size: clamp(2.8rem, 9vw, 8rem); max-width: 14ch; }
.connect { justify-self: stretch; margin-inline: calc(-1 * var(--gutter)); overflow: hidden; border-block: 1px solid var(--line); padding: 1rem 0; }
.connect-track { display: flex; width: max-content; gap: 4rem; animation: marquee 20s linear infinite; }
.connect-track span { font: 200 clamp(4rem, 14vw, 12rem)/1 var(--display); text-transform: uppercase; color: transparent; -webkit-text-stroke: 1px var(--muted); }
.contact-grid { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: left; }
.contact-grid > div { display: grid; gap: .6rem; align-content: start; }
.contact-grid a:hover { color: var(--accent); }
.contact-grid small { color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }

.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 2rem var(--gutter); border-top: 1px solid var(--line); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .works-3 { grid-template-columns: 1fr 1fr; }
  .works-3 .work:nth-child(3n+2) { margin-top: 0; }
  .chapters { display: none; }
  .chapter { padding-left: var(--gutter); }
  .process { grid-template-columns: 1fr 1fr; }
  .process li { min-height: 0; }
  .process li::after { display: none; }
}
@media (max-width: 760px) {
  .works-3 { grid-template-columns: 1fr; }
  .header-right .pill { display: none; }
  .hero-foot { grid-template-columns: 1fr; text-align: left; }
  .hero-roles { text-align: left; }
  .scroll-cue { display: none; }
  .about-grid, .works { grid-template-columns: 1fr; }
  .work:nth-child(even) { margin-top: 0; }
  .services li { grid-template-columns: 2.5rem 1fr; }
  .services p { grid-column: 2; }
  .process { grid-template-columns: 1fr; }
  .compare-head, .compare dl > div { grid-template-columns: 1fr; gap: .4rem; }
  .compare-head p:first-child { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .contact-grid { grid-template-columns: 1fr; }
  .split-statement p { padding-left: 0 !important; }
}

/* ---------- Cursor companion: planet on the native pointer tip + gapped orbit + satellite (see js/cursor.js) ---------- */
.cursor-dot, .cursor-ring, .cursor-body { position: fixed; left: 0; top: 0; z-index: 200; width: 40px; height: 40px; margin: -20px 0 0 -20px; pointer-events: none; opacity: 0; transition: opacity .3s; mix-blend-mode: difference; } /* like the header logo: inverts over light areas */
html.cursor-on .cursor-dot, html.cursor-on .cursor-ring, html.cursor-on .cursor-body { opacity: 1; }
html.cursor-field .cursor-dot, html.cursor-field .cursor-ring, html.cursor-field .cursor-body { opacity: 0; }
.cursor-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent); }
.cursor-scale { position: absolute; inset: 0; transition: transform .4s var(--ease); }
.cursor-orbit { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--ink); stroke-width: 1; stroke-linecap: round; stroke-dasharray: 78 22; animation: spin 20s linear infinite reverse; transition: stroke-width .4s var(--ease); }
.cursor-spin { position: absolute; inset: 0; animation: spin 8s linear infinite; }
.cursor-sat { position: absolute; top: -3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
html.cursor-hover .cursor-scale { transform: scale(1.7); }
html.cursor-hover .cursor-spin { animation-duration: 4s; }
html.cursor-hover .cursor-orbit { animation-duration: 9s; stroke-width: .59; } /* 1 / 1.7: keeps the line 1px while the ring scales */
html.cursor-down .cursor-scale { transform: scale(.75); }
html.cursor-down .cursor-orbit { stroke-width: 1.33; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .w > span { transform: none; transition: none; }
  .hl { opacity: 1; }
  .logos-track, .connect-track, .scroll-cue span, .loader-logo .o, .cursor-spin, .cursor-orbit { animation: none; }
}

/* ---------- Language switch ---------- */
.lang { display: flex; align-items: center; gap: .5rem; font: 500 .75rem var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.lang a, .lang span { color: var(--muted); transition: color .3s; }
.lang a:hover { color: var(--ink); }
.lang .active { color: var(--ink); }
.lang i { font-style: normal; color: var(--line); }

/* ---------- Lenis smooth scroll ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Pinned chapter I stage: all lines share one centred cell, shown one group at a time */
.reach.pin-stage { height: 100vh; height: 100svh; display: grid; align-content: center; margin-top: 0; }
.reach.pin-stage > .reach-group { grid-area: 1 / 1; align-self: center; display: grid; gap: 1rem; justify-items: center; }
.reach.pin-stage > .reach-group > * { margin: 0 !important; }

/* Pinned cards: borders live on the cards, so a card that has not arrived leaves no trace */
.process.pin-cards { background: transparent; border: 0; gap: 0; }
.process.pin-cards li { outline: 1px solid var(--line); outline-offset: -1px; }
.stats.pin-cards { border-color: transparent; }
.stats.pin-cards > div { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Pinned paragraphs on the home page: words that are not lit yet are invisible, not dimmed */
.scrub-hidden .hl:not(.on) { opacity: 0; }

/* Chapter I closing paragraph: twice the size of the regular body text */
.reach .body.center { font-size: clamp(1.5rem, 3.2vw, 2.6rem); max-width: 62rem; line-height: 1.4; }

/* Pinned chapter heads: the wrapper keeps the title's bottom spacing inside the pin */
.chapter-head { display: flow-root; }

/* Home contact: CONNECT is as big as the chapter I words; the closing line and the final group are pinned.
   The contact box is a short band with a line above it; the footer's own line closes it below. */
.contact-head { display: grid; justify-items: center; gap: 3rem; }
.contact-stage { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 6.5rem var(--gutter) 0; text-align: center; } /* 6.5rem = clears the header */
.contact-stage .connect-word { grid-row: 1; align-self: center; margin: 0; } /* centred in the free space between the header and the contact box */
.contact-stage .contact-tail { grid-row: 2; align-self: end; width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); display: grid; } /* box + footer sit on the bottom edge */
.contact-stage .contact-grid { text-align: left; padding: 1.5rem var(--gutter); border-top: 1px solid var(--line); }
#kontak .contact-grid { border-top: 1px solid var(--line); padding-block: 1.5rem; }

/* The table pins by itself on desktop, so it does not need the extra space above it */
.compare.pin-table { margin-top: 0; }

/* Pinned work grid: positioned so item offsets can be measured from the block */
.works-stage, .works { position: relative; }

/* Work items are animated by the pinned reveal: tell the browser, so the motion stays on the GPU */
.works-stage .work { will-change: transform, opacity; transform-origin: 50% 100%; }

/* Wrapper made shorter by the distance a pinned block slid; it clips the leftover space (see smooth.js).
   A fixed (pinned) child is never clipped by it. */
.slide-trim { display: flow-root; overflow: clip; }
