/* Home only: one viewport for the header, introduction and mobile contacts.
   Keep natural content height as a fallback for text zoom and tiny viewports. */
.page-home {
  --home-header-height: 119px;
  --home-contact-height: 0px;
  --home-viewport: 100vh;
  --home-gap: clamp(12px, 2vh, 24px);
}

@supports (height: 100dvh) {
  .page-home { --home-viewport: 100dvh; }
}

body.page-home .home-hero {
  box-sizing: border-box;
  display: flex;
  min-height: calc(var(--home-viewport) - var(--home-header-height) - var(--home-contact-height)) !important;
  padding: var(--home-gap) clamp(12px, 3vw, 64px);
}

.home-hero__surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  flex: 1;
  width: 100%;
  min-width: 0;
  background: var(--atelier-paper);
  border-radius: clamp(16px, 2vw, 28px);
  box-shadow: 0 20px 60px rgba(45, 27, 24, .1);
}

.home-hero__media {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 0 clamp(16px, 2vw, 28px) clamp(16px, 2vw, 28px) 0;
}

.home-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.home-hero__copy {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  gap: clamp(10px, 2vh, 22px);
  padding: clamp(20px, 4vh, 52px) clamp(22px, 3.5vw, 72px);
  text-align: left;
  background: radial-gradient(circle at 0 0, rgba(231, 184, 70, .12), transparent 55%);
  border-radius: inherit;
}

.page-home .home-hero__copy h6,
.page-home .home-hero__copy h1,
.page-home .home-hero__copy h2,
.page-home .home-hero__copy .atelier-hero-description,
.page-home .home-hero__copy .atelier-hero-actions {
  width: 100%;
  max-width: 680px;
  margin: 0 !important;
}

.home-hero__copy h6 {
  color: var(--atelier-raspberry);
  font-family: var(--atelier-sans);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .15em;
}

.home-hero__copy h1 {
  color: var(--atelier-espresso);
  font-size: clamp(38px, min(5.7vw, 9vh), 100px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.035em;
  overflow-wrap: normal;
  text-wrap: balance;
}

.home-hero__copy h2 {
  color: var(--atelier-raspberry);
  font-family: var(--atelier-sans);
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.home-hero__copy .atelier-hero-description {
  color: var(--atelier-cocoa);
  font-family: var(--atelier-sans);
  font-size: clamp(14px, min(1.25vw, 2.25vh), 20px);
  font-style: normal;
  line-height: 1.55;
}

.page-home .home-hero__copy .atelier-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-hero__copy .atelier-action {
  min-height: 46px;
  padding: 12px 16px;
  font-size: 11px;
}

@media (max-width: 991.98px) {
  .page-home {
    --home-header-height: 85px;
    --home-gap: 12px;
    --home-contact-height: calc(62px + env(safe-area-inset-bottom));
  }

  .home-hero__copy {
    gap: clamp(8px, 1.6vh, 16px);
    padding: clamp(16px, 2.5vh, 28px) clamp(18px, 3vw, 32px);
  }

  .home-hero__copy h1 { font-size: clamp(30px, min(5.5vw, 7vh), 62px); }
  .home-hero__copy .atelier-hero-description { font-size: clamp(13px, min(1.8vw, 2.5vh), 17px); }
  .page-home .home-hero__copy .atelier-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 767px) {
  .page-home {
    --home-contact-height: max(64px, calc(62px + env(safe-area-inset-bottom)));
  }
}

@media (max-width: 767.98px) and (orientation: portrait),
       (min-width: 768px) and (max-width: 991.98px) and (min-height: 900px) {
  .home-hero__surface {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .home-hero__media {
    grid-column: 1;
    min-height: max(0px, min(30vh, calc(var(--home-viewport) - 650px)));
    border-radius: clamp(16px, 2vw, 28px) clamp(16px, 2vw, 28px) 0 0;
  }

  .home-hero__copy { grid-row: 2; }
  .home-hero__copy h1 { font-size: clamp(30px, 8.8vw, 64px); }
  .home-hero__copy .atelier-hero-description { font-size: clamp(13px, 3.6vw, 17px); }
}

@media (max-width: 767.98px) and (max-height: 700px) and (orientation: portrait) {
  .page-home { --home-gap: 8px; }
  .home-hero__copy { gap: 8px; padding: 14px 16px; }
  .home-hero__copy h1 { font-size: clamp(28px, 8vw, 42px); }
  .home-hero__copy h6 { font-size: 10px; }
  .home-hero__copy h2 { font-size: 10px; }
  .home-hero__copy .atelier-hero-description { font-size: 13px; line-height: 1.4; }
  .home-hero__copy .atelier-action { min-height: 44px; padding: 10px 8px; font-size: 10px; }
}

@media (max-height: 540px) and (orientation: landscape) {
  .page-home { --home-gap: 8px; }
  .home-hero__surface { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .home-hero__copy { gap: 6px; padding: 12px 18px; }
  .home-hero__copy h6 { font-size: 10px; }
  .home-hero__copy h1 { font-size: clamp(24px, 3.7vw, 40px); line-height: 1; }
  .home-hero__copy h2 { font-size: 10px; }
  .home-hero__copy .atelier-hero-description { font-size: 12px; line-height: 1.35; }
  .home-hero__copy .atelier-action { min-height: 44px; padding: 8px; font-size: 10px; }
  .home-hero__copy h6::before { display: none; }
}

/* A phone held sideways needs compact chrome as well as compact content. */
@media (max-width: 991.98px) and (max-height: 540px) {
  .page-home {
    --home-header-height: 57px;
    --home-contact-height: calc(45px + env(safe-area-inset-bottom));
  }

  .page-home .rd-navbar-inner,
  .page-home .rd-navbar-panel { min-height: 56px !important; }
  .page-home .rd-navbar-brand { height: 50px !important; }
  .page-home .rd-navbar-brand img { max-height: 46px !important; }
  .page-home .rd-navbar-nav-wrap {
    top: 57px !important;
    height: calc(100vh - 57px) !important;
    height: calc(100dvh - 57px) !important;
  }

  .page-home .mobile-quick-actions {
    height: auto;
    min-height: calc(44px + env(safe-area-inset-bottom));
  }

  .page-home .mobile-quick-actions a {
    min-height: 44px;
    flex-direction: row;
    gap: 8px;
  }

}

@media (max-width: 991.98px) and (max-height: 540px) and (orientation: landscape) {
  .home-hero__surface { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); }
}

/* Give translated copy more width before the compact-height rules take over. */
@media (max-width: 991.98px) and (min-height: 540.01px) and (max-height: 640px) and (orientation: landscape) {
  .home-hero__surface { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

@media (max-height: 360px) and (orientation: landscape) {
  .page-home { --home-gap: 6px; }
  .home-hero__copy { gap: 4px; padding-block: 8px; }
  .home-hero__copy .atelier-hero-description { line-height: 1.3; }
}

@media (max-width: 600px) and (max-height: 360px) and (orientation: landscape) {
  .home-hero__surface { grid-template-columns: minmax(0, 4fr) minmax(0, 1fr); }
  .home-hero__copy { padding-inline: 12px; }
}
