/* ==========================================================================
   components.css — шапка, кнопки, карточки, чек, формы, подвал
   ========================================================================== */

/* --------------------------------------------------------------------------
   Шапка
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: var(--bw) solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
  margin-right: auto;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  background: var(--canary);
  color: var(--on-color);
  border: var(--bw) solid var(--line);
  border-radius: 12px 12px 12px 4px;
  box-shadow: 3px 3px 0 var(--shade);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.04em;
}

.logo__text {
  display: grid;
}

.logo__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.logo__role {
  font-size: 0.78rem;
  color: var(--muted);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  display: block;
  padding: 8px 14px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 999px;
  border: var(--bw) solid transparent;
}

.nav__link:hover {
  border-color: var(--line);
}

.nav__link[aria-current="page"] {
  background: var(--canary);
  color: var(--on-color);
  border-color: var(--line);
  font-weight: 700;
}

.rate-pill {
  display: none;
  align-items: baseline;
  gap: 4px;
  padding: 7px 14px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}

.rate-pill small {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}

.icon-btn:hover {
  background: var(--canary);
  color: var(--on-color);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.theme-toggle__moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__moon {
  display: block;
}

.burger {
  display: inline-grid;
}

.nav {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: 16px var(--gutter) 28px;
  background: var(--bg);
  border-bottom: var(--bw) solid var(--line);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.nav.is-open {
  transform: none;
  opacity: 1;
  visibility: visible;
}

.nav__list {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.nav__link {
  padding: 14px 18px;
  font-size: 1.1rem;
}

@media (min-width: 980px) {
  .rate-pill {
    display: inline-flex;
  }
  .burger {
    display: none;
  }
  .nav {
    position: static;
    inset: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .nav__list {
    flex-direction: row;
    align-items: center;
    gap: 2px;
  }
  .nav__link {
    padding: 8px 14px;
    font-size: 0.95rem;
  }
}

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.85em 1.5em;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  color: var(--on-color);
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--shade);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--shade);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--shade);
}

.btn--primary {
  background: var(--canary);
}

.btn--cobalt {
  background: var(--cobalt);
  color: var(--on-cobalt);
}

.btn--plain {
  background: var(--surface);
  color: var(--ink);
}

.btn--small {
  padding: 0.6em 1.1em;
  font-size: 0.9rem;
  box-shadow: 3px 3px 0 var(--shade);
}

.btn--block {
  width: 100%;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
}

.text-link {
  font-weight: 600;
  color: var(--link);
}

/* --------------------------------------------------------------------------
   Чипы и теги
   -------------------------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 16px;
  background: var(--surface);
  color: var(--ink);
  border: var(--bw) solid var(--line);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
}

.chip:hover {
  background: var(--surface-2);
}

.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--canary);
  color: var(--on-color);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 3px 10px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   «Чек» — табель рабочего времени. Главный фирменный элемент.
   Рамка и тень рисуются через drop-shadow, чтобы повторять зубчатый край.
   -------------------------------------------------------------------------- */
.receipt {
  position: relative;
  padding: 26px 24px 30px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px 6px 0 0;
  filter:
    drop-shadow(2px 0 0 var(--line))
    drop-shadow(-2px 0 0 var(--line))
    drop-shadow(0 -2px 0 var(--line))
    drop-shadow(0 2px 0 var(--line))
    drop-shadow(8px 8px 0 var(--shade));
}

.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
  /* два треугольника на плитку 16×12 — получается зубчатый край отрывного чека */
  background:
    linear-gradient(135deg, var(--surface) 50%, transparent 50%) 0 0 / 16px 12px repeat-x,
    linear-gradient(225deg, var(--surface) 50%, transparent 50%) 0 0 / 16px 12px repeat-x;
}

.receipt__title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px dashed var(--line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.receipt__title small {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
}

.receipt__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

.receipt__sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
}

.receipt__sum-label {
  font-weight: 600;
}

.receipt__total {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.receipt__calc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.receipt__note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.receipt__actions {
  margin-top: 18px;
}

.receipt__block {
  margin-top: 18px;
}

/* Ползунок часов */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  margin: 0;
  background: transparent;
  cursor: grab;
}

.range::-webkit-slider-runnable-track {
  height: 14px;
  background: linear-gradient(90deg, var(--canary) var(--fill, 30%), var(--surface-2) var(--fill, 30%));
  border: var(--bw) solid var(--line);
  border-radius: 999px;
}

.range::-moz-range-track {
  height: 10px;
  background: var(--surface-2);
  border: var(--bw) solid var(--line);
  border-radius: 999px;
}

.range::-moz-range-progress {
  height: 10px;
  background: var(--canary);
  border-radius: 999px;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -10px;
  background: var(--cobalt);
  border: var(--bw) solid var(--line);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--shade);
}

.range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  background: var(--cobalt);
  border: var(--bw) solid var(--line);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--shade);
}

.range:active {
  cursor: grabbing;
}

.range:focus-visible {
  outline-offset: 6px;
}

.hours-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.hours-readout strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

/* Таблица-отчёт внутри чека */
.report {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
}

.report th,
.report td {
  padding: 9px 6px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px dashed var(--muted);
}

.report th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.report td:nth-child(n + 3),
.report th:nth-child(n + 3) {
  text-align: right;
  white-space: nowrap;
}

.report tfoot td:nth-child(n + 2) {
  text-align: right;
  white-space: nowrap;
}

.report tbody th[scope="row"] {
  color: var(--ink);
  font-size: 0.93rem;
}

.report tfoot td {
  padding-top: 14px;
  border-bottom: 0;
  border-top: 2px solid var(--line);
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Карточки
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 3vw, 30px);
  background: var(--surface);
  color: var(--ink);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 6px 6px 0 var(--shade);
}

.card--cobalt {
  background: var(--cobalt);
  color: var(--on-cobalt);
  border-radius: var(--r-l) var(--r-m) var(--r-m) var(--r-m);
}

.card--canary {
  background: var(--canary);
  color: var(--on-color);
  border-radius: var(--r-m) var(--r-l) var(--r-m) var(--r-m);
}

.card--mint {
  background: var(--mint);
  color: var(--on-color);
}

.card--night {
  background: var(--night);
  color: var(--on-night);
}

.card__price {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding-top: 14px;
  border-top: 2px dashed currentColor;
  font-variant-numeric: tabular-nums;
}

.card__price strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.card__price span {
  font-size: 0.9rem;
  opacity: 0.85;
}

.card a {
  color: inherit;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Обложки проектов и статей (SVG-файлы и CSS-узоры)
   -------------------------------------------------------------------------- */
.cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-2);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-s);
}

.pattern {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-s);
  background-color: var(--canary);
}

.pattern--a {
  background-color: var(--canary);
  background-image: radial-gradient(circle at 24px 24px, var(--night) 4px, transparent 5px);
  background-size: 32px 32px;
}

.pattern--b {
  background-color: var(--cobalt);
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.22) 0 4px, transparent 4px 18px);
}

.pattern--c {
  background-color: var(--mint);
  background-image:
    linear-gradient(var(--night) 2px, transparent 2px),
    linear-gradient(90deg, var(--night) 2px, transparent 2px);
  background-size: 36px 36px;
  background-position: -1px -1px;
}

.pattern--d {
  background-color: var(--coral);
  background-image: radial-gradient(circle at 100% 100%, transparent 0 38px, var(--night) 38px 42px, transparent 42px 70px, var(--night) 70px 74px, transparent 74px);
  background-size: 76px 76px;
}

.pattern--e {
  background-color: var(--night);
  background-image: repeating-linear-gradient(0deg, var(--canary) 0 3px, transparent 3px 14px);
}

/* --------------------------------------------------------------------------
   Хлебные крошки
   -------------------------------------------------------------------------- */
.breadcrumbs {
  padding-top: 22px;
  font-size: var(--fs-small);
  color: var(--muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 10px;
  opacity: 0.6;
}

.breadcrumbs a {
  color: inherit;
}

/* --------------------------------------------------------------------------
   Формы
   -------------------------------------------------------------------------- */
.form {
  display: grid;
  gap: 18px;
}

.form__row {
  display: grid;
  gap: 18px;
  align-items: start;
}

@media (min-width: 640px) {
  .form__row--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.field legend {
  font-weight: 600;
  font-size: 0.95rem;
}

.field__hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface);
  color: var(--ink);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-s);
  line-height: 1.4;
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
  box-shadow: 4px 4px 0 var(--shade);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--coral);
  box-shadow: 4px 4px 0 var(--coral);
}

.field__error {
  min-height: 1.2em;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c4223a;
}

:root[data-theme="dark"] .field__error {
  color: #ff8a9a;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--cobalt);
}

.form__status {
  padding: 14px 18px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-s);
  background: var(--mint);
  color: var(--on-color);
  font-weight: 600;
}

.form__status[hidden] {
  display: none;
}

.form__status--error {
  background: var(--coral);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   FAQ на <details>
   -------------------------------------------------------------------------- */
.faq {
  display: grid;
  gap: 14px;
}

.faq__item {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 4px 4px 0 var(--shade);
}

.faq__q {
  position: relative;
  display: block;
  padding: 18px 56px 18px 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.98rem, 0.92rem + 0.3vw, 1.12rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat;
  transition: transform 0.2s ease;
}

.faq__item[open] .faq__q::after {
  transform: rotate(45deg);
}

.faq__a {
  padding: 0 22px 20px;
  color: var(--muted);
}

.faq__a p + p {
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Подвал
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 0;
  padding-block: clamp(40px, 6vw, 72px) 28px;
  background: var(--night);
  color: var(--on-night);
}

.site-footer a {
  color: var(--on-night);
}

.footer-grid {
  display: grid;
  gap: 36px;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  }
}

.footer-lead {
  max-width: 34ch;
  margin-top: 14px;
  color: #b9bde6;
  font-size: 0.95rem;
}

.footer-title {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.footer-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #343a6b;
  font-size: 0.85rem;
  color: #9aa0cf;
}

.site-footer .logo {
  color: var(--on-night);
}

.site-footer .logo__role {
  color: #b9bde6;
}

.site-footer .logo__mark {
  border-color: var(--on-night);
  box-shadow: 3px 3px 0 var(--cobalt);
}

/* --------------------------------------------------------------------------
   Нижняя панель на телефоне
   -------------------------------------------------------------------------- */
.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: var(--bw) solid var(--line);
}

.mobile-bar__rate {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.mobile-bar__rate small {
  display: block;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
}

body {
  padding-bottom: 72px;
}

@media (min-width: 760px) {
  .mobile-bar {
    display: none;
  }
  body {
    padding-bottom: 0;
  }
}

/* Кнопка «наверх» не нужна — страницы короткие, навигация закреплена */
