.page-home {
  --browse-header-height: 68px;
}

.page-home :is(#services, #photos, #contacts) {
  scroll-margin-top: calc(var(--browse-header-height) + 16px);
}

.page-home .home-masthead {
  --surface-height: 100%;
  --logo-width: 140px;
  height: calc(var(--header-height) + 1px);
  border: 0;
  background: transparent;
  pointer-events: none;
}

.home-masthead .masthead-surface {
  position: absolute;
  inset: 0 0 auto;
  height: var(--surface-height);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0f203b, var(--bg));
  pointer-events: auto;
  transition: height 160ms ease;
}

.page-home .home-masthead .masthead-main {
  height: 100%;
}

.home-masthead .masthead-main {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: clamp(10px, 1.6vw, 24px);
  padding-inline: clamp(14px, 3.2vw, 48px);
}

.home-masthead .masthead-brand {
  position: relative;
  grid-area: 1 / 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  justify-self: center;
}

.home-masthead .identity-logo {
  width: var(--logo-width);
  height: calc(var(--logo-width) * .4375);
}

.home-masthead .identity-logo > img {
  width: calc(var(--logo-width) * 1.25);
  left: calc(var(--logo-width) * -.1484375);
  top: calc(var(--logo-width) * -.3828125);
}

.masthead-brand h1 {
  margin: 0;
  color: var(--muted);
  font: 500 clamp(12px, 1.1vw, 15px)/1.2 Onest, Arial, sans-serif;
  white-space: nowrap;
}

.home-masthead .desktop-nav {
  grid-column: 1;
  justify-self: start;
  gap: clamp(10px, 2vw, 30px);
}

.home-masthead .masthead-actions {
  grid-area: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.6vw, 24px);
}

.home-masthead .masthead-contact {
  white-space: nowrap;
}

.page-home .home-masthead[data-mode="browse"] {
  --surface-height: var(--browse-header-height);
  --logo-width: 112px;
}

.home-masthead[data-mode="browse"] .masthead-surface {
  background: #091524f7;
}

.home-masthead[data-mode="browse"] .masthead-brand {
  grid-column: 1;
  justify-self: start;
}

.home-masthead[data-mode="browse"] .masthead-brand h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.home-masthead[data-mode="browse"] .desktop-nav {
  grid-column: 2;
  justify-self: center;
}

.home-masthead[data-mode="browse"] .header-address {
  display: none;
}

.home-masthead[data-mode="browse"] .header-book {
  min-height: 44px;
}

@media (max-width: 1000px) {
  .page-home .home-masthead { --logo-width: 124px; }
  .home-masthead .desktop-nav { gap: clamp(9px, 1.5vw, 18px); }
  .home-masthead .desktop-nav a { font-size: 13px; }
  .home-masthead .masthead-contact { display: none; }
  .home-masthead .header-book { min-width: 122px; padding-inline: 13px; font-size: 14px; }
  .home-masthead .mobile-call { display: flex; }
}

@media (max-width: 700px) {
  .page-home { --browse-header-height: 54px; }
  .page-home .home-masthead { --logo-width: 104px; }
  .home-masthead .masthead-main {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }
  .home-masthead .masthead-brand { gap: 1px; }
  .masthead-brand h1 { font-size: 12px; }
  .home-masthead .masthead-actions { display: contents; }
  .home-masthead .mobile-call { grid-area: 1 / 1; }
  .home-masthead .mobile-menu { grid-area: 1 / 3; }
  .home-masthead .mobile-menu nav {
    position: absolute;
    top: 100%;
    z-index: 1;
    right: 14px;
  }
  .page-home .home-masthead[data-mode="browse"] {
    --logo-width: 94px;
  }
  .home-masthead[data-mode="browse"] .masthead-brand {
    grid-column: 2;
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-masthead .masthead-surface { transition: none; }
}
