/* ==========================================================================
   ~/portfolio — components.css
   Шапка, drawer, footer, кнопки, крошки, карточки, чипсы, метрики,
   формы, соц.ссылки, пагинация, терминал, слайдер, модалка.
   ========================================================================== */

/* ==========================================================================
   1. Взякая мелоч
   ========================================================================== */
.entry-content-ps {
  margin: var(--s-s) 0;
}

/* ==========================================================================
   1. Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 130;
  height: var(--header-h);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-l);
  width: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--lime);
  text-decoration: none;
  line-height: 1;
}
.logo svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}
.logo-text {
  color: #fff;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  transition: color var(--dur) var(--ease);
}
@media (hover: hover) {
  .logo:hover {
    color: var(--lime);
  }
  .logo:hover .logo-text {
    color: var(--lime);
  }
  .logo:hover .dot-lime {
    color: #fff;
  }
}
.dot-lime {
  color: var(--lime);
  transition: color var(--dur) var(--ease);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: lowercase;
  color: var(--txt-2);
  padding: 0.45em 0.7em;
  border-radius: var(--r-sm);
  transition:
    color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.nav-item .arrow {
  color: var(--txt-3);
  font-size: 0.85em;
  transition:
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
@media (hover: hover) {
  .nav-item:hover {
    color: var(--lime);
    background: rgba(42, 241, 107, 0.06);
  }
  .nav-item:hover .arrow {
    color: var(--lime);
    transform: translateX(1px);
  }
}
.nav-item.is-active {
  color: var(--lime);
}
.nav-item.is-active::after {
  content: "";
  position: absolute;
  left: 0.7em;
  right: 0.7em;
  bottom: 0.16em;
  height: 1px;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-lo);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-s);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 0.5em;
  border-bottom: 1px solid var(--line);
  padding: 0.1em 0.4em;
  transition: border-bottom var(--dur) var(--ease);
}
.search-form:focus-within {
  border-bottom: 1px solid var(--lime);
}
.search-form input[type="search"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--txt);
  font-family: var(--mono);
  padding: 0.4em 0;
}
.search-form button[type="submit"] {
  background: transparent;
  border: none;
  color: var(--lime);
  cursor: pointer;
  font-family: var(--mono);
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
}
.burger span {
  display: block;
  height: 1px;
  background: var(--txt);
  transition:
    transform var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
@media (hover: hover) {
  .burger:hover span {
    background: var(--lime);
  }
}

.drawer-toggle:checked ~ .site-header .burger span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.drawer-toggle:checked ~ .site-header .burger span:nth-child(2) {
  opacity: 0;
}
.drawer-toggle:checked ~ .site-header .burger span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.drawer-toggle {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.drawer-toggle:focus-visible ~ .site-header .burger {
  outline: 1px solid var(--lime);
  outline-offset: 2px;
}

/* ==========================================================================
   2. Drawer
   ========================================================================== */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 120;
  visibility: hidden;
  transition: visibility 0s var(--dur-slow);
}
.drawer-veil {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 6, 0.8);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.drawer-panel {
  position: absolute;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: min(80vw, 320px);
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform var(--dur-slow) var(--ease-out);
  display: flex;
  flex-direction: column;
}
.drawer-toggle:checked ~ .drawer {
  visibility: visible;
  transition: visibility 0s 0s;
}
.drawer-toggle:checked ~ .drawer .drawer-veil {
  opacity: 1;
}
.drawer-toggle:checked ~ .drawer .drawer-panel {
  transform: none;
}

html.drawer-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-xl) var(--s-m);
}
.drawer-nav .nav-item {
  padding: 0.8em var(--s-m);
  font-size: var(--step-0);
}

.drawer-search {
  display: block;
  flex-shrink: 0;
  margin: var(--s-m) var(--s-m) 0;
}
.drawer-search-form {
  display: none;
  width: 100%;
}
.drawer-cta {
  flex-shrink: 0;
  margin-inline: var(--s-m);
  margin-block: var(--s-s) var(--s-m);
  justify-content: center;
}
.btn--sm.drawer-cta {
  display: none;
  font-size: var(--step--1);
  padding: var(--s-m) var(--s-l);
}

.site-header,
.drawer-panel {
  background: rgba(10, 10, 10, 0.8);
}

/* ==========================================================================
   3. Кнопки (единый источник)
   ========================================================================== */
.btn,
.wp-block-button__link,
.wp-block-read-more,
.wp-block-file__button {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1;
  padding: 0.85em 1.35em;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--dur) var(--ease),
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.btn .lead {
  color: var(--lime);
  transition: transform var(--dur) var(--ease);
}
@media (hover: hover) {
  .btn:hover .lead {
    transform: translateX(2px);
  }
}

.btn--primary,
.wp-block-button__link,
.wp-block-read-more,
.wp-block-file__button {
  background: var(--lime);
  color: #0a0a0a;
  border: 1px solid transparent;
  box-shadow: 0 0 0 0 transparent;
}

.btn--ghost {
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--line-2);
}
.btn--ghost .lead {
  color: var(--lime);
}

@media (hover: hover) {
  .btn--primary:hover,
  .btn--ghost:hover,
  .wp-block-button__link:hover,
  .wp-block-read-more:hover,
  .wp-block-file__button:hover {
    border-color: var(--lime-lo);
    color: var(--lime);
    background: rgba(42, 241, 107, 0.05);
  }
}

.btn--sm {
  padding: 0.7em 2em;
  font-size: var(--step--2);
}
.btn:active {
  transform: translateY(1px);
}

.link-code {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--lime);
  border-bottom: 1px dashed var(--lime-lo);
  padding-bottom: 1px;
}
@media (hover: hover) {
  .link-code:hover {
    color: var(--lime-hi);
    border-bottom-style: solid;
  }
}

.section-more {
  margin-top: var(--s-l);
}
.btn-txt {
  display: inline-block;
  white-space: nowrap;
}

/* ==========================================================================
   4. Крошки
   ========================================================================== */
.crumbs-wrap {
  position: relative;
}
.hero .crumbs-wrap {
  margin-bottom: var(--s-3xl);
}
.crumbs {
  display: block;
  padding-block: var(--s-l);
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--txt-3);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  scroll-padding: 0 var(--s-xl);
}
.crumbs::-webkit-scrollbar {
  display: none;
}
.crumbs-track {
  font-size: 0;
  line-height: 1.7;
}
.crumbs .seg {
  display: inline-block;
  color: var(--txt-2);
  padding: 0.1em 0.15em;
  font-size: var(--step--1);
}
.crumbs .sep {
  display: inline-block;
  color: var(--lime-lo);
  margin: 0 0.55em;
  font-size: var(--step--1);
}
.crumbs a.seg {
  color: var(--txt-2);
}
@media (hover: hover) {
  .crumbs a.seg:hover {
    color: var(--lime);
  }
}
.crumbs .seg:last-child {
  color: var(--lime);
}

.crumbs-scroll {
  position: absolute;
  top: 90%;
  right: 0.25em;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--lime);
  background: var(--bg-1);
  border: 1px solid var(--line-lime);
  border-radius: var(--r-sm);
  padding: 0.15em 0.5em 0.2em;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.crumbs-wrap.is-scrollable .crumbs-scroll {
  opacity: 1;
  animation: crumbs-breathe 2.4s var(--ease) infinite;
}
@keyframes crumbs-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 900px) {
  .hero .crumbs-wrap {
    margin-bottom: var(--s-xl);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crumbs-wrap.is-scrollable .crumbs-scroll {
    animation: none;
  }
}

/* ==========================================================================
   5. Карточки
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--s-l);
  min-width: 0;
}

.file-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--txt);
  min-width: 0;
  background: rgba(17, 17, 19, 0.8);
  transition: transform var(--dur) var(--ease);
}

@media (hover: hover) {
  .js .reveal.is-in.file-card:hover {
    transform: translateY(-5px);
  }
  html.no-js .file-card:hover {
    transform: translateY(-5px);
  }
}

.file-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-1);
  border-top-left-radius: var(--r-md);
  border-top-right-radius: var(--r-md);
}
.file-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform var(--dur-slow) var(--ease);
}
@media (hover: hover) {
  .file-card:hover .file-card-image img {
    transform: scale(1.01);
  }
}

.file-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-s);
  padding: var(--s-s) var(--s-m);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--txt-3);
}

/* Если картинки нет — .file-card-top первый, скругляем верх */
.file-card > .file-card-top:first-child {
  border-top-left-radius: var(--r-md);
  border-top-right-radius: var(--r-md);
}
.file-card-top .fname {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--txt-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
@media (hover: hover) {
  .file-card:hover .file-card-top .fname {
    color: var(--lime);
  }
}
.file-card-top .fmeta {
  flex-shrink: 0;
}

.file-card-body {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  gap: var(--s-s);
  padding: var(--s-l) var(--s-m) var(--s-m);
  border-bottom-left-radius: var(--r-md);
  border-bottom-right-radius: var(--r-md);
}
.file-card-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-s);
}
.file-card-title {
  font-family: var(--sans);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color var(--dur) var(--ease);
}
.file-card-desc {
  color: var(--txt-2);
  font-size: var(--step--1);
  line-height: 1.55;
}
.file-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  min-width: 0;
}

/* ---------- Чипсы ---------- */
.chip {
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--txt-2);
  border: 1px solid var(--line);
  padding: 0.28em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
@media (hover: hover) {
  .file-card:hover .chip {
    color: var(--lime-lo);
    border-color: var(--line-lime);
  }
}
.chip--link {
  color: var(--txt-2);
  border-color: var(--line);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
@media (hover: hover) {
  .chip--link:not(.is-active):hover {
    color: var(--lime);
    border-color: var(--lime-lo);
  }
}
.chip--current {
  cursor: default;
  color: var(--txt-4);
}

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
  margin-bottom: var(--s-2xl);
}

/* ==========================================================================
   CF7 — адаптация под стили темы
   ========================================================================== */

/* --- Скрываем служебные блоки CF7 --- */
.wpcf7 .screen-reader-response {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wpcf7 .hidden-fields-container {
  display: none;
}

/* --- Контейнер формы --- */
.contact-form {
  background: rgba(17, 17, 19, 0.8);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.form-body {
  padding: var(--s-s);
  display: grid;
  gap: var(--s-l);
}

/* --- Поле --- */
.field {
  display: grid;
  gap: 0.35em;
}

.field .f-prompt {
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--txt-3);
}

.field .f-prompt .p-type {
  color: var(--blue);
}

/* --- Инпуты и textarea --- */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form input[type="url"],
.contact-form textarea {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-family: var(--mono);
  font-size: var(--step-0);
  padding: 0.75em 0.95em;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.contact-form textarea,
.contact-form .wpcf7-textarea {
  resize: vertical !important;
  height: 120px;
  min-height: 80px !important;
  max-height: 500px !important;
  line-height: 1.6 !important;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--txt-4);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--lime-lo);
  box-shadow: 0 0 0 3px var(--lime-glow);
}

/* --- Ошибки валидации --- */
.contact-form .wpcf7-not-valid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(255, 92, 103, 0.15) !important;
}

.contact-form .wpcf7-not-valid-tip {
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--red);
  margin-top: 0.3em;
  display: block;
}

/* --- Чекбокс CF7 --- */
.contact-form .wpcf7-acceptance {
  display: block;
  margin: 0;
}

.contact-form .wpcf7-acceptance .wpcf7-list-item {
  margin: 0;
}

.contact-form .wpcf7-acceptance label {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--txt-2);
  user-select: none;
}

.contact-form .wpcf7-acceptance input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.contact-form .wpcf7-list-item-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  cursor: pointer;
  position: relative;
  padding-left: 1.7em;
}

.contact-form .wpcf7-list-item-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.1em;
  height: 1.1em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  transition:
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.contact-form .wpcf7-list-item-label::after {
  content: "";
  position: absolute;
  left: 0.32em;
  top: 0.3em;
  width: 0.35em;
  height: 0.6em;
  border-right: 2px solid var(--bg-0);
  border-bottom: 2px solid var(--bg-0);
  transform: rotate(45deg) scale(0);
  transition: transform var(--dur) var(--ease);
}

.contact-form .wpcf7-acceptance input:checked ~ .wpcf7-list-item-label::before {
  background: var(--lime);
  border-color: var(--lime);
}

.contact-form .wpcf7-acceptance input:checked ~ .wpcf7-list-item-label::after {
  transform: rotate(45deg) scale(1);
}

.contact-form
  .wpcf7-acceptance
  input:focus-visible
  ~ .wpcf7-list-item-label::before {
  outline: 1px solid var(--lime);
  outline-offset: 2px;
}

.contact-form .wpcf7-list-item-label a {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-form .wpcf7-list-item-label a:hover {
  color: var(--lime-hi);
}

/* --- Кнопка submit --- */
.contact-form .wpcf7-submit {
  text-align: left;
  justify-content: start;
}

/* --- Спиннер --- */
.contact-form .wpcf7-spinner {
  display: none;
}

.contact-form form.submitting .wpcf7-spinner {
  display: inline-block;
  margin-left: var(--s-s);
}

/* --- Результат отправки --- */
.contact-form .form-out {
  border-top: 1px solid var(--line);
  padding: var(--s-m) var(--s-l);
  font-family: var(--mono);
  font-size: var(--step--1);
  min-height: 3.4em;
  color: var(--txt-2);
}

.contact-form .form-out .form-out-hint {
  display: block;
  color: var(--txt-3);
}

.contact-form .form-out .wpcf7-response-output {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--mono);
  font-size: var(--step--1);
  display: block;
  color: var(--txt-3);
}

.contact-form .form-out .wpcf7-response-output:not(:empty)::before {
  content: "/* ";
  color: inherit;
}

.contact-form .form-out .wpcf7-response-output:not(:empty)::after {
  content: " */";
  color: inherit;
}

.contact-form .form-out .wpcf7-response-output:not(:empty) ~ .form-out-hint,
.contact-form .form-out .wpcf7-response-output:not(:empty) + .form-out-hint {
  display: none;
}

/* ========== СТАТУСЫ CF7 v6 ========== */

/* init */
form.init .contact-form .form-out .wpcf7-response-output {
  color: var(--txt-3);
}

/* submitting */
form.submitting .contact-form .form-out .wpcf7-response-output {
  color: var(--blue);
}

/* sent */
form.sent .contact-form .form-out .wpcf7-response-output {
  color: var(--lime);
}

/* invalid */
form.invalid .contact-form .form-out .wpcf7-response-output {
  color: var(--red);
}

/* spam */
form.spam .contact-form .form-out .wpcf7-response-output {
  color: var(--amber);
}

/* aborted */
form.aborted .contact-form .form-out .wpcf7-response-output {
  color: var(--amber);
}

/* ==========================================================================
   8. Соц.ссылки
   ========================================================================== */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-s);
}
.socials + .terminal {
  margin-top: var(--s-2xl);
}
.social {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--txt-2);
  border: 1px solid var(--line);
  padding: 0.55em 1em;
  border-radius: var(--r-sm);
  transition:
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.social .at {
  color: var(--lime-lo);
}
.social:hover {
  color: var(--lime);
  border-color: var(--line-lime);
  background: rgba(42, 241, 107, 0.05);
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--txt-2);
}
.footer-inner {
  width: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
  padding-block: var(--s-l);
  display: grid;
  grid-template-columns: 1fr max-content max-content max-content;
  gap: var(--s-m);
}
.footer-brand {
  align-self: start;
}
.footer-brand .logo {
  font-size: var(--step--1);
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-m);
}
.footer-line {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--txt-3);
}
.footer-line .ok {
  color: var(--lime);
}
.footer-term .term-line {
  white-space: normal;
}
/* Футер: терминалы «растворены» — только текст, без окна */
.terminal.footer-term {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.75;
  width: auto;
  max-width: 100%;
  margin: 0;
}

.terminal.footer-term .term-bar {
  display: none;
}

.terminal.footer-term .term-body {
  padding: 0;
  background: transparent;
  overflow: visible;
  min-height: 0;
}

.terminal.footer-term .term-line {
  white-space: normal;
  min-height: 0;
}

.terminal.footer-term .footer-link {
  display: inline-block;
  min-width: 14ch;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--txt-2);
  text-decoration: none;
}

.terminal.footer-term .footer-link__at {
  color: var(--lime-lo);
}

/* Зелёная палитра футера: промпт и подписи — лаймовые, без синего/фиолетового */
.terminal.footer-term .term-line .info {
  color: var(--lime-lo);
}
.terminal.footer-term .term-line .path {
  color: var(--lime-hi);
}

@media (hover: hover) {
  .terminal.footer-term .footer-link:hover {
    color: var(--lime);
  }
}

/* ==========================================================================
   10. Пагинация
   ========================================================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--s-s);
  margin-top: var(--s-2xl);
  font-family: var(--mono);
  font-size: var(--step--1);
}
.pagination .page-numbers {
  padding: 0.5em 0.9em;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--txt-2);
  transition: all var(--dur) var(--ease);
}
@media (hover: hover) {
  .pagination .page-numbers:hover {
    color: var(--lime);
    border-color: var(--lime-lo);
  }
}
.pagination .page-numbers.current {
  background: var(--lime);
  color: #0a0a0a;
  border-color: var(--lime);
}

/* ==========================================================================
   11. Hero
   ========================================================================== */
.hero {
  padding-block: 0 var(--s-2xl);
}
.hero-main {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding: var(--s-3xl) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s-3xl);
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--txt-3);
  margin-bottom: var(--s-m);
}
.hero-eyebrow .p {
  color: var(--lime-lo);
}
.hero-eyebrow .pipe {
  color: var(--txt-4);
}

.hero-title {
  font-size: var(--step-5);
}
.scramble-box {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}
/* ==========================================================================
   11a. Курсор (.caret)
   Только заголовки (hero и scrambler'ы) — терминалы курсор не используют.
   ========================================================================== */
.caret {
  display: inline-block;
  width: 0.45em;
  height: 1.05em;
  margin-left: 0.08em;
  vertical-align: text-bottom;
  background: var(--lime);
  animation: caret-blink 1s steps(1) infinite;
}
.caret--hero {
  position: relative;
  top: -0.18em;
  width: 0.4em;
  height: 1em;
}
@keyframes caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.hero-sub {
  color: var(--txt-2);
  font-size: var(--step-1);
  max-width: 46ch;
  margin: var(--s-m) 0 0;
  line-height: 1.5;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-m);
  margin-top: var(--s-xl);
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-s);
  margin-top: var(--s-l);
}
.hero-chips + .hero-actions {
  margin-top: var(--s-xl);
}
.status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--mono);
  font-size: var(--step--2);
  color: var(--txt-3);
}
.hero-actions + .status-line {
  margin-top: var(--s-l);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-2xl);
}

.grid-2--center {
  align-items: center;
}

.list-arrow {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s-xs);
}
.list-arrow li {
  position: relative;
  padding-left: 1.35em;
  color: var(--txt-2);
}
.list-arrow li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--lime-lo);
  font-family: var(--mono);
}

/* ==========================================================================
   12. Терминал
   ========================================================================== */
.terminal {
  /*border: 1px solid var(--line); */
  border-radius: var(--r-lg);
  overflow: hidden;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.7;
}
.js .term-body[data-boot] {
  opacity: 0;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: var(--s-s);
  padding: var(--s-s) var(--s-m);
  background: rgba(6, 6, 6, 0.8);
  font-size: var(--step--2);
  color: var(--txt-3);
  user-select: none;
}
.term-dots {
  display: flex;
  gap: 5px;
}
.term-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2a30;
  border: 1px solid var(--line-2);
}
.term-dots i:first-child {
  background: #ff5f56;
  border-color: transparent;
}
.term-dots i:nth-child(2) {
  background: #ffbd2e;
  border-color: transparent;
}
.term-dots i:nth-child(3) {
  background: #27c93f;
  border-color: transparent;
}
.term-name {
  color: var(--txt-2);
  margin-left: var(--s-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.term-body {
  padding: var(--s-m) var(--s-m) var(--s-l);
  overflow-x: auto;
  background: rgba(17, 17, 19, 0.8);
}
.terminal .term-body pre {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.75;
  white-space: pre;
}
/* Код-терминал в контенте: окно ужимается под ширину кода (как фото),
   короткий код слева, длинный — max-width 100% + горизонтальный скролл. */
.entry-content .terminal--code {
  width: fit-content;
  max-width: 100%;
}
.term-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--txt);
}

.term-line {
  white-space: pre;
}
.term-line .path,
.tk-f {
  color: var(--blue);
}
.term-line .ok {
  color: var(--lime);
}
.term-line .dim {
  color: var(--txt-3);
}
.term-line .warn,
.tk-n {
  color: var(--amber);
}
.term-line .err {
  color: var(--red);
}
.term-line .info,
.tk-k {
  color: var(--violet);
}
.tk-c {
  color: var(--txt-4);
  font-style: italic;
}
.tk-s {
  color: var(--lime-hi);
}
.tk-p {
  color: var(--txt);
}
.tk-v {
  color: var(--txt-2);
}
.tk-t {
  color: var(--blue);
}
.tk-a {
  color: var(--lime);
}
.tk-h {
  color: var(--red);
}

/* ---------- Тип: photo ---------- */
.terminal--photo {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.terminal--photo .term-body {
  padding: 0;
  display: grid;
  place-items: center;
}
.terminal--photo .term-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  margin: 0;
}
.terminal--photo .wp-block-image {
  margin: 0;
}
.terminal--photo .wp-block-image img {
  border: 0;
  border-radius: 0;
}

/* ---------- Тип: media (видео / аудио) ---------- */
.terminal--media .term-body {
  padding: 0;
  background: var(--bg-2);
}
.terminal--media .term-body figure {
  margin: 0;
}
.terminal--media .term-body .wp-block-video,
.terminal--media .term-body .wp-block-audio {
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.terminal--media .term-body video,
.terminal--media .term-body audio {
  display: block;
  width: auto;
  max-width: 100%;
  border-radius: 0;
  background: transparent;
  margin-inline: auto;
}
.terminal--media .term-body .wp-block-video figcaption,
.terminal--media .term-body .wp-block-audio figcaption {
  padding: var(--s-s) var(--s-m);
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- Тип: slider ----------
   Прогрессивное улучшение:
   — html.js (JS работает) → слайдер в окне с общей шапкой ~/gallery;
     шапки отдельных фото (~/photo) скрыты, стрелки абсолютом, точки, счётчик;
   — html.no-js (JS выключен) → грид: внешнее окно ~/gallery растворяется,
     каждое фото — своё окно с шапкой ~/photo (2 колонки на ПК,
     1 колонка на мобильном); фото никогда не обрезаются.
   Высота слайда всегда равна высоте самого высокого фото, остальные фото
   центрируются по вертикали; обрезка запрещена в обоих режимах. */
.terminal--slider .term-body {
  padding: 0;
}
/* JS: окно галереи принимает ширину самой широкой картинки (--sl-w задаётся
   серверно из width-атрибута), но не шире контейнера; по центру.
   Без JS (грид) окно остаётся полной ширины. */
html.js .terminal--slider {
  width: min(var(--sl-w, 100%), 100%);
  max-width: 100%;
  margin-inline: auto;
}
.gallery-slider {
  position: relative;
  background: var(--bg-1);
}
.gallery-slider__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Без JS: грид фото-терминалов (каждое фото — окно с шапкой ~/photo) --- */
html.no-js .terminal--slider {
  border-color: transparent;
  background: transparent;
}
html.no-js .terminal--slider > .term-bar {
  display: none;
}
html.no-js .gallery-slider__viewport {
  overflow: visible;
}
html.no-js .gallery-slider__track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-m);
  align-items: start;
  transform: none !important;
  transition: none;
}
html.no-js .gallery-slider__slide {
  min-width: 0;
}
html.no-js .gallery-slider__slide img {
  width: auto;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
html.no-js .gallery-slider__slide--wide {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
}
html.no-js .gallery-slider__slide--wide img {
  width: 100%;
}
html.no-js .gallery-slider__count,
html.no-js .gallery-slider__arrow {
  display: none;
}

/* --- JS: слайдер в окне ~/gallery --- */
html.js .gallery-slider__viewport {
  overflow: hidden;
}
html.js .gallery-slider__track {
  display: flex;
  align-items: stretch;
  transform: translateX(calc(var(--sl-i, 0) * -100%));
  transition: transform 0.55s var(--ease-out);
  will-change: transform;
}
html.js .gallery-slider__slide {
  flex: 0 0 100%;
  min-width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
html.js .gallery-slider__slide > .term-bar {
  display: none;
}
html.js .gallery-slider__slide .term-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0;
}
html.js .gallery-slider__slide img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  margin: 0;
}
.gallery-slider .gallery-slider__fig {
  margin: 0;
}
html.js .terminal--photo.gallery-slider__slide {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}
html.js .gallery-slider__count {
  position: absolute;
  top: var(--s-m);
  right: var(--s-m);
  z-index: 3;
  display: none;
  padding: 0.25em 0.6em;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--txt-2);
  background: rgba(6, 6, 6, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
html.js .gallery-slider__radio:checked + .gallery-slider__count {
  display: block;
}
html.js .gallery-slider__dots {
  position: absolute;
  left: 50%;
  bottom: var(--s-m);
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--s-xs) var(--s-m);
  background: rgba(6, 6, 6, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
html.js .gallery-slider__dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid var(--line);
  pointer-events: none;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
html.js .gallery-slider__dot:hover {
  background: rgba(42, 241, 107, 0.4);
}
html.js .gallery-slider__dot.is-active {
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
}
html.js .gallery-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 10, 0.75);
  border: 1px solid var(--line);
  color: var(--txt-2);
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 16px;
  opacity: 0.85;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}
@media (hover: hover) {
  html.js .gallery-slider__arrow:hover {
    color: var(--lime);
    border-color: var(--lime-lo);
    background: rgba(42, 241, 107, 0.12);
    box-shadow: 0 0 16px var(--lime-glow);
    opacity: 1;
  }
}
html.js .gallery-slider__arrow--prev {
  left: var(--s-s);
}
html.js .gallery-slider__arrow--next {
  right: var(--s-s);
}

/* Авто-скрытие (idle): одинаково гасит все видимые контролы —
   стрелки, точки и счётчик. Любое взаимодействие возвращает их. */
html.js .gallery-slider__arrow,
html.js .gallery-slider__dots,
html.js .gallery-slider__count {
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}
html.js .gallery-slider.is-idle .gallery-slider__arrow,
html.js .gallery-slider.is-idle .gallery-slider__dots,
html.js .gallery-slider.is-idle .gallery-slider__count {
  opacity: 0;
  pointer-events: none;
}

/* На тач-устройствах (телефон/планшет) стрелки и точки не показываем
   вовсе — там свайп. Счётчик остаётся и живёт по общему автоскрытию. */
@media (hover: none), (pointer: coarse) {
  html.js .gallery-slider__arrow,
  html.js .gallery-slider__dots {
    display: none;
  }
}

@media (max-width: 640px) {
  html.no-js .gallery-slider__track {
    grid-template-columns: 1fr;
  }
}

/* ---------- Модалка ---------- */
.shot-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-l);
  visibility: hidden;
  opacity: 0;
  transition:
    opacity var(--dur) var(--ease),
    visibility 0s var(--dur);
}
.shot-modal.is-open {
  visibility: visible;
  opacity: 1;
  transition:
    opacity var(--dur) var(--ease),
    visibility 0s 0s;
}
.shot-modal__veil {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 6, 0.8);
  cursor: pointer;
}
.shot-modal__panel {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: min(100%, 1100px);
  max-height: calc(100vh - var(--s-l) * 2);
  margin: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(8px) scale(0.98);
  transition: transform var(--dur-slow) var(--ease-out);
}
.shot-modal.is-open .shot-modal__panel {
  transform: none;
}
.shot-modal__close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--txt-3);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
@media (hover: hover) {
  .shot-modal__close:hover {
    color: var(--lime);
    border-color: var(--lime-lo);
    background: rgba(42, 241, 107, 0.06);
  }
}
.shot-modal .term-body {
  display: grid;
  place-items: center;
  overflow: auto;
}
.shot-modal .term-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 200px);
}
body.shot-modal-open {
  overflow: hidden;
}

/* ==========================================================================
   13. Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .shot-modal,
  .shot-modal__panel {
    transition: none;
  }
  .shot-modal__panel {
    transform: none;
  }
  .caret {
    animation: none;
  }
  .gallery-slider__track {
    transition: none;
  }
}

/* ==========================================================================
   14. Тач: :active вместо :hover
   ========================================================================== */
@media (hover: none) {
  a:active {
    color: var(--lime-hi);
  }
  .crumbs a.seg:active {
    color: var(--lime);
  }
  .btn:active .lead {
    transform: translateX(2px);
  }
  .btn--primary:active,
  .btn--ghost:active,
  .wp-block-button__link:active,
  .wp-block-read-more:active,
  .wp-block-file__button:active {
    border-color: var(--lime-lo);
    color: var(--lime);
    background: rgba(42, 241, 107, 0.05);
  }
  .link-code:active {
    color: var(--lime-hi);
    border-bottom-style: solid;
  }
  .logo-text:active {
    color: var(--lime);
  }
  .nav-item:active {
    color: var(--lime);
    background: rgba(42, 241, 107, 0.06);
  }
  .nav-item:active .arrow {
    color: var(--lime);
    transform: translateX(1px);
  }
  .burger:active span {
    background: var(--lime);
  }
  .file-card:active {
    border-color: var(--line-lime);
    background: var(--bg-3);
    transform: translateY(-2px);
  }
  .file-card:active .file-card-image img {
    transform: scale(1.03);
  }
  .file-card:active .file-card-top .fname {
    color: var(--lime);
  }
  .file-card:active .chip {
    color: var(--lime-lo);
  }
  .chip--link:not(.is-active):active {
    color: var(--lime);
    border-color: var(--lime-lo);
    background: rgba(42, 241, 107, 0.06);
  }
  .footer-link:active {
    color: var(--lime);
  }
  .pagination .page-numbers:active {
    color: var(--lime);
    border-color: var(--lime-lo);
  }
  .gallery-slider__arrow:active {
    color: var(--lime);
    border-color: var(--lime-lo);
    background: rgba(42, 241, 107, 0.12);
    box-shadow: 0 0 16px var(--lime-glow);
  }
  .shot-modal__close:active {
    color: var(--lime);
    border-color: var(--lime-lo);
    background: rgba(42, 241, 107, 0.06);
  }

  a:active,
  .crumbs a.seg:active,
  .btn:active,
  .btn:active .lead,
  .btn--primary:active,
  .btn--ghost:active,
  .link-code:active,
  .logo-text:active,
  .nav-item:active,
  .nav-item:active .arrow,
  .burger:active span,
  .file-card:active,
  .file-card:active .file-card-image img,
  .file-card:active .file-card-top .fname,
  .file-card:active .chip,
  .chip--link:not(.is-active):active,
  .footer-link:active,
  .pagination .page-numbers:active {
    transition-duration: var(--tap-in);
    transition-timing-function: var(--ease);
  }

  a,
  .crumbs a.seg,
  .btn .lead,
  .btn--primary,
  .btn--ghost,
  .link-code,
  .logo-text,
  .nav-item,
  .nav-item .arrow,
  .burger span,
  .file-card,
  .file-card-image img,
  .file-card-top .fname,
  .file-card .chip,
  .chip--link:not(.is-active),
  .footer-link,
  .pagination .page-numbers {
    transition-duration: var(--tap-out);
  }
}

/* ==========================================================================
   15. Медиазапросы
   ========================================================================== */
@media (max-width: 1100px) {
  .nav {
    display: none;
  }
  .burger {
    display: flex;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--s-2xl);
  }
  .hero-grid > .terminal {
    display: none;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: var(--s-2xl);
  }

  .grid-2 > .terminal {
    display: none;
  }
  .grid-2 > * {
    min-width: 0;
  }
  .metric {
    min-width: 0;
  }
}

@media (max-width: 680px) {
  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: var(--s-l);
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-term--projects {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-search {
    display: none;
  }
  .drawer-search-form {
    display: flex;
  }
  h1 {
    font-size: var(--step-4);
  }
  section {
    padding-block: var(--s-xl);
  }
}

@media (max-width: 420px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-term--nav {
    display: none;
  }
}

@media (max-width: 400px) {
  .header-cta {
    display: none;
  }
  .btn--sm.drawer-cta {
    display: inline-flex;
  }
}
