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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

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

.page-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--page-gutter-top) var(--page-gutter) 0;
}

.page-shell {
  padding: 0;
  padding-bottom: calc(var(--dock-height) + var(--fab-size) + 20px);
}

@media (min-width: 768px) {
  .page-shell {
    padding-bottom: calc(var(--section-gap) + 32px);
  }
}

@media (min-width: 1024px) {
  .page-shell {
    padding-bottom: calc(var(--section-gap) + 48px);
  }
}

.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-section);
  overflow: hidden;
  margin-bottom: var(--section-gap);
  box-shadow: var(--shadow-sm);
}

/* Ниже первого экрана — отложенная отрисовка без смены layout */
#services,
#works,
#clients,
#news,
#useful,
.form-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

.section-card:last-child {
  margin-bottom: 0;
}

.section-card--alt {
  background: var(--color-bg-alt);
}

.section-card__inner {
  padding: var(--section-pad);
}

.section-header--center {
  text-align: center;
  margin-bottom: 24px;
}

.section-header--center .section-lead {
  margin-bottom: 0;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-lead {
  color: var(--color-text-muted);
  font-size: clamp(0.9375rem, 1.6vw, 1.125rem);
  line-height: 1.6;
  margin-bottom: 20px;
}

.two-col {
  display: grid;
  gap: 20px;
  align-items: start;
  grid-template-columns: 2fr 3fr;
}

.two-col--reverse {
  grid-template-columns: 3fr 2fr;
}

.two-col--reverse .two-col__media {
  order: -1;
}

.two-col__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.two-col__media {
  min-width: 0;
}

@media (min-width: 768px) {
  .two-col {
    gap: 32px;
  }

  .section-card__inner--carousel-row {
    align-items: start;
  }

  .section-card__inner--carousel-row .two-col__text--padded {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .two-col {
    gap: 48px;
    grid-template-columns: 2fr 3fr;
  }

  .two-col--reverse {
    grid-template-columns: 3fr 2fr;
  }
}

/* No scroll-reveal: sections are always fully visible */
.page-shell > .section-card,
.page-shell > .form-section,
.page-shell > footer.section-card,
.fade-in,
.fade-in.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}
