/* OWN — site v2 · frames for the real platform UI
   The product demos are the OWN app's own markup and styles (platform/*.html,
   css/platform.css). This file only (1) gives each .plat island the app's base
   type, (2) re-anchors the app's viewport-bound pieces (sticky sidebar, fixed
   rail disc, modal overlays) inside a frame, and (3) choreographs the demos. */

/* ---------- the app's base (client body styles) ---------- */
.plat {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: normal;
  text-align: left;
  font-feature-settings: "kern", "liga", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.plat-app { background: var(--ivory); }

/* A frame renders its content at a fixed desktop width (data-w) and is scaled
   to fit by site.js — the app is never reflowed into a narrower layout. */
.plat-fit { width: var(--fit-w, auto); zoom: var(--fit-z, 1); }
/* A full-app frame (fixed height) holds the app's page, and the page is a
   container the app's own @container rules read (.mn, platform.css). Safari
   measures a container inside `zoom` at its zoomed size, so a scaled-down hero
   got the app's narrow layouts (the Dashboard stayed one column with Atlas
   closed). These frames scale with a transform instead, which never changes
   layout in any browser; the negative margins hand back the space the
   unscaled box would otherwise take. */
.plat-fit[data-h] {
  height: var(--fit-h, auto); overflow: hidden;
  zoom: 1;
  transform: scale(var(--fit-z, 1)); transform-origin: 0 0;
  margin-right: calc(var(--fit-w, 0px) * (var(--fit-z, 1) - 1));
  margin-bottom: calc(var(--fit-h, 0px) * (var(--fit-z, 1) - 1));
}
/* like the app, the shell is exactly one viewport tall: the sidebar is sized to
   it and the page scrolls (here: crops) inside */
.plat-fit[data-h] > .plat { height: 100%; }
.plat-fit[data-h] .dash { height: 100%; grid-template-rows: 100%; overflow: hidden; }

/* ---------- re-anchoring inside frames ---------- */
.plat .dash { min-height: 0; height: 100%; }
.plat .sb { position: relative; top: 0; max-height: none; overflow: hidden; }
.plat .ar { position: relative; top: auto; height: auto; align-self: stretch; }
.plat .ar-resting { position: absolute; }
.plat .obe-rail, .plat .ah-rail { position: static; }
/* …except in the hero, whose pages scroll the way the app's do: there the
   side columns keep the app's own pinning (ownBudget.css .obe-rail,
   ownAccounts.css .ah-rail; top offsets from platform.css) */
.hero-window:not(.is-compact) .plat-app .obe-rail, .hero-window:not(.is-compact) .plat-app .ah-rail { position: sticky; }
.plat .bw-ov, .plat .setup-ov { position: absolute; }
.plat .setup-ov { position: static; inset: auto; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; display: block; }
.plat .setup-ov > .setup-card { height: auto; animation: none; margin: 0; }
.plat .mn { padding-bottom: 24px !important; overflow: hidden; }
.plat-app[data-atlas-collapsed="true"] .dash { grid-template-columns: 196px minmax(0, 1fr); grid-template-areas: "sb mn"; }
.plat-app[data-atlas-collapsed="true"] .ar { display: none; }
.plat-app[data-atlas-collapsed="false"] .ar-resting { display: none; }
.plat-app .mn[data-pane]:not(.is-active) { display: none; }
.plat-app .fh-mn { padding: 8px 8px 0 0; }
.plat a, .plat button { cursor: default; }
/* every product demo is for viewing only: the frames are also `inert` in the
   page source, and nothing inside them takes a pointer or a text selection */
.plat-fit { pointer-events: none; user-select: none; -webkit-user-select: none; }
@keyframes replaySpin { to { transform: rotate(360deg); } }

/* ---------- hero window ---------- */
.hero-window {
  position: relative;
  width: 100%; margin: 24px auto 0; /* .hero-showcase sets the width */
  border: 1px solid #d6dbd8; border-radius: 16px;
  background: #f5f5f5;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 28px 64px -28px #1d3a3640, 0 4px 12px -4px #1d3a3614;
}
/* the rail arrives the way the app's does: from the right, settling */
.plat-app .ar.is-arriving { animation: rail-in .42s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes rail-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.plat-app .ar-msg.is-new { animation: msg-in .32s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- the edit (hero.js): camera, pointer, marks ----------
   Cut on top of the real app the way a screen recording is edited into a
   product film. None of it is app UI: the camera is a transform on the whole
   app, and the pointer, ripple and rings are the site's own marks. */
.hero-window .plat-app { position: relative; transform-origin: 0 0; will-change: transform; }
/* the app's own open-state rule for the Health explainer
   (ownFinancialHealth.css:225); the capture was taken closed, so it is missing
   from platform.css, and the hero opens it */
.plat .fh-method[open] > summary > span::before { transform: rotate(90deg); }
/* the demo's composer wraps a long question instead of scrolling it out of
   view (hero.js); the app's is one line */
.hero-window .plat-app .ar-composer { align-items: end; border-radius: 20px; }
.hero-window .plat-app .ar-composer textarea.ar-input { display: block; margin: 0; padding: 4px 0; line-height: 1.45; resize: none; overflow: hidden; }
.demo-pointer {
  position: absolute; left: 0; top: 0; z-index: 60;
  width: 25px; height: 32px;
  opacity: 0; pointer-events: none;
  transform-origin: 2px 2px;
  filter: drop-shadow(0 3px 4px #0003);
}
.demo-pointer.is-on { opacity: 1; }
.demo-pointer svg { display: block; width: 100%; height: 100%; transform-origin: 2px 2px; }
.demo-ripple {
  position: absolute; z-index: 59;
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 2px solid #0e3a3e; border-radius: 50%;
  pointer-events: none;
  animation: demo-ripple .55s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes demo-ripple { from { opacity: .55; transform: scale(.35); } to { opacity: 0; transform: scale(1.25); } }
.demo-mark { position: absolute; z-index: 55; overflow: visible; pointer-events: none; transition: opacity .3s; }
.demo-mark rect {
  fill: #3f8f7f14; stroke: #2f7d6d; stroke-width: 2.5;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 6px #2f7d6d55);
  animation: demo-mark .75s cubic-bezier(.6, 0, .2, 1) forwards;
}
.demo-mark.is-out { opacity: 0; }
@keyframes demo-mark { to { stroke-dashoffset: 0; } }

.hero-tabs button { position: relative; overflow: hidden; }
.tab-progress {
  position: absolute; left: 14px; right: 14px; bottom: 5px;
  height: 2px; border-radius: 2px;
  background: #0e3a3e59;
  transform: scaleX(0); transform-origin: 0 50%;
  pointer-events: none;
}

/* compact phones: the app without its sidebar; Atlas lays over the page */
.is-compact-fit > .plat-app .sb { display: none; }
.is-compact-fit > .plat-app .dash { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "mn" !important; }
/* the app's phone rail is a right-hand sheet over a scrim (position: fixed);
   the same sheet, anchored to the frame instead of the viewport */
.hero-window.is-compact .plat-app .ar { position: absolute !important; top: 0; right: 0; bottom: 0; height: auto !important; }
.hero-window.is-compact .plat-app .ar::before { position: absolute; inset: 0 100% 0 auto; width: 640px; }

/* ---------- the dragged file (the visitor's own file, not app UI) ---------- */
.doc-thumb {
  position: relative; flex: none;
  display: grid; align-content: start; gap: 5px;
  width: 46px; height: 58px; padding: 10px 8px;
  border-radius: 6px; background: #fff;
  box-shadow: 0 0 0 1px #e1e4e2, 0 5px 9px #0e3a3e14;
}
.doc-thumb i { display: block; height: 3px; border-radius: 2px; background: #dfe3e1; }
.doc-thumb i:nth-child(2) { width: 70%; }
.doc-thumb b { position: absolute; left: 6px; bottom: 6px; padding: 1px 4px; border-radius: 3px; background: var(--clay); color: #fff; font-size: 7.5px; font-weight: 700; letter-spacing: .04em; }

/* ============================================================
   HOW IT WORKS — 7s loops, running only while visible
   ============================================================ */
.quick-visual .plat-fit { position: relative; }

/* 1 · connect: Accounts toolbar → "Link your bank." → "Bank connected." */
.connect-visual { align-items: flex-start; padding: 22px 18px; }
.qc-frame .plat { position: relative; height: 520px; }
.qc-frame .ah { padding: 0; }
.qc-frame .mn { padding-bottom: 0 !important; }
.plat .qc-ov { position: absolute; inset: 0; opacity: 0; border-radius: 18px; animation: qc-ov 7s var(--qe) infinite; }
.plat .qc-ov .bw-modal { max-width: 520px; animation: none; }
.qc-modal { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 20px; }
.qc-open { animation: qc-open 7s var(--qe) infinite; }
.qc-done { opacity: 0; animation: qc-done 7s var(--qe) infinite; }
.qc-pointer { left: 47%; top: 20%; animation: qc-pointer 7s var(--qe) infinite; }
@keyframes qc-ov { 0%, 33% { opacity: 0; } 37%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes qc-open { 0%, 33% { opacity: 0; transform: translateY(10px) scale(.98); } 38%, 58% { opacity: 1; transform: none; } 62%, 100% { opacity: 0; } }
@keyframes qc-done { 0%, 60% { opacity: 0; transform: scale(.98); } 65%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes qc-pointer {
  0%, 8% { opacity: 0; transform: translate(70px, 150px); }
  12% { opacity: 1; transform: translate(60px, 130px); }
  26%, 29% { opacity: 1; transform: translate(0, 0) scale(1); }
  32% { transform: translate(0, 0) scale(.84); }
  35% { opacity: 1; transform: translate(0, 0) scale(1); }
  44%, 100% { opacity: 0; transform: translate(16px, 30px); }
}

/* 2 · upload: drop → "Reading your document…" → "Saved to vault ✓" → what OWN read */
.upload-visual { flex-direction: column; justify-content: flex-start; padding-top: 30px; }
.qu-frame .mn { padding-bottom: 0 !important; }
.qu-stack { display: grid; }
.qu-state { grid-area: 1 / 1; }
.qu-idle { animation: qu-idle 7s var(--qe) infinite; }
.qu-busy { opacity: 0; animation: qu-busy 7s var(--qe) infinite; }
.qu-done { opacity: 0; animation: qu-done 7s var(--qe) infinite; }
.qu-receipt { margin-top: 12px; opacity: 0; animation: qu-receipt 7s var(--qe) infinite; }
.qu-receipt .dvx-read { margin: 0; }
.qu-file {
  position: absolute; left: 50%; top: 13%; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 14px; background: #fff;
  font-size: 12.5px; color: var(--ink); white-space: nowrap;
  box-shadow: 0 12px 24px -10px #0e3a3e55;
  animation: qu-file 7s var(--qe) infinite;
}
.qu-file .doc-thumb { width: 30px; height: 38px; padding: 6px 5px; gap: 3px; }
.qu-file .doc-thumb b { font-size: 6px; left: 4px; bottom: 4px; padding: 0 2px; }
@keyframes qu-file {
  0% { opacity: 0; transform: translate(-130%, 120%) rotate(-10deg) scale(.9); }
  6% { opacity: 1; transform: translate(-120%, 100%) rotate(-8deg) scale(1); }
  22% { opacity: 1; transform: translate(-50%, 0) rotate(0) scale(1.02); }
  26% { opacity: 0; transform: translate(-50%, 0) scale(.9); }
  100% { opacity: 0; }
}
@keyframes qu-idle { 0%, 25% { opacity: 1; } 28%, 97% { opacity: 0; } 100% { opacity: 1; } }
@keyframes qu-busy { 0%, 26% { opacity: 0; } 29%, 60% { opacity: 1; } 63%, 100% { opacity: 0; } }
@keyframes qu-done { 0%, 61% { opacity: 0; } 64%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes qu-receipt { 0%, 64% { opacity: 0; transform: translateY(10px); } 70%, 94% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }

/* 3 · ask: the Atlas rail, mid-conversation */
.ask-visual { align-items: flex-start; padding: 18px; }
.qa-frame .ar { margin: 0; height: 356px; }
.qa-frame [data-step] { opacity: 0; }
.qa-frame [data-step="q"] { animation: qa-q 7s var(--qe) infinite; }
.qa-frame [data-step="wait"] { animation: qa-wait 7s var(--qe) infinite; }
.qa-frame [data-step="a"] { animation: qa-a 7s var(--qe) infinite; }
.qa-frame .ar-thread { display: grid; }
.qa-frame [data-step="wait"], .qa-frame [data-step="a"] { grid-row: 2; grid-column: 1; }
@keyframes qa-q { 0%, 6% { opacity: 0; transform: translateY(8px); } 10%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes qa-wait { 0%, 16% { opacity: 0; } 20%, 40% { opacity: 1; } 43%, 100% { opacity: 0; } }
@keyframes qa-a { 0%, 42% { opacity: 0; transform: translateY(8px); } 47%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ============================================================
   STORY ART
   ============================================================ */
.accounts-art .plat-fit { position: absolute; top: 11%; left: 9%; }
.accounts-art .plat-fit .plat { border-radius: 20px; box-shadow: 0 24px 60px -28px #0e3a3e66; overflow: hidden; }
.accounts-art .ah { padding: 0; }
.accounts-art .mn { padding-bottom: 0 !important; }
.sa-frame .mn, .tx-frame .mn, .rv-frame .mn, .bm-frame .mn, .bd-frame .mn { padding-bottom: 0 !important; }
.statement-art .plat { background: transparent; }
.sa-read { margin-top: 14px; }
.sa-read .dvx-read { margin: 0; background: var(--bg-elevated); border-radius: 18px; }
.sa-busy { animation: sa-busy 8s var(--expo) infinite; }
.sa-done { opacity: 0; animation: sa-done 8s var(--expo) infinite; }
@keyframes sa-busy { 0%, 18% { opacity: 1; } 21%, 100% { opacity: 0; } }
@keyframes sa-done { 0%, 19% { opacity: 0; } 22%, 94% { opacity: 1; } 97%, 100% { opacity: 0; } }
.statement-art:not(.is-playing) .sa-busy { opacity: 1; animation: none; }
.why-art { padding: 28px 0 0 28px; overflow: hidden; justify-content: flex-start; }
.why-art .plat { border-radius: 18px 0 0 0; overflow: hidden; box-shadow: 0 24px 60px -30px #0e3a3e66; }

/* ============================================================
   HEALTH STAGE
   ============================================================ */
.voice-backdrop { position: absolute; inset: 0; opacity: .9; overflow: hidden; }
.voice-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #f5f5f500 10%, #f5f5f5cc 55%, #f5f5f5 85%); pointer-events: none; }
.v-panel { position: absolute; }
.v-panel .plat { background: transparent; }
.v-main { z-index: 3; left: 22px; bottom: 22px; width: 50%; }
.v-main .fh-picture-card { box-shadow: 0 20px 50px -24px #20232c55; }
.v-settings { z-index: 2; top: 70px; right: 22px; width: 330px; }
.v-settings .setup-card { box-shadow: 0 20px 50px -24px #20232c55; }
.v-learned { z-index: 4; right: 22px; bottom: 22px; width: 200px; }
.v-learned .fh-rating-card { box-shadow: 0 20px 50px -24px #20232c55; }
.v-panel .fh-page { padding: 0; }

/* ============================================================
   FOLLOW-UP SPREADS
   ============================================================ */
.budget-main { align-items: flex-start; padding: 34px 40px 0; }
.budget-main .plat-fit { border-radius: 18px 18px 0 0; overflow: hidden; }
.budget-main .obe { padding-top: 0; }
.budget-detail { padding: 32px 22px; }
.budget-detail .obe { padding: 0; }
.review-main { position: relative; display: block; height: 520px; padding: 0; }
.review-sheet {
  position: absolute; top: 56px; left: 11%; width: calc(100% - 40px);
  border-radius: 22px; overflow: hidden;
  background: var(--paper, #fff);
  box-shadow: 0 18px 50px #294b4a30, 0 1px 2px #ffffffb3 inset;
}

@media (max-width: 1199px) {
  .v-settings { width: 290px; }
  .v-learned { width: 200px; }
}
@media (max-width: 900px) {
  .v-main { left: 14px; bottom: 14px; width: calc(100% - 28px); }
  .v-settings { top: 60px; right: 14px; width: min(330px, calc(100% - 28px)); }
  .v-learned { top: 60px; left: 14px; right: auto; bottom: auto; width: 200px; }
}
@media (max-width: 800px) {
  .v-learned { top: 420px; }
  .budget-main { padding: 20px 16px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .qc-open, .qu-busy, .qu-idle, .sa-busy { opacity: 0 !important; }
  .qc-ov, .qc-done, .qu-done, .qu-receipt, .sa-done, .qa-frame [data-step="q"], .qa-frame [data-step="a"] { opacity: 1 !important; animation: none !important; transform: none !important; }
  .qa-frame [data-step="wait"], .qu-file, .qc-pointer { display: none; }
}

/* Frames have a fixed virtual width; never let it widen the layout tracks
   that hold them — the frame scales to the track, not the other way round. */
.story-chapters { grid-template-columns: minmax(0, 1fr); }
.story-chapter, .story-art, .benefit-panel, .quick-visual, .quick-steps > li, .v-panel, .voice-workspace { min-width: 0; }
@media (min-width: 1001px) { .benefit-artwork { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
@media (min-width: 801px) and (max-width: 1000px) { .benefit-artwork { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
@media (max-width: 800px) { .benefit-artwork { grid-template-columns: minmax(0, 1fr); } .review-main { height: 380px; } .budget-detail { padding: 22px; } }
.story-art { overflow: hidden; }

/* Fragments lifted out of the Budget page keep its two-column grid; each
   frame holds one column of it, so give that column the full width. */
.bm-frame .obe-grid, .bd-frame .obe-grid { grid-template-columns: minmax(0, 1fr); }
/* The Health stage backdrop shows the page; it is not a switchable pane. */
.voice-backdrop .plat-app .mn[data-pane]:not(.is-active) { display: flex; }
/* Health cards lifted out of the report keep its two-column hero grid. */
.v-panel .plat .fh-hero-grid.fh-scorecard-hero { grid-template-columns: minmax(0, 1fr); }
