:root {
  --layout-max: 1380px;
  --layout-gutter: 30px;
  --page-top-space: clamp(40px, 5vw, 64px);
  --page-top-space-compact: clamp(28px, 3.5vw, 48px);
  --section-space: clamp(64px, 7vw, 96px);
  --section-space-compact: clamp(40px, 5vw, 64px);
  --layout-edge: max(
    var(--layout-gutter),
    calc((100vw - var(--layout-max)) / 2)
  );
}

html {
  overflow-x: clip;
  background: var(--color-paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink);
}

:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) {
  min-height: 100dvh;
  overflow: clip;
  background: var(--color-paper);
  color: var(--color-ink);
}

:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site),
:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) *,
:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) *::before,
:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) *::after {
  box-sizing: border-box;
}

:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) :where(h1, h2, h3, p, figure) {
  margin: 0;
}

:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) :where(a) {
  color: inherit;
  text-decoration: none;
}

:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) :where(button, input, select, textarea) {
  font: inherit;
}

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

:where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) :focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.shell {
  width: min(
    var(--layout-max),
    calc(100% - (var(--layout-gutter) * 2))
  );
  margin-inline: auto;
}

.site-menu {
  padding-inline: var(--layout-edge);
}

.footer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 1fr) auto;
  grid-template-areas:
    "identity navigation contact"
    "bottom bottom bottom";
  align-items: start;
  gap: 44px 64px;
  width: 100%;
  padding: 42px var(--layout-edge) 24px;
  padding-inline: var(--layout-edge);
  border-top: 1px solid var(--color-ink);
  background: var(--color-paper-2);
  color: var(--color-ink);
  box-sizing: border-box;
}

.footer :where(p) {
  margin: 0;
}

.footer :where(a) {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.page-breadcrumbs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

:where(
  .hero-form button,
  .lead-form button,
  .hero-catalog-button,
  .work-banner__button,
  .catalog-cta,
  .order-submit,
  .house-order-button,
  .house-error a
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding-inline: 22px;
  border: 0;
  background: var(--color-accent);
  color: var(--color-accent-ink) !important;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}

:where(
  .hero-form button,
  .lead-form button,
  .hero-catalog-button,
  .work-banner__button,
  .catalog-cta,
  .order-submit,
  .house-order-button,
  .house-error a
):hover {
  background: var(--color-accent-hover);
}

:where(
  .hero-form button,
  .lead-form button,
  .hero-catalog-button,
  .work-banner__button,
  .catalog-cta,
  .order-submit,
  .house-order-button,
  .house-error a
):active {
  transform: none;
  box-shadow: none;
}

.footer__identity {
  grid-area: identity;
  display: grid;
  gap: 10px;
}

.footer__brand {
  width: fit-content;
}

.footer__brand-mark {
  display: block;
  width: 150px;
  aspect-ratio: 2256 / 402;
  background: currentColor;
  -webkit-mask: url("../icons/ostovpro-logo.svg") center / contain no-repeat;
  mask: url("../icons/ostovpro-logo.svg") center / contain no-repeat;
}

.footer__identity p {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.45;
}

.footer__nav {
  grid-area: navigation;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 30px;
  font-size: 13px;
  line-height: 1.4;
}

.footer__nav a {
  white-space: nowrap;
}

.footer__contact {
  grid-area: contact;
  display: grid;
  justify-items: end;
  gap: 10px;
  text-align: right;
}

.footer__contact span {
  color: var(--color-muted);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.footer__contact a {
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
}

.footer__bottom {
  grid-area: bottom;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-top: 20px;
  border-top: 1px solid var(--color-rule);
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.45;
}

.footer__bottom nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 22px;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--color-accent);
}

:is(.catalog-hero, .route-intro, .brief-copy) > h1 {
  font-size: var(--type-h1);
  line-height: .98;
  letter-spacing: -.045em;
}

:is(.catalog-hero__grid, .route-intro) {
  align-items: start;
}

/* Stages are denser than catalog grids; the page heading keeps the global grid. */
.how-site .atlas {
  --route-content-max: 1180px;
  width: min(
    var(--route-content-max),
    calc(100% - (var(--layout-gutter) * 2))
  );
}

@media (max-width: 767px) {
  :root {
    --layout-gutter: 16px;
    --page-top-space: 32px;
    --page-top-space-compact: 24px;
    --section-space: 58px;
    --section-space-compact: 40px;
  }

  .footer {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity contact"
      "navigation navigation"
      "bottom bottom";
    gap: 24px 16px;
    padding: 28px var(--layout-edge) 22px;
  }

  .footer__contact {
    justify-items: end;
    text-align: right;
  }

  .footer__brand-mark {
    width: 132px;
  }

  .footer__nav {
    gap: 14px 18px;
  }

  .footer__bottom {
    display: grid;
    gap: 12px;
    padding-top: 18px;
  }

  .footer__bottom nav {
    justify-content: flex-start;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .footer {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity contact"
      "navigation navigation"
      "bottom bottom";
    gap: 34px 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) *,
  :where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) *::before,
  :where(.site, .catalog-site, .house-site, .how-site, .individual-site, .legal-page, .about-site, .learning-site, .partnership-site) *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .partnership-roadmap__node {
    animation: none;
    will-change: auto;
  }
}
