/* Refinements after the first live review. */
.header {
  background: rgba(246, 243, 237, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(18, 32, 42, 0.06);
}

.header-inner {
  min-height: 82px;
}

.header nav {
  gap: clamp(14px, 1.55vw, 22px);
}

.brand-mark.brand-mark-logo {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.brand-mark.brand-mark-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-brand .brand-mark.brand-mark-logo {
  width: 50px;
  height: 50px;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.page-hero {
  padding: 92px 0 76px;
}

.page-hero-grid {
  grid-template-columns: minmax(0, 1.62fr) minmax(270px, 0.58fr);
  gap: clamp(46px, 7vw, 96px);
  align-items: end;
}

.page-hero h1 {
  max-width: 900px;
  font-size: clamp(48px, 5.75vw, 82px);
  line-height: 1.04;
  text-wrap: balance;
}

.page-hero-grid > p {
  max-width: 340px;
  justify-self: end;
  padding-bottom: 9px;
  line-height: 1.58;
}

.about-photo img,
.portrait img {
  object-fit: contain;
}

.facts dd,
.credentials strong {
  overflow-wrap: anywhere;
}

.product-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: clamp(24px, 4vw, 56px);
}

.product-mark img {
  display: block;
  width: min(100%, 360px);
  max-height: 300px;
  object-fit: contain;
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.18));
}

.college-section {
  padding-top: 0;
}

.college-card {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(38px, 7vw, 92px);
  align-items: center;
  padding-top: clamp(40px, 6vw, 76px);
  border-top: 1px solid rgba(18, 32, 42, 0.16);
}

.college-logo-wrap {
  overflow: hidden;
  border: 1px solid rgba(18, 32, 42, 0.1);
  background: #e7eaf0;
}

.college-logo-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.college-card h2 {
  max-width: 760px;
  margin: 14px 0 20px;
  font-size: clamp(34px, 4.2vw, 62px);
  line-height: 1.05;
  text-wrap: balance;
}

.college-card > div:last-child > p:not(.eyebrow):not(.caption) {
  max-width: 650px;
  font-size: 18px;
  line-height: 1.65;
}

.college-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 18px;
  border: 1px solid rgba(18, 32, 42, 0.2);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  transition: transform 0.2s, background 0.2s;
}

.college-link:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.5);
}

.college-card .caption {
  max-width: 650px;
  margin-top: 20px;
  opacity: 0.7;
}

.analytics-consent {
  position: fixed;
  z-index: 1000;
  right: 22px;
  bottom: 22px;
  left: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 32, 42, 0.97);
  color: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.analytics-consent strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.analytics-consent p {
  max-width: 720px;
  margin: 0 0 7px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.5;
}

.analytics-consent a {
  color: #fff;
}

.analytics-consent-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.analytics-consent .button {
  white-space: nowrap;
  cursor: pointer;
}

.analytics-consent .ghost {
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
}

/* All grid and flex children must be allowed to shrink. */
.hero-grid > *,
.page-hero-grid > *,
.two > *,
.product-grid > *,
.about-grid > *,
.contacts > *,
.form-section > *,
.cta-inner > *,
.faq-layout > *,
.detail > * {
  min-width: 0;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 1060px) {
  .header nav {
    gap: 14px;
  }

  .header nav a {
    font-size: 13px;
  }

  .page-hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(245px, 0.65fr);
    gap: 44px;
  }
}

@media (max-width: 820px) {
  .header {
    background: rgba(246, 243, 237, 0.96);
  }

  .page-hero {
    padding: 68px 0 60px;
  }

  .page-hero-grid,
  .college-card {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
  }

  .page-hero-grid > p {
    max-width: 620px;
    justify-self: start;
    padding-bottom: 0;
  }

  .college-logo-wrap {
    width: min(100%, 560px);
  }

  .product-mark {
    min-height: 190px;
  }

  .analytics-consent {
    grid-template-columns: 1fr;
    gap: 18px;
    right: 12px;
    bottom: 12px;
    left: 12px;
    padding: 18px;
  }

  .analytics-consent-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 32px), var(--container));
  }

  .header-inner {
    min-height: 76px;
    gap: 12px;
  }

  .brand {
    min-width: 0;
    gap: 10px;
  }

  .brand > span:last-child {
    min-width: 0;
  }

  .brand strong {
    font-size: 15px;
    white-space: nowrap;
  }

  .brand small {
    font-size: 11px;
  }

  .brand-mark.brand-mark-logo {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
  }

  .menu-button {
    flex: 0 0 auto;
  }

  .hero {
    min-height: auto;
    padding: 54px 0 54px;
    overflow: clip;
  }

  .hero-grid {
    gap: 36px;
  }

  .hero h1 {
    max-width: 100%;
    margin-bottom: 24px;
    font-size: clamp(39px, 11vw, 50px);
    line-height: 0.98;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .lead {
    font-size: 18px;
    line-height: 1.62;
  }

  .actions,
  .cta-inner .actions,
  .product-hero .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 12px;
  }

  .actions .button,
  .cta-inner .button,
  .product-hero .button {
    width: 100%;
    min-height: 54px;
    padding-inline: 18px;
    text-align: center;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .facts > div {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .facts > div:last-child {
    border-bottom: 0;
  }

  .portrait {
    min-height: 0;
  }

  .portrait-bg {
    inset: 5% 0 0;
  }

  .license-chip {
    left: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
  }

  .section {
    padding: 72px 0;
  }

  .page-hero {
    padding: 60px 0 54px;
    overflow: clip;
  }

  .page-hero h1 {
    max-width: 100%;
    font-size: clamp(37px, 10.4vw, 48px);
    line-height: 1.02;
    letter-spacing: -0.04em;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .page-hero-grid > p {
    max-width: 100%;
    font-size: 17px;
    overflow-wrap: anywhere;
  }

  .two h2,
  .heading h2,
  .about-grid h2,
  .detail h2,
  .notice h2,
  .empty h1,
  .empty h2 {
    font-size: clamp(34px, 9.4vw, 46px);
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .values article,
  .features article,
  .card {
    min-height: 0;
    padding: 28px 24px;
  }

  .values h3,
  .features h3,
  .card h3 {
    margin-top: 38px;
    font-size: clamp(28px, 8vw, 36px);
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .product-hero {
    min-height: auto;
    padding: 64px 0;
    overflow: clip;
  }

  .product-hero h1,
  .product-grid h2 {
    max-width: 100%;
    font-size: clamp(42px, 12vw, 58px);
    overflow-wrap: anywhere;
  }

  .product-mark {
    width: 100%;
    max-width: none;
    min-height: 0;
    border-radius: 28px;
    padding: 28px;
  }

  .product-mark img {
    width: min(72%, 260px);
  }

  .faq-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .faq-layout aside {
    position: static;
  }

  .faq-layout aside h2 {
    font-size: 36px;
  }

  .faq-list summary {
    gap: 16px;
    font-size: clamp(22px, 6.7vw, 28px);
    line-height: 1.25;
  }

  .faq-list details > div {
    padding-right: 0;
  }

  .contact-list article {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 22px 0;
  }

  .contact-list article > small,
  .contact-list article .text-link {
    grid-column: auto;
  }

  .contact-list article > a,
  .contact-list article > strong {
    max-width: 100%;
    font-size: clamp(20px, 6.3vw, 25px);
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .contact-panel {
    min-width: 0;
    min-height: 0;
    padding: 34px 24px;
    border-radius: 24px;
    overflow: hidden;
  }

  .contact-panel h2 {
    max-width: 100%;
    font-size: clamp(38px, 10.5vw, 50px);
    line-height: 1.04;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .cta {
    padding: 58px 0 72px;
  }

  .cta-inner {
    display: grid;
    grid-template-columns: 1fr;
    padding: 34px 24px;
    gap: 28px;
  }

  .cta h2 {
    font-size: clamp(38px, 10vw, 48px);
    line-height: 1.04;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .credentials div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .practice-list > a {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 14px;
  }

  .practice-list h2 {
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .timeline article {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 18px;
  }

  .license-gallery,
  .form-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .analytics-consent-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .analytics-consent .button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .brand-mark.brand-mark-logo {
    width: 44px;
    height: 44px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    font-size: 10px;
  }

  .hero h1 {
    font-size: clamp(37px, 10.7vw, 43px);
  }

  .page-hero h1 {
    font-size: clamp(35px, 10vw, 42px);
  }
}

/* Управление согласием на аналитику: отзыв должен быть так же доступен, как дача. */
.analytics-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.analytics-settings .analytics-state { margin: 0; font-weight: 600; }
