/* ============================================================
   Сбер — Система бренда · компоненты страниц-разделов
   ============================================================ */

/* ---------- Do / Don't ---------- */
.dodont { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.dd {
  border-radius: var(--r-tile);
  overflow: clip;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
  display: flex; flex-direction: column;
}
.dd__stage {
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  background: var(--paper);
  position: relative;
  overflow: clip;
}
.dd__stage > * { max-width: 66%; max-height: 66%; }
.dd__foot {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 18px 18px;
  font-size: 15px; line-height: 1.4;
}
.dd__badge {
  flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 15px;
}
.dd--do    .dd__badge { background: var(--green); }
.dd--dont  .dd__badge { background: #E11D2E; }
.dd--do    { box-shadow: inset 0 0 0 2px rgba(33,160,56,.35); }
.dd--dont  { box-shadow: inset 0 0 0 2px rgba(225,29,46,.28); }

/* ---------- Спецификации (карточки-факты) ---------- */
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.spec {
  padding: 26px;
  border-radius: var(--r-tile);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
}
.spec__k { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .55; }
.spec__v { font-size: clamp(28px, 3vw, 44px); font-weight: 900; letter-spacing: -.03em; margin: 8px 0 6px; }
.spec p { font-size: 14.5px; line-height: 1.45; opacity: .8; }

/* панель на цветном фоне: карточки становятся стеклянными */
.on-dark .spec, .on-dark .dd { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.16); color: #fff; }
.on-dark .dd__stage { background: rgba(255,255,255,.06); }

/* ---------- Логотип: сцена и охранное поле ---------- */
.logo-stage {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-tile);
  display: grid; place-items: center;
  background: var(--paper);
  transition: background .4s var(--ease);
  position: relative; overflow: clip;
}
.logo-stage svg { width: min(300px, 42%); }
.logo-stage.bg-paper    { background: var(--paper); }
.logo-stage.bg-white    { background: #fff; }
.logo-stage.bg-green    { background: var(--green); }
.logo-stage.bg-graphite { background: var(--graphite); }
.logo-stage.bg-gradient { background: var(--grad); background-size: 200% 100%; }
.logo-stage.bg-photo    { background: linear-gradient(135deg,#2b3a2e,#0f1a12); }

.bg-swap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.bg-swap button {
  padding: 9px 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700;
  box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.18);
  transition: background .2s, color .2s;
}
.bg-swap button[aria-pressed="true"] { background: var(--black); color: #fff; box-shadow: none; }

/* охранное поле / сетка построения */
.clearspace {
  --u: clamp(30px, 6vw, 64px);
  display: grid; place-items: center;
  padding: var(--u);
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(var(--u) - 1px), rgba(33,160,56,.18) calc(var(--u) - 1px) var(--u)),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--u) - 1px), rgba(33,160,56,.18) calc(var(--u) - 1px) var(--u)),
    var(--paper);
  border-radius: var(--r-tile);
  position: relative;
}
.clearspace__mark {
  padding: var(--u);
  outline: 2px dashed rgba(33,160,56,.6);
  background: #fff;
}
.clearspace__mark svg { width: clamp(90px, 18vw, 160px); }

/* ---------- Цвета: свотчи ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.swatch {
  border-radius: var(--r-tile);
  overflow: clip;
  text-align: left;
  box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.08);
  transition: transform .3s var(--ease-spring);
}
.swatch:hover { transform: translateY(-4px); }
.swatch__chip { height: 130px; background: var(--c); display: flex; align-items: flex-end; padding: 14px; }
.swatch__chip span { font-size: 12px; font-weight: 700; opacity: .85; color: var(--ink); }
.swatch__meta { padding: 14px 16px 18px; background: #fff; }
.swatch__name { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.swatch__hex { font-family: var(--mono); font-size: 13px; opacity: .6; margin-top: 3px; }
.swatch__role { font-size: 13px; opacity: .7; margin-top: 8px; line-height: 1.4; }

/* цветовые полосы-аккордеон (переиспользуем на цветной странице) */
.stripes { display: flex; min-height: 62vh; border-radius: var(--r-tile); overflow: clip; }
.stripe {
  position: relative; flex: 1; background: var(--c); color: var(--ink);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  gap: 6px; padding: 5vh 22px; overflow: clip; transition: flex .7s var(--ease); min-width: 0;
}
.stripe:hover, .stripe.is-open, .stripe:focus-visible { flex: 3.2; }
.stripe__name { font-size: clamp(18px, 2vw, 30px); font-weight: 900; letter-spacing: -.02em; white-space: nowrap; writing-mode: vertical-rl; rotate: 180deg; }
.stripe:hover .stripe__name, .stripe.is-open .stripe__name, .stripe:focus-visible .stripe__name { writing-mode: horizontal-tb; rotate: none; }
.stripe__hex { font-family: var(--mono); font-size: clamp(13px, 1.4vw, 18px); opacity: 0; transform: translateY(10px); transition: opacity .4s .12s, transform .4s .12s var(--ease); }
.stripe__role { font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(10px); transition: opacity .4s .2s, transform .4s .2s var(--ease); }
.stripe:hover .stripe__hex, .stripe.is-open .stripe__hex, .stripe:focus-visible .stripe__hex,
.stripe:hover .stripe__role, .stripe.is-open .stripe__role, .stripe:focus-visible .stripe__role { opacity: .92; transform: none; }

/* сочетания */
.combos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.combo { border-radius: var(--r-tile); padding: 30px 26px; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; }
.combo__big { font-size: clamp(26px, 3vw, 40px); font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.combo__note { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; opacity: .8; }

/* контраст-чекер */
.contrast { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: stretch; }
.cc-preview {
  border-radius: var(--r-tile); padding: 34px; min-height: 260px;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  transition: background .3s, color .3s;
}
.cc-preview .cc-big { font-size: clamp(30px, 4vw, 54px); font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.cc-preview .cc-small { font-size: 16px; line-height: 1.5; max-width: 30ch; }
.cc-panel { display: flex; flex-direction: column; gap: 18px; }
.cc-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; }
.cc-row label { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
.cc-row select {
  padding: 12px 14px; border-radius: var(--r-control);
  background: #fff; box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.16);
  font-weight: 700;
}
.cc-ratio { font-size: clamp(48px, 8vw, 88px); font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.cc-ratio span { font-size: .35em; opacity: .5; font-weight: 700; }
.cc-ratio.is-pass { color: var(--green); }
.cc-ratio.is-fail { color: #E11D2E; }
.cc-grades { display: grid; gap: 8px; margin-top: 6px; }
.cc-grades li { font-size: 15px; font-weight: 600; }
.cc-grades li.ok { color: var(--green-dk); }
.cc-grades li.no { opacity: .45; }

/* ---------- Типографика: Type Explorer ---------- */
.te {
  border-radius: var(--r-tile);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
  overflow: clip;
  display: grid; grid-template-columns: 1fr;
}
.te__stage {
  padding: clamp(28px, 5vw, 64px);
  min-height: 300px;
  display: flex; align-items: center;
  overflow-x: auto;
}
.te__stage p {
  font-weight: 700; letter-spacing: -.02em; line-height: 1; margin: 0;
  outline: none; text-wrap: balance;
}
.te__stage p:focus-visible { outline: 2px dashed rgba(2,145,235,.5); outline-offset: 8px; }
.te__controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px 28px;
  padding: 24px clamp(28px, 5vw, 64px) 30px;
  background: var(--paper);
  border-top: 1.5px solid rgba(16,19,20,.1);
}
.te__ctl label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.te__ctl label b { font-weight: 700; color: var(--green-dk); }
.te__hint { font-family: var(--mono); font-size: 12px; opacity: .5; padding: 0 clamp(28px, 5vw, 64px) 20px; background: var(--paper); }

/* range в фирменном стиле */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: rgba(16,19,20,.18); outline-offset: 6px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--green); cursor: pointer; box-shadow: 0 2px 8px rgba(33,160,56,.4); transition: transform .15s; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--green); cursor: pointer; }

/* шкала кеглей */
.type-scale { display: grid; gap: 2px; }
.type-scale > div {
  display: flex; align-items: baseline; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid rgba(16,19,20,.12);
  cursor: pointer; transition: padding-left .3s var(--ease);
}
.type-scale > div:hover { padding-left: 12px; }
.type-scale .ts-tag { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; opacity: .55; flex: 0 0 130px; }
.type-scale .ts-sample { font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* начертания */
.weights { border-top: 2px solid rgba(16,19,20,.2); }
.weights li button {
  width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
  padding: 16px 0; border-bottom: 2px solid rgba(16,19,20,.2); text-align: left; transition: padding-left .3s var(--ease);
}
.weights li button:hover { padding-left: 14px; }
.weights .w-tag { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; flex: 0 0 auto; }
.weights .w-sample { font-size: clamp(20px, 2.4vw, 32px); letter-spacing: -.02em; }

/* ---------- Иконки: галерея + слот-машина ---------- */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.icon-cell {
  aspect-ratio: 1; border-radius: var(--r-tile);
  background: #fff; box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  transition: transform .3s var(--ease-spring), background .3s;
}
.icon-cell:hover { transform: translateY(-4px); background: var(--green); color: #fff; }
.icon-cell svg { width: 40%; height: auto; stroke: currentColor; }
.icon-cell span { font-size: 12px; font-weight: 600; opacity: .7; }
.icon-cell:hover span { opacity: 1; }

/* конструкция иконки */
.icon-construct {
  aspect-ratio: 1; max-width: 320px; border-radius: var(--r-tile);
  background:
    repeating-linear-gradient(0deg, transparent 0 11.5%, rgba(2,145,235,.14) 11.5% 12.5%),
    repeating-linear-gradient(90deg, transparent 0 11.5%, rgba(2,145,235,.14) 11.5% 12.5%),
    #fff;
  box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
  display: grid; place-items: center; position: relative;
}
.icon-construct svg { width: 62%; color: var(--black); }
.icon-construct::after {
  content: ""; position: absolute; inset: 12.5%;
  border-radius: 50%; outline: 1.5px dashed rgba(33,160,56,.5);
}

/* слот-машина */
.slot {
  border-radius: var(--r-tile); overflow: clip;
  background: var(--graphite); color: #fff;
  padding: clamp(20px, 4vw, 40px);
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.slot__reels {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%;
  max-width: 560px;
}
.reel {
  height: 120px; border-radius: 18px; overflow: clip;
  background: #fff;
}
.reel__strip { will-change: transform; }
.reel__cell { height: 120px; display: grid; place-items: center; }
.reel__cell svg { width: 52px; height: 52px; color: var(--graphite); stroke: var(--graphite); }
.slot__spin {
  padding: 15px 34px; border-radius: var(--r-pill);
  background: var(--green); color: #fff; font-weight: 800; font-size: 17px;
  transition: transform .2s var(--ease-spring), background .2s;
}
.slot__spin:hover { background: var(--green-dk); transform: translateY(-2px); }
.slot__spin:active { transform: scale(.96); }
.slot__cap { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; opacity: .6; text-transform: uppercase; }

/* ---------- Голос ---------- */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.principle {
  padding: 30px; border-radius: var(--r-tile);
  background: #fff; box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
}
.principle__n { font-family: var(--mono); font-size: 12px; opacity: .5; }
.principle__t { font-size: clamp(24px, 2.6vw, 34px); font-weight: 900; letter-spacing: -.02em; margin: 10px 0 8px; }
.principle p { font-size: 15px; line-height: 1.5; opacity: .82; }

.voice-lines { display: grid; gap: clamp(10px, 2vh, 20px); }
.voice-lines li {
  font-size: clamp(26px, 4.4vw, 60px); font-weight: 900; line-height: 1.1; letter-spacing: -.03em;
  color: rgba(255,255,255,.28); transition: color .5s ease, transform .5s var(--ease);
}
.voice-lines li.is-lit { color: #fff; transform: translateX(clamp(6px, 1.5vw, 22px)); }

/* до / после */
.beforeafter { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ba {
  padding: 26px; border-radius: var(--r-tile);
  background: #fff; box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
}
.ba__tag { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 8px; }
.ba--no .ba__tag { color: #E11D2E; }
.ba--yes .ba__tag { color: var(--green-dk); }
.ba p { font-size: clamp(18px, 2vw, 24px); font-weight: 600; line-height: 1.4; }

/* ---------- Движение ---------- */
.motion-lab { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.md {
  border-radius: var(--r-tile); overflow: clip;
  background: #fff; box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
  cursor: pointer;
}
.md__stage { height: 200px; position: relative; display: grid; place-items: center; background: var(--paper); overflow: clip; }
.md__foot { padding: 16px 18px 18px; }
.md__foot b { display: block; font-weight: 800; letter-spacing: -.01em; }
.md__foot span { font-family: var(--mono); font-size: 12px; opacity: .55; }

/* демо: reveal снизу */
.md__ball { width: 64px; height: 64px; border-radius: 18px; background: var(--green); }
[data-motion-demo="reveal"] .md__ball { opacity: 0; transform: translateY(40px); }
[data-motion-demo="reveal"].is-play .md__ball { animation: dm-reveal .8s var(--ease) forwards; }
@keyframes dm-reveal { to { opacity: 1; transform: none; } }

[data-motion-demo="spring"] .md__ball { border-radius: 50%; background: var(--blue); }
[data-motion-demo="spring"].is-play .md__ball { animation: dm-spring .5s var(--ease-spring); }
@keyframes dm-spring { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

[data-motion-demo="draw"] svg { width: 90px; }
[data-motion-demo="draw"] circle, [data-motion-demo="draw"] path { stroke-dasharray: 400; stroke-dashoffset: 400; }
[data-motion-demo="draw"].is-play circle { animation: dm-draw 1.2s var(--ease) forwards; }
[data-motion-demo="draw"].is-play path { animation: dm-draw .8s var(--ease) .6s forwards; }
@keyframes dm-draw { to { stroke-dashoffset: 0; } }

[data-motion-demo="stagger"] .md__row { display: flex; gap: 10px; }
[data-motion-demo="stagger"] .md__row i { width: 26px; height: 60px; border-radius: 8px; background: var(--yellow); opacity: 0; transform: translateY(24px); }
[data-motion-demo="stagger"].is-play .md__row i { animation: dm-reveal .6s var(--ease) forwards; }
[data-motion-demo="stagger"].is-play .md__row i:nth-child(2) { animation-delay: .08s; }
[data-motion-demo="stagger"].is-play .md__row i:nth-child(3) { animation-delay: .16s; }
[data-motion-demo="stagger"].is-play .md__row i:nth-child(4) { animation-delay: .24s; }
[data-motion-demo="stagger"].is-play .md__row i:nth-child(5) { animation-delay: .32s; }

/* графики изинга */
.ease-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ease-card { padding: 24px; border-radius: var(--r-tile); background: #fff; box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1); }
.ease-card svg { width: 100%; height: auto; margin-bottom: 14px; }
.ease-card b { display: block; font-weight: 800; }
.ease-card code { font-family: var(--mono); font-size: 12px; opacity: .6; }

/* ---------- Downloads ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.dl {
  padding: 28px; border-radius: var(--r-tile);
  background: #fff; box-shadow: inset 0 0 0 1.5px rgba(16,19,20,.1);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.dl:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -20px rgba(0,0,0,.25); }
.dl__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--paper); display: grid; place-items: center; }
.dl__icon svg { width: 26px; height: 26px; }
.dl__t { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.dl p { font-size: 14.5px; line-height: 1.45; opacity: .8; }
.dl__act { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--green-dk); }
.dl__act svg { width: 16px; height: 16px; }

/* блок-кода */
.code {
  border-radius: var(--r-tile); overflow: clip;
  background: var(--black); color: #E9EDF0;
}
.code pre { margin: 0; padding: 24px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; }
.code .tok-c { color: #8DA0AD; }
.code .tok-g { color: var(--lime); }

/* ---------- утилиты сетки ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.grid-2--wide { grid-template-columns: 1.2fr .8fr; }
.stack-24 > * + * { margin-top: 24px; }
.stack-14 > * + * { margin-top: 14px; }
.mt-s { margin-top: 20px; } .mt-m { margin-top: 40px; } .mt-l { margin-top: 64px; }

@media (max-width: 900px) {
  .contrast, .grid-2, .grid-2--wide { grid-template-columns: 1fr; }
  .beforeafter { grid-template-columns: 1fr; }
  .stripes { min-height: auto; flex-direction: column; }
  .stripe { padding: 18px; }
  .stripe:hover, .stripe.is-open, .stripe:focus-visible { flex: 1; }
  .stripe__name { writing-mode: horizontal-tb; rotate: none; }
  .stripe__hex, .stripe__role { opacity: .9; transform: none; }
}
