/* «Ярус» — плотная раскладка по образцу apple.com и microsoft.com (14.11.2026).
   Заказчик: «очень много пустого места на ПК». Правило Taste-Skill «один раздел = один экран» снято:
   разделы по высоте содержимого, обзор плитками 2×2, путь заявки рядом карточек, вопросы в две колонки.
   Подключается последним, поверх system.css и page.css. Первый экран (#hero) не трогаем. */

:root { --ap-gap: 12px; --ap-radius: 28px; --ap-tile: #f2f1ee; --ap-pad: 88px; }
@media (max-width: 1023px) { :root { --ap-pad: 64px; --ap-radius: 22px; } }
@media (max-width: 639px) { :root { --ap-pad: 48px; --ap-radius: 18px; } }

/* ---------------------------------------------------------------- разделы по высоте содержимого */
main > :is(section, .section):not(.hero), footer.closing {
  height: auto; min-height: 0;
  padding: var(--ap-pad) 0 calc(var(--ap-pad) + var(--bar, 0px));
}
main > :is(section, .section):not(.hero) > :is(.wrap, .container), footer.closing > .wrap { height: auto; }
main > :is(section, .section):not(.hero) > .wrap > .fill,
main > :is(section, .section):not(.hero) .fill { flex: none; min-height: 0; }
/* соседние светлые разделы — меньше воздуха между ними */
main > section:not(.hero, .ground-surface, .tiles) + section:not(.ground-surface, .tiles) { padding-top: calc(var(--ap-pad) * .6); }
footer.closing { padding-top: 72px; }

/* заголовок раздела по центру, как у Apple */
.section-head--mid { max-width: 820px; margin-inline: auto; text-align: center; justify-items: center; margin-bottom: 40px; }
.section-head--mid p { margin-inline: auto; color: var(--p-muted); }

/* ---------------------------------------------------------------- обзор: плитки 2×2 */
.tiles { padding: var(--ap-gap) 0 !important; }
main > section.tiles > .wrap.tiles__grid { width: calc(100% - 2 * var(--ap-gap)); max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: var(--ap-gap); }
.tile { position: relative; overflow: hidden; border-radius: var(--ap-radius); min-height: 620px;
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 52px 40px 0; isolation: isolate; }
.tile--dark { background: var(--p-inv-bg); color: var(--p-inv-ink); }
.tile--light { background: var(--ap-tile); color: var(--p-ink); }
.tile__text { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; max-width: 30em; }
.tile__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 2.6vw, 40px); line-height: 1.1; letter-spacing: -0.025em; margin: 0; }
.tile__lead { font-size: 19px; line-height: 1.4; margin: 0; opacity: .82; }
.tile__link { margin-top: 6px; font-size: 17px; font-weight: 500; color: inherit; text-decoration: none; }
.tile--dark .tile__link { color: var(--p-accent); }
.tile__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.tile__pic { position: absolute; inset: auto 0 0 0; height: 64%; z-index: 0; }
.tile__pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; display: block; }
.tile--dark .tile__pic::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 38%; z-index: 1; pointer-events: none;
  background: linear-gradient(var(--p-inv-bg), transparent); }
.tile__pic--photo { height: 58%; }
.tile__pic--photo img { object-position: 50% 35%; }
@media (max-width: 1023px) {
  main > section.tiles > .wrap.tiles__grid { grid-template-columns: 1fr; }
  .tile { min-height: 560px; padding: 40px 24px 0; }
}
@media (max-width: 639px) {
  .tile { min-height: 500px; }
  .tile__title { font-size: 28px; }
  .tile__lead { font-size: 17px; }
  .tile__pic { height: 52%; }
}

/* ---------------------------------------------------------------- звонок на линию */
#call .call-frame { height: auto; }
#call .device { --dv-h: 600px; }

/* ---------------------------------------------------------------- программа диспетчера: заголовок по центру, снимок целиком */
#desk .desk-head { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; max-width: 900px; margin: 0 auto 40px; row-gap: 16px; }
#desk .desk-head > * { grid-column: 1 / -1 !important; }
#desk .desk-intro { display: grid; justify-items: center; gap: 12px; }
#desk .desk-intro .t-lead { color: var(--p-muted); }
#desk .desk-frame { height: auto; min-height: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 60px -30px rgb(23 24 28 / .35); }
#desk .desk-frame > .desk-shot { position: static; inset: auto; display: block; width: 100%; height: auto; object-fit: contain; }

/* ---------------------------------------------------------------- мастер, жильцы, режимы, цены, форма: фото по пропорциям */
#master .master-photo, #modes .modes-photo { height: auto; align-self: stretch; border-radius: var(--ap-radius); overflow: hidden; }
#master .master-photo img, #modes .modes-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 1024px) {
  #master .master-grid, #modes .modes-grid, #resident .resident-grid, #price .price-grid, #start .start-grid { align-items: center; }
  #master .master-photo { aspect-ratio: 1 / 1; }
  #modes .modes-photo { aspect-ratio: 910 / 1024; max-height: 680px; }
}
#resident .resident-frame { height: auto; min-height: 0; border-radius: var(--ap-radius); }
#modes { background: var(--ap-tile); }

/* ---------------------------------------------------------------- путь заявки: ряд карточек, как у Microsoft */
.steps-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ap-gap); counter-reset: none; }
.step-card { background: var(--ap-tile); border-radius: var(--ap-radius); padding: 28px 24px 28px; display: flex; flex-direction: column; gap: 8px; }
.step-card__shot { margin: 0 0 12px; height: 380px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.step-card__shot img { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: 50% 0;
  border-radius: 18px; box-shadow: 0 18px 40px -22px rgb(23 24 28 / .45); }
.step-card__shot--wide img { height: auto; width: 100%; border-radius: 10px; align-self: center; }
.step-card__shot--wide { align-items: center; }
.step-card__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--p-accent); color: var(--p-accent-ink); font-weight: 600; font-size: 15px; }
.step-card h3 { margin: 4px 0 0; font-size: 21px; line-height: 1.25; font-weight: 600; }
.step-card p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--p-muted); }
@media (max-width: 1100px) { .steps-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .steps-row { grid-template-columns: 1fr; }
  .step-card__shot { height: 320px; }
}

/* ---------------------------------------------------------------- подключение: две плитки */
#connect .connect-grid { align-items: stretch; }
#connect .card { border-radius: var(--ap-radius); background: var(--ap-tile); border: 0; }
#connect .card .panel { min-height: 300px; }

/* ---------------------------------------------------------------- вопросы: две колонки */
@media (min-width: 1024px) {
  #faq .faq-grid { grid-template-columns: 1fr; row-gap: 32px; }
  #faq .faq-grid > * { grid-column: 1 / -1 !important; }
  #faq .faq-head { text-align: center; justify-items: center; display: grid; gap: 12px; max-width: 760px; margin-inline: auto; }
  #faq .faq { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ap-gap); }
  #faq .faq__item { background: var(--ap-tile); border-radius: 20px; padding: 24px 28px; border: 0; margin: 0; }
}
@media (min-width: 1024px) { #faq .faq__item:last-child:nth-child(odd) { grid-column: 1 / -1; } }
