/* ============================================================
   Oraoki — marketing hero animation ("Manage more, stress less")
   Self-contained, token-driven styles for the orchestrated hero:
   CSS-3D phone -> app screens -> mark room clean -> desktop reveal
   -> desktop browser sync. Paired with hero-scene.js.

   Scoping prefix: .hpx-  (hero phone experience)
   All colors reference Koto tokens (tokens.css). No hex literals.
   Motion is GPU-only (transform / opacity / filter / clip-path).
   ============================================================ */

/* ── Stage ────────────────────────────────────────────────── */
.mkt-hero-stage {
  --ph-w: clamp(206px, 21vw, 244px);
  --ph-h: calc(var(--ph-w) * 2.07);
  --ph-d: 16px;
  --ph-radius: calc(var(--ph-w) * 0.16);
  --dt-w: min(460px, 82vw);
  --dt-x: 18%;
  --dt-y: -10%;
  --pc-screen-top: 8.9%;
  --pc-screen-left: 7.9%;
  --pc-screen-right: 9.9%;
  --pc-screen-bottom: 34.6%;
  position: relative;
  width: 100%;
  min-height: clamp(470px, 56vh, 600px);
  display: grid;
  place-items: center;
  perspective: 1600px;
  perspective-origin: 50% 42%;
  isolation: isolate;
}

.hpx-device-layer {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
}

/* Ambient glow behind the device */
.hpx-ambient {
  position: absolute;
  width: 78%;
  height: 70%;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(60% 55% at 50% 45%, var(--sky-100), transparent 70%),
    radial-gradient(45% 45% at 70% 65%, var(--lilac-100), transparent 72%);
  filter: blur(14px);
  opacity: 0.9;
  z-index: 0;
  pointer-events: none;
}

/* Contact shadow under the phone */
.hpx-contact-shadow {
  position: absolute;
  width: calc(var(--ph-w) * 0.82);
  height: 22px;
  left: 50%;
  bottom: clamp(18px, 6%, 46px);
  transform: translateX(-50%);
  background: radial-gradient(50% 60% at 50% 50%, rgba(42, 70, 86, 0.30), transparent 72%);
  filter: blur(7px);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}
.mkt-hero-stage.is-ready .hpx-contact-shadow { opacity: 1; }

/* ── Phone shell (CSS 3D, 6 faces) ───────────────────────── */
.hpx-phone-wrap {
  position: relative;
  width: var(--ph-w);
  height: var(--ph-h);
  z-index: 2;
  /* No will-change here: opacity/transform are grouping properties that
     would flatten transform-style and break the 3D box + perspective. */
  transform-style: preserve-3d;
}
.mkt-hero-stage.is-ready .hpx-phone-wrap {
  animation: hpx-float 7s ease-in-out 0.2s infinite;
}

.hpx-phone {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(-7deg) rotateX(1.5deg);
}
.mkt-hero-stage.is-entering .hpx-phone {
  animation: hpx-phone-in 1.55s cubic-bezier(0.22, 0.8, 0.24, 1) both;
}
/* Pre-entrance state — transform-only (no opacity, so preserve-3d isn't
   flattened) and matched to the keyframe start for a seamless fly-in.
   Gated on body.js-on so no-JS users keep a settled static phone poster. */
.js-on .mkt-hero-stage .hpx-phone {
  transform: translateZ(-300px) translateY(18px) rotateY(-210deg) rotateX(12deg) scale(0.2);
}
.js-on .mkt-hero-stage.is-static .hpx-phone {
  transform: rotateY(-6deg);
}

.hpx-face {
  position: absolute;
  border-radius: var(--ph-radius);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.hpx-face--front,
.hpx-face--back {
  width: var(--ph-w);
  height: var(--ph-h);
  top: 0;
  left: 0;
}
.hpx-face--front {
  transform: translateZ(calc(var(--ph-d) / 2));
  background: var(--neutral-900);
  box-shadow:
    0 0 0 2px var(--neutral-800),
    var(--shadow-lg);
  padding: 8px;
  overflow: hidden;
}
.hpx-face--back {
  transform: translateZ(calc(var(--ph-d) / -2)) rotateY(180deg);
  background:
    linear-gradient(150deg, var(--neutral-700), var(--neutral-900) 60%, var(--neutral-800));
}
.hpx-face--left,
.hpx-face--right {
  width: var(--ph-d);
  height: calc(var(--ph-h) - 2 * var(--ph-radius));
  top: var(--ph-radius);
  left: calc(50% - var(--ph-d) / 2);
  border-radius: 3px;
  background: linear-gradient(90deg, var(--neutral-900), var(--neutral-600), var(--neutral-900));
}
.hpx-face--right { transform: rotateY(90deg)  translateZ(calc(var(--ph-w) / 2)); }
.hpx-face--left  { transform: rotateY(-90deg) translateZ(calc(var(--ph-w) / 2)); }
.hpx-face--top,
.hpx-face--bottom {
  width: calc(var(--ph-w) - 2 * var(--ph-radius));
  height: var(--ph-d);
  left: var(--ph-radius);
  top: calc(50% - var(--ph-d) / 2);
  border-radius: 3px;
  background: linear-gradient(0deg, var(--neutral-900), var(--neutral-600), var(--neutral-900));
}
.hpx-face--top    { transform: rotateX(90deg)  translateZ(calc(var(--ph-h) / 2)); }
.hpx-face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--ph-h) / 2)); }

/* The display */
.hpx-screen {
  position: absolute;
  inset: 8px;
  border-radius: calc(var(--ph-radius) - 6px);
  overflow: hidden;
  background: var(--neutral-50);
  font-size: calc(var(--ph-w) * 0.0455);
  line-height: 1.3;
  color: var(--fg1);
}

.hpx-notch {
  position: absolute;
  top: calc(var(--ph-w) * 0.05);
  left: 50%;
  transform: translateX(-50%);
  width: 33%;
  height: calc(var(--ph-w) * 0.085);
  background: var(--neutral-900);
  border-radius: var(--radius-pill);
  z-index: 45;
}
.hpx-home-indicator {
  position: absolute;
  bottom: calc(var(--ph-w) * 0.035);
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--neutral-900);
  opacity: 0.32;
  z-index: 45;
}

/* iOS status bar (shared across app screens) */
.hpx-statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--ph-w) * 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5em 0 1.7em;
  font-size: 0.92em;
  font-weight: 700;
  color: var(--fg1);
  z-index: 30;
  pointer-events: none;
}
.hpx-statusbar--dark { color: var(--neutral-0); }
.hpx-sb-right { display: inline-flex; align-items: center; gap: 0.35em; }
.hpx-sb-bars { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 0.8em; }
.hpx-sb-bars i { width: 2px; background: currentColor; border-radius: 1px; }
.hpx-sb-bars i:nth-child(1) { height: 35%; }
.hpx-sb-bars i:nth-child(2) { height: 55%; }
.hpx-sb-bars i:nth-child(3) { height: 78%; }
.hpx-sb-bars i:nth-child(4) { height: 100%; }
.hpx-sb-batt {
  width: 1.5em; height: 0.78em; border-radius: 2px;
  border: 1px solid currentColor; position: relative; padding: 1px;
}
.hpx-sb-batt::after {
  content: ''; position: absolute; right: -2px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 40%; background: currentColor; border-radius: 1px;
}
.hpx-sb-batt span { display: block; height: 100%; width: 72%; background: currentColor; border-radius: 1px; }

/* Screen page system */
.hpx-os {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hpx-layer {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
}

/* ── Home screen ─────────────────────────────────────────── */
.hpx-home {
  background:
    radial-gradient(120% 80% at 20% 0%, var(--sky-200), transparent 55%),
    radial-gradient(120% 90% at 90% 100%, var(--lilac-200), transparent 55%),
    linear-gradient(160deg, var(--sky-300), var(--peri-300) 70%, var(--lilac-300));
  padding: calc(var(--ph-w) * 0.17) 1.4em 1.2em;
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform-origin: 72% 38%;
}
.mkt-hero-stage.is-app .hpx-home { opacity: 0; transform: scale(1.45); }
.hpx-home,
.hpx-app { transition: opacity 0.5s var(--ease-out), transform 0.55s var(--ease-out); }

.hpx-home-clock {
  text-align: center;
  color: var(--neutral-0);
  margin-top: 0.4em;
  text-shadow: 0 1px 8px rgba(42, 70, 86, 0.25);
}
.hpx-home-clock b { display: block; font-size: 3.1em; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.hpx-home-clock span { font-size: 0.95em; font-weight: 600; opacity: 0.92; }

.hpx-home-grid {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1em 0.9em;
  padding-bottom: 0.8em;
}
.hpx-app-icon {
  aspect-ratio: 1;
  border-radius: 28%;
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  color: var(--neutral-0);
  position: relative;
}
.hpx-app-icon i { width: 56%; height: 56%; }
.hpx-app-icon--a { background: linear-gradient(150deg, var(--coral-300), var(--coral-500)); }
.hpx-app-icon--b { background: linear-gradient(150deg, var(--mint-300), var(--mint-700)); }
.hpx-app-icon--c { background: linear-gradient(150deg, var(--butter-300), var(--butter-500)); }
.hpx-app-icon--d { background: linear-gradient(150deg, var(--peri-300), var(--peri-700)); }
.hpx-app-icon--e { background: linear-gradient(150deg, var(--sky-300), var(--sky-600)); }
.hpx-app-icon--f { background: linear-gradient(150deg, var(--lilac-300), var(--lilac-700)); }
.hpx-app-icon--g { background: linear-gradient(150deg, var(--neutral-300), var(--neutral-500)); }
.hpx-app-icon--oraoki {
  background: var(--neutral-0);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(42, 70, 86, 0.28), 0 0 0 1px rgba(255,255,255,0.4);
}
.hpx-app-icon--oraoki img { width: 100%; height: 100%; object-fit: cover; }
.hpx-app-icon__label {
  position: absolute;
  bottom: -1.45em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72em;
  font-weight: 600;
  color: var(--neutral-0);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(42, 70, 86, 0.4);
}
.hpx-home-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9em;
  padding: 0.7em;
  border-radius: 1.6em;
  background: rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Tap-press feedback (applied to icons/buttons/cards) */
.hpx-pressable { transition: transform 0.12s var(--ease-out), filter 0.12s var(--ease-out); }
.hpx-pressable.is-pressed { transform: scale(0.93); filter: brightness(0.96); }

/* ── App shell ───────────────────────────────────────────── */
.hpx-app {
  position: absolute;
  inset: 0;
  background: var(--neutral-50);
  opacity: 0;
  transform: scale(1.06);
  display: flex;
  flex-direction: column;
}
.mkt-hero-stage.is-app .hpx-app { opacity: 1; transform: scale(1); }

.hpx-appview {
  position: absolute;
  inset: 0;
  bottom: calc(var(--ph-w) * 0.2);
  overflow: hidden;
}
.hpx-appview::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.4em;
  background: linear-gradient(to bottom, transparent, var(--neutral-50));
  pointer-events: none;
  z-index: 5;
}
.hpx-page {
  position: absolute;
  inset: 0;
  padding: calc(var(--ph-w) * 0.14) 1.15em 0.4em;
  overflow: hidden;
  transition: transform 0.5s var(--ease-in-out), filter 0.5s var(--ease-in-out), opacity 0.5s var(--ease-in-out);
  background: var(--neutral-50);
  will-change: transform;
}
/* Hero opens straight to Rooms — Schedule markup stays for realism but is never shown. */
.hpx-page--schedule { display: none; }
.hpx-page--rooms { transform: translateX(0); }

/* Page header shared */
.hpx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6em; }
.hpx-head h3 { font-family: var(--font-display); font-size: 1.85em; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.hpx-head p { font-size: 0.82em; color: var(--fg3); margin: 0.15em 0 0; }
.hpx-avatar {
  width: 2.3em; height: 2.3em; border-radius: 50%; flex-shrink: 0;
  background: var(--sky-100); color: var(--sky-700);
  display: grid; place-items: center;
}
.hpx-avatar i { width: 1.1em; height: 1.1em; }

/* Segmented control + date row */
.hpx-segment {
  display: inline-flex;
  background: var(--neutral-200);
  border-radius: var(--radius-pill);
  padding: 0.2em;
  gap: 0.15em;
}
.hpx-segment span {
  font-size: 0.82em; font-weight: 600; color: var(--fg3);
  padding: 0.35em 0.85em; border-radius: var(--radius-pill);
}
.hpx-segment span.is-active { background: var(--neutral-0); color: var(--fg1); box-shadow: var(--shadow-sm); }
.hpx-daterow { display: flex; align-items: center; justify-content: space-between; gap: 0.5em; margin-top: 0.8em; }
.hpx-datenav { display: inline-flex; align-items: center; gap: 0.55em; font-weight: 700; font-size: 0.92em; }
.hpx-datenav i { width: 1em; height: 1em; color: var(--fg3); }
.hpx-livepill {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-size: 0.74em; font-weight: 800; letter-spacing: 0.04em;
  color: var(--mint-700); background: var(--mint-100);
  padding: 0.3em 0.7em; border-radius: var(--radius-pill);
}
.hpx-livedot { width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--mint-500); }
.mkt-hero-stage.is-ready .hpx-livedot { animation: hpx-pulse-dot 2s ease-out infinite; }

/* Schedule groups */
.hpx-sched-scroll { margin-top: 0.85em; display: flex; flex-direction: column; gap: 0.8em; }
.hpx-group { background: var(--neutral-0); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75em; box-shadow: var(--shadow-sm); }
.hpx-group--live { background: var(--mint-50); border-color: var(--mint-200); }
.hpx-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6em; }
.hpx-group-title { font-size: 0.98em; font-weight: 700; }
.hpx-group-time { font-size: 0.76em; color: var(--fg3); margin-top: 0.1em; }
.hpx-group-count { font-size: 0.78em; font-weight: 700; color: var(--fg2); background: var(--neutral-100); border-radius: var(--radius-pill); padding: 0.15em 0.6em; }
.hpx-staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5em; }
.hpx-staff {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.5em 0.55em; background: var(--neutral-0); position: relative; overflow: hidden;
}
.hpx-staff::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--mint-500); }
.hpx-staff--blue::before { background: var(--sky-400); }
.hpx-staff-name { font-size: 0.82em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 0.3em; }
.hpx-staff-row { display: flex; align-items: center; justify-content: space-between; margin-top: 0.35em; padding-left: 0.3em; gap: 0.3em; }
.hpx-chip { font-size: 0.68em; font-weight: 800; padding: 0.2em 0.55em; border-radius: var(--radius-pill); white-space: nowrap; }
.hpx-chip--out { background: var(--coral-100); color: var(--coral-700); }
.hpx-chip--in { background: var(--mint-100); color: var(--mint-700); }
.hpx-chip--done { background: var(--mint-100); color: var(--mint-700); display: inline-flex; align-items: center; gap: 0.2em; }
.hpx-chip--done i { width: 0.85em; height: 0.85em; }
.hpx-staff-time { font-size: 0.7em; color: var(--fg3); font-weight: 600; display: inline-flex; align-items: center; gap: 0.2em; }
.hpx-staff-time i { width: 0.8em; height: 0.8em; }
.hpx-staff-key { font-size: 0.66em; color: var(--sky-700); font-weight: 700; display: inline-flex; align-items: center; gap: 0.15em; }
.hpx-staff-key i { width: 0.75em; height: 0.75em; }

/* ── Rooms page ──────────────────────────────────────────── */
.hpx-rooms-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5em; margin-top: 0.45em; }
.hpx-sum {
  border-radius: var(--radius-md); padding: 0.6em 0.7em; border: 1px solid var(--border);
  background: var(--neutral-0); position: relative; overflow: hidden;
}
.hpx-sum::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.hpx-sum--rooms::before { background: var(--sky-400); }
.hpx-sum--checkouts::before { background: var(--coral-400, var(--coral-500)); }
.hpx-sum-title { font-size: 0.72em; font-weight: 700; color: var(--fg3); display: inline-flex; align-items: center; gap: 0.3em; }
.hpx-sum-title i { width: 0.9em; height: 0.9em; }
.hpx-sum-nums { display: flex; align-items: baseline; gap: 0.7em; margin-top: 0.3em; }
.hpx-sum-num b { font-size: 1.5em; font-weight: 800; line-height: 1; }
.hpx-sum-num span { font-size: 0.66em; color: var(--fg3); font-weight: 700; display: block; }
.hpx-sum--rooms .hpx-sum-num--done b { color: var(--mint-700); }
.hpx-sum--rooms .hpx-sum-num--left b { color: var(--coral-700); }
.hpx-sum--checkouts .hpx-sum-num b { color: var(--coral-700); }

.hpx-levels { display: flex; gap: 0.35em; margin-top: 0.5em; overflow: hidden; }
.hpx-level {
  flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.4em 0.6em; background: var(--neutral-0); text-align: center;
}
.hpx-level.is-active { border-color: var(--sky-500); background: var(--sky-50); box-shadow: var(--focus-ring); }
.hpx-level b { font-size: 0.8em; font-weight: 700; display: block; }
.hpx-level-dots { font-size: 0.64em; font-weight: 700; color: var(--fg3); display: inline-flex; align-items: center; gap: 0.2em; margin-top: 0.15em; }
.hpx-dot { width: 0.45em; height: 0.45em; border-radius: 50%; display: inline-block; }
.hpx-dot--mint { background: var(--mint-500); }
.hpx-dot--coral { background: var(--coral-500); }

.hpx-todo-seg { margin-top: 0.5em; }
.hpx-rooms-list { margin-top: 0.5em; display: flex; flex-direction: column; gap: 0.5em; }

.hpx-room {
  background: var(--neutral-0); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.6em 0.75em 0.6em 0.85em;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.hpx-room::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--butter-500); }
.hpx-room--checkout::before { background: var(--coral-500); }
.hpx-room--clean::before { background: var(--mint-500); }
.hpx-room-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5em; }
.hpx-room-id { display: flex; align-items: center; gap: 0.45em; }
.hpx-room-num { font-size: 1.45em; font-weight: 800; letter-spacing: -0.01em; }
.hpx-room-type { font-size: 0.66em; font-weight: 700; color: var(--fg3); text-transform: uppercase; letter-spacing: 0.02em; }
.hpx-room-badge {
  font-size: 0.68em; font-weight: 800; letter-spacing: 0.03em;
  padding: 0.3em 0.7em; border-radius: var(--radius-pill);
  background: var(--butter-100); color: var(--butter-700);
}
.hpx-room-badge--clean { background: var(--mint-100); color: var(--mint-700); }
.hpx-room-stats { display: flex; align-items: stretch; justify-content: space-between; margin-top: 0.6em; }
.hpx-room-stat { flex: 1; text-align: center; }
.hpx-room-stat + .hpx-room-stat { border-left: 1px solid var(--border); }
.hpx-room-stat small { display: block; font-size: 0.66em; font-weight: 700; color: var(--fg3); margin-bottom: 0.3em; }
.hpx-room-stat-v { display: inline-flex; align-items: center; gap: 0.3em; font-weight: 800; font-size: 1em; }
.hpx-room-stat-v i { width: 0.95em; height: 0.95em; }
.hpx-room-stat--in i { color: var(--sky-700); }
.hpx-room-stat--out .hpx-room-stat-v { color: var(--danger-strong); }
.hpx-room-stat--free .hpx-room-stat-v { color: var(--success-strong); }

/* ── Bottom dock (tab bar) ───────────────────────────────── */
.hpx-dock {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--ph-w) * 0.2);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 0.6em calc(var(--ph-w) * 0.04);
  background: rgba(252, 251, 249, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  z-index: 20;
}
.hpx-tab { display: flex; flex-direction: column; align-items: center; gap: 0.2em; color: var(--fg3); position: relative; }
.hpx-tab i { width: 1.25em; height: 1.25em; }
.hpx-tab span { font-size: 0.6em; font-weight: 600; }
.hpx-tab.is-active { color: var(--sky-700); }
.hpx-tab__badge {
  position: absolute; top: -0.2em; right: 0.4em; min-width: 1.1em; height: 1.1em;
  background: var(--coral-500); color: var(--neutral-0); border-radius: var(--radius-pill);
  font-size: 0.55em; font-weight: 800; display: grid; place-items: center; padding: 0 0.2em;
}

/* ── Sheets (room detail + bed form) ─────────────────────── */
.hpx-scrim {
  position: absolute; inset: 0; background: rgba(24, 22, 19, 0.32);
  opacity: 0; transition: opacity 0.45s var(--ease-out); z-index: 25; pointer-events: none;
}
.mkt-hero-stage.is-sheet .hpx-scrim { opacity: 1; }

.hpx-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 90%;
  background: var(--neutral-50);
  border-radius: 1.4em 1.4em 0 0;
  border-top: 1px solid var(--neutral-50);
  box-shadow: 0 -4px 16px rgba(42, 70, 86, 0.1);
  transform: translateY(101%) translateZ(0);
  transition: transform 0.55s var(--ease-out);
  z-index: 26; overflow: hidden;
  display: flex; flex-direction: column;
  will-change: transform;
}
.mkt-hero-stage.is-sheet .hpx-sheet { transform: translateY(0) translateZ(0); }
.hpx-grabber { width: 2.4em; height: 0.3em; border-radius: var(--radius-pill); background: var(--neutral-300); margin: 0.55em auto 0; flex-shrink: 0; }

.hpx-sheetview { position: relative; flex: 1; overflow: hidden; }
.hpx-panel {
  position: absolute; inset: 0; padding: 0.7em 1.1em 1em;
  overflow: hidden; transition: transform 0.45s var(--ease-in-out), opacity 0.45s var(--ease-in-out);
  display: flex; flex-direction: column;
}
.hpx-panel--detail { transform: translateX(0); }
.hpx-panel--beds { transform: translateX(100%); }
.mkt-hero-stage.is-beds .hpx-panel--detail { transform: translateX(-26%); opacity: 0; }
.mkt-hero-stage.is-beds .hpx-panel--beds { transform: translateX(0); }

.hpx-panel-top { display: flex; align-items: center; gap: 0.5em; margin-bottom: 0.6em; }
.hpx-back { display: inline-flex; align-items: center; gap: 0.2em; font-size: 0.82em; font-weight: 700; color: var(--sky-700); }
.hpx-back i { width: 1em; height: 1em; }
.hpx-panel-title { font-family: var(--font-display); font-size: 1.2em; font-weight: 600; }

/* Room detail */
.hpx-detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 0.5em; }
.hpx-detail-hero .hpx-room-num { font-size: 2.1em; }
.hpx-detail-type { font-size: 0.78em; color: var(--fg3); font-weight: 600; }
.hpx-clean-btn {
  display: inline-flex; align-items: center; gap: 0.35em;
  background: var(--mint-700); color: var(--neutral-0);
  font-size: 0.82em; font-weight: 800; padding: 0.6em 1em; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.hpx-clean-btn i { width: 1em; height: 1em; }
.hpx-clean-btn.is-done {
  background: var(--mint-500);
  opacity: 0.72;
  pointer-events: none;
}
.hpx-detail-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5em; margin-top: 0.8em; }
.hpx-dtile { background: var(--neutral-0); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.55em 0.4em; text-align: center; }
.hpx-dtile small { display: block; font-size: 0.62em; font-weight: 700; color: var(--fg3); letter-spacing: 0.02em; }
.hpx-dtile b { font-size: 1.5em; font-weight: 800; }
.hpx-dtile--in b { color: var(--fg1); }
.hpx-dtile--out b { color: var(--danger-strong); }
.hpx-dtile--free b { color: var(--success-strong); }
.hpx-detail-rows { margin-top: 0.8em; display: flex; flex-direction: column; gap: 0.5em; overflow: hidden; flex: 1 1 auto; min-height: 0; }
.hpx-drow {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5em;
  background: var(--neutral-0); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.6em 0.7em;
}
.hpx-drow-left { display: inline-flex; align-items: center; gap: 0.5em; font-size: 0.84em; font-weight: 700; }
.hpx-drow-ic { width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.hpx-drow-ic i { width: 0.95em; height: 0.95em; }
.hpx-drow-ic--report { background: var(--coral-100); color: var(--coral-700); }
.hpx-drow-ic--note { background: var(--sky-100); color: var(--sky-700); }
.hpx-drow-ic--task { background: var(--butter-100); color: var(--butter-700); }
.hpx-drow-ic--guest { background: var(--peri-100); color: var(--peri-700); }
.hpx-drow-ic--sheet { background: var(--mint-100); color: var(--mint-700); }
.hpx-drow-meta { font-size: 0.72em; color: var(--fg3); font-weight: 600; }

.hpx-detail-actions { margin-top: auto; display: flex; gap: 0.5em; padding-top: 0.7em; }
.hpx-act {
  flex: 1; text-align: center; font-size: 0.8em; font-weight: 800;
  padding: 0.65em 0.5em; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35em;
}
.hpx-act i { width: 1em; height: 1em; }
.hpx-act--beds { background: var(--sky-100); color: var(--sky-800); }
.hpx-act--report { background: var(--coral-500); color: var(--neutral-0); }

/* Bed update form */
.hpx-beds-card {
  background: var(--neutral-0); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.6em 0.7em;
  display: flex; align-items: center; justify-content: space-between;
}
.hpx-beds-card b { font-size: 1.5em; font-weight: 800; }
.hpx-beds-card .hpx-detail-type { display: block; }
.hpx-beds-card small { font-size: 0.7em; color: var(--fg3); font-weight: 700; }

.hpx-beds-table { margin-top: 0.7em; background: var(--neutral-0); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.hpx-beds-cols { display: grid; grid-template-columns: 1fr auto auto; align-items: center; padding: 0.5em 0.7em; gap: 0.5em; }
.hpx-beds-cols + .hpx-beds-cols { border-top: 1px solid var(--border); }
.hpx-beds-colhead { color: var(--fg3); font-size: 0.64em; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.hpx-beds-rowlabel { display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.8em; font-weight: 800; }
.hpx-beds-rowlabel .hpx-rl-dot { width: 0.5em; height: 0.5em; border-radius: 50%; }
.hpx-beds-rowlabel--in .hpx-rl-dot { background: var(--sky-500); }
.hpx-beds-rowlabel--out .hpx-rl-dot { background: var(--coral-500); }
.hpx-beds-rowlabel--free .hpx-rl-dot { background: var(--mint-500); }
.hpx-beds-current { font-size: 1.25em; font-weight: 800; min-width: 1.4em; text-align: center; }
.hpx-beds-current--out { color: var(--danger-strong); }
.hpx-beds-current--free { color: var(--success-strong); }
.hpx-stepper { display: inline-flex; align-items: center; gap: 0.45em; }
.hpx-step-btn {
  width: 1.7em; height: 1.7em; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--neutral-0); color: var(--fg2); display: grid; place-items: center; font-weight: 800;
}
.hpx-step-btn i { width: 0.85em; height: 0.85em; }
.hpx-step-val { min-width: 1.2em; text-align: center; font-size: 1.15em; font-weight: 800; }
.hpx-step-val--out { color: var(--danger-strong); }
.hpx-step-val--free { color: var(--success-strong); }

.hpx-beds-total {
  margin-top: 0.7em; background: var(--neutral-0); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.6em 0.7em;
  display: flex; align-items: center; justify-content: space-between;
}
.hpx-beds-total-label { font-size: 0.66em; font-weight: 800; color: var(--fg3); letter-spacing: 0.03em; text-transform: uppercase; }
.hpx-beds-total-val { font-size: 1.15em; font-weight: 800; }
.hpx-beds-total-val.is-invalid { color: var(--danger-strong); }
.hpx-beds-total-val.is-valid { color: var(--success-strong); }
.hpx-send {
  display: inline-flex; align-items: center; gap: 0.35em; font-size: 0.82em; font-weight: 800;
  padding: 0.55em 1.1em; border-radius: var(--radius-pill);
  background: var(--neutral-300); color: var(--neutral-0); transition: background 0.3s var(--ease-out);
}
.hpx-send.is-ready { background: var(--sky-600); }
.hpx-send i { width: 1em; height: 1em; }
.hpx-beds-validmsg { margin-top: 0.45em; font-size: 0.7em; font-weight: 700; color: var(--danger-strong); min-height: 1em; transition: opacity 0.3s; }
.hpx-beds-validmsg.is-hidden { opacity: 0; }

.hpx-note {
  margin-top: 0.7em; display: flex; align-items: center; gap: 0.5em;
  background: var(--neutral-0); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.5em 0.6em;
}
.hpx-note-input { flex: 1; font-size: 0.78em; color: var(--fg2); min-height: 1.2em; }
.hpx-note-input .hpx-caret { color: var(--sky-600); animation: hpx-caret 1s step-end infinite; }
.hpx-note-input:empty::before { content: 'Note (optional)'; color: var(--fg3); }
.hpx-note-cam { width: 1.9em; height: 1.9em; border-radius: var(--radius-md); background: var(--sky-100); color: var(--sky-700); display: grid; place-items: center; }
.hpx-note-cam i { width: 1em; height: 1em; }

.hpx-sent-toast {
  position: absolute; left: 50%; bottom: 1.2em; transform: translate(-50%, 1.5em);
  background: var(--mint-700); color: var(--neutral-0); font-size: 0.78em; font-weight: 800;
  padding: 0.5em 0.9em; border-radius: var(--radius-pill); box-shadow: var(--shadow-md);
  display: inline-flex; align-items: center; gap: 0.35em; opacity: 0;
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out); z-index: 30;
}
.hpx-sent-toast i { width: 1em; height: 1em; }
.mkt-hero-stage.is-sent .hpx-sent-toast { opacity: 1; transform: translate(-50%, 0); }

/* ── Desktop PC setup (illustration + live browser in screen) ─ */
.hpx-desktop {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--dt-w);
  transform: translate(calc(-50% + var(--dt-x)), calc(-50% + var(--dt-y))) scale(0.2);
  opacity: 0;
  z-index: 4;
  font-size: calc(var(--dt-w) * 0.022);
  will-change: transform, opacity;
}
.mkt-hero-stage.is-desktop .hpx-desktop { opacity: 1; }

.hpx-pc-setup {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 790;
}

.hpx-pc-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.hpx-monitor-viewport {
  position: absolute;
  top: var(--pc-screen-top);
  left: var(--pc-screen-left);
  right: var(--pc-screen-right);
  bottom: var(--pc-screen-bottom);
  overflow: hidden;
  border-radius: 6px;
  z-index: 1;
  background: var(--neutral-0);
  display: flex;
  flex-direction: column;
}
.hpx-dt-body { display: flex; flex: 1; min-height: 0; }
.hpx-dt-chrome {
  display: flex; align-items: center; gap: 0.6em; padding: 0.55em 0.8em;
  background: var(--neutral-100); border-bottom: 1px solid var(--border);
}
.hpx-dt-traffic { display: inline-flex; gap: 0.35em; }
.hpx-dt-traffic span { width: 0.7em; height: 0.7em; border-radius: 50%; }
.hpx-dt-traffic span:nth-child(1) { background: var(--coral-500); }
.hpx-dt-traffic span:nth-child(2) { background: var(--butter-500); }
.hpx-dt-traffic span:nth-child(3) { background: var(--mint-500); }
.hpx-dt-url {
  flex: 1; background: var(--neutral-0); border-radius: var(--radius-pill);
  font-size: 0.82em; color: var(--fg3); font-weight: 600; padding: 0.3em 0.8em;
  display: inline-flex; align-items: center; gap: 0.4em;
}
.hpx-dt-url i { width: 0.9em; height: 0.9em; color: var(--mint-700); }
.hpx-dt-side {
  width: 27%; background: var(--sky-900); color: var(--neutral-0); padding: 0.8em 0.7em;
  display: flex; flex-direction: column; gap: 0.55em;
}
.hpx-dt-brand { font-family: var(--font-display); font-size: 1.1em; font-weight: 600; margin-bottom: 0.4em; }
.hpx-dt-navitem { display: inline-flex; align-items: center; gap: 0.45em; font-size: 0.78em; font-weight: 600; opacity: 0.72; }
.hpx-dt-navitem i { width: 1em; height: 1em; }
.hpx-dt-navitem.is-active { opacity: 1; background: rgba(255,255,255,0.14); border-radius: var(--radius-sm); padding: 0.3em 0.45em; margin: -0.3em -0.45em; }
.hpx-dt-main { flex: 1; padding: 0.85em 0.9em; position: relative; }
.hpx-dt-main-head { display: flex; align-items: center; justify-content: space-between; }
.hpx-dt-main-head h4 { font-size: 1.15em; font-weight: 800; }
.hpx-dt-tag { font-size: 0.72em; font-weight: 700; color: var(--sky-700); background: var(--sky-100); border-radius: var(--radius-pill); padding: 0.2em 0.6em; }
.hpx-dt-board { margin-top: 0.7em; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5em; }
.hpx-dt-tile {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.5em 0.45em;
  background: var(--neutral-0); position: relative; overflow: hidden;
}
.hpx-dt-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--mint-500); }
.hpx-dt-tile--checkout::before { background: var(--coral-500); }
.hpx-dt-tile--target::before { background: var(--sky-500); }
.hpx-dt-tile b { font-size: 0.95em; font-weight: 800; }
.hpx-dt-tile small { display: block; font-size: 0.66em; color: var(--fg3); font-weight: 600; margin-top: 0.15em; }
.hpx-dt-tile.is-updated { box-shadow: 0 0 0 2px var(--sky-300); }

/* Request popup on desktop */
.hpx-dt-popup {
  position: absolute; right: 0.9em; top: 0.9em; width: 58%;
  background: var(--neutral-0);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 0.7em 0.8em;
  transform: translateY(-0.8em); opacity: 0; pointer-events: none;
  transition: transform 0.45s var(--ease-out), opacity 0.45s var(--ease-out);
  z-index: 6;
}
.mkt-hero-stage.is-req .hpx-dt-popup { transform: translateY(0); opacity: 1; }
.hpx-dt-popup-head { display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.82em; font-weight: 800; }
.hpx-dt-popup-head i { width: 1em; height: 1em; color: var(--sky-700); }
.hpx-dt-popup-sub { font-size: 0.72em; color: var(--fg3); font-weight: 600; margin-top: 0.15em; }
.hpx-dt-status-change {
  display: inline-flex; align-items: center; gap: 0.45em;
  margin: 0.55em 0 0.15em; padding: 0.45em 0.55em;
  background: var(--neutral-100); border-radius: var(--radius-md);
}
.hpx-dt-status {
  font-size: 0.72em; font-weight: 800; letter-spacing: 0.03em;
  padding: 0.25em 0.55em; border-radius: var(--radius-pill);
}
.hpx-dt-status--before { background: var(--butter-100); color: var(--butter-700); }
.hpx-dt-status--after { background: var(--mint-100); color: var(--mint-700); }
.hpx-dt-status-change i { width: 0.85em; height: 0.85em; color: var(--fg3); }
.hpx-dt-popup-stats { display: flex; gap: 0.6em; margin: 0.55em 0; }
.hpx-dt-pstat { font-size: 0.72em; font-weight: 700; }
.hpx-dt-pstat b { font-size: 1.15em; font-weight: 800; }
.hpx-dt-pstat--out b { color: var(--danger-strong); }
.hpx-dt-pstat--free b { color: var(--success-strong); }
.hpx-dt-note { font-size: 0.72em; color: var(--fg2); font-style: italic; background: var(--neutral-100); border-radius: var(--radius-sm); padding: 0.35em 0.5em; }
.hpx-dt-popup-actions { display: flex; gap: 0.45em; margin-top: 0.6em; }
.hpx-dt-pbtn { flex: 1; text-align: center; font-size: 0.76em; font-weight: 800; padding: 0.45em; border-radius: var(--radius-pill); }
.hpx-dt-pbtn--approve { background: var(--sky-600); color: var(--neutral-0); }
.hpx-dt-pbtn--dismiss { background: var(--neutral-100); color: var(--fg2); }

.hpx-dt-toast {
  position: absolute; left: 50%; bottom: 0.8em; transform: translate(-50%, 1.2em);
  background: var(--mint-700); color: var(--neutral-0); font-size: 0.76em; font-weight: 800;
  padding: 0.45em 0.85em; border-radius: var(--radius-pill); box-shadow: var(--shadow-md);
  display: inline-flex; align-items: center; gap: 0.35em; opacity: 0;
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out); z-index: 7;
}
.hpx-dt-toast i { width: 1em; height: 1em; }
.mkt-hero-stage.is-synced .hpx-dt-toast { opacity: 1; transform: translate(-50%, 0); }

/* ── Pointers (finger + cursor) ──────────────────────────── */
.hpx-finger, .hpx-cursor {
  position: absolute; left: 0; top: 0; z-index: 60;
  opacity: 0; pointer-events: none;
  transition: transform 0.5s var(--ease-out), opacity 0.3s var(--ease-out);
  will-change: transform, opacity;
}
.hpx-finger.is-on, .hpx-cursor.is-on { opacity: 1; }
.hpx-finger__dot {
  position: absolute; left: 0; top: 0;
  width: calc(var(--ph-w) * 0.16); height: calc(var(--ph-w) * 0.16);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255,255,255,0.85), rgba(42,70,86,0.32) 70%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 10px rgba(42, 70, 86, 0.3);
  transform: translate(-50%, -50%);
  transition: transform 0.14s var(--ease-out);
}
.hpx-finger.is-down .hpx-finger__dot { transform: translate(-50%, -50%) scale(0.78); }
.hpx-finger__ripple {
  position: absolute; left: 0; top: 0;
  width: calc(var(--ph-w) * 0.16); height: calc(var(--ph-w) * 0.16);
  transform: translate(-50%, -50%) scale(0.4); border-radius: 50%;
  border: 2px solid var(--sky-400); opacity: 0;
}
.hpx-finger.is-down .hpx-finger__ripple { animation: hpx-ripple 0.5s var(--ease-out); }
.hpx-cursor svg { display: block; width: calc(var(--dt-w) * 0.05); height: auto; filter: drop-shadow(0 2px 3px rgba(42,70,86,0.35)); transition: transform 0.12s var(--ease-out); }
.hpx-cursor.is-down svg { transform: scale(0.82); }
.hpx-cursor svg path { fill: var(--neutral-0); stroke: var(--neutral-800); stroke-width: 1.5; stroke-linejoin: round; }

/* ── Icon sizing/coloring (Lucide copies these classes onto the <svg>) ── */
.hpx-ic { width: 1em; height: 1em; flex-shrink: 0; }
.hpx-app-icon .hpx-ic { width: 52%; height: 52%; }
.hpx-tab .hpx-ic { width: 1.25em; height: 1.25em; }
.hpx-ic--sky { color: var(--sky-700); }
.hpx-ic--danger { color: var(--danger-strong); }
.hpx-ic--success { color: var(--success-strong); }
.hpx-ic--muted { color: var(--fg3); }

/* ── Paused state (off-screen / hidden tab): freeze CSS loops ── */
.mkt-hero-stage.is-paused,
.mkt-hero-stage.is-paused * { animation-play-state: paused !important; }

/* ── Instant reset between loops (suppress transitions) ── */
.mkt-hero-stage.is-resetting .hpx-home,
.mkt-hero-stage.is-resetting .hpx-app,
.mkt-hero-stage.is-resetting .hpx-page,
.mkt-hero-stage.is-resetting .hpx-panel,
.mkt-hero-stage.is-resetting .hpx-sheet,
.mkt-hero-stage.is-resetting .hpx-scrim,
.mkt-hero-stage.is-resetting .hpx-desktop,
.mkt-hero-stage.is-resetting .hpx-dt-popup,
.mkt-hero-stage.is-resetting .hpx-phone-wrap,
.mkt-hero-stage.is-resetting .hpx-finger,
.mkt-hero-stage.is-resetting .hpx-cursor { transition: none !important; }

/* While folding away, JS drives the phone transform inline */
.mkt-hero-stage.is-folding .hpx-phone-wrap { animation: none !important; }

/* ── Keyframes (GPU-only) ────────────────────────────────── */
@keyframes hpx-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
@keyframes hpx-phone-in {
  0%   { transform: translateZ(-300px) translateY(18px) rotateY(-210deg) rotateX(12deg) scale(0.2); }
  60%  { transform: translateZ(54px) translateY(0) rotateY(14deg) rotateX(-3deg) scale(1.05); }
  100% { transform: translateZ(0) translateY(0) rotateY(-7deg) rotateX(1.5deg) scale(1); }
}
@keyframes hpx-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 187, 133, 0.55); }
  60%      { box-shadow: 0 0 0 0.6em rgba(94, 187, 133, 0); }
}
@keyframes hpx-ripple {
  0%   { opacity: 0.7; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(1.7); }
}
@keyframes hpx-caret {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ── Static fallback (reduced motion) ────────────────────── */
.mkt-hero-stage.is-static .hpx-device-layer { transform: none; }
.mkt-hero-stage.is-static .hpx-phone-wrap {
  animation: none;
  transform: translateX(-22%) scale(0.82);
}
.mkt-hero-stage.is-static .hpx-phone { transform: rotateY(-6deg); opacity: 1; }
.mkt-hero-stage.is-static .hpx-livedot { animation: none; }
.mkt-hero-stage.is-static .hpx-home { opacity: 0; }
.mkt-hero-stage.is-static .hpx-app { opacity: 1; transform: none; }
.mkt-hero-stage.is-static .hpx-scrim { opacity: 0; }
.mkt-hero-stage.is-static .hpx-sheet { transform: translateY(101%) translateZ(0); }
.mkt-hero-stage.is-static .hpx-desktop {
  transform: translate(calc(-50% + 22%), calc(-50% + -10%)) scale(0.62);
  opacity: 1;
}
.mkt-hero-stage.is-static .hpx-dt-popup { transform: translateY(0); opacity: 1; }
.mkt-hero-stage.is-static .hpx-dt-tile--target.is-updated { box-shadow: 0 0 0 2px var(--sky-300); }
.mkt-hero-stage.is-static .hpx-contact-shadow { opacity: 1; }
.mkt-hero-stage.is-static .hpx-finger,
.mkt-hero-stage.is-static .hpx-cursor { display: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .mkt-hero-stage {
    --ph-w: clamp(212px, 56vw, 256px);
    --dt-w: min(420px, 92vw);
    --dt-x: 0%;
    --dt-y: -42%;
    min-height: clamp(440px, 70vh, 560px);
    margin-top: var(--space-4);
  }
}
@media (max-width: 420px) {
  .mkt-hero-stage { --ph-w: 208px; }
}

@media (prefers-reduced-motion: reduce) {
  .mkt-hero-stage .hpx-phone-wrap,
  .mkt-hero-stage .hpx-phone,
  .mkt-hero-stage .hpx-livedot { animation: none !important; }
  /* Force a settled, visible phone regardless of js-on / static-frame state. */
  .mkt-hero-stage .hpx-phone-wrap { transform: none !important; }
  .mkt-hero-stage .hpx-phone { transform: rotateY(-6deg) !important; opacity: 1 !important; }
  .hpx-finger, .hpx-cursor { display: none !important; }
}
