/* HERO: hero-door. Message and call to action on the left, an arched doorway
   on the right whose door swings open once on load, letting warm light out.
   The page's standout. Text and door fit the first screen (door height comes
   from --door-h). Under reduced motion the door is simply shown open. Also holds the shared
   device frames (.device-phone, .device-laptop) and .btn--whatsapp. */

/* ---- Shared: WhatsApp button ---------------------------------------------- */
.btn--whatsapp {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-contrast);
  padding-inline: var(--space-m) var(--space-l);
}

.btn--whatsapp::before {
  content: "";
  flex: none;
  inline-size: 1.3em;
  block-size: 1.3em;
  background: currentColor;
  mask: url("../assets/icons/whatsapp.svg") center / contain no-repeat;
}

/* Brass version for dark bands */
.btn--brass {
  background: var(--color-brass);
  border-color: var(--color-brass);
  color: var(--color-brass-contrast);
}

.btn--brass:hover {
  background: var(--color-brass-hover);
  border-color: var(--color-brass-hover);
  color: var(--color-brass-contrast);
}

.btn--lg {
  min-height: 3.25rem;
  font-size: var(--step-1);
}

/* ---- Shared: device frames ------------------------------------------------- */
.device-phone {
  margin: 0;
  padding: 0.45rem;
  background: var(--color-device);
  border-radius: var(--radius-device);
  box-shadow: var(--shadow-lg);
}

.device-phone img {
  inline-size: 100%;
  aspect-ratio: 390 / 844;
  object-fit: cover;
  object-position: top;
  border-radius: calc(var(--radius-device) - 0.45rem);
}

.device-laptop {
  margin: 0;
}

.device-laptop__screen {
  padding: 0.5rem 0.5rem 0.6rem;
  background: var(--color-device);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  box-shadow: var(--shadow-md);
}

.device-laptop__screen img {
  inline-size: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}

.device-laptop::after {
  /* the keyboard base */
  content: "";
  display: block;
  block-size: 0.6rem;
  margin-inline: -6%;
  background: linear-gradient(var(--color-line), var(--color-text-muted));
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

/* ---- Hero layout ----------------------------------------------------------- */
/* Text and door share the first screen: the door is sized by screen height
   (--door-h), never by column width, so it can't push the CTA below the fold. */
.hero-door {
  --door-h: min(40svh, 20rem); /* phones and tablets: a smaller door under the text */
  padding-block: var(--space-xl) var(--section-pad-y);
  overflow: clip;
}

.hero-door__grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.hero-door__text {
  display: grid;
  gap: var(--space-m);
  justify-items: start;
}

.hero-door h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.6vw, 5.2rem);
  line-height: 1.02;
  max-width: 13ch;
}

/* Sub-line under the headline: plain body type, easy to read */
.hero-door__lead {
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
  max-width: 44ch;
}

.hero-door__actions {
  --cluster-gap: var(--space-s) var(--space-l);
}

.hero-door__note {
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

/* ---- The doorway: stone arch, steps, warm light, 3D door leaf ----------------
   Inline SVG in index.html. The door rests open (what reduced-motion users see);
   with motion allowed it swings open once on load. */
.hero-door__doorway {
  justify-self: center;
}

.hero-door__stage {
  position: relative;
  block-size: var(--door-h);
  aspect-ratio: 400 / 520;
  max-inline-size: 100%;
  perspective: 1300px;
  filter: drop-shadow(0 18px 22px rgb(25 53 43 / 0.25));
}

.hero-door__stage > svg {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
}

.hero-door__leaf {
  transform-origin: 26% 50%;
  transform: rotateY(74deg);
}

.hero-door__shade {
  opacity: 0.55;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-door__leaf {
    animation: door-open var(--dur-standout) var(--ease-door) 450ms both;
  }
  .hero-door__shade {
    animation: door-shade var(--dur-standout) var(--ease-door) 450ms both;
  }
  .hero-door__inside {
    animation: door-light 1400ms ease-out 700ms both;
  }
  .hero-door__handle {
    transform-origin: 291px 327px;
    animation: door-handle 500ms ease-in-out 150ms both;
  }
}

@keyframes door-open {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(74deg); }
}
@keyframes door-shade {
  from { opacity: 0; }
  to { opacity: 0.55; }
}
@keyframes door-light {
  from { opacity: 0.1; }
  to { opacity: 1; }
}
@keyframes door-handle {
  0%, 100% { transform: rotate(0); }
  40% { transform: rotate(14deg); }
}

@media (min-width: 56em) {
  /* Two columns that fill the first screen: message left, door right, both
     centred vertically. 4.25rem is the header height. */
  .hero-door {
    --door-h: min(70svh - 6rem, 36rem);
    display: grid;
    align-items: center;
    min-block-size: calc(100svh - 4.25rem);
    padding-block: var(--space-l);
  }

  .hero-door__grid {
    grid-template-columns: 7fr 5fr;
    gap: var(--space-3xl);
  }
}
