/* Красные кеды · works.css
   Разделы: «Работы» (#works: подборка из каталога, чипы направлений, ролики), «Процесс» (#process: шнурок
   через люверсы), «Вопросы» (#faq: аккордеон). Цвета только из токенов base.css, все селекторы с префиксом блока. */

/* ============================== РАБОТЫ ============================== */

/* «СМОНТИРОВАЛИ» — длинное слово: на узких телефонах кегль заголовка подстраивается под ширину */
.works .h2 { font-size: min(var(--fs-h2), calc((100vw - 2 * var(--gutter)) / 11.8)); }

/* ленты на телефоне выходят за поля — режем по ширине раздела */
.works { overflow-x: clip; }

.works__gallery { position: relative; }

/* Чипы направлений: ведут в каталог с выбранным фильтром */
.works__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 28px;
  margin-bottom: clamp(20px, 2.6vw, 32px);
}
.works__bar-label { color: var(--s-muted); white-space: nowrap; }
.works__dirs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.works__dir {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--s-line);
  border-radius: var(--r-pill);
  color: var(--s-fg);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.works__dir-n { font-family: var(--f-mono); font-size: .6875rem; font-weight: 600; color: var(--s-muted); transition: color .2s; }
.works__dir:hover { background: var(--s-fg); border-color: var(--s-fg); color: var(--s-bg); }
.works__dir:hover .works__dir-n { color: color-mix(in srgb, var(--s-bg) 70%, transparent); }

/* Подборка: ряды одной высоты, ширина плитки — по пропорции снимка (--ar из разметки).
   flex-grow пропорционален --ar, поэтому после растяжения высота в ряду остаётся общей. */
.works__feat {
  --row-h: 230px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.works__tile { position: relative; flex: var(--ar) 1 calc(var(--ar) * var(--row-h)); min-width: 0; }
.works__tile-link {
  position: relative;
  display: block;
  aspect-ratio: var(--ar);
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
}
.works__tile-link:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.works__tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: var(--works-zoom, 1);
  transition: scale .9s var(--ease-out);
}
.works__tile-flag {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--led-warm);
  font-size: .625rem;
  line-height: 1;
}
.works__tile-flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--led-warm); }
/* Подпись: название на белой плашке видно всегда, направление выезжает по наведению */
.works__tile-cap {
  position: absolute;
  z-index: 2;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  display: grid;
  grid-template-rows: auto 0fr;
  padding: 7px 11px 8px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  transition: grid-template-rows .5s var(--ease-out);
}
.works__tile-title { font-weight: 600; font-size: .875rem; line-height: 1.25; overflow-wrap: anywhere; }
.works__tile-type {
  min-height: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: .625rem;
  line-height: 1.35;
  opacity: 0;
  transition: opacity .35s;
}
.works__tile-type::before { content: ""; display: block; height: 4px; }
@media (hover: hover) and (pointer: fine) {
  .works__tile-link:hover .works__tile-img,
  .works__tile-link:focus-visible .works__tile-img { scale: calc(var(--works-zoom, 1) * 1.07); }
  .works__tile-link:hover .works__tile-cap,
  .works__tile-link:focus-visible .works__tile-cap { grid-template-rows: auto 1fr; }
  .works__tile-link:hover .works__tile-type,
  .works__tile-link:focus-visible .works__tile-type { opacity: 1; }
}
@media (hover: none), (pointer: coarse) {
  .works__tile-cap { grid-template-rows: auto 1fr; }
  .works__tile-type { opacity: 1; }
}

/* Лёгкий параллакс снимка внутри плитки (только где есть scroll-driven animations) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .works__tile-img {
      --works-zoom: 1.1;
      animation: works-parallax linear both;
      animation-timeline: view();
    }
  }
}
@keyframes works-parallax {
  from { translate: 0 -4%; }
  to { translate: 0 4%; }
}

/* Плитка-призыв забирает остаток последнего ряда (или встаёт полосой на всю ширину) */
.works__tile--cta { flex: 999 1 250px; min-height: var(--row-h); }
.works__cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  min-height: var(--row-h);
  padding: clamp(16px, 1.8vw, 24px);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  isolation: isolate;
}
.works__cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.works__cta-kicker { color: var(--ink); }
.works__cta-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.25rem, 1.9vw, 1.75rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  max-width: 11ch;
}
.works__cta-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: .9375rem;
}
.works__cta-arrow { width: 16px; height: 16px; transition: transform .25s var(--ease-out); }
.works__cta-mark {
  position: absolute;
  z-index: -1;
  right: -8%;
  bottom: -30%;
  width: auto;
  height: 120%;
  max-width: none;
  opacity: .22;
  transition: transform 1.2s var(--ease-out);
}
.works__cta:hover .works__cta-arrow { transform: translateX(4px); }
.works__cta:hover .works__cta-mark { transform: rotate(72deg); }

/* Весь каталог */
.works__all {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: clamp(24px, 3vw, 36px);
}
.works__all-note { color: var(--s-muted); }

@media (min-width: 1280px) {
  .works__feat { --row-h: 270px; gap: 14px; }
}

/* Телефон: чипы и подборка — горизонтальные ленты со снапом */
@media (max-width: 699px) {
  .works__bar { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .works__dirs,
  .works__feat {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
  }
  .works__dirs::-webkit-scrollbar,
  .works__feat::-webkit-scrollbar { display: none; }
  .works__dirs li { flex: none; }
  .works__dir { min-height: 38px; padding: 0 14px; font-size: .875rem; }
  .works__feat { --row-h: 320px; gap: 10px; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .works__tile {
    flex: none;
    width: clamp(200px, calc(var(--ar) * var(--row-h)), 82vw);
    scroll-snap-align: start;
  }
  .works__tile-link { aspect-ratio: auto; height: var(--row-h); }
  .works__tile--cta { width: 240px; }
  .works__all .btn { flex: 1 1 auto; }
}

/* Курсор-подсказка над подборкой (только мышь) */
.works__cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  scale: .3;
  transition: opacity .25s, scale .35s var(--ease-out);
  will-change: transform;
}
.works__cursor.is-on { opacity: 1; scale: 1; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .works__cursor { display: none; }
}

/* Ролики: ночная плашка, вертикальные видео */
.works .works__reels {
  margin-top: clamp(56px, 8vw, 112px);
  margin-inline: calc(-1 * var(--gutter));
  padding: 28px 0 32px;
  display: grid;
  gap: 24px;
}
.works__reels-head { display: grid; gap: 12px; padding-inline: var(--gutter); min-width: 0; }
.works__reels-kicker { color: var(--s-accent); }
.works__reels-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.375rem, 2.4vw, 2.125rem);
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.works__reels-text { color: var(--s-muted); font-size: var(--fs-small); max-width: 36ch; }

.works__reels-list {
  list-style: none;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 4px var(--gutter) 8px;
  scrollbar-width: none;
}
.works__reels-list::-webkit-scrollbar { display: none; }
.works__reel { flex: 0 0 min(68%, 280px); scroll-snap-align: start; min-width: 0; }
.works__reel-fig { display: grid; gap: 12px; }
.works__reel-media {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: var(--wall-2);
  border: 1px solid var(--s-line);
}
.works__video { width: 100%; height: 100%; object-fit: cover; background: var(--wall-2); }
.works__reel-ui { position: absolute; inset: 0; pointer-events: none; }
.works__reel-ui[hidden] { display: none; }
.works__reel-progress {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  height: 3px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper) 30%, transparent);
  overflow: hidden;
}
.works__reel-progress span {
  display: block;
  height: 100%;
  background: var(--paper);
  transform-origin: left center;
  transform: scaleX(0);
}
.works__reel-btn {
  position: absolute;
  bottom: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  color: var(--paper);
  pointer-events: auto;
  transition: background-color .2s, transform .25s var(--ease-out);
}
.works__reel-btn svg { width: 20px; height: 20px; }
.works__reel-btn:hover { background: var(--ink); transform: scale(1.06); }
.works__reel-btn:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }
.works__reel-play { left: 12px; }
.works__reel-sound { right: 12px; }
.works__reel-sound[aria-pressed="true"] { background: var(--red); }
.works__i-play { display: none; }
.works__reel-play[data-paused="true"] .works__i-pause { display: none; }
.works__reel-play[data-paused="true"] .works__i-play { display: block; }
.works__i-on { display: none; }
.works__reel-sound[aria-pressed="true"] .works__i-on { display: block; }
.works__reel-sound[aria-pressed="true"] .works__i-off { display: none; }
.works__reel-cap { font-size: var(--fs-small); line-height: 1.35; }
.works__reel-name { font-weight: 600; }
.works__reel-type { color: var(--s-muted); letter-spacing: .06em; }

@media (min-width: 900px) {
  .works .works__reels {
    margin-inline: 0;
    padding: clamp(32px, 4vw, 56px);
    border-radius: var(--r-m);
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    align-items: end;
    gap: clamp(24px, 4vw, 64px);
  }
  .works__reels-head { padding: 0 0 56px; align-self: stretch; align-content: space-between; }
  .works__reels-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    overflow: visible;
    padding: 0 0 48px;
  }
  .works__reel:nth-child(2) { translate: 0 48px; }
  .works__reel:nth-child(1), .works__reel:nth-child(3) { translate: 0 0; }
}

/* Ссылка на Instagram под разделом */
.works .works__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: clamp(40px, 6vw, 80px);
  padding-top: 24px;
  border-top: 1.5px solid var(--s-line);
}
.works__more-text { color: var(--s-muted); }
.works__more-link { font-size: clamp(1.0625rem, 1.6vw, 1.375rem); min-width: 0; }
.works__more-arrow { width: 20px; height: 20px; flex: none; transition: transform .25s var(--ease-out); }
.works__more-link:hover .works__more-arrow { transform: translate(3px, -3px); }

/* ============================== ПРОЦЕСС ============================== */

.process__track {
  position: relative;
  --lace-w: 5px;
  --rail: 52px;
}
.process__lace {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.process__lace-halo { fill: none; stroke: var(--s-bg); stroke-width: calc(var(--lace-w) + 5px); stroke-linecap: butt; stroke-linejoin: round; }
.process__lace-core { fill: none; stroke: var(--red); stroke-width: var(--lace-w); stroke-linecap: round; stroke-linejoin: round; }
.process__aglet-body { fill: var(--ink); }
.process__aglet-shine { fill: var(--paper); opacity: .35; }

.process__steps {
  position: relative;
  z-index: 1;
  list-style: none;
  display: grid;
  gap: 14px;
  padding-left: var(--rail);
}
.process__step {
  position: relative;
  min-width: 0;
  padding: 22px 20px 22px;
  border: 1.5px solid var(--s-line);
  border-radius: var(--r-m);
  background: var(--s-bg);
  transition: border-color .5s;
}
.process__step.is-laced { border-color: color-mix(in srgb, var(--s-fg) 22%, var(--s-line)); }

/* Люверс: металлическое кольцо, сквозь отверстие виден шнурок */
.process__eyelet {
  position: absolute;
  left: calc(-1 * var(--rail) + 13px);
  top: 30px;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  border: 6px solid var(--ink);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--paper) 30%, transparent);
  pointer-events: none;
}
.process__num {
  display: block;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  line-height: .9;
  letter-spacing: -0.03em;
  color: var(--s-accent);
  /* обводка есть всегда и только меняет цвет: при «прошнуровке» цифра не пропадает на время заливки */
  -webkit-text-stroke: 1.5px var(--s-accent);
  transition: color .5s var(--ease-out), -webkit-text-stroke-color .5s;
}
.process--live .process__step:not(.is-laced) .process__num {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--s-fg);
}
.process__title {
  margin-top: 16px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  line-height: 1.15;
}
.process__text { margin-top: 10px; color: var(--s-muted); max-width: 46ch; }
.process__meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--s-line);
  color: var(--s-fg);
  font-size: .6875rem;
  line-height: 1.5;
}

.process__cta {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  margin-left: var(--rail);
  display: grid;
  justify-items: start;
  gap: 18px;
  padding: 24px 20px;
  border: 1.5px solid var(--s-fg);
  border-radius: var(--r-m);
  background: var(--s-bg);
}
.process__cta .process__eyelet { top: 36px; }
.process__cta-text {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  max-width: 22ch;
}

@media (min-width: 900px) {
  .process__track { --lace-w: 7px; --channel: clamp(140px, 15vw, 230px); }
  .process__steps {
    padding-left: 0;
    grid-template-columns: minmax(0, 1fr) var(--channel) minmax(0, 1fr);
    column-gap: 0;
    row-gap: 18px;
  }
  .process__step { padding: 30px 30px 28px; }
  .process__step:nth-child(odd) { grid-column: 1; }
  .process__step:nth-child(even) { grid-column: 3; }
  .process__step:nth-child(1) { grid-row: 1 / span 2; }
  .process__step:nth-child(2) { grid-row: 2 / span 2; }
  .process__step:nth-child(3) { grid-row: 3 / span 2; }
  .process__step:nth-child(4) { grid-row: 4 / span 2; }
  .process__step:nth-child(5) { grid-row: 5 / span 2; }
  .process__step:nth-child(6) { grid-row: 6 / span 2; }
  .process__step .process__eyelet { top: 52px; }
  .process__step:nth-child(odd) .process__eyelet { left: auto; right: -46px; }
  .process__step:nth-child(even) .process__eyelet { left: -46px; }
  .process__num { font-size: clamp(3rem, 4.4vw, 4.25rem); }
  .process__cta {
    margin: clamp(56px, 7vw, 96px) auto 0;
    max-width: 860px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 34px 36px;
    gap: 24px 40px;
  }
  .process__cta .process__eyelet { left: 50%; top: -1px; margin-left: -13px; }
}

/* ============================== ВОПРОСЫ ============================== */

.faq__layout {
  display: grid;
  gap: 32px;
}
.faq__list { min-width: 0; border-top: 1.5px solid var(--s-line); }
.faq__item { border-bottom: 1.5px solid var(--s-line); }
.faq__q {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::marker { content: ""; }
.faq__q:focus-visible { outline: 3px solid var(--s-accent); outline-offset: 4px; border-radius: 8px; }
.faq__num { color: var(--s-muted); transition: color .3s; align-self: start; padding-top: .45em; }
.faq__q-text {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.0625rem, 1.9vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.005em;
  transition: color .3s;
}
.faq__icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--s-line);
  transition: background-color .35s, border-color .35s, transform .5s var(--ease-out);
}
.faq__icon::before, .faq__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 2px;
  background: var(--s-fg);
  transition: transform .45s var(--ease-out), background-color .35s;
}
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open]:not(.is-closing) .faq__icon { background: var(--s-accent); border-color: var(--s-accent); }
.faq__item[open]:not(.is-closing) .faq__icon::before,
.faq__item[open]:not(.is-closing) .faq__icon::after { background: var(--paper); }
.faq__item[open]:not(.is-closing) .faq__icon::after { transform: rotate(0deg); }
.faq__item[open]:not(.is-closing) .faq__num { color: var(--s-accent); }
.faq__q:hover .faq__icon { border-color: var(--s-fg); }
.faq__q:hover .faq__num { color: var(--s-accent); }
.faq__a { overflow: hidden; }
.faq__a p {
  padding: 0 0 24px 42px;
  max-width: calc(62ch + 42px);
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.65;
  color: var(--s-fg);
}
.faq__link { font-weight: 600; color: var(--s-fg); white-space: nowrap; }
.faq__link:hover { color: var(--s-accent); }

.faq__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  container-type: inline-size;
  gap: 12px;
  padding: 26px 24px;
  border-radius: var(--r-m);
}
.faq__card-kicker { color: var(--s-accent); }
.faq__card-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  line-height: 1;
  text-transform: uppercase;
}
.faq__card-text { color: var(--s-muted); font-size: var(--fs-small); }
.faq__phone {
  justify-self: start;
  margin-top: 6px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.125rem, 1.6vw, 1.5rem);
  font-size: min(1.5rem, 9cqi); /* номер ~11em: всегда помещается в ширину карточки */
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}
.faq__phone:hover { color: var(--s-accent); }
.faq__card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

@media (min-width: 600px) {
  .faq__q { grid-template-columns: 44px minmax(0, 1fr) 48px; gap: 16px; padding: 26px 0; }
  .faq__icon { width: 48px; height: 48px; }
  .faq__a p { padding-left: 60px; padding-bottom: 30px; max-width: calc(62ch + 60px); }
}
/* Планшет: карточка во всю ширину под списком, текст слева, телефон и кнопки справа */
@media (min-width: 760px) and (max-width: 1199px) {
  .faq__card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "kicker phone" "title phone" "text actions";
    column-gap: 32px;
    padding: 32px;
  }
  .faq__card-kicker { grid-area: kicker; }
  .faq__card-title { grid-area: title; }
  .faq__card-text { grid-area: text; }
  .faq__phone { grid-area: phone; justify-self: end; align-self: end; margin-top: 0; font-size: min(1.75rem, 4.2cqi); }
  .faq__card-actions { grid-area: actions; justify-content: flex-end; margin-top: 0; }
}

/* Две колонки только там, где карточка сбоку вмещает телефон крупно; ниже карточка под списком */
@media (min-width: 1200px) {
  .faq__layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    gap: clamp(20px, 4vw, 64px);
    align-items: start;
  }
  .faq__list { grid-column: 2; grid-row: 1; }
  .faq__aside { grid-column: 1; grid-row: 1; position: sticky; top: calc(var(--header-h) + 24px); }
}
