/* ═══════════════════════════════════════════════════════════════════════
   Zaberi — cinematic home page.

   Tokens are the brand values from the brief, which match zaberi.kg:
   primary #1F8A3B · deep #173D22 · supporting #2E9E49 · cream #F8F5EE.
   Onest sets everything a visitor reads; Bricolage Grotesque sets only the
   Latin wordmark, as it does on the live site.

   Two presentations share one DOM:
   · default  — no JavaScript, or prefers-reduced-motion: every chapter is an
                ordinary section over its own still photograph;
   · html.film — the journey pins, a canvas plays the scroll-driven film and
                the chapters take turns above it.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --green: #1F8A3B;
  --green-press: #166B2D;
  --green-2: #2E9E49;
  --deep: #173D22;
  --cream: #F8F5EE;
  --ink: #1E2A20;
  --body: #3A4A3D;
  --muted: #6F7F72;
  --line: #E8E3D6;
  --white: #FFFFFF;

  --gutter: clamp(20px, 5.2vw, 88px);
  --top-h: 68px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --font: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mark: 'Bricolage Grotesque', 'Onest', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, p { margin: 0; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--deep); color: var(--cream); padding: 12px 16px; border-radius: 12px;
  text-decoration: none; font-weight: 700;
}
.skip:focus { top: calc(12px + var(--safe-t)); }

:focus-visible { outline: 3px solid var(--green-2); outline-offset: 3px; border-radius: 6px; }

/* ── buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border-radius: 14px;
  background: var(--green); color: var(--white);
  font: 700 1.02rem/1 var(--font); letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 10px 22px -10px rgba(31, 138, 59, 0.55);
  transition: background-color .18s ease, transform .18s ease;
}
.btn:hover { background: var(--green-press); }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 44px; padding: 0 18px; border-radius: 12px; font-size: .95rem; box-shadow: none; }

/* ── header ───────────────────────────────────────────────────────────── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) calc(var(--gutter) + var(--safe-r)) 0 calc(var(--gutter) + var(--safe-l));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  /* always solid: over a photograph the links must stay readable, and a
     transparent header left «Стать партнёром» on top of the produce */
  background: rgba(248, 245, 238, 0.94);
  transition: box-shadow .25s ease;
}
.top.solid { box-shadow: 0 1px 0 var(--line); }
.logo {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px;
  text-decoration: none; color: var(--deep); flex-shrink: 0;
}
.logo .mark { border-radius: 9px; width: 34px; height: 34px; }
/* the original wordmark: title-case «Zaberi», Bricolage Grotesque 800 — as on zaberi.kg */
.wordmark { font-family: var(--mark); font-weight: 800; font-size: 27px; letter-spacing: -0.03em; line-height: 1; }
.top-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.top-partner {
  font-weight: 700; font-size: .95rem; color: var(--deep); text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px;
}
.top-partner:hover { color: var(--green); }
.lang { display: flex; gap: 4px; }
.lang[hidden] { display: none; }
.lang button {
  min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 12px;
  border: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.7); color: var(--deep);
  font: 700 .82rem/1 var(--font); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: var(--cream); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none; }
.progress span {
  display: block; height: 100%; background: var(--green);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ── typography ───────────────────────────────────────────────────────── */
.display {
  font-family: var(--font); font-weight: 800; color: var(--deep);
  letter-spacing: -0.035em; line-height: 0.98; text-wrap: balance;
}
/* sized so the desktop copy column stays within about a third of the screen,
   leaving the rest to the food (the film is fitted around the measured column) */
h1.display { font-size: clamp(2.5rem, 3.3vw + 0.8rem, 4.6rem); }
h2.display { font-size: clamp(2.2rem, 2.8vw + 0.7rem, 4rem); }
.lede {
  font-size: clamp(1.02rem, 0.45vw + 0.9rem, 1.28rem); line-height: 1.5;
  color: var(--body); max-width: 31ch; text-wrap: pretty;
}
.eyebrow {
  font-weight: 800; font-size: .82rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--green);
}

/* ── chapters (shared) ────────────────────────────────────────────────── */
.journey { position: relative; }
.pin { position: relative; }
.film-canvas, .loading { display: none; }   /* html.film is the mode class — never reuse it on an element */

.chapter {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--top-h) + var(--safe-t) + 24px) calc(var(--gutter) + var(--safe-r)) calc(40px + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
  overflow: hidden;
}
.still { position: absolute; inset: 0; z-index: 0; }
.still img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; max-width: min(31rem, 33vw); }
.copy .btn { margin-top: 6px; }

.steps {
  position: relative; z-index: 2; list-style: none; margin: 30px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px; max-width: min(31rem, 33vw);
}
.steps li { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: clamp(1.02rem, .5vw + .9rem, 1.25rem); color: var(--deep); }
.steps b {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: var(--white); font-weight: 800; font-size: 1rem;
}

/* same — the close-ups fill the screen, so each line sits on its own label
   instead of a veil over the photograph; the offer and the slogan in green */
#same { justify-content: flex-end; padding-bottom: calc(9svh + var(--safe-b)); }
#same .copy { max-width: none; }
/* in the film the slogan takes the three lines' place; without it, it follows them */
html.film #same .copy { display: grid; justify-items: start; }
html.film #same .copy > * { grid-area: 1 / 1; }
html.film #same .slogan { align-self: end; }
#same .lines, #same .slogan {   /* the id outranks h2.display, which would otherwise set the size */
  display: flex; flex-direction: column; align-items: flex-start; gap: .16em;
  font-size: clamp(2.4rem, 3.2vw + 0.9rem, 4.6rem);
}
.line {
  display: inline-block; max-width: 100%;
  padding: .1em .32em .16em; border-radius: .26em;
  background: rgba(248, 245, 238, 0.95); color: var(--deep);
  box-shadow: 0 18px 40px -26px rgba(23, 61, 34, 0.55);
}
.line.accent { background: var(--green); color: var(--white); }

/* the price tag: an example, cut in half as the reader scrolls */
.price-wrap {
  position: absolute; z-index: 2; inset: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: flex-end;
  padding: calc(var(--top-h) + var(--safe-t)) calc(var(--gutter) + var(--safe-r) + 4vw) 0 0;
}
.price {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 24px 42px 30px 62px;
  background: #FFFDF8; color: var(--deep); border-radius: 28px;
  box-shadow: 0 34px 70px -34px rgba(23, 61, 34, 0.6);
}
.price::before {          /* the punched hole of a price tag */
  content: ""; position: absolute; left: 23px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px;
  border-radius: 50%; background: var(--cream); box-shadow: inset 0 1px 3px rgba(23, 61, 34, 0.35);
}
.price-eyebrow { font-weight: 800; font-size: .86rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.price-old { position: relative; font-weight: 700; font-size: clamp(1.3rem, 1.2vw + 1rem, 2.1rem); color: var(--muted); line-height: 1.2; }
.price-strike {
  position: absolute; left: -6%; right: -6%; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: 2px; background: #D9432C; transform: rotate(-8deg); transform-origin: 0 50%;
}
.price-new {
  font-weight: 800; font-size: clamp(3.6rem, 5.4vw + 1rem, 8rem); line-height: .95; letter-spacing: -0.045em;
  color: var(--green); font-variant-numeric: tabular-nums;
}
.price-new span { font-size: .4em; letter-spacing: 0; margin-left: .3em; }
.price-off {
  position: absolute; right: -28px; top: -34px;
  width: 112px; height: 112px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: var(--white);
  font-weight: 800; font-size: 1.75rem; letter-spacing: -0.02em;
  transform: rotate(-12deg);
  box-shadow: 0 14px 28px -14px rgba(23, 61, 34, 0.7);
}

/* why — the question and two steps, on a card over the closing-time counter */
#why { justify-content: flex-end; padding-bottom: calc(9svh + var(--safe-b)); }
#why .copy { max-width: min(34rem, 44vw); }
.card {
  display: flex; flex-direction: column; gap: 14px;
  background: rgba(248, 245, 238, 0.96); border-radius: 26px;
  padding: clamp(22px, 2.4vw, 34px);
  box-shadow: 0 24px 60px -34px rgba(23, 61, 34, 0.55);
}
.card .lede { max-width: 36ch; }
.why-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.why-steps li { display: flex; align-items: flex-start; gap: 14px; font-size: clamp(1.02rem, .4vw + .92rem, 1.2rem); line-height: 1.4; color: var(--body); }
.why-steps b {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 11px; margin-top: -2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: var(--white); font-weight: 800; font-size: .95rem;
}

/* sources — the three kinds of place: rooms the camera walks into, or, without
   the film, photographs with their names */
#sources { justify-content: flex-start; gap: clamp(18px, 3.2vh, 36px); }
#sources .copy { max-width: min(46rem, 100%); }
#sources h2.display { font-size: clamp(2rem, 2.4vw + 0.8rem, 3.6rem); }
html:not(.film) #sources .card { background: none; box-shadow: none; padding: 0; }
.venues {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px);
  flex: 1 1 auto; min-height: 0;
}
.venue {
  position: relative; overflow: hidden; min-height: 300px;
  border-radius: 24px; background: #EAE3D3;
  box-shadow: 0 -10px 30px -20px rgba(23, 61, 34, 0.45), 0 28px 60px -36px rgba(23, 61, 34, 0.6);
}
.venue img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.venue p {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 4px;
  padding: 56px 22px 20px;
  background: linear-gradient(180deg, rgba(18, 30, 21, 0) 0%, rgba(18, 30, 21, 0.72) 100%);
  color: var(--white);
}
.venue b { font-weight: 800; font-size: clamp(1.2rem, .7vw + 1rem, 1.6rem); letter-spacing: -0.02em; line-height: 1.1; }
.venue span { font-size: .95rem; line-height: 1.35; opacity: .92; }
/* the finale's three boxes need the lower screen: its copy sits above them */
#finale { justify-content: flex-start; align-items: center; text-align: center; padding-top: calc(var(--top-h) + var(--safe-t) + 7svh); }
#finale .copy { align-items: center; max-width: min(40rem, 90vw); }

.scroll-hint {
  position: absolute; z-index: 2; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.scroll-hint i { display: block; width: 2px; height: 34px; border-radius: 2px; background: linear-gradient(var(--green), transparent); }
@media (prefers-reduced-motion: no-preference) {
  .scroll-hint i { animation: hint 1.8s ease-in-out infinite; transform-origin: 50% 0; }
  @keyframes hint { 0% { transform: scaleY(0.2); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(0.2); opacity: 0.4; } }
}
html:not(.film) .scroll-hint { display: none; }

/* ── partner + footer ─────────────────────────────────────────────────── */
.partner { padding: clamp(72px, 12vw, 150px) calc(var(--gutter) + var(--safe-r)) clamp(64px, 9vw, 120px) calc(var(--gutter) + var(--safe-l)); }
.partner-inner {
  max-width: 1080px; margin: 0 auto;
  background: var(--white); border: 1px solid var(--line); border-radius: 28px;
  padding: clamp(32px, 5vw, 64px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
}
.partner h2.display { font-size: clamp(2rem, 3vw + 0.6rem, 3.4rem); max-width: 18ch; }
.partner .lede { max-width: 42ch; }

.foot { padding: 28px calc(var(--gutter) + var(--safe-r)) calc(36px + var(--safe-b)) calc(var(--gutter) + var(--safe-l)); border-top: 1px solid var(--line); }
.foot-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.logo-sm .mark { width: 28px; height: 28px; border-radius: 8px; }
.logo-sm .wordmark { font-size: 22px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-links a { font-size: .9rem; color: var(--body); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot-links a:hover { color: var(--green); }
.foot-copy { width: 100%; font-size: .85rem; color: var(--muted); }

/* ── film mode ────────────────────────────────────────────────────────── */
html.film .journey { height: var(--journey-h, 2400vh); }
html.film .pin {
  position: sticky; top: 0;
  height: 100vh; height: 100lvh;          /* the canvas reaches under mobile toolbars */
  overflow: hidden;
  background: var(--cream);
}
html.film .film-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
html.film .chapter {
  position: absolute; inset: 0 0 auto 0;
  height: 100vh; height: 100svh;           /* copy stays inside what is always visible */
  min-height: 0;
}
html.film-pending .chapter:not(#hero) .still { display: none; }
/* chapters are stacked over one another; only their links may take a tap */
html.film .chapter { pointer-events: none; }
html.film .chapter a, html.film .chapter button { pointer-events: auto; }
html.film .still { display: none; }
/* the hero still is the poster: it stays until the canvas has a real frame */
html.film #hero .still { display: block; transition: opacity .3s ease; }
html.film.frame-ready #hero .still { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
html.film .chapter:not(#hero) { visibility: hidden; }  /* until the timeline hands it the stage */
/* in the film the camera walks through the rooms, so the venue photographs are
   never shown (nor, being display:none, loaded); each name is a label over its room */
html.film #sources .copy, html.film #sources .venue {
  position: absolute; left: calc(var(--gutter) + var(--safe-l)); right: calc(var(--gutter) + var(--safe-r));
  bottom: calc(9svh + var(--safe-b));
}
html.film #sources .copy { max-width: min(46rem, calc(100% - 2 * var(--gutter))); }
html.film .venues { display: block; }
html.film .venue { min-height: 0; overflow: visible; border-radius: 0; background: none; box-shadow: none; }
html.film .venue img { display: none; }
html.film .venue p {
  position: static; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0; background: none; color: var(--deep);
}
html.film .venue b { font-size: clamp(2.4rem, 3.2vw + 0.9rem, 4.6rem); letter-spacing: -0.035em; line-height: 0.98; }
html.film .venue b, html.film .venue span {
  display: inline-block; padding: .1em .32em .16em; border-radius: .26em;
  background: rgba(248, 245, 238, 0.95); box-shadow: 0 18px 40px -26px rgba(23, 61, 34, 0.55);
}
html.film .venue span { font-size: clamp(1rem, .5vw + .9rem, 1.3rem); font-weight: 600; color: var(--body); opacity: 1; padding: .45em .8em; border-radius: 14px; }

html.film .loading { display: block; position: absolute; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); z-index: 3; opacity: 0; transition: opacity .2s ease; }
html.film .loading.on { opacity: 1; }
.loading span { display: block; width: 44px; height: 3px; border-radius: 3px; background: rgba(23, 61, 34, 0.18); overflow: hidden; position: relative; }
.loading span::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--green); border-radius: 3px; animation: load 1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ── phones and portrait screens ──────────────────────────────────────── */
@media (orientation: portrait), (max-width: 720px) {
  :root { --top-h: 60px; }
  .wordmark { font-size: 23px; }
  .logo .mark { width: 30px; height: 30px; }
  .top-partner { display: none; }
  .top-right { gap: 8px; }

  .chapter { justify-content: flex-start; padding-top: calc(var(--top-h) + var(--safe-t) + 18px); padding-bottom: calc(24px + var(--safe-b)); }
  .still img { object-position: 50% 100%; }
  .copy { max-width: 100%; gap: 14px; }
  h1.display { font-size: clamp(2.35rem, 10.4vw, 3.4rem); }
  h2.display { font-size: clamp(2rem, 8.8vw, 2.9rem); }
  .lede { max-width: 34ch; font-size: clamp(1rem, 4vw, 1.12rem); }
  .copy .btn { margin-top: 2px; }

  /* the three steps sit under the box, not over the rising food */
  .steps { margin: auto 0 0; max-width: 100%; gap: 10px; }
  .steps li { font-size: 1rem; }
  .steps b { width: 32px; height: 32px; border-radius: 10px; font-size: .92rem; }

  #finale .copy { max-width: 100%; }

  /* the close-ups' lines and the reason sit under the header, clear of the cut faces */
  #same, #why { justify-content: flex-start; padding-bottom: calc(24px + var(--safe-b)); }
  /* sized so «Но намного дешевле.» (10.7 em with its label) stays one line on a phone */
  #same .lines, #same .slogan { font-size: clamp(1.7rem, 8.2vw, 2.8rem); }
  html.film #same .slogan { align-self: start; }
  /* the tag sits under the lines, clear of the cut faces below */
  .price-wrap { position: static; display: block; padding: 0; margin-top: 34px; }
  .price { padding: 16px 30px 20px 46px; border-radius: 22px; }
  .price::before { left: 17px; width: 12px; height: 12px; margin-top: -6px; }
  .price-eyebrow { font-size: .78rem; }
  .price-old { font-size: 1.4rem; }
  .price-new { font-size: clamp(3.4rem, 17vw, 4.6rem); }
  .price-off { width: 82px; height: 82px; right: -18px; top: -26px; font-size: 1.3rem; }
  #why .copy { max-width: 100%; }
  .card { padding: 20px 22px; gap: 12px; }
  .why-steps li { font-size: 1rem; gap: 12px; }
  .why-steps b { width: 30px; height: 30px; border-radius: 10px; font-size: .9rem; }

  #sources h2.display { font-size: clamp(1.75rem, 7.4vw, 2.4rem); }
  .venues { grid-template-columns: 1fr; }
  .venue { min-height: 0; aspect-ratio: 4 / 3; }
  .venue p { padding: 44px 18px 16px; }
  /* in the film the labels sit under the header, over the ceiling of each room */
  html.film #sources .copy, html.film #sources .venue { top: calc(var(--top-h) + var(--safe-t) + 18px); bottom: auto; }
  html.film #sources .copy { max-width: calc(100% - 2 * var(--gutter)); }
  html.film .venue b { font-size: clamp(2rem, 8.8vw, 2.9rem); }
  html.film .venue span { font-size: 1rem; }
}

@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .btn-sm { padding: 0 14px; }
  .lang button { min-width: 44px; padding: 0 8px; }
}

/* short landscape phones: keep the hero readable */
@media (orientation: landscape) and (max-height: 520px) {
  h1.display { font-size: clamp(2rem, 6vh + 0.8rem, 3rem); }
  h2.display { font-size: clamp(1.8rem, 5.5vh + 0.7rem, 2.6rem); }
  .copy { gap: 12px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .top { transition: none; }
}
