/* ============================================================
   ОхТруда · базовые стили
   Сброс, типографика, сетка, шапка с переключателем направлений,
   кнопки, общие секции, подвал. Цвета берутся из токенов темы.
   ============================================================ */

:root {
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-brand: "Unbounded", "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --fs-hero: clamp(2.15rem, 1rem + 5.4vw, 6rem);
  --fs-h2: clamp(1.75rem, 1.05rem + 2.9vw, 3.4rem);
  --fs-h3: clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
  --fs-lead: clamp(1.06rem, 0.98rem + 0.4vw, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-label: 0.8125rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

[hidden] {
  display: none !important;
}

/* ---------- фокус ---------- */

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.is-dark :focus-visible,
.is-dark:focus-visible {
  outline-color: var(--focus-on-deep);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- сетка ---------- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

.section {
  padding-block: clamp(64px, 5vw + 40px, 128px);
}

.is-dark {
  background: var(--deep);
  color: var(--on-deep);
}

/* ---------- типографика ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-label);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: var(--display-leading);
  font-size: var(--fs-hero);
}

.display em {
  font-family: var(--font-accent);
  font-style: var(--accent-style);
}

.h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: calc(var(--display-tracking) * 0.8);
  line-height: 1.04;
  font-size: var(--fs-h2);
}

.h2 em {
  font-family: var(--font-accent);
  font-style: var(--accent-style);
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  max-width: 38em;
}

.muted {
  color: var(--muted);
}

.is-dark .muted {
  color: var(--deep-muted);
}

.section-head {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(32px, 4vw, 56px);
  max-width: 52rem;
}

.section-head p {
  max-width: 40em;
}

/* ---------- кнопки ---------- */

.btn {
  --btn-bg: var(--primary);
  --btn-fg: var(--on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 24px;
  border: 2px solid var(--btn-bg);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.25s var(--ease);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
  transition: transform 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--btn-bg) 70%, transparent);
}

.btn:hover svg {
  transform: translate(3px, 0);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  border-color: currentColor;
}

.btn--ghost:hover {
  box-shadow: none;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.btn--accent {
  --btn-bg: var(--accent);
  --btn-fg: var(--on-accent);
}

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

/* ---------- полоса статуса ---------- */

.status-strip {
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  line-height: 1.35;
}

.status-strip .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  padding-block: 9px;
}

.status-strip b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.status-strip b::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ---------- шапка и переключатель направлений ---------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.logo__mark {
  width: 36px;
  height: 36px;
  flex: none;
}

.logo__mark .m-sheet {
  fill: #FFD21F;
}

.logo__mark .m-ink {
  fill: #15151A;
}

.niche-nav {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.niche-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.niche-nav__list::-webkit-scrollbar {
  display: none;
}

.niche-nav__list > li {
  flex: none;
  scroll-snap-align: start;
}

.niche-nav__item {
  --dot: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}

.niche-nav__item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--dot);
  transition: transform 0.3s var(--ease-spring), border-radius 0.3s;
}

a.niche-nav__item:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

a.niche-nav__item:hover::before {
  transform: rotate(45deg) scale(1.15);
}

.niche-nav__item[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
}

.niche-nav__item[aria-current="page"]::before {
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 2px var(--bg);
}

.niche-nav__item--all {
  --dot: transparent;
  font-weight: 650;
}

.niche-nav__item--all::before {
  width: 14px;
  height: 14px;
  border-radius: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 6px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 6px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 6px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 6px 6px no-repeat;
}

.niche-nav__item--all[aria-current="page"]::before {
  box-shadow: none;
  border-radius: 0;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 6px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 6px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 6px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 6px 6px no-repeat;
}

.niche-nav__sep {
  width: 1px;
  height: 24px;
  margin-inline: 6px;
  background: var(--line);
}

.niche-nav__item--beauty { --dot: #FF6A55; }
.niche-nav__item--cosmetology { --dot: #2F55F0; }
.niche-nav__item--vet { --dot: #9BD21E; }

.niche-nav__item--soon {
  --dot: transparent;
  color: var(--muted);
  cursor: default;
}

.niche-nav__item--soon::before {
  border: 2px dashed currentColor;
  width: 12px;
  height: 12px;
}

.soon-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  :root {
    --header-h: 58px;
  }
}

/* до 1000 px переключатель занимает всю строку: знак без подписи,
   список прокручивается внутри себя, край подсказывает прокрутку */
@media (max-width: 1000px) {
  .logo__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .site-header__bar {
    gap: 8px;
  }

  .niche-nav.is-overflowing:not(.is-end)::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 28px;
    pointer-events: none;
    background: linear-gradient(to right, transparent, var(--bg));
  }

  .niche-nav__item {
    padding-inline: 12px;
    font-size: 0.9rem;
  }

  /* «Все направления» закреплена: остальное листается под ней */
  .niche-nav__list > li:first-child {
    position: sticky;
    left: -4px;
    z-index: 1;
    padding-right: 4px;
    background: var(--bg);
    box-shadow: 10px 0 10px -8px color-mix(in srgb, var(--ink) 30%, transparent);
  }

  .niche-nav:not(.is-overflowing) .niche-nav__list > li:first-child {
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  .niche-nav__tail {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}


/* ---------- заметки о статусе ---------- */

.demo-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 44rem;
  padding: 16px 18px;
  border: 1.5px dashed color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 14px;
  font-size: var(--fs-small);
  line-height: 1.5;
}

.demo-note svg {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 1px;
}

/* ---------- способы покупки ---------- */

.buy-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}

.buy-mode {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  padding: 28px clamp(16px, 2.4vw, 32px) 32px 0;
}

.buy-mode + .buy-mode {
  padding-left: clamp(16px, 2.4vw, 32px);
  border-left: 1px solid var(--line);
}

.buy-mode__art {
  height: 120px;
  width: 100%;
}

.buy-mode__title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem);
  letter-spacing: calc(var(--display-tracking) * 0.6);
  line-height: 1.05;
}

.buy-mode__example {
  align-self: end;
  font-size: var(--fs-small);
  color: var(--muted);
}

.buy-mode__example b {
  color: var(--ink);
  font-weight: 600;
}

.buy-foot {
  margin-top: 28px;
  font-size: var(--fs-small);
  color: var(--muted);
}

@media (max-width: 820px) {
  .buy-modes {
    grid-template-columns: 1fr;
  }

  .buy-mode,
  .buy-mode + .buy-mode {
    grid-template-columns: 96px 1fr;
    grid-template-rows: auto;
    column-gap: 18px;
    row-gap: 6px;
    padding: 22px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .buy-mode__art {
    grid-row: span 3;
    height: 88px;
  }
}

/* ---------- вопросы ---------- */

.faq {
  display: grid;
  border-top: 2px solid var(--ink);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.3;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 14px no-repeat,
    var(--soft);
  transition: transform 0.35s var(--ease), background-color 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(135deg);
}

.faq summary:hover::after {
  background-color: var(--accent);
}

.faq details > div {
  padding: 0 0 24px;
  max-width: 44em;
  color: var(--muted);
}

/* ---------- другие направления ---------- */

.cross {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0;
  border-top: 1px solid var(--deep-line);
}

.cross__link {
  --dot: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 84px;
  padding: 20px 20px 20px 0;
  border-bottom: 1px solid var(--deep-line);
  text-decoration: none;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem);
  letter-spacing: -0.02em;
  transition: padding 0.3s var(--ease), color 0.2s;
}

.cross__link span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.cross__link span::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--dot);
  flex: none;
}

.cross__link svg {
  width: 26px;
  height: 26px;
  flex: none;
  transition: transform 0.3s var(--ease);
}

a.cross__link:hover {
  padding-left: 12px;
}

a.cross__link:hover svg {
  transform: translateX(4px);
}

.cross__link--beauty { --dot: #FF6A55; }
.cross__link--cosmetology { --dot: #5B7CFF; }
.cross__link--vet { --dot: #C6F23C; }

.cross__link--soon {
  color: var(--deep-muted);
  font-weight: 500;
}

.cross__link--soon span::before {
  background: transparent;
  border: 2px dashed currentColor;
}

/* ---------- подвал ---------- */

.site-footer {
  padding-block: 48px 40px;
  background: var(--deep);
  color: var(--on-deep);
  font-size: var(--fs-small);
}

.site-footer .wrap {
  display: grid;
  gap: 28px;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px 40px;
  align-items: flex-start;
}

.site-footer__note {
  max-width: 40em;
  color: var(--deep-muted);
}

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

/* ---------- появление при загрузке ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94) rotate(var(--r, 0deg));
  }
  to {
    opacity: 1;
    transform: rotate(var(--r, 0deg));
  }
}

.rise {
  animation: rise 0.8s var(--ease) both;
  animation-delay: var(--delay, 0s);
}

/* ---------- уменьшение движения ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* ---------- иллюстрации способов покупки ---------- */

.ba-paper {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}

.ba-accent {
  fill: var(--accent);
}

.ba-primary {
  fill: var(--primary);
}

.ba-soft {
  fill: var(--soft);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.ba-cover {
  fill: var(--primary);
  stroke: var(--ink);
  stroke-width: 2;
}

.ba-cover-line {
  fill: none;
  stroke: var(--on-primary);
  stroke-width: 4;
  stroke-linecap: round;
  opacity: 0.8;
}

.ba-line {
  fill: none;
  stroke: color-mix(in srgb, var(--ink) 28%, transparent);
  stroke-width: 4;
  stroke-linecap: round;
}
