/* Owner-selected photographs retain the existing slot and reveal contract. */
.ph > img { object-position: center; }
.ph::before, .ph::after { content: none; }
.ph[data-slot="life-learning"] > img { object-position: 65% center; }
.ph[data-slot="life-event"] > img { object-position: 48% center; }

.team-film-section { padding-top: 0; }
.team-film-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); gap: 70px; align-items: center; padding: 62px; background: #edf3ec; border: 1px solid #d5e3d6; border-radius: 24px; }
.team-film-copy { min-width: 0; }
.team-film-copy h2 { margin-block: 27px; }
.team-film-description { max-width: 380px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.film-note { display: flex; align-items: center; gap: 20px; margin-top: 38px; padding-top: 26px; border-top: 1px solid #bdcfbf; }
.film-note > span { font-size: 58px; line-height: 1; color: var(--mint-dark); }
.film-note p { color: var(--wine); font-size: 17px; line-height: 1.6; }
.film-invitation { margin-top: 30px; font-size: 10px; color: var(--mint-dark); }
.film-invitation > span { display: inline-block; margin-left: 12px; font-size: 23px; vertical-align: middle; }
.team-film-card { width: 100%; max-width: 338px; justify-self: center; min-width: 0; }
.film-frame { position: relative; isolation: isolate; padding: 7px; background: var(--wine); border: 1px solid #846e67; border-radius: 29px; box-shadow: 0 18px 40px #3e1a2220; }
.film-frame::before { content: ''; position: absolute; z-index: -1; inset: -9px; border-radius: 36px; box-shadow: 0 0 50px 8px #d4a84735, 0 0 28px 6px #72bd9433; opacity: .8; pointer-events: none; }
.film-frame video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 22px; background: #201618; object-fit: cover; }
.film-start { position: absolute; inset: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; width: calc(100% - 14px); border: 0; border-radius: 22px; color: white; background: linear-gradient(180deg, transparent 20%, #241a2240 60%, #241a2266); font-size: 12px; font-weight: 550; text-shadow: 0 1px 12px #000; }
.film-play-icon { display: grid; place-items: center; width: 76px; height: 76px; padding-left: 4px; font-size: 24px; background: #fbfaf7ed; color: var(--wine); text-shadow: none; border: 1px solid white; border-radius: 50%; box-shadow: 0 8px 30px #0003; transition: transform .35s var(--motion-ease); }
.film-start:hover .film-play-icon { transform: scale(1.08); }
.film-start:focus-visible { outline-offset: 3px; outline-color: var(--gold); }
.film-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 10px; margin-top: 16px; }
.film-duration { font-size: 8px; font-weight: 600; letter-spacing: 1px; }
.film-toggle { padding: 10px 0; min-height: 44px; border: 0; border-bottom: 1px solid var(--mint-dark); background: transparent; color: var(--mint-dark); font-size: 10px; font-weight: 600; }
.film-status { font-size: 9px; color: var(--muted); margin-top: 10px; min-height: 3.3em; }

.spaces-section { padding-bottom: 0; }
.spaces-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 22px; }
.space-card { min-width: 0; }
.space-card:nth-child(3n + 2) { padding-top: 28px; }
.space-image { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 12px; border: 1px solid var(--line); background: var(--cream); }
.space-image img { position: absolute; width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--space-y, 0px)) scale(1.07); }
.space-card figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; font-size: 10px; color: var(--muted); }
.space-card figcaption > span:last-child { color: var(--mint-dark); font-size: 9px; }
.spaces-hint { display: none; }

@media (min-width: 641px) and (max-width: 900px) {
  /* A group portrait needs a wide frame to keep people at both edges visible. */
  .hero-photo { aspect-ratio: 5 / 4; }
  .hero-sticker { bottom: 12px; padding: 12px; }
  .hero-footnote { padding-right: 145px; min-height: 75px; }
  .hero-footnote .tiny-line, .hero-footnote .round-link { display: none; }
}
@media (max-width: 1100px) {
  .team-film-layout { padding: 40px; gap: 36px; }
}
@media (max-width: 760px) {
  .team-film-layout { gap: 26px; padding: 28px; }
  .team-film-copy h2 { font-size: 34px; }
  .film-note { gap: 12px; }
  .film-note p { font-size: 14px; }
  .team-film-description { font-size: 12px; }
}
@media (max-width: 640px) {
  .team-film-section { padding-top: 0; }
  .team-film-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; padding: 24px 16px; border-radius: 18px; }
  .team-film-copy h2 { margin-block: 22px; }
  .film-note { margin-top: 23px; padding-top: 20px; }
  .film-note > span { font-size: 42px; }
  .film-invitation { margin-top: 20px; }
  .team-film-card { max-width: none; }
  .spaces-section { padding-bottom: 0; }
  .spaces-track { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 88%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #adbdaf transparent; padding-bottom: 16px; }
  .space-card { scroll-snap-align: start; }
  .space-card:nth-child(3n + 2) { padding-top: 0; }
  .spaces-hint { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .space-image img { transform: none; }
  .film-start:hover .film-play-icon { transform: none; }
}

/* Safari 14 и старше не знают aspect-ratio: фото с position:absolute схлопывались. Запасная высота через padding-top. */
@supports not (aspect-ratio: 1 / 1) {
  .ph, .space-image { height: 0; padding-top: 75%; }
  .hero-photo { padding-top: 80%; }
  .office-photo { padding-top: 62.5%; }
  .ph > img, .space-image img { top: 0; left: 0; }
}
