/* A continuous riwaq fills the opening frame; its pavilion rises beside the copy. */
.hero-elevation {
  --elevation-stone: color-mix(in srgb, var(--sand) 25%, var(--ivory));
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-block-size: 620px;
  block-size: calc(100svh - 80px);
  background: var(--forest);
  color: var(--ivory);
}

.hero-elevation .elevation-content {
  position: relative;
  z-index: 2;
  /* Keep text rasterization stable when the animated architecture releases its layers. */
  transform: translateZ(0);
  flex: none;
  padding-block: 28px;
}

.hero-elevation .hero-title {
  margin: 0 0 0 -.035em;
  max-inline-size: none;
  font-family: var(--display);
  font-size: min(16.2vw, 30svh, 302px);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.057em;
  font-kerning: normal;
  white-space: nowrap;
  text-wrap: nowrap;
}

.hero-elevation .elevation-copy {
  margin-block-start: 24px;
  max-inline-size: 470px;
}

.hero-elevation .hero-description {
  max-inline-size: 41ch;
  font-size: 18px;
  line-height: 1.55;
}

.hero-elevation .elevation-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-block-start: 20px;
}

.hero-elevation .button {
  gap: 30px;
  min-block-size: 56px;
  padding-inline: 22px;
  background: var(--sand);
  color: var(--forest);
}

.hero-elevation .elevation-work-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.hero-elevation .elevation-drawing {
  position: relative;
  z-index: 0;
  flex: 1;
  min-block-size: 160px;
  inline-size: 100%;
  margin: 0;
  pointer-events: none;
  direction: ltr;
}

.hero-elevation .elevation-front {
  display: flex;
  justify-content: center;
  block-size: 100%;
  overflow: hidden;
  background: var(--elevation-stone);
}

.hero-elevation .elevation-facade {
  display: block;
  flex: none;
  inline-size: auto;
  block-size: 100%;
  max-inline-size: none;
}

.hero-elevation .elevation-pavilion {
  position: absolute;
  right: var(--gutter);
  bottom: calc(100% - 2px);
  display: block;
  inline-size: auto;
  block-size: min(21svh, 180px);
  /* The moving pavilion remains behind its fixed roofline connection. */
  overflow: hidden;
}

.hero-elevation .elevation-pavilion-tall { display: none; }

[dir=rtl] .hero-elevation .hero-title {
  margin-inline-start: -.015em;
  margin-inline-end: 0;
  font-size: min(17.9vw, 27svh, 332px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: 0;
}

[dir=rtl] .hero-elevation .elevation-copy { margin-block-start: 14px; }
[dir=rtl] .hero-elevation .elevation-pavilion-low { display: none; }
[dir=rtl] .hero-elevation .elevation-pavilion-tall {
  display: block;
  right: auto;
  left: var(--gutter);
  inline-size: clamp(260px, calc(100vw - 2 * var(--gutter) - min(17.9vw, 27svh, 332px) * 4.7 - 24px), 680px);
  block-size: auto;
  transform: scaleX(-1);
}

@media (min-width: 1600px) {
  .hero-elevation .elevation-copy { max-inline-size: 520px; }
  .hero-elevation .hero-description { font-size: 20px; }
}

@media (max-width: 1000px) and (min-width: 641px) {
  .hero-elevation { block-size: calc(100svh - 88px); }
  .hero-elevation .elevation-copy { max-inline-size: 430px; }
  .hero-elevation .elevation-front {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    block-size: min(100%, 400px);
  }
  .hero-elevation .elevation-pavilion { bottom: calc(min(100%, 400px) - 2px); }
  .hero-elevation .elevation-pavilion-low {
    inline-size: clamp(100px, calc(100vw - 490px), 400px);
    block-size: auto;
  }
}

@media (max-width: 1000px) and (min-width: 641px) and (min-height: 950px) {
  .hero-elevation .elevation-pavilion-low { inline-size: min(calc(100% - 2 * var(--gutter)), 600px); }
  [dir=rtl] .hero-elevation .elevation-pavilion-tall { inline-size: 440px; }
}

@media (max-width: 640px) {
  .hero-elevation {
    display: flex;
    flex-direction: column;
    block-size: calc(100svh - 80px);
    min-block-size: 560px;
  }
  .hero-elevation .elevation-content { flex: none; padding-block: 20px 24px; }
  .hero-elevation .hero-title {
    margin-inline-start: -.04em;
    font-size: 22.4vw;
    line-height: .9;
    letter-spacing: -.055em;
    white-space: normal;
  }
  .hero-elevation .elevation-name-first,
  .hero-elevation .elevation-name-last { display: block; }
  .hero-elevation .elevation-copy {
    max-inline-size: 100%;
    margin-block-start: 18px;
  }
  .hero-elevation .hero-description {
    max-inline-size: 33ch;
    font-size: 18px;
    line-height: 1.5;
  }
  .hero-elevation .elevation-actions {
    gap: 16px;
    margin-block-start: 16px;
  }
  .hero-elevation .button {
    min-block-size: 54px;
    gap: 24px;
    padding-inline: 20px;
  }
  .hero-elevation .elevation-work-link { font-size: 15px; }
  /* The phone gives the complete portico its own row beneath the content. */
  .hero-elevation .elevation-pavilion,
  [dir=rtl] .hero-elevation .elevation-pavilion-tall { display: none; }
  [dir=rtl] .hero-elevation .elevation-content { padding-block-start: 18px; }
  [dir=rtl] .hero-elevation .hero-title {
    font-size: 22.6vw;
    line-height: 1.09;
    font-weight: 500;
  }
  [dir=rtl] .hero-elevation .elevation-copy { margin-block-start: 14px; }
}

@media (max-width: 370px) {
  .hero-elevation .hero-description { font-size: 16px; }
  .hero-elevation .elevation-actions { gap: 12px; }
  .hero-elevation .button { font-size: 14px; min-block-size: 50px; padding-inline: 12px; gap: 10px; }
  .hero-elevation .elevation-work-link { font-size: 14px; }
  .hero-elevation .elevation-content { padding-block-end: 18px; }
}

@media (hover: hover) and (pointer: fine) {
  .hero-elevation .elevation-work-link:hover { text-decoration-thickness: 2px; }
}

/* Static geometry is the fallback. hero-elevation.js adds one interruptible entrance. */
