/* Тема «терминал»: тёмный фон, моноширинные заголовки, фон из ASCII-символов.
   Подключается после site.css и меняет только публичную часть. Админка остаётся светлой. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono.ttf") format("truetype");
  font-weight: 100 800;
  font-display: swap;
}

body.theme-term {
  --fg: #ececec;
  --bg: #0c0c0e;
  --muted: #8f8f94;        /* 6:1 на фоне */
  --rule: #26262b;
  --panel: #111114;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --radius: 2px;
  background: var(--bg);
  color: var(--fg);
}
.theme-term::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("/static/img/ascii-bg.svg") repeat;
}
.theme-term ::selection { background: #fff; color: #000; }

/* заголовки и цифры моноширинным */
.theme-term h1, .theme-term .block-title, .theme-term .logo, .theme-term .hero-name,
.theme-term .row-price, .theme-term .offer-price, .theme-term .menu-price, .theme-term .step-n,
.theme-term .work-title, .theme-term .faq-title, .theme-term .footer-title, .theme-term .page-from {
  font-family: var(--mono);
}
.theme-term h1 { letter-spacing: -0.04em; font-weight: 700; }
.theme-term .block-title { font-weight: 600; letter-spacing: -0.03em; }

.term-label {
  margin: 0 0 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.block-inv .term-label { color: var(--muted); }

/* кнопки: прямые углы, белая основная */
.theme-term .btn { border-radius: var(--radius); font-family: var(--mono); font-weight: 600; font-size: 15px; }
.theme-term .btn-solid { background: #fff; color: #000; border: 1px solid #fff; }
.theme-term .btn-solid:hover { opacity: 1; background: transparent; color: #fff; }
.theme-term .btn-line { border: 1px solid #5a5a60; color: var(--fg); }
.theme-term .btn-line:hover { opacity: 1; border-color: #fff; }
.theme-term a:hover { opacity: .75; }

/* шапка и меню */
.theme-term .site-header { background: rgba(12, 12, 14, .92); border-bottom-color: var(--rule); }
.theme-term .logo { font-weight: 800; letter-spacing: -0.02em; }
.theme-term .main-nav { font-family: var(--mono); font-size: 14px; }
.theme-term .price-menu summary { border: 1px solid #5a5a60; border-radius: var(--radius); font-family: var(--mono); font-size: 14px; }
.theme-term .price-menu[open] summary { background: #fff; color: #000; border-color: #fff; }
.theme-term .price-menu-panel { background: var(--panel); border-top-color: var(--rule); border-bottom: 1px solid var(--rule); }
.theme-term .menu-col-title { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid var(--rule); }
.theme-term .menu-dark { background: #000; border: 1px solid #3a3a40; border-radius: var(--radius); }

/* первый экран: слева текст, справа панель-терминал */
.hero-term { display: flex; flex-wrap: wrap; gap: 48px 56px; align-items: flex-start; padding: 64px 0 48px; }
.hero-main { flex: 1.25 1 440px; min-width: 0; }
.hero-term h1 { font-size: clamp(32px, 4.3vw, 54px); line-height: 1.08; max-width: 17ch; }
.hero-term .hero-text { margin-top: 22px; font-size: 18px; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 20px 48px; margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--rule); }
.hero-stats dt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); order: 2; }
.hero-stats div { display: flex; flex-direction: column-reverse; gap: 4px; }
.hero-stats dd { margin: 0; font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }

.term-panel {
  flex: 1 1 360px; min-width: 0; background: rgba(17, 17, 20, .9);
  border: 1px solid var(--rule); font-family: var(--mono); font-size: 13px;
}
.term-head, .term-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  padding: 14px 18px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-size: 11px;
}
.term-head { border-bottom: 1px solid var(--rule); }
.term-head span:first-child { color: var(--fg); }
.term-foot { border-top: 1px solid var(--rule); text-transform: none; letter-spacing: 0; font-size: 13px; }
.term-foot span { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.term-foot a { color: var(--fg); }
.term-row { display: block; padding: 13px 18px 12px; text-decoration: none; border-top: 1px solid transparent; }
.term-row + .term-row { border-top-color: #1b1b1f; }
.term-row:hover { opacity: 1; background: #17171b; }
.term-row-top { display: flex; align-items: baseline; gap: 10px; }
.term-name { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--muted); }
.term-row:hover .term-name { color: var(--fg); }
.term-price { white-space: nowrap; font-size: 13px; }
.term-panel .leader { opacity: .35; }
.term-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.term-dots i { width: 9px; height: 9px; background: #3a3a40; }
.term-row:hover .term-dots i { background: #8f8f94; }

.dark-wrap { margin-bottom: 8px; }
.theme-term .dark-tile { margin-top: 0; background: #000; border: 1px solid #3a3a40; border-radius: var(--radius); }
.theme-term .dark-tile-go { border-radius: var(--radius); font-family: var(--mono); font-size: 15px; border-width: 1px; }

/* разделы прайса */
.theme-term .block { border-top: 1px solid var(--rule); }
.theme-term .row-name { font-weight: 500; }
.theme-term .row-price, .theme-term .offer-price { font-weight: 600; font-size: 18px; }
.theme-term .extra-title { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.theme-term .block-inv {
  margin: 0; padding: 56px 0; background: transparent; color: var(--fg); border-radius: 0;
  border-top: 1px solid var(--rule) !important; --muted: #8f8f94; --rule: #26262b;
}
.theme-term .block-inv .btn-inv { background: #fff; color: #000; border: 1px solid #fff; }
.theme-term .faq-item summary { font-weight: 500; }
.theme-term .faq-item summary::after { font-family: var(--mono); }

/* работы и шаги */
.theme-term .work-img { border-color: var(--rule); border-radius: var(--radius); }
.theme-term .work-img-empty { background: var(--panel); color: #5a5a60; font-family: var(--mono); }
.theme-term .steps li { border-top: 1px solid var(--rule); padding-top: 18px; }
.theme-term .step-n { font-size: 36px; font-weight: 500; color: #5a5a60; }

/* подвал */
.theme-term .site-footer { background: transparent; color: var(--fg); border-top: 1px solid var(--rule); --muted: #8f8f94; }
.theme-term .site-footer .btn-inv { background: #fff; color: #000; border: 1px solid #fff; border-radius: var(--radius); }
.theme-term .footer-nav { font-family: var(--mono); font-size: 13px; }
.theme-term .footer-nav-dark { color: var(--fg); }

.theme-term .mobile-cta { background: #fff; color: #000; border-radius: var(--radius); font-family: var(--mono); box-shadow: 0 0 0 1px #000; }
.theme-term :focus-visible { outline-color: #fff; }

/* страница DARK: чёрная, фон виден только под «фонариком» курсора */
.theme-term.page-dark { --bg: #000; }
.theme-term.page-dark::before {
  opacity: 1; background: url("/static/img/ascii-bg-dark.svg") repeat; background-size: 384px;
  -webkit-mask-image: radial-gradient(circle 220px at var(--mx, 50%) var(--my, 42%), #000 0%, rgba(0,0,0,.5) 50%, transparent 100%);
          mask-image: radial-gradient(circle 220px at var(--mx, 50%) var(--my, 42%), #000 0%, rgba(0,0,0,.5) 50%, transparent 100%);
}
.theme-term .dk { padding: 64px 0 112px; }
.dk-path { margin-bottom: 18px; }
.theme-term .dk-word { margin: 0; line-height: 0; font-size: inherit; }
.dk-log { margin-top: 44px; font-family: var(--mono); font-size: 16px; color: #8f8f94; }
.dk-log p { margin: 0 0 8px; opacity: 0; animation: dk-line .01s linear forwards; }
.dk-log p:nth-child(1) { animation-delay: 1.8s; }
.dk-log p:nth-child(2) { animation-delay: 2.4s; }
.dk-log p:nth-child(3) { animation-delay: 3s; color: #ececec; }
.dk-prompt { color: #5a5a60; margin-right: 6px; }
.dk-cursor { display: inline-block; width: .6em; height: 1.1em; margin-left: 6px; vertical-align: -0.18em; background: #ececec; animation: dk-blink 1s steps(1) infinite; }
@keyframes dk-line { to { opacity: 1; } }
@keyframes dk-blink { 50% { opacity: 0; } }
.theme-term .dk-btn {
  margin-top: 32px; border-radius: var(--radius); background: transparent; color: #ececec; border: 1px solid #5a5a60;
  font-family: var(--mono); font-size: 16px; min-height: 56px; padding: 0 32px;
  opacity: 0; animation: dk-line .01s linear 3.4s forwards;
}
.theme-term .dk-btn:hover { background: #fff; color: #000; border-color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .dk-log p, .theme-term .dk-btn { opacity: 1; animation: none; }
  .dk-cursor { animation: none; }
}

/* плашка DARK на главной */
.theme-term .dark-tile-word { line-height: 0; }
.theme-term .dark-tile-text::after { content: ""; display: inline-block; width: .55em; height: 1em; margin-left: 6px; vertical-align: -0.15em; background: #bdbdbd; animation: dk-blink 1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .theme-term .dark-tile-text::after { animation: none; } }

@media (max-width: 760px) {
  .hero-term { padding: 36px 0 32px; gap: 32px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-stats { gap: 16px 28px; }
  .hero-stats dd { font-size: 22px; }
  .term-row-top { flex-wrap: wrap; }
  .term-row-top .leader { display: none; }
  .term-price { flex-basis: 100%; }
}

/* DARK из символов */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.da { display: block; width: min(100%, 860px); height: auto; overflow: visible; }
.da g { fill: #e6e6e6; font: 700 10.5px var(--mono); }
.da-tile { display: block; width: clamp(150px, 22vw, 240px); height: auto; }
@media (max-width: 760px) {
  .theme-term.page-dark::before { display: none; }
}
