/* ---------- About page: extensions of the shared site system ---------- */
/* Stops mobile Safari's automatic text-size inflation, which can widen
   headings/copy past their flex container on a real phone without ever
   showing up in desktop devtools emulation. No effect on desktop browsers. */
body.about-page {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.about-page-hero .hero-title {
  font-size: clamp(40px, 3.2vw, 54px);
}

.about-page-hero .hero-top {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px) minmax(0, 1fr);
}

.about-page-hero .hero-lead {
  width: 100%;
  max-width: none;
  justify-self: center;
}

.about-page-hero-image {
  height: clamp(560px, 70vw, 900px);
  aspect-ratio: 4 / 3;
}

.about-page-hero-image img {
  object-position: center 42%;
}

/* ---------- Why choose us ---------- */
.about-why-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.about-why-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px);
  padding: clamp(28px, 3.2vw, 52px) 0;
  border-bottom: 1px solid var(--border);
}

.about-why-number {
  padding-top: 5px;
  color: var(--text-muted);
  font-family: var(--font-head);
  font-weight: 400;
  font-synthesis: none;
  font-size: var(--fs-label);
  line-height: 1.2;
}

.about-why-item > div {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr);
  gap: clamp(24px, 5vw, 96px);
  align-items: start;
}

.about-why-item h3 {
  font-size: clamp(28px, 3.15vw, 48px);
  line-height: 1.04;
  transition: transform var(--transition-base) var(--ease);
}

.about-why-item p {
  justify-self: end;
  max-width: 35ch;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-body-small);
  line-height: var(--lh-body-small);
  transition: color var(--transition-base) var(--ease), transform var(--transition-base) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .about-why-item:hover h3 {
    transform: translateX(10px);
  }

  .about-why-item:hover p {
    color: var(--text);
    transform: translateX(10px);
  }
}

/* ---------- Team ---------- */
.about-team-section .section-heading {
  margin-bottom: 22px;
}

.about-team-section .section-heading h2 {
  padding-top: .08em;
  line-height: 1;
}

.about-team-intro {
  max-width: 36ch;
  margin: 0 0 32px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.about-team-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3.2vw, 56px);
  align-items: stretch;
}

.about-team-member {
  --team-photo-scale: 1;
  --team-photo-hover-scale: 1.03;
  --portrait-scale: 1;
  --portrait-x: 50%;
  --portrait-y: 6%;
  min-width: 0;
  margin: 0;
}

/* Per-member portrait crop: normalizes framing (full-length / seated / close
   portrait source photos) to a consistent waist-up composition with even
   headroom and matching face scale. Values measured against each source
   image (head-top / chin position) and tuned by rendering test crops. */
.about-team-member-olga      { --portrait-scale: 1.51; --portrait-y: 0%; }
.about-team-member-nikita    { --portrait-scale: 2.27; --portrait-y: 2%; }
.about-team-member-olga-alex { --portrait-scale: 1.51; --portrait-y: 15%; }
.about-team-member-natalya   { --portrait-scale: 1.2;  --portrait-y: 37%; }

.about-team-photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-alt);
}

.about-team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: var(--portrait-x) var(--portrait-y);
  transform: scale(calc(var(--portrait-scale) * var(--team-photo-scale)));
  transition: transform var(--transition-slow) var(--ease), filter var(--transition-base) var(--ease);
}

.about-team-member figcaption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.about-team-member h3 {
  max-width: 19ch;
  font-size: clamp(25px, 2.15vw, 36px);
  line-height: 1.08;
  transition: transform var(--transition-base) var(--ease);
}

.about-team-member p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-align: left;
  transition: color var(--transition-base) var(--ease), transform var(--transition-base) var(--ease);
}

.about-team-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: clamp(28px, 3vw, 48px);
  margin: clamp(56px, 6vw, 80px) auto 0;
}

.about-team-secondary .about-team-photo {
  aspect-ratio: 4 / 5;
}

.about-team-secondary .about-team-member h3 {
  font-size: clamp(25px, 2.15vw, 36px);
  line-height: 1.08;
}

.about-team-secondary .about-team-member figcaption {
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
}

@media (min-width: 701px) and (hover: hover) and (pointer: fine) {
  .about-team-member:hover .about-team-photo img {
    filter: brightness(1.02) contrast(1.01);
    transform: scale(calc(var(--portrait-scale) * var(--team-photo-hover-scale)));
  }

  .about-team-member:hover h3,
  .about-team-member:hover p {
    transform: translateX(6px);
  }

  .about-team-member:hover p {
    color: var(--text);
  }
}

/* ---------- Stats ---------- */
.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  border-top: 1px solid var(--border);
}

.about-stat {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  border-right: 1px solid var(--border);
  text-align: center;
}

.about-stat:last-child {
  border-right: none;
}

/* stagger helper — matches .stats-row .stat-card on other pages */
.about-stats-grid .about-stat:nth-child(2) { transition-delay: calc(var(--stagger-step) * 1); }
.about-stats-grid .about-stat:nth-child(3) { transition-delay: calc(var(--stagger-step) * 2); }

.about-stat-value {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(72px, 9vw, 140px);
  font-weight: 400;
  font-synthesis: none;
  line-height: .85;
  letter-spacing: -.03em;
}

.about-stat-label {
  max-width: 180px;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-align: center;
}

/* Keeps in-page CTAs aligned beneath the sticky header and the form heading in view. */
.about-contact-form {
  scroll-margin-top: var(--anchor-gap);
}

@media (max-width: 960px) {
  .about-page-hero .hero-top {
    grid-template-columns: 1fr;
  }

  .about-page-hero .hero-title {
    font-size: clamp(40px, 7vw, 48px);
  }

  .about-page-hero-image {
    height: min(72vw, 720px);
    aspect-ratio: 4 / 3;
  }

  .about-why-item > div {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .about-why-item p {
    justify-self: start;
    max-width: 52ch;
  }

  .about-stats-grid {
    grid-template-columns: 1fr;
  }

  .about-stat,
  .about-stat:last-child {
    min-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .about-stat:last-child {
    border-bottom: none;
  }

  /* ---------- Section header system (02 / 03 / 04 / 05) ----------
     Grid (not flex) so the text column has a real min-width:0 track —
     fixes section 05's heading/paragraph getting clipped against the
     container edge instead of wrapping. Must start at 960, not 768:
     the global mobile/tablet breakpoint is 960px, so 769–960px was a
     hybrid state with mobile spacing but this desktop-only layout. */
  .about-page .section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;
    width: 100%;
    margin-bottom: 32px;
    overflow: visible;
  }

  .about-page .section-heading > * {
    min-width: 0;
  }

  .about-page .section-heading h2,
  .about-page .contact-form-heading-copy {
    min-width: 0;
    width: auto;
    max-width: 100%;
    overflow: visible;
    white-space: normal;
  }

  .about-page .section-heading h2 {
    font-size: 32px;
    line-height: 1.05;
  }

  .about-page .contact-form-heading-copy,
  .about-page .contact-form-intro {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  /* ---------- Typography baseline ---------- */
  .about-page .about-why-item p,
  .about-page .about-team-intro,
  .about-page .contact-form-intro {
    font-size: 16px;
    line-height: 1.5;
  }

  .about-page .about-team-member p,
  .about-page .about-stat-label {
    font-size: 14px;
    line-height: 1.4;
  }
}

@media (max-width: 768px) {
  /* ---------- One mobile system for the about page ----------
     Single breakpoint, single horizontal-padding rule (on .container,
     so header/hero/every section/footer share it), single vertical
     rhythm variable. Nothing below sets padding-inline, width, or
     margin-top a second time for the same element. */
  .about-page {
    --mobile-x: 20px;
    --mobile-section-y: 64px;
    --header-height: 69px;
    --anchor-gap: 20px;
  }

  .about-page .container {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: var(--mobile-x);
    padding-right: var(--mobile-x);
    box-sizing: border-box;
  }

  .about-page .header-inner {
    height: 68px;
  }

  .about-page .logo-mark {
    height: 42px;
  }

  .about-page .nav-toggle {
    width: 40px;
    height: 40px;
    display: flex;
  }

  .about-page .mobile-nav {
    top: 68px;
    height: calc(100dvh - 68px);
    padding: 20px 20px max(24px, env(safe-area-inset-bottom));
  }

  .about-page .section {
    margin-top: var(--mobile-section-y);
  }

  .about-page .hero {
    padding-top: 38px;
  }

  .about-page .contact-form-section {
    padding-bottom: var(--mobile-section-y);
  }

  /* ---------- Hero ---------- */
  .about-page .hero-top {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 30px;
    min-width: 0;
  }

  .about-page .hero-title {
    margin-bottom: 16px;
    font-size: 44px;
    line-height: 1.05;
  }

  .about-page .hero-lead {
    width: auto;
    max-width: 100%;
    margin-bottom: 22px;
    font-size: 15px;
    line-height: 1.5;
    white-space: normal;
  }

  .about-page-hero-image {
    height: clamp(300px, 82vw, 360px);
    aspect-ratio: 4 / 3;
  }

  .about-page .reveal-lines .reveal-line {
    opacity: 1;
    transform: none;
  }

  .about-page .section-number {
    margin-left: auto;
    flex-shrink: 0;
    font-size: clamp(32px, 8vw, 38px);
    line-height: .9;
  }

  /* ---------- Why choose us ---------- */
  .about-page .about-why-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    padding: 26px 0;
  }

  .about-page .about-why-number {
    padding-top: 3px;
    font-size: 13px;
  }

  .about-page .about-why-item > div {
    gap: 12px;
  }

  .about-page .about-why-item h3 {
    font-size: clamp(22px, 6vw, 26px);
    line-height: .98;
  }

  .about-page .about-why-item p {
    max-width: none;
  }

  /* ---------- Team ---------- */
  .about-page .about-team-intro {
    margin-bottom: 32px;
  }

  .about-page .about-team-primary,
  .about-page .about-team-secondary {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-page .about-team-secondary {
    margin-top: 48px;
  }

  .about-page .about-team-photo,
  .about-page .about-team-primary .about-team-photo,
  .about-page .about-team-secondary .about-team-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .about-page .about-team-member-olga,
  .about-page .about-team-member-vadim {
    --team-photo-scale: 1;
    --team-photo-hover-scale: 1;
  }

  .about-page .about-team-member figcaption,
  .about-page .about-team-secondary .about-team-member figcaption {
    gap: 12px;
    margin-top: 20px;
    padding-top: 0;
    border-top: 0;
  }

  .about-page .about-team-member h3,
  .about-page .about-team-secondary .about-team-member h3 {
    max-width: none;
    font-size: 26px;
    line-height: 1.1;
  }

  /* ---------- Stats ---------- */
  .about-page .about-stat,
  .about-page .about-stat:last-child {
    min-height: 190px;
    gap: 26px;
  }

  .about-page .about-stat-value {
    font-size: clamp(72px, 15.5vw, 80px);
  }

  /* ---------- Contact form ---------- */
  .about-page .contact-form {
    width: 100%;
    min-width: 0;
  }

  .about-page .contact-form-heading-copy {
    gap: 12px;
  }

  .about-page .contact-form-fields {
    row-gap: 16px;
  }

  .about-page .contact-form-field {
    gap: 12px;
    padding-bottom: 12px;
  }

  .about-page .contact-form input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 54px;
    font-size: 16px;
    line-height: 1.35;
  }

  .about-page .contact-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 72px;
    font-size: 16px;
    line-height: 1.35;
  }

  .about-page .contact-form-footer {
    gap: 16px;
    margin-top: 20px;
  }
}
