/* The home mosaic sets placement; product, case and journal cards provide their own artwork. */
#bento { grid-auto-rows:auto; }
#bento > .tile { grid-row:auto; min-width:0; }
.home-catalog.cases-page {
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--gap);
  min-width:0;
  margin:0;
  padding:0;
}
.home-catalog > :is(.journal-cards,.chapter-grid) {
  container:catalog-slot / inline-size;
  grid-template-columns:minmax(0,1fr);
  min-width:0;
}
.home-catalog .journal-wide { grid-column:1; }
.home-catalog .case-feature__visual { container-type:inline-size; }
@media (min-width:1181px) {
  .home-catalog-wide { grid-column:span 2; }
}
@container catalog-slot (max-width:560px) {
  .home-catalog .chapter-grid .case-feature,
  .home-catalog .journal-cards .journal-wide {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:24px;
    padding:var(--card-padding);
  }
  .home-catalog .journal-cards .journal-wide > .sc-footer,
  .home-catalog .chapter-grid .case-feature > .sc-footer {
    position:static;
    margin-top:auto;
  }
}
.home-collection {
  justify-content:space-between;
  gap:32px;
}
.home-collection .stat__num { font-size:clamp(72px,7vw,128px); }
.home-collection.tile--ink .stat__num { color:var(--lime); }
.home-collection.tile--lilac .stat__num { color:var(--violet); }
.home-collection__label {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:clamp(24px,2vw,36px);
  letter-spacing:-.035em;
  line-height:1.1;
}
#bento .tile--big { min-height:clamp(480px,36vw,620px); }
#bento .tile--revo .v-gantt { position:relative; inset:auto; width:100%; margin:24px 0; }
#bento .tile--assort { display:flex; flex-direction:column; }
#bento > .tile:focus-visible { outline:3px solid var(--violet); outline-offset:3px; }

@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  #cursor { display:block; }
  #bento :is(a.tile, a[data-card]) { cursor:none; }
}
/* cards stay in place on hover: a lifted card slips from under a pointer resting on its bottom edge,
   drops back, lifts again — the card and the «Открыть» bubble flicker */
#bento :is(a.tile, a[data-card], .style-card):hover { transform:none; }

@media (min-width:721px) and (max-width:1180px) {
  .home-catalog.cases-page { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #bento { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #bento > .tile { grid-column:auto; }
  #bento > .home-integrations { grid-column:1/-1; }
}
@media (max-width:720px) {
  .home-catalog.cases-page { grid-template-columns:minmax(0,1fr); }
  #bento { grid-template-columns:minmax(0,1fr); }
  #bento > .tile { grid-column:auto; }
  #bento .tile--big { min-height:500px; }
}

/* OptiTrack: the supply chain fills the card, the product description sits below it. */
#bento #t-opti { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:18px; }
#t-opti .v-map { position:relative; inset:auto; grid-area:1/1; align-self:center; width:100%; aspect-ratio:2/1; overflow:hidden; }
#t-opti .v-map svg { position:absolute; inset:0; }
/* Frame the route and its labels within the shared 800 × 500 illustration. */
#t-opti .map-network { transform:translate(-110px,-240px) scale(1.85); }
#t-opti .tile__body { grid-area:2/1; align-self:end; }
#bento .tile--revo .tile__top { order:0; }
#bento .tile--revo .v-gantt { order:1; }
#bento .tile--revo .tile__body { order:2; }
@container optitrack (max-width:540px) {
  #t-opti .v-map { aspect-ratio:8/5; }
}

/* Section dividers inside the home mosaic, in the style of the case chapter headings. */
#bento > .home-divider {
  grid-column:1/-1;
  margin:0;
  padding:clamp(40px,5vw,88px) 4px 12px;
  font-size:clamp(30px,3vw,46px);
  font-weight:500;
  letter-spacing:-.045em;
  line-height:1.1;
}
#bento > .home-divider:first-child { padding-top:0; }
/* Collection tiles close the cases and the articles grids. */
.home-catalog > .tile { grid-column:span var(--c,2); grid-row:auto; min-width:0; }
@media (max-width:1180px) {
  .home-catalog > .tile { order:1; grid-column:1/-1; }
}
@media (max-width:720px) {
  .home-catalog > .tile { grid-column:1/-1; min-height:240px; }
}

/* The verb stays on the line with "который": the title is sized so that the longest verb fits there. */
.hero__title { font-size:clamp(48px,7.1vw,184px); }

/* The longest rotating verb ("автоматизирует") has to fit the narrowest phones. */
@media (max-width:600px) {
  .hero__title { font-size:min(48px,12vw); }
}

/* Product descriptions use the card width, keeping clear space next to the arrow button. */
#bento > [data-card^="product:"] .tile__body { max-width:none; padding-right:72px; }
#bento > [data-card^="product:"] .tile__text { max-width:none; }
#bento > [data-card^="product:"][data-card-size="medium"] .tile__body { padding-right:60px; }
/* Assortora follows the other cards: the description ends level with the arrow button. */
#bento > [data-card="product:assortora"].tile.tile--assort { padding-bottom:var(--pad); }

/* The title sits in the middle of the free space above the lead instead of resting on it. */
.hero__title { margin-block:auto; }

/* Case titles wrap by whole words; the wide cards use a size at which the longest word fits the text column. */
.home-catalog .style-card h2 { overflow-wrap:break-word; hyphens:manual; }
.home-catalog .case-feature h2 { font-size:clamp(24px,2.1vw,32px); }
/* The newest case opens the block as one full-width card; the rest are single-column cards with the picture under the text. */
@media (min-width:721px) {
  .home-catalog-full { grid-column:1/-1; }
}

/* ───── Home case cards: who → title → two sentences → picture. Wide cards put the picture beside the text. ───── */
.home-catalog .home-case {
  --ci-bg:var(--white); --ci-item:#F1EFEA; --ci-fg:var(--ink); --ci-accent:var(--violet); --ci-box:var(--violet); --ci-box-fg:var(--white);
  height:100%; min-height:0; padding:clamp(22px,1.8vw,30px); background:var(--white);
}
/* The picture panel is always light, so the same drawing works on every card colour. */
.home-catalog .home-case--white  { --ci-bg:#F1EFEA; --ci-item:var(--white); }
.home-catalog .home-case--grey   { background:#E8E5DD; }
.home-catalog .home-case--lilac  { background:var(--lilac); }
.home-catalog .home-case--lime   { background:#E5F59D; }
.home-catalog .home-case--violet { background:var(--violet); --sc-text:var(--white); --sc-muted:var(--lilac); }
.home-catalog .home-case--ink    { background:var(--ink); --sc-text:var(--white); --sc-muted:#B8B2C1; }
.home-case--violet .sc-open, .home-case--ink .sc-open { background:var(--lime); color:var(--ink); }
.home-case--lime .sc-open { background:var(--ink); color:var(--lime); }
.home-catalog .home-case h2 { font-size:clamp(23px,1.9vw,30px); line-height:1.08; letter-spacing:-.035em; }
.home-catalog .home-case > p { margin:14px 0 0; font-size:15px; line-height:1.45; color:var(--sc-muted); }
.home-catalog .home-case .sc-footer { margin-top:0; padding-top:18px; }

.ci { display:flex; flex-direction:column; gap:8px; margin-top:auto; padding:16px; border-radius:22px; background:var(--ci-bg); color:var(--ci-fg); font-size:14px; line-height:1.3; }
.home-catalog .home-case > p + .ci { margin-top:auto; }
.home-catalog .home-case > p { padding-bottom:22px; }
.ci b { font-weight:500; }
/* Drawings: flat brand-colour shapes, no interface mock-ups. */
.ci-art { display:block; width:100%; height:auto; overflow:visible; }
.ci-art .gv { fill:var(--violet); } .ci-art .gl { fill:var(--lime); } .ci-art .gli { fill:var(--lilac); } .ci-art .gk { fill:var(--ink); } .ci-art .gw { fill:var(--white); }
.ci-art :is(.sv,.sl,.sk,.sli) { fill:none; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.ci-art .sv { stroke:var(--violet); } .ci-art .sl { stroke:var(--lime); } .ci-art .sk { stroke:var(--ink); } .ci-art .sli { stroke:var(--lilac); }
.ci-art .gbg { fill:var(--ci-bg); } .ci-art .gi { fill:var(--ci-item); } .ci-art .w5 { stroke-width:5; } .ci-art .w26 { stroke-width:26; } .ci-art .w30 { stroke-width:30; } .ci-art .w2 { stroke-width:2; } .ci-art .w3 { stroke-width:3; } .ci-art .w4 { stroke-width:4; } .ci-art .w7 { stroke-width:7; }
.ci-art .dash { stroke-dasharray:6 7; } .ci-art .dot { stroke-dasharray:1 9; }
.ci-art .o1 { opacity:.12; } .ci-art .o2 { opacity:.18; } .ci-art .o3 { opacity:.3; } .ci-art .o35 { opacity:.38; } .ci-art .o5 { opacity:.5; } .ci-art .o6 { opacity:.62; }
.ci-art .gt { font:500 13px var(--f-sans, inherit); letter-spacing:-.01em; }
.ci-num { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin-top:auto; padding-top:10px; }
.ci-num b { font-size:clamp(26px,2.3vw,36px); letter-spacing:-.04em; line-height:1; color:var(--ci-accent); white-space:nowrap; }
.ci-num span { font-size:13px; opacity:.75; }

@media (min-width:1181px) {
  .home-catalog :is(.home-catalog-wide,.home-catalog-full) .home-case { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); grid-template-rows:auto auto 1fr auto; column-gap:clamp(20px,2vw,32px); }
  .home-catalog :is(.home-catalog-wide,.home-catalog-full) .home-case > :is(.case-who,h2,p,.sc-footer) { grid-column:1; }
  .home-catalog :is(.home-catalog-wide,.home-catalog-full) .home-case > .ci { grid-column:2; grid-row:1/-1; margin-top:0; justify-content:center; padding:clamp(18px,1.6vw,26px); gap:10px; font-size:15px; }
  .home-catalog :is(.home-catalog-wide,.home-catalog-full) .home-case > .ci .ci-num { margin-top:6px; }
  .home-catalog .home-catalog-wide .home-case h2 { font-size:clamp(26px,2.4vw,38px); }
  .home-catalog :is(.home-catalog-wide,.home-catalog-full) .home-case > p { padding-bottom:0; }
  .home-catalog :is(.home-catalog-wide,.home-catalog-full) .home-case .sc-footer { align-self:end; }
  .home-catalog .home-catalog-full .home-case { grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); column-gap:clamp(28px,4vw,72px); padding:clamp(28px,3vw,48px); }
  .home-catalog .home-catalog-full .home-case h2 { font-size:clamp(32px,3.3vw,52px); margin-top:10px; }
  .home-catalog .home-catalog-full .home-case > p { margin-top:22px; font-size:18px; max-width:34em; }
  .home-catalog .home-catalog-full .home-case > .ci { flex-direction:row; align-items:center; gap:clamp(16px,2vw,32px); }
  .home-catalog .home-catalog-full .home-case > .ci .ci-art { flex:1 1 55%; min-width:0; }
  .home-catalog .home-catalog-full .home-case > .ci .ci-num { flex:1 1 45%; margin-top:0; padding-top:0; flex-direction:column; align-items:flex-start; }
  .home-catalog .home-catalog-full .home-case > .ci .ci-num b { font-size:clamp(34px,3.2vw,52px); }
  .home-catalog .home-catalog-full .home-case > .ci .ci-num span { font-size:15px; line-height:1.35; }
}

/* The claim that closes the cases block: plain sentence, figures in lime. */
.sys--claim { display:block; line-height:1.08; }
.sys--claim b { font-weight:500; color:var(--lime); }
.home-catalog > .home-integrations { justify-content:center; gap:14px; }
.home-catalog > .home-integrations .tile__text { margin-top:0; max-width:36em; }

/* Practices: the rows read as claims, so the names are smaller than the one-word originals; the block gets a heading like the others. */
.sec > .home-divider { margin:0; padding:0 4px clamp(14px,1.6vw,26px); font-size:clamp(30px,3vw,46px); font-weight:500; letter-spacing:-.045em; line-height:1.1; }
#services .svc { border-top:1px solid var(--line); }
#services .svc__name { font-size:clamp(21px,2.3vw,34px); line-height:1.12; letter-spacing:-.03em; text-align:left; }
#services .svc__btn { padding:clamp(14px,1.4vw,22px) 0; }
#services .svc__plus { width:44px; height:44px; border-radius:12px; }
#services .svc__btn { gap:20px; }
#services .svc__plus { flex:none; }
#services .svc__btn:hover .svc__name { transform:none; }
#services .svc__grid { grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); align-items:start; gap:clamp(24px,5vw,96px); padding-top:4px; }
#services .svc__copy { display:grid; gap:clamp(16px,1.4vw,22px); justify-items:start; max-width:46em; }
#services .svc__copy p { font-size:clamp(17px,1.25vw,21px); line-height:1.4; grid-column:auto; }
#services .svc__more { display:inline-flex; align-items:center; gap:8px; font-size:16px; font-weight:500; color:var(--violet); border-bottom:1px solid currentColor; padding-bottom:2px; transition:gap .25s, opacity .25s; }
#services .svc__more:hover { gap:12px; opacity:.8; }
#services .facts { display:grid; grid-template-columns:1fr 1fr; gap:16px clamp(20px,2vw,36px); }
#services .facts > div { max-width:none; }
#services .facts b { color:var(--violet); }
@media (max-width:720px){
  #services .svc__grid { grid-template-columns:1fr; gap:22px; }
  #services .facts { grid-template-columns:minmax(0,auto) minmax(0,auto); justify-content:start; gap:14px 32px; }
}

/* the dark figures block is the last one on the page: it runs straight into the dark footer */
main:has(> #scale:last-child) + .ftr { margin-top:0; }
.hero__lead { text-wrap:balance; }
@media (min-width:901px){
  .hero__foot { grid-template-columns:1fr; }
  .hero__lead { max-width:none; text-wrap:wrap; }
  .hero__lead > span { display:block; }
}

/* clients strip right under the hero */
.home-clients { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,5fr); align-items:center; gap:var(--gap); padding:clamp(8px,1vw,16px) var(--gutter) 0; }
.home-clients__title { margin:0; font-size:clamp(18px,1.4vw,24px); font-weight:500; letter-spacing:-.02em; line-height:1.2; }
.home-clients__list { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:var(--gap); }
.home-clients__list li { display:flex; align-items:center; justify-content:center; height:clamp(104px,9.5vw,152px); padding:0 clamp(16px,2vw,32px); border-radius:var(--radius); background:var(--white); }
.home-clients__list img { display:block; width:auto; max-width:100%; height:clamp(34px,3.2vw,52px); object-fit:contain; filter:brightness(0); }
.home-clients__list img[src*="united-breweries"] { height:clamp(44px,4.2vw,68px); }
.home-clients__list img[src*="mars.svg"] { height:clamp(28px,2.6vw,42px); }
.home-clients__list img[src*="loreal"] { height:clamp(20px,1.9vw,30px); }
@media (max-width:900px){
  .home-clients { grid-template-columns:1fr; gap:14px; }
  .home-clients__list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-clients__list li:last-child:nth-child(odd) { grid-column:1/-1; }
}
