/* ═══════════════════════════════════════════════════════════════
   Конфигуратор сайта - рабочий стол.

   Страница не лендинг, а инструмент: слева выбор, справа ваш сайт
   в натуральную величину на тёмном столе. Тёмный стол - единственное
   яркое место на странице: он нужен, чтобы светлый собранный сайт
   читался как предмет, а не как часть интерфейса.

   Палитра та же, что в портфолио «Digital для бизнеса»: холодная
   серо-голубая бумага, тёмно-синий текст, один электрический синий
   на том, что нажимают. Unbounded - заголовки, Onest - весь текст,
   JetBrains Mono - только цифры шагов.

   Движение отвечает на действие: нажатие, выбор, приход блока.
   Одна кривая (--ease) и три длительности на весь проект.

   Стили собранной страницы лежат отдельно, внутри рамки
   (assets/js/preview.js) - здесь их нет.
   ═══════════════════════════════════════════════════════════════ */

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper: #E9EDF3;
  --sheet: #F6F8FB;
  --card: #FFFFFF;
  --ink: #0B1220;
  --muted: #4A5568;
  --line: #C3CBD8;
  --line-soft: #DCE2EB;
  --accent: #2F5BFF;
  --on-accent: #FFFFFF;
  --accent-ink: #2448D8;
  --accent-soft: rgba(47, 91, 255, .09);

  /* стол под собранным сайтом */
  --desk: #10182A;
  --on-desk: #E9EDF3;
  --on-desk-muted: #9AA6BE;

  --f-display: 'Unbounded', 'Arial Black', Arial, sans-serif;
  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --ease: cubic-bezier(.2, 0, 0, 1);
  --t-quick: .14s;
  --t-base: .28s;

  --r-card: 14px;
  --r-ctl: 10px;
  --top: 56px;
  --pad: clamp(16px, 2vw, 28px);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--f-display); font-weight: 600; line-height: 1.1; letter-spacing: -.015em; }
a { color: var(--accent-ink); }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  border-radius: var(--r-ctl); text-decoration: none; transform: translateY(-150%);
  transition: transform var(--t-base) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

:where(a, button, input, label, summary):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* ── Верхняя строка ───────────────────────────────────────────── */
.top {
  height: var(--top);
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.top__in {
  height: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 0 var(--pad);
}
.brand {
  font-family: var(--f-display); font-weight: 600; font-size: 14px;
  letter-spacing: -.01em; text-decoration: none; color: var(--ink);
}
.top__right { display: flex; align-items: center; gap: 16px; }
.top__link { font-size: 14px; color: var(--muted); text-decoration: none; }
.top__link:hover { color: var(--accent-ink); }

.lang { display: flex; gap: 2px; font-family: var(--f-mono); font-size: 12px; }
.lang__opt {
  min-width: 40px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; text-decoration: none; color: var(--muted);
  transition: background-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease);
}
.lang__opt[aria-current] { background: var(--ink); color: var(--paper); }
.lang__opt:not([aria-current]):hover { background: var(--accent-soft); color: var(--accent-ink); }

/* ── Рабочий стол ─────────────────────────────────────────────── */
.desk {
  display: grid;
  grid-template-columns: minmax(360px, 420px) 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100dvh - var(--top));
}
.js .desk { animation: deskIn .5s var(--ease) both; }
@keyframes deskIn { from { opacity: 0; } to { opacity: 1; } }

.panel {
  grid-column: 1; grid-row: 2;
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line-soft); background: var(--paper);
}
.panel__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--pad); }

.intro {
  grid-column: 1; grid-row: 1;
  padding: var(--pad) var(--pad) 14px;
  border-right: 1px solid var(--line-soft);
}
.intro h1 { font-size: clamp(22px, 1.8vw, 28px); max-width: 19ch; }
.intro p { color: var(--muted); font-size: 15px; margin-top: 10px; max-width: 46ch; }

.steps { list-style: none; display: grid; gap: 12px; }
.step {
  background: var(--sheet); border: 1px solid var(--line-soft);
  border-radius: var(--r-card); padding: 16px;
}
.step__head { display: flex; align-items: baseline; gap: 10px; }
.step__n { font-family: var(--f-mono); font-size: 12px; color: var(--accent-ink); }
.step__t { font-size: 17px; }
.step__note { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }

/* карточки выбора */
.opts { display: grid; gap: 8px; }
.opts--niche, .opts--theme { grid-template-columns: 1fr 1fr; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt__body {
  height: 100%; display: grid; gap: 3px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  transition: border-color var(--t-quick) var(--ease), background-color var(--t-quick) var(--ease),
              color var(--t-quick) var(--ease), transform var(--t-quick) var(--ease);
}
.opt:active .opt__body { transform: scale(.985); }
.opt__t { font-weight: 500; font-size: 15px; }
.opt__h { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.opt__ico { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.opt input:focus-visible + .opt__body { outline: 2px solid var(--accent); outline-offset: 2px; }

/* выбранное заливается чернилами: видно с одного взгляда */
.opt input:checked + .opt__body { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.opt input:checked + .opt__body .opt__h { color: var(--on-desk-muted); }
.opt input:checked + .opt__body .opt__ico { stroke: var(--paper); }

/* эскиз оформления: маленькая страница в его цветах */
.thumb {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: start;
  padding: 8px; margin-bottom: 7px; border-radius: 8px;
  background: var(--t-bg); border: 1px solid var(--line-soft);
}
.thumb i { display: block; background: var(--t-ink); border-radius: 2px; grid-column: 1; }
.thumb__h { height: 8px; width: 80%; }
.thumb__p { height: 4px; width: 95%; opacity: .4; }
.thumb__p2 { height: 4px; width: 62%; opacity: .4; }
.thumb__btn { grid-column: 2; grid-row: 1 / span 3; align-self: end; height: 14px; width: 28px; background: var(--t-accent); }

/* переключатели блоков */
.opt--switch .opt__body {
  grid-template-columns: 1fr auto; grid-template-areas: 'title switch' 'hint switch';
  align-items: center; gap: 2px 12px;
}
.opt--switch .opt__t { grid-area: title; }
.opt--switch .opt__h { grid-area: hint; }
.switch {
  grid-area: switch; width: 40px; height: 24px; border-radius: 999px;
  background: var(--line); position: relative;
  transition: background-color var(--t-quick) var(--ease);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 999px; background: var(--card);
  transition: transform var(--t-base) var(--ease);
}
.opt--switch input:checked + .opt__body { background: var(--card); border-color: var(--accent); color: inherit; }
.opt--switch input:checked + .opt__body .opt__h { color: var(--muted); }
.opt--switch input:checked + .opt__body .switch { background: var(--accent); }
.opt--switch input:checked + .opt__body .switch::after { transform: translateX(16px); }

/* ── Итог ─────────────────────────────────────────────────────── */
.sum { display: grid; gap: 14px; }
.brief { display: grid; gap: 8px; }
.brief > div { display: grid; grid-template-columns: 104px 1fr; gap: 10px; align-items: baseline; }
.brief dt { font-size: 13px; color: var(--muted); }
.brief dd { font-size: 14.5px; }

.quote { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-ctl); padding: 16px; }
.quote__main { font-family: var(--f-display); font-weight: 600; font-size: 18px; line-height: 1.25; }
.quote__note { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 6px; }
.quote__rows { list-style: none; margin: 12px 0; display: grid; gap: 7px; }
.quote__rows li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.quote__rows b { font-weight: 500; white-space: nowrap; }
.dots { flex: 1; border-bottom: 1px dotted var(--line); }

.acts { display: grid; gap: 8px; }
/* в столбик: подписи кнопок не переносятся на вторую строку */
.acts--row { grid-template-columns: 1fr; }
.acts__note { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; font: inherit; font-size: 15px; font-weight: 500;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); color: var(--ink);
  text-decoration: none; cursor: pointer; text-align: center;
  transition: transform var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease),
              background-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease);
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.is-done { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* нижняя строка левого столбца: что собрано и куда это уходит */
.panel__bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--pad); border-top: 1px solid var(--line-soft);
  background: var(--sheet);
}
.tally { flex: 1; font-size: 13px; color: var(--muted); line-height: 1.4; }
.tally b { display: block; color: var(--ink); font-weight: 500; font-size: 14.5px; }
.panel__bar .btn { flex: 0 0 auto; }

/* ── Стол с собранным сайтом ──────────────────────────────────── */
.stage {
  grid-column: 2; grid-row: 1 / span 2;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--desk); color: var(--on-desk);
}
.stage__bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px var(--pad); border-bottom: 1px solid rgba(233, 237, 243, .1);
}
.stage__title { flex: 1; min-width: 130px; font-size: 13px; color: var(--on-desk-muted); }
.stage__title b { color: var(--on-desk); font-weight: 500; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: rgba(233, 237, 243, .08); border-radius: var(--r-ctl); }
.seg button {
  min-height: 34px; padding: 0 12px; font: inherit; font-size: 13px;
  border: 0; border-radius: 8px; background: transparent; color: var(--on-desk-muted); cursor: pointer;
  transition: background-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease), transform var(--t-quick) var(--ease);
}
.seg button:active { transform: scale(.985); }
.seg button[aria-pressed="true"] { background: var(--on-desk); color: var(--ink); }

.stage .btn--quiet { background: transparent; border-color: rgba(233, 237, 243, .22); color: var(--on-desk); }

.stage__desk { flex: 1; min-height: 0; display: grid; place-items: center; padding: 14px var(--pad); }
.screen {
  position: relative; overflow: hidden; background: #FFF;
  border-radius: var(--r-card);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45), 0 0 0 1px rgba(233, 237, 243, .12);
  transition: border-radius var(--t-base) var(--ease);
}
.screen--phone {
  border-radius: 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5), 0 0 0 6px #05070D, 0 0 0 7px rgba(233, 237, 243, .18);
}
.screen iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; display: block; }
.stage__note { padding: 0 var(--pad) 12px; font-size: 12.5px; color: var(--on-desk-muted); }

/* ── Подвал (виден только на узких экранах) ───────────────────── */
.foot {
  display: none; padding: 20px var(--pad) 28px; color: var(--muted); font-size: 13.5px;
  border-top: 1px solid var(--line-soft);
}
.foot p + p { margin-top: 6px; }

@media (hover: hover) {
  .opt:hover .opt__body { border-color: var(--line); }
  .opt input:checked + .opt__body:hover { border-color: var(--ink); }
  .btn:hover { border-color: var(--accent); }
  .btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
  .stage .btn--quiet:hover { border-color: var(--on-desk); }
  .seg button:hover { color: var(--on-desk); }
}

/* ── Узкие экраны: стол сверху, выбор под ним, итог прилипает ─── */
@media (max-width: 1040px) {
  .desk { display: flex; flex-direction: column; height: auto; }
  .intro { order: -3; border-right: 0; padding-bottom: 16px; }
  .panel { border-right: 0; }
  .stage__bar { padding: 8px var(--pad); }
  .stage__title { order: 3; flex-basis: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel__scroll { overflow: visible; padding-bottom: 8px; }
  .stage { order: -2; }
  /* на узком экране у стола нет своей высоты от раскладки - задаём её явно,
     иначе рамке не от чего считать размер */
  .stage__desk { flex: 0 0 auto; height: min(62vh, 620px); padding: 12px var(--pad); }
  .panel__bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    border-top: 1px solid var(--line); background: rgba(246, 248, 251, .96);
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  body { padding-bottom: 88px; }
  .foot { display: block; }
  .btn--sm { min-height: 42px; padding: 0 14px; }
  .seg button { min-height: 40px; }
}

@media (max-width: 560px) {
  .opts--niche, .opts--theme { grid-template-columns: 1fr; }
  .acts--row { grid-template-columns: 1fr; }
  .brief > div { grid-template-columns: 1fr; gap: 1px; }
  .top__link { display: none; }
  .intro h1 { font-size: 23px; }
  .tally { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
