/* Feature page heroes: the real operator app (AppShell and page) in a window,
   with short excerpts of real records beside it, choreographed by feature-hero.js. */

.fh { position: relative; isolation: isolate; overflow-x: clip; padding: clamp(48px, 6.4vw, 88px) 0 clamp(72px, 9vw, 120px); text-align: center; }
.fh .hero-glow { top: 330px; height: 760px; width: min(1400px, 130vw); opacity: .85; }
.fh .fp-crumbs { justify-content: center; }
.fh h1 { max-width: 860px; margin: 20px auto 0; }
.fh .lead { max-width: 620px; margin: 22px auto 0; }
.fh .hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Stage and window */
.fh-stage { position: relative; margin: clamp(56px, 7vw, 88px) auto 0; max-width: 1180px; text-align: left; }
.fh-window {
  position: relative; overflow: hidden;
  border: 1px solid rgb(4 19 25 / .09); border-radius: 16px; background: var(--a-surface);
  box-shadow: 0 1px 2px rgb(4 19 25 / .04), 0 30px 80px -30px rgb(6 27 58 / .35), 0 12px 32px -18px rgb(4 19 25 / .18);
}
/* Whole-app scenes are drawn on a 1280×800 canvas and scaled to the window; phones get the app's own phone layout. */
.fh-window--app > [data-ui-scene] { display: block; }

/* Tenant portal: the portal page in a browser window */
.fh-window .dash.fh-portal { position: relative; width: 100%; height: 760px; grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr); }
.fh-portal .dash-main { min-height: 0; padding: 0; display: flex; flex-direction: column; min-width: 0; }
.fh-scene { position: relative; flex: 1; min-height: 0; }
.fh-scene > [data-ui-scene] { position: absolute; inset: 0; display: block; }
.fh-scene .scene-fallback { min-height: 100%; }
.no-js .fh-window .scaled > .scaled-inner { position: static; }
.no-js .fh-window .dash.fh-portal { height: auto; display: block; }
.no-js .fh-portal .fh-browser { min-height: 44px; }
.no-js .fh-scene > [data-ui-scene] { position: static; }
.no-js .fh-scene .scene-fallback { min-height: 240px; }
.fh-window:has(.fh-portal)::after { content: ""; position: absolute; inset: auto 0 0; height: 32px; background: linear-gradient(to bottom, transparent, var(--a-canvas)); pointer-events: none; }
.fh-browser { display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--a-line2); background: var(--a-soft); }
.fh-dots { display: flex; gap: 6px; }
.fh-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--a-strong); }
.fh-url { margin: 0 auto; width: min(420px, 50%); height: 26px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 7px; background: var(--a-surface); color: var(--a-muted); font: 12px var(--a-sans); }

/* Record excerpts beside the window. They settle in once and drift gently while visible. */
.fh-float {
  position: absolute; z-index: 3; overflow: hidden; width: 300px;
  border: 1px solid rgb(4 19 25 / .1); border-radius: 14px; background: var(--a-surface);
  box-shadow: 0 2px 4px rgb(4 19 25 / .05), 0 28px 60px -22px rgb(6 27 58 / .38);
  opacity: 0; transform: translateY(18px) scale(.965); transform-origin: var(--origin, 50% 100%);
  transition: opacity .45s var(--ease), transform .7s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.fh-float.is-shown { opacity: 1; transform: none; }
.fh-float.is-leaving { opacity: 0; transform: translateY(8px) scale(.985); transition-duration: .35s, .35s; transition-timing-function: ease, ease; }
.fh-float [data-ui-scene] { display: block; border-radius: 0; }
.no-js .fh-float, .fh-stage:not([data-hero-ready]) .fh-float { opacity: 1; transform: none; }
@keyframes fh-drift { to { translate: 0 -6px; } }

.fh-stage--details { max-width: 1080px; }
.fh-float--detail-left { left: -150px; bottom: 36px; --origin: 0 100%; }
.fh-float--detail-right { right: -150px; top: -48px; width: 280px; --origin: 100% 0; }
.fh-stage--details .fh-float.is-shown { animation: fh-drift 7s ease-in-out 1s infinite alternate; animation-play-state: paused; }
.fh-stage--details .fh-float--detail-right.is-shown { animation-duration: 8.5s; animation-delay: 1.8s; }
.fh-stage--details[data-hero-visible="true"] .fh-float.is-shown { animation-play-state: running; }

/* Messaging: panels sit over the operator sidebar and the empty corner above the conversation. */
.fh-stage--messaging { max-width: 1080px; }
.fh-float--msg-left { left: -150px; top: 236px; width: 320px; --origin: 0 50%; }
.fh-float--msg-right { right: -150px; top: -58px; width: 280px; --origin: 100% 0; }
.fh-stage--messaging .fh-float.is-shown { animation: fh-drift 7s ease-in-out 1s infinite alternate; animation-play-state: paused; }
.fh-stage--messaging .fh-float--msg-right.is-shown { animation-duration: 8.5s; animation-delay: 1.8s; }
.fh-stage--messaging[data-hero-visible="true"] .fh-float.is-shown { animation-play-state: running; }

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .fh-float--detail-left, .fh-float--msg-left { left: max(-84px, calc((1080px - 100vw) / 2 + 20px)); width: 266px; }
  .fh-float--detail-right, .fh-float--msg-right { right: max(-84px, calc((1080px - 100vw) / 2 + 20px)); width: 240px; top: -40px; }
}
/* Below desktop the excerpts sit under the window instead of over it. */
@media (max-width: 1199.98px) {
  .fh-stage--details, .fh-stage--messaging { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .fh-stage--details .fh-window, .fh-stage--messaging .fh-window { grid-column: 1 / -1; }
  .fh-stage--details .fh-float, .fh-stage--messaging .fh-float { position: relative; inset: auto; display: block; width: min(100%, 440px); justify-self: center; text-align: left; }
}
@media (max-width: 809.98px) {
  .fh .hero-actions { flex-direction: column; align-items: stretch; }
  .fh-window { border-radius: 12px; }
}
@media (max-width: 639.98px) {
  .fh-stage--details, .fh-stage--messaging { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* Stage cursor */
.fh-cursor { position: absolute; z-index: 10; left: 0; top: 0; width: 22px; height: 26px; opacity: 0; pointer-events: none; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .25)); transition: translate .95s cubic-bezier(.65, 0, .25, 1), opacity .3s; }
.fh-cursor.is-shown { opacity: 1; }
.fh-cursor svg { display: block; width: 100%; height: 100%; }
.fh-cursor.is-pressing svg { scale: .88; transition: scale .12s; }
.fh-tap { position: absolute; z-index: 9; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgb(6 27 58 / .18); opacity: 0; pointer-events: none; }
.fh-tap.is-on { animation: fh-tap .6s ease-out; }
@keyframes fh-tap { from { opacity: 1; scale: .3; } to { opacity: 0; scale: 1.5; } }

/* Caption: what the stage is showing right now */
.fh-caption { margin: 28px auto 0; max-width: 620px; min-height: 24px; text-align: center; color: var(--text); font-size: 15px; }
.fh-caption b { color: var(--ink); font-weight: 500; }
.fh-caption span { display: inline-block; transition: opacity .3s, translate .4s var(--ease); }
.fh-caption.is-changing span { opacity: 0; translate: 0 6px; }

@media (prefers-reduced-motion: reduce) {
  .fh-float, .fh-caption span { transition: none; }
  .fh-float.is-shown { animation: none !important; }
  .fh-cursor, .fh-tap { display: none; }
}

/* In-page showcases: real UI at its natural size in a window on a dotted stage */
.product-film { overflow: hidden; padding: clamp(18px, 3.2vw, 48px); border-radius: 20px; background-color: var(--gray); background-image: radial-gradient(rgb(4 19 25 / .07) 1px, transparent 1.2px); background-size: 18px 18px; }
.product-film::before {
  content: ""; position: absolute; z-index: -1; inset: auto -10% -40% -10%; height: 70%;
  background: radial-gradient(45% 55% at 50% 100%, oklch(56% 0.18 260 / .14), transparent 72%);
  pointer-events: none;
}
.product-film [data-ui-scene] { margin-inline: auto; max-width: var(--scene-width, 100%); }
.film-window {
  position: relative; overflow: hidden; width: 100%; margin-inline: auto; max-width: var(--scene-width, 100%); max-height: 600px;
  border: 1px solid rgb(4 19 25 / .09); border-radius: 14px; background: var(--a-canvas);
  box-shadow: 0 1px 2px rgb(4 19 25 / .04), 0 24px 60px -28px rgb(6 27 58 / .32);
}
.film-window::after { content: ""; position: absolute; inset: auto 0 0; height: 40px; background: linear-gradient(to bottom, transparent, var(--a-canvas)); pointer-events: none; }
.film-bar { height: 38px; padding: 0 14px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--a-line2); background: var(--a-surface); }
.film-bar-title { color: var(--a-muted); font: 500 12px var(--a-sans); }
.product-film .film-window [data-ui-scene] { border: 0; border-radius: 0; box-shadow: none; max-width: none; margin: 0; }
.product-film figcaption { padding-top: 22px; }
/* The letter composer is cropped to the recipient, letter, and preview. */
.film-window:has([data-ui-scene="mail"]) { max-height: 520px; }
/* The Send text dialog is shown whole, through its Save buttons. */
.film-window:has([data-ui-scene="consent-dialog"]) { max-height: none; }
.film-window:has([data-ui-scene="consent-dialog"])::after { display: none; }

/* Wide showcases: caption beside the window */
@media (min-width: 1200px) {
  .fp-tour-wide .product-film { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: center; gap: clamp(32px, 4vw, 64px); }
  .fp-tour-wide .product-film figcaption { order: -1; padding: 0; max-width: 360px; font-size: 16px; line-height: 1.6; }
  .fp-tour-wide .product-film .film-topic { margin-bottom: 10px; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; }
}
/* Flipped splits keep the product window in the wider column */
@media (min-width: 1200px) { .fp-tour-split.is-flipped { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
@media (max-width: 1199.98px) {
  .product-film { max-width: min(800px, calc(var(--scene-width, 736px) + 2 * clamp(18px, 3.2vw, 48px))); }
  .product-film [data-ui-scene], .film-window { margin-inline: 0; }
}
