/* PM Apartment homepage. Design system from ui-ux-pro-max: Minimalism & Swiss style, light mode,
 * Be Vietnam Pro, the app's brand blue for actions, success green for recognised faces, error red for unknown faces. */
@import url("./tokens.css");
@import url("./base.css");

/* ---------- Type ---------- */
.pma-home { --pma-header-height: 73px; color: var(--color-ink-2); }
.pma-home strong, .pma-home dt, .pma-home th { font-weight: 600; color: var(--color-ink); }
.pma-home small, .pma-home figcaption, .pma-home caption, .pma-note { font-size: var(--text-sm); color: var(--color-muted); }
.pma-home :where(ul, ol, dl, dd, figure) { margin: 0; padding: 0; list-style: none; }

/* ---------- Buttons and links ---------- */
.pma-home .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--space-lg); border: 0; border-radius: var(--radius-pill); background: var(--color-primary); color: var(--color-on-primary); font: 600 var(--text-md)/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.pma-home .btn:hover { background: var(--color-primary-hover); color: var(--color-on-primary); }
.pma-home .btn:active { transform: translateY(1px); }
.pma-home .btn--line { background: var(--color-paper); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--color-rule-2); }
.pma-home .btn--line:hover { background: var(--color-paper-2); color: var(--color-ink); }
.pma-home .btn-quiet { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-md); border: 1px solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-paper); color: var(--color-ink-2); font: 500 var(--text-sm)/1 var(--font-body); white-space: nowrap; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); }
.pma-home .btn-quiet:hover { background: var(--color-paper-2); color: var(--color-ink); }
.pma-home .btn-quiet:active { transform: translateY(1px); }
.pma-home .btn-quiet:disabled, .pma-home .btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.pma-home .btn-quiet[aria-pressed="true"] { color: var(--color-ink); border-color: var(--color-muted); }
.pma-text-link { color: var(--color-primary); font-weight: 600; text-decoration: none; transition: color var(--dur-short) var(--ease-out); }
.pma-text-link:hover { color: var(--color-primary-hover); text-decoration: underline; }
html:not(.js) [data-loop-toggle] { display: none; }


/* ---------- Header ---------- */
.pma-skip { position: absolute; left: var(--space-md); top: -96px; z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); border-radius: var(--radius-sm); }
.pma-skip:focus-visible { top: var(--space-md); }
.pma-header { position: sticky; top: 0; z-index: var(--z-sticky-nav); margin-bottom: calc(-1 * var(--pma-header-height)); background: transparent; border-bottom: 1px solid transparent; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.pma-header.is-scrolled { background: rgb(255 255 255 / 0.94); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom-color: var(--color-rule); }
@media (min-width: 60.001rem) {
  .pma-header:not(.is-scrolled) .pma-nav > a:not(.btn), .pma-header:not(.is-scrolled) .pma-language a { color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / 0.6); }
  .pma-header:not(.is-scrolled) .pma-nav > a:not(.btn):hover, .pma-header:not(.is-scrolled) .pma-language a:hover { text-decoration: underline; text-underline-offset: 5px; }
}
.admin-bar .pma-header { top: 32px; }
.pma-header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: 72px; }
.pma-brand { display: inline-flex; flex-shrink: 0; }
.pma-brand img { display: block; width: 136px; height: 48px; object-fit: contain; }
.pma-nav { display: flex; align-items: center; gap: var(--space-lg); font-size: var(--text-sm); font-weight: 500; }
.pma-nav > a:not(.btn) { color: var(--color-ink-2); text-decoration: none; transition: color var(--dur-short) var(--ease-out); }
.pma-nav > a:not(.btn):hover { color: var(--color-primary); }
.pma-language ul, .pma-language li { margin: 0; padding: 0; list-style: none; }
.pma-language a { color: var(--color-ink-2); text-decoration: none; }
.pma-language a:hover { color: var(--color-primary); }
.pma-home .pma-menu-toggle { display: none; min-height: 44px; padding: 0 var(--space-md); border: 1px solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-paper); color: var(--color-ink); font: 500 var(--text-sm)/1 var(--font-body); cursor: pointer; }
.pma-home .pma-menu-toggle:hover { background: var(--color-paper-2); }

/* ---------- Concept C: one viewport for the complete architectural visit ---------- */
.pma-hero { --pma-tour-phone-width: min(280px, calc((100dvh - 300px) * 0.5)); --pma-tour-side: var(--gutter); --pma-tour-top: calc(var(--pma-header-height) + 24px); --pma-header-offset: 73px; position: relative; height: calc(100svh - var(--pma-header-offset) + var(--pma-header-height)); height: calc(100dvh - var(--pma-header-offset) + var(--pma-header-height)); padding: 0; overflow: clip; background: var(--color-paper); scroll-margin-top: var(--pma-header-offset); }
.pma-hero-inner { position: relative; height: 100%; min-height: 0; max-width: none; padding: 0; }
.pma-hero-text { --pma-intro-phone-width: min(280px, calc((100dvh - 440px) * 0.5)); position: absolute; top: calc(var(--pma-header-height) + 24px); left: var(--gutter); z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) var(--pma-intro-phone-width); align-items: center; gap: 32px; width: min(820px, calc(100% - var(--gutter) * 2)); padding: 28px; border: 1px solid rgb(255 255 255 / 0.65); border-radius: 10px; background: rgb(250 249 246 / 0.97); box-shadow: 0 10px 40px rgb(40 34 25 / 0.06); }
.pma-hero-intro { display: grid; gap: 16px; min-width: 0; }
.pma-hero-intro .pma-tour-entry-label { color: var(--color-primary); font-size: 13px; letter-spacing: .02em; text-transform: none; }
.pma-tour-entry-hint { color: var(--color-muted); font-size: 12px; line-height: 1.6; }
.pma-eyebrow { display: inline-flex; align-items: center; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-muted); }
.pma-home .pma-hero h1 { max-width: none; font-size: clamp(1.85rem, 2.5vw, 2.5rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.055em; text-wrap: pretty; }
.pma-hero h1 span { color: var(--color-ink); }
.pma-hero .lead { font-size: 14px; line-height: 1.65; }
.pma-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pma-home .pma-hero-actions .btn { gap: 12px; min-height: 48px; padding-inline: 18px; border-radius: 6px; }
.pma-hero-actions .pma-glyph { width: 22px; height: 22px; flex: 0 0 auto; }
.pma-arrow { width: 20px; height: 20px; flex-shrink: 0; }
.pma-text-link .pma-arrow, .pma-index .pma-arrow { transition: transform var(--dur-short) var(--ease-out); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pma-text-link:hover .pma-arrow, .pma-index a:hover .pma-arrow { transform: translate(3px, -3px); }
}
.pma-home .btn-quiet:active { transform: translateY(1px); }
.pma-tour-story { display: none; gap: 8px; }
.pma-tour-story h2 { font-size: clamp(1.2rem, 1.7vw, 1.65rem); letter-spacing: -0.035em; font-weight: 500; }
.pma-tour-story > p { font-size: var(--text-sm); line-height: 1.6; }
[data-started="true"] .pma-tour-story, [data-unavailable="true"] .pma-tour-story { display: grid; }
[data-started="true"] .pma-hero-intro, [data-unavailable="true"] .pma-hero-intro { display: none; }
.pma-hero:is([data-started="true"], [data-unavailable="true"]) .pma-hero-text { --pma-intro-phone-width: var(--pma-tour-phone-width); inset: 0; display: block; width: auto; padding: 0; border: 0; background: none; box-shadow: none; pointer-events: none; }
.pma-hero:is([data-started="true"], [data-unavailable="true"]) .pma-tour-story { position: absolute; top: var(--pma-tour-top); left: var(--pma-tour-side); width: min(340px, calc(100% - var(--pma-tour-phone-width) - var(--pma-tour-side) * 2 - 12px)); padding: 16px; border: 1px solid rgb(255 255 255 / 0.65); border-radius: 10px; background: rgb(250 249 246 / 0.97); }
.pma-hero:is([data-started="true"], [data-unavailable="true"]) .pma-visit-phone { position: absolute; top: var(--pma-tour-top); right: var(--pma-tour-side); pointer-events: auto; }
.pma-hero[data-chapter="elevator"] .pma-tour-story { display: none; }
.pma-home .pma-hero[data-started="true"] .pma-elevator-control { left: var(--pma-tour-side); right: auto; top: var(--pma-tour-top); }
.pma-home .pma-visit { position: absolute; inset: 0; min-height: 0; }
.pma-visit-view { position: absolute; inset: 0; isolation: isolate; overflow: hidden; background: #e9e4d9; }
.pma-visit-poster, .pma-building-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity 480ms var(--ease-out); }
.pma-visit-poster { object-position: center; }
.pma-building-canvas { opacity: 0; touch-action: pan-y pinch-zoom; cursor: grab; outline-offset: -5px; }
[data-ready="false"] .pma-building-canvas { pointer-events: none; }
.pma-building-canvas:active { cursor: grabbing; }
[data-ready="true"] .pma-building-canvas { opacity: 1; }
[data-ready="true"] .pma-visit-poster { opacity: 0; pointer-events: none; }
.pma-tour-loading { position: absolute; z-index: 6; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; background: rgb(247 245 239 / 0.94); backdrop-filter: blur(8px); color: var(--color-ink); font-size: 14px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 400ms var(--ease-out), visibility 0s linear 400ms; }
[data-loading="true"] .pma-tour-loading { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 180ms var(--ease-out), visibility 0s; }
.pma-tour-spinner { display: block; width: 40px; height: 40px; color: var(--color-primary); }
[data-loading="true"] .pma-tour-spinner { animation: pma-tour-spin 900ms linear infinite; }
@keyframes pma-tour-spin { to { transform: rotate(360deg); } }
.pma-visit-phone { width: var(--pma-intro-phone-width); min-width: 0; }
.pma-visit-phone .pma-preview-phone { max-width: none; box-shadow: -3px 1px 0 #ddd8ce, 1px 16px 28px rgb(40 34 25 / 0.2); }

.pma-reader-view { position: absolute; left: var(--gutter); bottom: 88px; width: 148px; z-index: 2; padding: 6px; border: 1px solid #6d7c84; border-radius: 12px; background: #152027; box-shadow: 0 12px 32px rgb(15 25 30 / 0.18); }
.pma-reader-view > span { display: block; padding: 2px 4px 6px; color: #eef4f6; font-size: 11px; }
.pma-reader-view canvas { display: block; width: 100%; height: auto; border-radius: 6px; }
.pma-home .pma-elevator-control { position: absolute; z-index: 3; top: calc(var(--pma-header-height) + 24px); right: var(--gutter); display: grid; gap: 8px; max-width: 290px; padding: 12px; border: 1px solid var(--color-rule); border-radius: 8px; background: rgb(250 249 246 / 0.97); font-size: 12px; }
.pma-elevator-control small { font-size: 10px; line-height: 1.4; }
.pma-stores { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.pma-home .pma-store { display: block; width: 156px; border-radius: var(--radius-sm); transition: transform var(--dur-micro) var(--ease-out); }
.pma-home .pma-store img { display: block; width: 100%; height: auto; }
.pma-home .pma-store:hover { transform: translateY(-2px); }
.pma-download-app { min-width: 0; width: min(100%, 340px); }
.pma-download-app .pma-stores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pma-home .pma-download-app .pma-store { display: flex; align-items: center; width: 100%; max-width: 156px; min-height: 44px; }
.pma-visit-console { position: absolute; z-index: 4; inset-inline: 0; bottom: max(20px, env(safe-area-inset-bottom)); max-width: none; margin: 0; padding-block: 0; pointer-events: none; }
.pma-visit-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pma-visit-more { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 44px; min-height: 44px; padding-inline: 16px; border: 1px solid var(--color-rule); border-radius: 8px; background: rgb(250 249 246 / 0.96); font-size: 12px; white-space: nowrap; pointer-events: auto; }
.pma-visit-console .pma-stage-actions { padding: 5px; border: 1px solid var(--color-rule); border-radius: 10px; background: rgb(250 249 246 / 0.96); pointer-events: auto; }
.pma-hero:not([data-started="true"]) .pma-stage-actions { visibility: hidden; pointer-events: none; }
.pma-home .pma-control-short { display: none; }
.pma-stage-actions .pma-glyph { width: 16px; height: 16px; }
.pma-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
html:not(.js) [data-tour-start], html:not(.js) .pma-stage-actions { display: none; }
html:not(.js) .pma-tour-story { display: grid; }

/* One shared phone shell provides status and gesture safe areas for images and iframes. */
.pma-phone { container-type: inline-size; width: 100%; padding: 6px; overflow: hidden; border: 1px solid #777b75; border-radius: 30px; background: #272b27; box-shadow: 0 12px 20px rgb(30 39 30 / 0.12); }
.pma-phone-display { overflow: hidden; border-radius: 23px; background: #fff; color: #202421; }
.pma-phone-status { display: flex; align-items: center; justify-content: space-between; height: 34px; height: 10cqw; padding-inline: 22px; padding-inline: 7cqw; font: 600 12px/1 var(--font-body); font-size: 4cqw; }
.pma-phone-status > svg { display: block; width: 46px; width: 16cqw; height: auto; }
.pma-phone-speaker { width: 44px; width: 15cqw; height: 4px; height: 1.3cqw; border-radius: 4px; background: #272b27; }
.pma-phone-home { display: grid; place-items: center; height: 18px; height: 6cqw; }
.pma-phone-home::after { content: ''; width: 100px; width: 34cqw; height: 3px; height: 1.1cqw; border-radius: 4px; background: #272b27; }
.pma-phone .pma-app-capture { border-radius: 0; }
.pma-phone.pma-preview-frame { padding: 6px; border: 1px solid #777b75; border-radius: 30px; background: #272b27; }
.pma-phone .pma-app-viewport { border-radius: 0; background: #fff; }

/* The real app screens. */
.pma-proof { display: grid; gap: var(--space-md); justify-items: center; }
.pma-preview-frame { color-scheme: light; width: 100%; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--color-rule); background: var(--color-paper); box-shadow: var(--shadow-card); }
.pma-app-viewport { position: relative; overflow: hidden; background: var(--color-paper); }
.pma-home .pma-app-preview { display: block; max-width: none; width: 390px; border: 0; transform-origin: top left; transform: scale(var(--pma-preview-scale, 1)); color-scheme: light; }
.pma-preview-phone { max-width: 320px; }
.pma-preview-phone .pma-app-viewport { aspect-ratio: 390 / 720; }
.pma-preview-phone .pma-app-preview { height: 720px; }
.pma-preview-panel { max-width: 540px; }
.pma-preview-panel .pma-app-viewport { height: calc(212px * var(--pma-preview-scale, 1)); }
.pma-preview-panel .pma-app-preview { height: 310px; }

/* ---------- Under 60rem everything stacks in reading order ---------- */
@media (max-width: 60rem) {
  .pma-home .pma-menu-toggle { display: inline-flex; align-items: center; }
  .pma-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; max-height: calc(100dvh - var(--pma-header-height)); overflow-y: auto; padding: var(--space-sm) var(--gutter) var(--space-lg); background: var(--color-paper); border-bottom: 1px solid var(--color-rule); font-size: var(--text-md); }
  .pma-navigation-ready .pma-nav:not(.is-open) { display: none; }
  .pma-nav > a:not(.btn), .pma-language { padding-block: var(--space-sm); border-bottom: 1px solid var(--color-rule); }
  .pma-nav .btn { margin-top: var(--space-md); }

}
@media (max-width: 40rem) {
  .pma-home .pma-store { width: calc((100% - var(--space-sm)) / 2); max-width: 156px; }
}
@media (prefers-reduced-motion: reduce) {
  .pma-header, .pma-home .btn, .pma-home .btn-quiet, .pma-home .pma-store { transition: none; }
  .pma-tour-loading, .pma-visit-poster, .pma-building-canvas { transition: none; }
  [data-loading="true"] .pma-tour-spinner { animation: none; }
}

/* The support chat keeps a transparent frame. */
.pma-home #tiledeskiframe { color-scheme: normal; background: transparent; }
/* Keep the closed support launcher clear of the visit's navigation. */
.pma-visit-visible #tiledesk-container.closed #tiledeskdiv { visibility: hidden; pointer-events: none; }

@media (max-width: 60rem) {
  .pma-hero-text { --pma-intro-phone-width: min(240px, calc((100dvh - 440px) * 0.5)); width: min(740px, calc(100% - var(--gutter) * 2)); padding: 20px; gap: 20px; }
  .pma-home .pma-hero h1 { font-size: clamp(1.75rem, 3.5vw, 2.125rem); }
}
@media (max-width: 40rem) {
  .pma-hero { --pma-tour-phone-width: min(186px, calc((100dvh - 300px) * 0.5), calc(100vw - 172px)); --pma-tour-side: 12px; --pma-tour-top: calc(var(--pma-header-height) + 12px); }
  .pma-visit-console { padding-inline: 12px; }
  .pma-hero-text { --pma-intro-phone-width: 156px; top: calc(var(--pma-header-height) + 12px); left: 12px; width: calc(100% - 24px); padding: 14px; gap: 14px; }
  .pma-hero-intro { gap: 12px; }
  .pma-hero .lead { font-size: 12px; line-height: 1.6; }
  .pma-home .pma-hero h1 { font-size: clamp(1.25rem, 5.8vw, 1.55rem); line-height: 1.15; }
  .pma-hero-actions { gap: 12px; align-items: flex-start; }
  .pma-hero-actions .pma-text-link { font-size: 12px; }
  .pma-home .pma-hero-actions .btn { min-height: 44px; padding-inline: 12px; gap: 8px; font-size: 12px; }
  .pma-hero:not([data-started="true"]):not([data-unavailable="true"]) .pma-hero-text { grid-template-columns: minmax(0, 1fr); max-width: 420px; padding: 20px; }
  /* Keep the hidden iframe laid out: app typography reads its dimensions once at startup. */
  .pma-hero:not([data-started="true"]):not([data-unavailable="true"]) .pma-visit-phone { position: absolute; top: 0; right: 0; visibility: hidden; pointer-events: none; }
  .pma-home .pma-hero-intro h1 { font-size: clamp(24px, 7vw, 28px); }
  .pma-hero-intro .lead { font-size: 14px; }
  .pma-hero-actions { display: grid; justify-items: start; gap: 4px; }
  .pma-home .pma-hero-actions .btn { min-height: 48px; font-size: 14px; }
  .pma-hero-actions .pma-text-link { font-size: 13px; }
  .pma-hero:is([data-started="true"], [data-unavailable="true"]) .pma-tour-story { padding: 12px; }
  .pma-tour-story { gap: 5px; }
  .pma-tour-story .pma-eyebrow { font-size: 9px; letter-spacing: 0.04em; }
  .pma-tour-story h2 { font-size: 16px; line-height: 1.2; }
  .pma-tour-story > p { display: none; }
  .pma-hero[data-reading="true"] .pma-tour-story { display: none; }

  .pma-reader-view { left: 12px; bottom: 88px; width: 122px; }
  .pma-home .pma-elevator-control { top: calc(var(--pma-header-height) + 12px); right: 12px; max-width: 136px; padding: 8px; gap: 5px; }
  .pma-home .pma-elevator-control > div { display: grid; grid-template-columns: repeat(2, 44px); gap: 4px; }
  .pma-home .pma-elevator-control button { width: 44px; height: 44px; min-height: 44px; }
  .pma-elevator-control small { font-size: 9px; }
  .pma-visit-toolbar { gap: 6px; }
  .pma-home .pma-stage-actions { flex-wrap: nowrap; gap: 5px; }
  .pma-home .pma-stage-actions .btn-quiet { min-width: 44px; justify-content: center; padding-inline: 8px; font-size: 12px; }
  .pma-replay-label, [data-play-label] { display: none; }
  .pma-home .pma-control-short { display: inline; }
}
@media (max-height: 740px) {
  .pma-hero-text { top: calc(var(--pma-header-height) + 12px); padding: 14px; gap: 14px; }
  .pma-hero { --pma-tour-top: calc(var(--pma-header-height) + 12px); }
  .pma-hero .lead, .pma-tour-story > p { display: none; }
  .pma-reader-view { width: 112px; bottom: 88px; }
}
@media (max-width: 360px) {
  .pma-visit-more-label { display: none; }
  .pma-visit-more { padding-inline: 12px; }
  .pma-hero-text { padding: 12px; gap: 10px; }
  .pma-home .pma-hero-actions .btn { padding-inline: 8px; gap: 4px; }
  .pma-hero-actions .pma-arrow { width: 16px; height: 16px; }
}
@media (min-width: 40.001rem) and (max-height: 740px) {
  .pma-home .pma-hero h1 { font-size: 1.65rem; }
}
@media (max-width: 40rem) and (max-height: 700px) {
  .pma-reader-view { width: 102px; bottom: 88px; }
  .pma-hero-text { --pma-intro-phone-width: 104px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .pma-hero { --pma-tour-phone-width: 80px; }
  .pma-hero-text { width: min(700px, calc(100% - var(--gutter) * 2)); padding: 10px 12px; gap: 12px; }
  .pma-hero .pma-hero-text { --pma-intro-phone-width: 48px; }
  .pma-hero-intro { gap: 8px; }
  .pma-home .pma-hero-actions .btn { min-height: 44px; font-size: 13px; }
  .pma-hero-actions .pma-text-link { display: none; }
  .pma-home .pma-hero h1 { font-size: 1.3rem; }
  .pma-hero[data-reading="true"] .pma-tour-story { display: none; }
  .pma-reader-view { width: 84px; bottom: 80px; max-height: calc(100% - 88px); display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .pma-reader-view canvas { min-height: 0; height: 100%; object-fit: contain; }
  .pma-home .pma-hero[data-started="true"] .pma-elevator-control { top: calc(var(--pma-header-height) + 8px); left: auto; right: 140px; padding: 6px; }
  .pma-elevator-control small { display: none; }
}
