/* Smile4U · „Näher" · block 02, the first screen, round 2 (Fable 2026-11-17, docs/HOME-NEXT.md „Hero and index, round 2").
   David: "review the hero … there is weirdly much free space, maybe the motion or ui or layout can be enhanced or
   rethought". Measured at 1920 × 1080: the left column under the buttons, 777 × 621 px (23 % of the window), held one
   tilted card.
   Concept: the first screen is already the room. Under the one-line H1 one row of copy (what he does on the left,
   how to reach him on the right), then one wide picture of the treatment room to the fold. The three facts a caller
   needs stand on its bare right wall as one column of plates: the address, open today, the rating. Scroll lets the
   picture take the window. The left foot stays free: the privacy note lands there on a first visit.
   v8's 02-hero.css stays loaded; everything here is scoped to .hero.hx (set by _tools/v8_next/hero.py).
   Static (no JS, reduced motion): the copy row, then the full photo with the three plates landed. */

/* ---- ≥ 810: the copy row and the plates' places ---- */
@media (min-width: 810px) {
  .hero.hx .hero-text { display: contents; }                 /* lede and buttons become two cells of the row */
  .hero.hx .hero-lede {
    grid-column: 1 / 8; margin-top: 0; max-width: none;
    font-size: var(--fs-h5); line-height: 1.4; letter-spacing: var(--ls-h5);
  }
  .hero.hx .hero-ctas { grid-column: 8 / 13; align-self: end; justify-content: flex-end; margin-top: 0; }

  /* the plates: one column on the picture's right wall, 24 px inside the frame, one width, 8 px apart */
  .hero.hx .hero-cards {
    left: auto; right: calc(var(--side) + 24px); bottom: 48px;
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .hero.hx .hero-veil { display: none; }                     /* nothing is veiled: the plates stand flat on the picture */
  .hero.hx .hero-ride {
    order: -1; position: relative; right: auto; bottom: auto; z-index: auto; max-width: none;
    padding: 16px 36px; text-align: left;                    /* the cards' own side padding: one text edge down the column */
  }
}
@media (min-width: 1200px) and (max-width: 1599.98px) {
  /* a shorter window: the column a little tighter, so it stays under two thirds of the picture's height */
  .hero.hx .hero-card .card { padding: 20px 28px; }
  .hero.hx .hero-ride { padding: 14px 28px; }
}
@media (min-width: 810px) and (max-width: 1199.98px) {
  .hero.hx .hero-lede { font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: 0; }
  .hero.hx .hero-cards { right: calc(var(--side) + 16px); bottom: 40px; width: 272px; }
  .hero.hx .hero-card .card { min-width: 0; padding: 14px 20px; }
  .hero.hx .hero-card .card-status { font-size: var(--fs-body); }
  .hero.hx .hero-card .card-figure { font-size: var(--fs-h3); }
  .hero.hx .hero-card .card-source { margin-top: 4px; }
  .hero.hx .hero-ride { padding: 10px 20px; }
}

/* ---- ≥ 810, live: the wide frame from under the copy row to the fold ---- */
@media (min-width: 810px) {
  html.js:not(.rm) .hero.hx .hero-row { grid-template-rows: auto minmax(0, 1fr); row-gap: 28px; }
  html.js:not(.rm) .hero.hx .hero-slot { grid-column: 1 / -1; grid-row: 2; height: auto; min-height: 240px; }
}

/* ---- phones: the bar under the thumb carries both actions, so the copy keeps only the number; address before it ---- */
@media (max-width: 809.98px) {
  .hero.hx .hero-ctas .btn { display: none; }
  .hero.hx .hero-addr { order: 4; margin-top: 20px; }
  .hero.hx .hero-ctas, html.js:not(.rm) .hero.hx .hero-ctas { order: 5; margin-top: 4px; }
}

/* ---- load: the frame opens from its middle line ----
   purpose: Fahrt, the room opens as the page does (with the first-view sheet and without it). The picture's own box
   is clipped from a line at the frame's middle to the frame's height and settles 4 % in scale; clip and transform
   only, once, 1.1 s; when it has run the clip is gone and the scroll owns the frame (02-hero-next.js).
   --hx-t / --hx-b / --hx-h: the frame's top, the space under it and its height in the stage, measured in layout passes. */
html.js:not(.rm) .hero.hx .hero-photo > picture { position: absolute; inset: 0; display: block; }
html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-frame { opacity: 1; transition: opacity .3s var(--ease-ui) .2s; }
html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-photo > picture {
  transform-origin: 50% calc(var(--hx-t, 0px) + var(--hx-h, 100%) * .5);
  animation: hx-open 1.1s var(--ease-scroll) .2s backwards;
}
@keyframes hx-open {
  from {
    clip-path: inset(calc(var(--hx-t, 0px) + var(--hx-h, 100%) * .5) 0 calc(var(--hx-b, 0px) + var(--hx-h, 100%) * .5) 0);
    transform: scale(1.04);
  }
  to { clip-path: inset(var(--hx-t, 0px) 0 var(--hx-b, 0px) 0); transform: scale(1); }
}
/* the glass rim waits until the frame stands (its own opacity is the scroll's; this only holds it back at load) */
html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-rim { animation: hx-rim 1.5s linear backwards; }
@keyframes hx-rim { from, 80% { opacity: 0; } }
/* the plates land on the open picture, bottom one first (the liked landing, played once as the page shows; the row
   itself only stops hiding them). purpose: the facts come to rest where they belong. Transform and opacity only. */
@media (min-width: 810px) {
  html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-cards { transition: opacity .01s linear .9s; }
  html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-ride { transition: none; }
  html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-card,
  html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-ride { animation: hx-land .9s var(--spring-enter) backwards; }
  html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-card[data-pose="google"] { animation-delay: .9s; --hx-tilt: 1.6deg; }
  html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-card[data-pose="hours"] { animation-delay: 1.02s; --hx-tilt: -1.6deg; }
  html.motion:not(.rm).is-loaded .hero.hx.is-ready .hero-ride { animation-delay: 1.14s; --hx-tilt: 1.2deg; }
}
@keyframes hx-land {
  from { opacity: 0; transform: perspective(1200px) translate3d(0, -22px, 0) rotate(var(--hx-tilt, 0deg)) rotateX(5deg); }
  30% { opacity: 1; }
  to { opacity: 1; transform: perspective(1200px) translate3d(0, 0, 0) rotate(0deg) rotateX(0deg); }
}
@media (max-width: 809.98px) {
  /* phones keep v8's card rule (the row fades up once the frame has opened under the thumb) */
  html.js:not(.rm) .hero.hx .hero-cards { transition: opacity .2s var(--ease-ui), transform .2s var(--ease-ui); }
  html.js:not(.rm) .hero.hx.is-cards .hero-cards { transition: opacity .5s var(--ease-ui), transform .5s var(--ease-ui); }
}

/* ---- if this block's script never runs, the picture and its plates still show (6 s) ---- */
html.js:not(.rm) .hero.hx:not(.is-ready) .hero-photo { animation: hx-safe-clip 0s 6s forwards; }
html.motion:not(.rm) .hero.hx:not(.is-ready) .hero-frame,
html.motion:not(.rm) .hero.hx:not(.is-ready) .hero-cards,
html.motion:not(.rm) .hero.hx:not(.is-ready) .hero-ride { animation: hx-safe 0s 6s forwards; }
@keyframes hx-safe { to { opacity: 1; } }
@keyframes hx-safe-clip { to { clip-path: none; } }
