/* healow™ phone app preview.

   Two layers here, and they must not bleed into each other:
     · the PAGE  — a normal desktop marketing/spec page, using styles.css
     · the PHONE — everything inside .device, which is its own little product
       at phone scale. Type inside the frame is sized as if on a 390pt screen,
       so it is deliberately larger relative to its container than page type.

   The frame is a fixed 390×844 (iPhone 15 logical size) and is scaled with a
   transform on small screens rather than reflowed — a reflowed mock stops
   being a faithful preview of the app.
*/

/* ── page layout ──────────────────────────────────────────────────────── */

.app-hero { padding: clamp(32px, 5vw, 62px) 0 clamp(30px, 4vw, 52px); }
.app-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(30px, 5vw, 70px); align-items: start; }

.screen-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  transition: all .14s ease;
}
.chip:hover { border-color: #D6DEEC; color: var(--ink); background: var(--paper); }
.chip.on { background: var(--grad-accent); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -8px rgba(37,99,235,.5); }

.spec-list { display: grid; gap: 11px; margin: 24px 0 0; padding: 0; list-style: none; }
.spec-list li { display: flex; gap: 11px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.spec-list .ic { flex: none; margin-top: 2px; color: var(--accent); width: 16px; height: 16px; }

/* ── device frame ─────────────────────────────────────────────────────── */

.device-stage { display: flex; justify-content: center; position: relative; }
.device-stage::before {
  content: ''; position: absolute; inset: 8% -12% 2%;
  background: radial-gradient(60% 50% at 50% 50%, rgba(124,58,237,.16), transparent 70%);
  filter: blur(34px); z-index: 0;
}

.device {
  position: relative; z-index: 1;
  width: 390px; height: 844px; flex: none;
  background: #0B1120; border-radius: 54px; padding: 11px;
  box-shadow: 0 2px 0 rgba(255,255,255,.14) inset,
              0 40px 90px -34px rgba(30,41,90,.55),
              0 12px 30px -18px rgba(15,23,42,.4);
}
.device-screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: 44px; background: var(--paper); display: flex; flex-direction: column;
}

/* dynamic island */
.island {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 112px; height: 31px; border-radius: 999px; background: #0B1120; z-index: 20;
}

.status-bar {
  flex: none; height: 52px; padding: 0 28px 0 32px;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink);
  font-family: var(--font-body); letter-spacing: -.01em;
}
.status-bar .right { display: flex; align-items: center; gap: 5px; }
.status-bar svg { width: 16px; height: 11px; }

/* app header inside the phone */
.ph-head {
  flex: none; padding: 6px 20px 12px; background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px;
}
.ph-head.clear { background: transparent; border-bottom: none; }
.ph-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -.03em; }
.ph-sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.ph-head-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; flex: none; }
.ph-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--grad-accent); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.ph-icbtn { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--ink-soft); background: var(--paper); position: relative; flex: none; }
.ph-icbtn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--neg); border: 1.5px solid #fff; }

/* scrollable app body */
.ph-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 24px; }
.ph-body::-webkit-scrollbar { width: 0; }
.ph-body.flush { padding: 0 0 24px; }
.ph-screen { animation: rise .32s cubic-bezier(.2,.7,.3,1) both; }

/* phone-scale components */
.ph-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 17px; box-shadow: var(--shadow-card); margin-bottom: 13px;
}
.ph-card.grad { background: var(--grad-accent); border-color: transparent; color: #fff; box-shadow: 0 14px 30px -14px rgba(37,99,235,.65); }
.ph-card.grad .ph-k, .ph-card.grad .ph-s { color: rgba(255,255,255,.78); }
.ph-k { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); }
.ph-h { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin-top: 7px; }
.ph-s { font-size: 13px; color: var(--ink-soft); margin-top: 5px; line-height: 1.5; }
.ph-sec { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin: 20px 4px 10px; }
.ph-sec:first-child { margin-top: 4px; }

.ph-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ph-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 10px 12px; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
.ph-tile:active { transform: scale(.96); }
.ph-tile .bx { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 8px; }
.ph-tile .bx .ic { width: 19px; height: 19px; }
.ph-tile .lb { font-size: 11.5px; font-weight: 500; line-height: 1.3; }
.ph-tile .n { position: absolute; }
.ph-badge {
  display: inline-block; min-width: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--neg); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 17px; text-align: center; margin-left: 5px;
}

.ph-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line-soft); width: 100%; text-align: left;
  cursor: pointer; background: none; border-inline: none; border-top: none;
}
.ph-row:last-child { border-bottom: none; }
.ph-row-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ph-row-main { flex: 1; min-width: 0; }
.ph-row-t { font-size: 14px; font-weight: 500; line-height: 1.35; }
.ph-row-s { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.ph-row-end { text-align: right; flex: none; font-size: 12px; color: var(--ink-soft); }
.ph-row.unread .ph-row-t { font-weight: 600; }

.ph-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.ph-pill .ic { width: 11px; height: 11px; stroke-width: 2.4; }

.ph-btn {
  width: 100%; padding: 13px 16px; border-radius: 14px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; box-shadow: 0 10px 22px -12px rgba(15,23,42,.8);
  transition: transform .14s ease;
}
.ph-btn:active { transform: scale(.98); }
.ph-btn.ghost { background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line); box-shadow: none; }
.ph-btn.sm { padding: 9px 14px; font-size: 13.5px; border-radius: 12px; width: auto; }
.ph-btn.light { background: rgba(255,255,255,.18); color: #fff; box-shadow: none; backdrop-filter: blur(4px); }

.ph-input {
  width: 100%; padding: 14px 15px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16px; outline: none; color: var(--ink);
}
.ph-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.ph-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 0 0 7px 3px; }

/* tab bar */
.tabbar {
  flex: none; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 9px 6px 26px; background: rgba(255,255,255,.93);
  backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--line-soft);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-faint); font-size: 10px; font-weight: 500; position: relative; }
.tab .ic { width: 21px; height: 21px; }
.tab.on { color: var(--accent); }
.tab .n {
  position: absolute; top: -3px; right: 50%; margin-right: -20px;
  min-width: 16px; height: 16px; line-height: 16px; border-radius: 999px;
  background: var(--neg); color: #fff; font-size: 9.5px; font-weight: 700; text-align: center; padding: 0 4px;
}
.home-bar { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 999px; background: #0F172A; opacity: .3; z-index: 20; }

/* onboarding screens use the full bleed */
.ph-splash {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 0 28px 40px; background: var(--page-wash); text-align: left;
}
.ph-splash .mark { width: 58px; height: 58px; border-radius: 17px; background: #fff; border: 1px solid var(--line); padding: 7px; object-fit: contain; box-shadow: var(--shadow-card); margin-bottom: 24px; }
.ph-splash h2 { font-size: 27px; letter-spacing: -.035em; line-height: 1.15; }
.ph-splash p { font-size: 14.5px; color: var(--ink-soft); margin-top: 11px; line-height: 1.6; }

.code-cells { display: flex; gap: 9px; margin: 22px 0 6px; }
.code-cell {
  flex: 1; aspect-ratio: 1 / 1.24; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 23px; font-weight: 600; color: var(--ink);
}
.code-cell.filled { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

.pin-dots { display: flex; gap: 16px; justify-content: center; margin: 26px 0 32px; }
.pin-dot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line); }
.pin-dot.on { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.key {
  aspect-ratio: 1.5 / 1; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--ink);
  display: grid; place-items: center; transition: transform .1s ease, background .1s ease;
}
.key:active { transform: scale(.95); background: var(--paper); }
.key.blank { background: none; border: none; }

/* mini chart inside the phone */
.ph-chart { margin-top: 12px; }
.ph-chart svg { display: block; overflow: visible; }

/* gallery of static screens below the fold */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 24px; }
.mini-device {
  width: 100%; max-width: 234px; margin: 0 auto; aspect-ratio: 390 / 844;
  background: #0B1120; border-radius: 32px; padding: 6px;
  box-shadow: 0 24px 50px -26px rgba(30,41,90,.5);
}
.mini-screen { width: 100%; height: 100%; border-radius: 27px; overflow: hidden; background: var(--paper); position: relative; }
.mini-screen > .scaler {
  width: 390px; height: 844px; transform-origin: top left; position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column; pointer-events: none;
}
.gallery figcaption { text-align: center; margin-top: 14px; }
.gallery figcaption b { display: block; font-family: var(--font-display); font-size: 14px; font-weight: 600; }
.gallery figcaption span { font-size: 12.5px; color: var(--ink-faint); }

@media (max-width: 1080px) {
  .app-grid { grid-template-columns: 1fr; }
  .device-stage { margin-top: 10px; }
}
@media (max-width: 460px) {
  /* Scale, never reflow — a reflowed frame stops being a preview. */
  .device { transform: scale(.82); transform-origin: top center; margin-bottom: -150px; }
}
