.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: var(--section-y);
}

.section__header {
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.section__eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

@media (max-width: 767px) {
  .section__eyebrow {
    position: sticky;
    top: calc((var(--header-h) - var(--fs-caption) * var(--lh-body)) / 2);
    z-index: 40;
    max-width: calc(100% - 8.5rem);
  }

  .section__eyebrow::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    width: calc(100% + 1.8rem);
    height: 2.25rem;
    border-radius: var(--radius-button);
    background: var(--color-card-elevated);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
  }

  .section__eyebrow.is-stuck::before {
    opacity: 1;
  }
}

.section__title {
  margin-bottom: 0.85rem;
  scroll-margin-top: calc(var(--header-h) + 0.5rem);
}

.section__title:last-child {
  margin-bottom: 0;
}

.section__lead {
  max-width: 40rem;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

.audience-card,
.service-card,
.case-card,
.format-card,
.session-card,
.contact__channel {
  position: relative;
  isolation: isolate;
}

.audience-card::after,
.service-card::after,
.case-card::after,
.format-card::after,
.session-card::after,
.contact__channel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 2px solid var(--color-accent);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.audience-card:hover::after,
.service-card:hover::after,
.case-card:hover::after,
.format-card:hover::after,
.session-card:hover::after,
.contact__channel:hover::after {
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: var(--btn-height);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  border-radius: var(--radius-button);
  font-weight: var(--fw-medium);
  font-size: var(--fs-button);
  line-height: var(--lh-button);
  text-align: center;
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    transform var(--duration) var(--ease),
    opacity var(--duration) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border: 1px solid var(--color-accent);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-on-accent);
  border-color: var(--color-accent-hover);
}

.btn--with-arrow {
  gap: 0.55rem;
  transition:
    background-color 400ms var(--ease),
    border-color 400ms var(--ease),
    transform 400ms var(--ease),
    color 400ms var(--ease);
}

.btn__arrow {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.btn--with-arrow:hover {
  background: color-mix(in srgb, var(--color-accent) 78%, #000);
  border-color: color-mix(in srgb, var(--color-accent) 78%, #000);
  color: var(--color-on-accent);
  transform: scale(1.06);
}

.btn--with-arrow:active {
  transform: scale(1.03);
}

.btn--secondary {
  background: transparent;
  color: var(--color-caption);
  border: 1px solid var(--color-border-muted);
}

.btn--secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-heading);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Header */
.header-slot {
  min-height: 0;
}

.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  min-height: var(--header-h);
  background: transparent;
  pointer-events: none;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: var(--header-h);
  gap: 0.75rem;
  pointer-events: none;
}

.term-switch-block {
  position: relative;
  display: none; /* место в шапке решим позже; разметка и логика на месте */
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem 0.35rem 0.9rem;
  border-radius: var(--radius-button);
  background: var(--color-card-elevated);
  pointer-events: auto;
  cursor: pointer;
}

.term-switch-block__text {
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  line-height: 1;
  color: var(--color-caption);
}

.term-switch {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.term-switch[aria-checked="false"] {
  background: var(--color-text-muted);
}

.term-switch[aria-checked="true"] {
  background: var(--color-accent);
}

.term-switch__knob {
  position: relative;
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #111827;
  transform: translateX(0.25rem);
  transition:
    transform 320ms cubic-bezier(0.34, 1.35, 0.64, 1),
    background-color 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.term-switch[aria-checked="true"] .term-switch__knob {
  background: var(--color-on-accent);
  transform: translateX(1.25rem);
}

.term-switch-block::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  z-index: 120;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card-elevated);
  color: var(--color-heading);
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  line-height: 1.3;
  width: 200px;
  max-width: 200px;
  box-sizing: border-box;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition:
    opacity 200ms var(--ease),
    transform 200ms var(--ease);
}

.term-switch-block:hover::after,
.term-switch-block:focus-within::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

html.terms-off .term {
  border-bottom: none;
  cursor: inherit;
  color: inherit;
}

html.terms-off .term:hover,
html.terms-off .term:focus-visible {
  color: inherit;
  border-bottom-color: transparent;
}

.header__contact {
  position: relative;
  pointer-events: auto;
}

.header__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.header__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.8125rem;
  line-height: 1.2;
}

.header__cta-icons {
  position: relative;
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

.header__cta-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition:
    opacity 200ms var(--ease),
    transform 200ms var(--ease);
}

.header__cta-icon--close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.header__cta[aria-expanded="true"] {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.header__cta[aria-expanded="true"] .header__cta-icon--chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.header__cta[aria-expanded="true"] .header__cta-icon--close {
  opacity: 1;
  transform: none;
}

.header-contacts {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 16.5rem;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-card);
}

.header-contacts[hidden] {
  display: none;
}

.header-contacts__link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  color: inherit;
  transition: background-color var(--duration) var(--ease);
}

.header-contacts__link:hover {
  background: var(--color-card-elevated);
  color: inherit;
}

.header-contacts__label {
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-caption);
}

.header-contacts__value {
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  color: var(--color-heading);
}

/* Footer */
.footer {
  border-top: 1px solid var(--color-border);
  padding-block: 2.5rem;
  background: var(--color-bg);
}

.footer__inner {
  display: grid;
  gap: 0.85rem 2.5rem;
}

body:has(.to-top) .footer__inner {
  padding-inline-end: max(
    var(--container-padding),
    calc(3rem + clamp(1rem, 3vw, 1.75rem) + 0.85rem)
  );
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-heading);
}

.footer__meta {
  color: var(--color-text-muted);
  font-size: var(--fs-caption);
}

.footer__link {
  font-size: var(--fs-caption);
  color: var(--color-caption);
  text-underline-offset: 0.18em;
}

.footer__link:hover {
  color: var(--color-text-muted);
}

@media (min-width: 640px) {
  .footer__inner {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .footer__col--end {
    text-align: right;
    align-items: flex-end;
  }
}

/* Reveal animation — only when JS loaded (progressive enhancement) */
html.js .reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity var(--duration-reveal) var(--ease),
    transform var(--duration-reveal) var(--ease);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.term {
  text-decoration: none;
  border-bottom: 1px dashed var(--color-accent);
  cursor: help;
  color: inherit;
}

.term:hover,
.term:focus-visible {
  color: var(--color-heading);
  border-bottom-color: var(--color-accent-hover);
}

.term-tooltip {
  position: fixed;
  z-index: 200;
  max-width: min(22rem, calc(100vw - 24px));
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  background: #343434;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: term-tooltip-in 160ms var(--ease);
}

@keyframes term-tooltip-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .term-tooltip {
    animation: none;
  }
}

.term-tooltip[hidden] {
  display: none;
}

.term-tooltip__title {
  margin: 0 0 0.2rem;
  font-size: 0.8125rem;
  font-weight: var(--fw-semibold);
  color: var(--color-accent);
}

.term-tooltip__en,
.term-tooltip__ru {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--color-text);
}

.term-tooltip__en {
  color: var(--color-heading);
}

.term-tooltip__ru {
  color: var(--color-text-muted);
}

.cookie-note {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: clamp(1rem, 3vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  width: min(22.5rem, calc(100vw - 2 * clamp(1rem, 3vw, 1.75rem)));
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
}

.cookie-note__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.cookie-note__link {
  color: var(--color-heading);
  text-underline-offset: 0.18em;
}

.cookie-note__link:hover {
  color: var(--color-accent);
}

.cookie-note__ok {
  flex-shrink: 0;
  min-height: 2.25rem;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
}

html.has-cookie-note {
  --cookie-note-space: calc(5.5rem + clamp(1rem, 3vw, 1.75rem));
  scroll-padding-bottom: var(--cookie-note-space);
}

html.has-cookie-note body {
  padding-bottom: var(--cookie-note-space);
}

html.has-cookie-note .footer,
html.has-cookie-note .footer__link {
  scroll-margin-bottom: var(--cookie-note-space);
}

html.has-cookie-note .to-top {
  bottom: var(--cookie-note-space);
}

.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  cursor: pointer;
  transform: translateY(100vh);
  pointer-events: none;
  transition:
    transform 450ms var(--ease),
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.to-top.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.to-top.is-visible:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(0) scale(1.08);
}

.to-top.is-visible:active {
  transform: translateY(0) scale(1.02);
}

.to-top__icon {
  width: 1.25rem;
  height: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .to-top {
    transition: none;
  }

  .to-top.is-visible:hover,
  .to-top.is-visible:active {
    transform: none;
  }
}
