/* Страница Qwerty Switcher. Общие токены, шапка, кнопки, подвал и FAQ берутся из ../style.css.
   Цветовое правило: коралл (--red) только на действиях, янтарь иконки (--qa) только на исправлении
   текста и нажатых клавишах. Других акцентов нет. */
.q-page {
  --qa: #f2a04e;
  --qa-ink: #ffd29e;
  --qa-bg: rgba(242, 160, 78, .2);
  --sel: rgba(237, 228, 211, .2);
  --win: #121216;
  --win-bar: #18181d;
  --win-line: #2a2a31;
  --g: clamp(3px, 1vw, 6px);
  --kw: clamp(20px, calc((100vw - 40px - 11 * var(--g)) / 12), 44px);
}
html, body { overflow-x: clip; }
/* Big Shoulders из style.css без кириллицы: в смешанной строке латиница уходила в другой шрифт
   («Mac», «Shift»). Здесь заголовки целиком в Oswald, у него есть оба алфавита. */
.q-page h1, .q-page h2, .q-page h3, .q-page .faq-item summary {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 700;
}
.q-page a.logo-tag:hover { color: var(--cream); }

/* Hero: иконка по центру, заголовок, действие, строка фактов */
.q-hero { padding: 44px 0 96px; border-bottom: 1px solid var(--line); }
.q-hero > .wrap:first-child { display: flex; flex-direction: column; align-items: center; text-align: center; }
.q-icon { width: 112px; height: 112px; margin-bottom: 20px; filter: drop-shadow(0 18px 40px rgba(242, 160, 78, .22)); }
.q-hero h1 {
  max-width: 12em;
  margin: 12px 0 16px;
  font-size: clamp(2.5rem, 5.2vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -.01em;
}
.q-lead { max-width: 40ch; color: var(--cream-dim); font-size: 1.15rem; }
.q-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.q-btn-lg { min-height: 52px; padding: 14px 24px; font-size: 14px; gap: 10px; }
.q-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-top: 20px;
  color: var(--cream-mute);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

/* Окно в стиле macOS: неактивные серые «светофоры», заголовок по центру, индикатор раскладки справа */
.q-stage { display: flex; flex-direction: column; align-items: center; gap: 32px; margin-top: 64px; }
.mac {
  width: 100%;
  max-width: 820px;
  overflow: hidden;
  background: var(--win);
  border: 1px solid var(--win-line);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  text-align: left;
  transition: border-color .3s ease;
}
.mac.hit { border-color: var(--qa); }
.mac:focus-within { border-color: #4a4a52; }
.mac-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  background: var(--win-bar);
  border-bottom: 1px solid #222228;
}
.mac-dots { display: flex; gap: 7px; }
.mac-dots i { width: 12px; height: 12px; border-radius: 50%; background: #34343b; }
.mac-title { color: var(--cream-mute); font-size: 13px; }
.mac-layout {
  justify-self: end;
  padding: 3px 7px;
  border: 1px solid #36363e;
  border-radius: 5px;
  color: var(--cream-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  transition: color .3s ease, background-color .3s ease, border-color .3s ease;
}
.mac-layout.flash { color: #0a0a0c; background: var(--qa); border-color: var(--qa); }
.mac-body { position: relative; min-height: 150px; padding: 28px 30px 32px; }
.typed,
.try {
  color: var(--cream);
  font-size: clamp(1.35rem, 3.2vw, 2.1rem);
  line-height: 1.38;
  letter-spacing: -.01em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.try {
  display: block;
  width: 100%;
  min-height: 2.8em;
  padding: 0;
  resize: none;
  background: transparent;
  border: 0;
  font-family: inherit;
  caret-color: var(--qa);
}
.try[hidden] { display: none; }
.try::placeholder { color: var(--cream-mute); }
.mac .try:focus-visible { outline: none; }
.fx {
  color: var(--qa-ink);
  background: var(--qa-bg);
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--qa-bg);
  transition: color 1.4s ease, background-color 1.4s ease, box-shadow 1.4s ease;
}
.fx.fade { color: inherit; background: transparent; box-shadow: 0 0 0 2px transparent; }
.sel { background: var(--sel); border-radius: 3px; }
.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -.14em;
  background: var(--qa);
  animation: q-blink 1.05s steps(1) infinite;
}
@keyframes q-blink { 50% { opacity: 0; } }

/* Клавиатура: на каждой клавише латиница и кириллица, нажатая подсвечивается янтарём */
.kb { display: flex; flex-direction: column; gap: var(--g); user-select: none; }
.kb-row { display: flex; justify-content: center; gap: var(--g); }
.k {
  position: relative;
  flex: 0 0 auto;
  width: var(--kw);
  height: var(--kw);
  background: #141418;
  border: 1px solid #2a2a31;
  border-bottom-width: 2px;
  border-radius: 7px;
  font-family: "JetBrains Mono", monospace;
  transition: background-color .25s ease, border-color .25s ease, transform .12s ease;
}
.k b { position: absolute; top: 5px; left: 7px; color: var(--cream-dim); font-size: 12px; font-weight: 600; line-height: 1; }
.k i { position: absolute; right: 7px; bottom: 6px; color: var(--cream-mute); font-size: 11px; font-style: normal; line-height: 1; }
.k-mod { display: flex; align-items: center; justify-content: center; width: calc(var(--kw) * 1.55); color: var(--cream-mute); font-size: 15px; }
.k-space { width: calc(var(--kw) * 6.5); height: calc(var(--kw) * .75); }
.k.on { background: var(--qa-bg); border-color: var(--qa); transform: translateY(1px); }
.k.on b, .k.on i, .k-mod.on { color: var(--qa-ink); }

.q-try { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 62ch; text-align: center; }
.q-try-cap { color: var(--cream-dim); font-size: 1rem; }
.q-try-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.q-try-actions [hidden] { display: none; }

/* Общие секции */
.q-sec { padding: 112px 0; border-bottom: 1px solid var(--line); }
.q-sec h2 { max-width: 18ch; margin-top: 14px; font-size: clamp(2.2rem, 4.4vw, 3.5rem); line-height: 1.04; }
.q-page kbd {
  display: inline-flex;
  justify-content: center;
  min-width: 2em;
  padding: .22em .55em;
  background: #141418;
  border: 1px solid #36363e;
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--cream);
  font-family: "JetBrains Mono", monospace;
  font-size: .82em;
  line-height: 1.3;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.faq-item kbd { margin-inline: 1px; }
.faq-item a { color: var(--cream); border-bottom: 1px solid var(--line); }
.faq-item a:hover { border-color: var(--red); }

/* Как работает: слева закреплённый заголовок и оглавление, справа сцены */
.fs { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; }
.fs-pin { position: sticky; top: 112px; }
.fs-index { list-style: none; counter-reset: fsi; margin-top: 36px; border-top: 1px solid var(--line); }
.fs-index li {
  counter-increment: fsi;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--cream-mute);
  font-size: 1.05rem;
  transition: color .3s ease;
}
.fs-index li::before { content: counter(fsi, decimal-leading-zero); color: var(--cream-mute); font-family: "JetBrains Mono", monospace; font-size: 12px; transition: color .3s ease; }
.fs-index li.on { color: var(--cream); }
.fs-index li.on::before { color: var(--qa); }
.fs-note { max-width: 40ch; margin-top: 24px; color: var(--cream-mute); font-size: .92rem; }
.fs-caps { display: flex; flex-direction: column; gap: 104px; }
.cap h3 { margin-top: 24px; font-size: 1.7rem; line-height: 1.1; }
.cap p { max-width: 52ch; margin-top: 8px; color: var(--cream-dim); }
.fs-cta { align-self: flex-start; }
.mac-sm .mac-body { min-height: 176px; padding: 24px 26px 56px; }
.mac-sm .typed { font-size: clamp(1.15rem, 2.2vw, 1.5rem); }
.mac-term .typed,
.mac-term pre { color: var(--cream); font-family: "JetBrains Mono", monospace; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.ds { position: absolute; right: 18px; bottom: 16px; display: flex; gap: 6px; opacity: .3; transition: opacity .2s ease; }
.ds.on { opacity: 1; }
.ds.on kbd { color: var(--qa-ink); border-color: var(--qa); background: var(--qa-bg); }
.tag {
  position: absolute;
  right: 18px;
  bottom: 16px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--cream-mute);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: opacity .3s ease;
}
.tag.hide { opacity: 0; }
.tag-on { color: var(--qa-ink); border-color: rgba(242, 160, 78, .45); }
.wasd { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: 52px 52px; gap: 6px; }
.wasd kbd { align-items: center; width: 52px; height: 52px; font-size: 15px; }
.wasd kbd[data-k="w"] { grid-column: 2; }
.wasd kbd[data-k="a"] { grid-column: 1; grid-row: 2; }
.wasd kbd[data-k="s"] { grid-column: 2; grid-row: 2; }
.wasd kbd[data-k="d"] { grid-column: 3; grid-row: 2; }
.wasd kbd.on { color: var(--qa-ink); border-color: var(--qa); background: var(--qa-bg); }

/* Клавиши */
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; margin-top: 48px; }
.keys > div {
  display: grid;
  grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.keys dt { display: flex; flex-wrap: wrap; gap: 6px; }
.keys dd { color: var(--cream-dim); }
.keys-note { max-width: 60ch; margin-top: 26px; color: var(--cream-mute); font-size: .92rem; }

/* Приватность */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.plain { list-style: none; display: grid; gap: 14px; margin-top: 30px; }
.plain li { position: relative; max-width: 52ch; padding-left: 24px; color: var(--cream-dim); }
.plain li::before { content: ""; position: absolute; left: 0; top: .78em; width: 12px; height: 1px; background: var(--cream-mute); }
.proof { margin: 0; }
.proof .mac-body { min-height: 0; padding: 22px 26px 26px; }
.proof pre { margin: 0; }
.proof code { font: inherit; }
.proof figcaption { max-width: 52ch; margin-top: 16px; color: var(--cream-mute); font-size: .9rem; }

/* Установка */
.steps-q { list-style: none; counter-reset: stq; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 48px; border-top: 1px solid var(--line); }
.steps-q li { counter-increment: stq; padding: 28px 28px 8px 0; }
.steps-q li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.steps-q li::before { content: counter(stq, decimal-leading-zero); display: block; margin-bottom: 14px; color: var(--cream-mute); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.steps-q h3 { font-size: 1.45rem; line-height: 1.12; }
.steps-q p { margin-top: 10px; color: var(--cream-dim); font-size: .95rem; }

#faq .faq-list { margin-top: 40px; }

/* Финал: то же действие ещё раз */
.q-end { padding: 120px 0 112px; border-bottom: 1px solid var(--line); }
.q-end .wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.q-end h2 { font-size: clamp(2.2rem, 4.4vw, 3.5rem); line-height: 1.04; }
.q-ver { color: var(--cream-mute); font-family: "JetBrains Mono", monospace; font-size: 12px; }

@media (max-width: 960px) {
  .fs { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .fs-pin { position: static; }
  .fs-index { display: none; }
  .fs-caps { gap: 72px; }
  .keys { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .steps-q { grid-template-columns: minmax(0, 1fr); }
  .steps-q li, .steps-q li + li { padding: 24px 0 8px; border-left: 0; }
  .steps-q li + li { border-top: 1px solid var(--line); }
}
@media (max-width: 620px) {
  .q-hero { padding: 40px 0 72px; }
  .q-icon { width: 104px; height: 104px; }
  .q-sec { padding: 80px 0; }
  .q-end { padding: 88px 0 80px; }
  .mac-body { padding: 22px 20px 26px; }
  .mac-sm .mac-body { padding: 20px 20px 56px; }
  .k { border-radius: 5px; }
  .k b { top: 3px; left: 4px; font-size: 9px; }
  .k i { right: 4px; bottom: 3px; font-size: 9px; }
  .k-mod { font-size: 12px; }
  .keys > div { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mac-term .typed, .mac-term pre { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .fx, .k, .mac-layout, .tag, .ds, .mac { transition: none; }
}
