/* Homepage v2: one player in the hero, a ranked benefits block, and a shorter page.
   Loaded after home.css. New components use their own class names so earlier rules don't apply. */

/* ---------- Hero: copy beside the stage (player + questions) ---------- */
.hero { padding-block:44px 40px; }

.stage-grid {
  display:grid;
  grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr);
  grid-template-areas:"intro stage" "actions stage";
  grid-template-rows:auto 1fr;
  column-gap:56px;
  align-items:start;
}
.stage-grid > * { min-width:0; }
.stage-grid .hero-copy { align-self:end; padding-top:18px; }
.stage-grid .hero-actions { align-self:start; }

.hero h1 { font-size:clamp(40px,4.1vw,58px); line-height:1.05; }
.hero .hero-lede { font-size:19px; margin-top:22px; }

.stage {
  grid-area:stage;
  position:relative;
  isolation:isolate;
  display:grid;
  grid-template-columns:minmax(0,280px) minmax(0,1fr);
  gap:22px;
  align-items:start;
  padding:22px;
  border-radius:26px;
  scroll-margin-top:112px;
}

.stage-player { margin:0; min-width:0; display:grid; grid-template-columns:minmax(0,1fr); gap:10px; }

/* A thin outline so the recording reads as a phone. The outline clips the picture, which is
   enlarged a hair so the dark and grey lines at the very edge of each screen recording fall
   outside it. */
.stage-phone {
  position:relative;
  width:100%;
  overflow:hidden;
  /* A new stacking context, and a radius on the picture too, so browsers that don't clip an
     enlarged child to its parent's rounded corners still show them. */
  isolation:isolate;
  border:3px solid var(--navy);
  border-radius:24px;
  background:white;
  box-shadow:0 24px 60px #102d5733;
}
.stage-phone video {
  display:block;
  width:100%;
  aspect-ratio:740/1620;
  border-radius:21px;
  background:white;
  transform:scale(1.014);
}
/* Untrimmed whenever the browser's own controls are showing (no script, playback declined, or
   full screen), so its control bar is never cut off. */
.stage-phone video[controls],
.stage-phone video:fullscreen { transform:none; border-radius:0; }

/* The overlay is an enhancement: without the script the native controls do the work. */
.stage-play { display:none; }
.js .stage-phone[data-idle] .stage-play {
  position:absolute;
  inset:0;
  display:grid;
  justify-items:center;
  align-content:end;
  padding:0 0 75%;
  width:100%;
  border:0;
  background:linear-gradient(180deg,#071e4300 55%,#071e4326 100%);
  color:white;
}
.stage-play-label {
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:52px;
  padding:10px 22px 10px 18px;
  border-radius:999px;
  background:var(--navy);
  font-weight:650;
  font-size:16px;
  box-shadow:0 10px 26px #071e4352;
}
.stage-play-label::before {
  content:"";
  border:7px solid transparent;
  border-right:0;
  border-left:11px solid currentColor;
}
.stage-play:hover .stage-play-label { background:var(--blue); }
.stage-play:focus-visible { outline-offset:-6px; }

.stage-controls {
  width:100%;
  align-items:center;
  gap:8px;
  padding:6px;
  border-radius:12px;
  background:white;
}
.stage-toggle,.stage-full {
  flex:none;
  min-height:44px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:9px;
  background:white;
  color:var(--navy);
  font-size:14px;
  font-weight:600;
}
.stage-toggle { min-width:68px; background:var(--navy); border-color:var(--navy); color:white; }
.stage-toggle:hover { background:var(--blue); border-color:var(--blue); }
.stage-full:hover { background:var(--soft); border-color:var(--blue); }
.stage-toggle:focus-visible,.stage-full:focus-visible { outline-offset:2px; }
.stage-seek {
  flex:1;
  min-width:0;
  height:44px;
  margin:0;
  accent-color:var(--blue);
  cursor:pointer;
}
.stage-seek:disabled { cursor:default; opacity:.45; }
.stage-full:disabled { color:var(--muted); background:var(--paper); }
.stage-full:disabled:hover { border-color:var(--line); background:var(--paper); }
.stage-seek:focus-visible { outline:3px solid #0b5cd5; outline-offset:-4px; border-radius:8px; }
.js .stage-phone video { cursor:pointer; }

.stage-caption { width:100%; text-align:center; }
.stage-label { color:var(--navy); line-height:1.35; }
.stage-label strong { display:block; font-size:15px; font-weight:700; }
.stage-label span { display:block; font-size:14px; font-weight:500; }

.stage-questions {
  padding:20px 18px 18px;
  border-radius:18px;
  background:#fffffff0;
  box-shadow:0 18px 48px #102d5722;
}
.stage-questions h2 {
  font-size:26px;
  line-height:1.15;
  letter-spacing:-.03em;
}
.stage-hint { margin-top:6px; font-size:14px; color:var(--muted); }
.stage-questions h3 {
  margin:16px 0 8px;
  font-size:13px;
  font-weight:650;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--blue);
}
.stage-questions ul { margin:0; display:grid; gap:6px; }
.stage-questions a {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  min-height:48px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:white;
  color:var(--ink);
  font-size:15px;
  line-height:1.35;
  text-decoration:none;
}
.stage-questions a:hover,
.stage-questions a[aria-current] {
  border-color:var(--blue);
  background:var(--soft);
  color:var(--navy);
}
.stage-questions a[aria-current] { font-weight:600; }
.stage-questions a:focus-visible { outline-offset:-3px; }
.stage-questions small { flex:none; font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; }

.stage-note {
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--line);
  font-size:13px;
  line-height:1.5;
  color:var(--muted);
}

/* ---------- Benefits: one idea beside three reasons ---------- */
.why-lead {
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  gap:56px;
  align-items:start;
}
.why-quote {
  position:sticky;
  top:128px;
  padding:44px 40px;
  border-radius:26px;
  background:var(--navy);
  color:white;
  font-family:var(--serif);
  font-size:clamp(34px,3.5vw,50px);
  font-weight:430;
  line-height:1.08;
  letter-spacing:-.04em;
}
.why-primary { margin:0; padding:0; list-style:none; counter-reset:why; }
.why-primary li {
  counter-increment:why;
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  column-gap:14px;
  padding:26px 0;
  border-top:1px solid var(--line);
}
.why-primary li:last-child { border-bottom:1px solid var(--line); }
.why-primary li::before {
  content:counter(why);
  grid-row:1 / span 2;
  font-family:var(--serif);
  font-size:38px;
  line-height:1;
  color:var(--blue);
}
.why-primary h3 { font-size:24px; color:var(--navy); }
.why-primary p { grid-column:2; margin-top:8px; font-size:17px; color:#344761; max-width:56ch; }


/* ---------- How it works, with the written-guide sample folded in ---------- */
.steps { counter-reset:step; }
.steps li { counter-increment:step; }
.steps li::before {
  content:counter(step);
  display:block;
  margin-bottom:10px;
  font-family:var(--serif);
  font-size:30px;
  line-height:1;
  color:var(--blue);
}

.experience-block {
  margin-top:72px;
  padding:48px;
  border:1px solid var(--line);
  border-radius:26px;
  background:var(--paper);
  scroll-margin-top:112px;
}
.experience-block .section-heading { margin-bottom:36px; }
h2.block-title {
  font-family:var(--serif);
  font-weight:430;
  font-size:clamp(30px,3vw,42px);
  line-height:1.08;
  letter-spacing:-.04em;
  color:var(--navy);
}
.experience-block .guide-demo { gap:56px; }

/* ---------- What patients receive: the handout and the card ---------- */
.handouts {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,300px) minmax(0,340px);
  gap:48px;
  align-items:center;
  margin-top:64px;
  padding:44px 48px;
  border:1px solid var(--line);
  border-radius:26px;
  background:var(--paper);
}
.handouts-copy h3 {
  font-family:var(--serif);
  font-weight:430;
  font-size:clamp(28px,2.6vw,38px);
  line-height:1.1;
  letter-spacing:-.035em;
  color:var(--navy);
}
.handouts-copy p { margin-top:14px; font-size:17px; color:#344761; max-width:40ch; }
.handouts-copy .handouts-note { font-size:14px; color:var(--muted); }
.handout-sample { margin:0; }
.handout-sample a {
  display:block;
  border-radius:6px;
  background:white;
  box-shadow:0 1px 2px #102d5726,0 18px 40px #102d5724;
  transition:box-shadow .18s,transform .18s;
}
.handout-sample-card a { border-radius:10px; overflow:hidden; }
.handout-sample a:hover { transform:translateY(-2px); box-shadow:0 2px 4px #102d5726,0 24px 52px #102d5730; }
.handout-sample img { width:100%; border-radius:inherit; }
.handout-sample figcaption { margin-top:14px; font-size:14px; font-weight:600; color:var(--navy); text-align:center; }

/* The enlarged sample. The dialog itself is the dimmed, scrollable area; a click on it closes. */
.sample-dialog {
  /* Percentages, not viewport units: a modal dialog is already pinned to the visible area, so
     this stays clear of phone toolbars and of the page's scrollbar. */
  width:100%;
  max-width:none;
  height:100%;
  max-height:none;
  margin:0;
  padding:76px 20px calc(32px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color:transparent;
  border:0;
  background:#071e43d9;
  overflow:auto;
  overscroll-behavior:contain;
}
.sample-dialog::backdrop { background:transparent; }
/* Keep the page behind where it was while a sample is open. */
html:has(.sample-dialog[open]) { overflow:hidden; }
.sample-dialog img {
  width:min(100%,850px);
  height:auto;
  margin-inline:auto;
  border-radius:6px;
  background:white;
  box-shadow:0 24px 70px #00000066;
}
.sample-dialog[data-sample="Card"] img { width:min(100%,700px); border-radius:12px; }
.sample-dialog-close {
  position:fixed;
  top:16px;
  right:20px;
  min-height:44px;
  padding:8px 18px;
  border:1px solid white;
  border-radius:11px;
  background:white;
  color:var(--navy);
  font-size:15px;
  font-weight:650;
}
.sample-dialog-close:hover { background:var(--soft); }
.sample-dialog-close:focus-visible { outline:3px solid white; outline-offset:3px; }
.js .handout-sample a { cursor:zoom-in; }

/* ---------- Closing box and footer: a second way to reach us ---------- */
.demo-contact > p { margin-top:14px; max-width:60ch; font-size:17px; color:#344761; }
.closing-actions { margin-top:26px; }
.button.secondary { border-color:var(--blue); background:white; color:var(--navy); }
.button.secondary:hover { background:var(--soft); color:var(--navy); }
.demo-contact > p.closing-signin { margin-top:18px; font-size:15px; }
.closing-signin a { display:inline-flex; align-items:center; min-height:44px; }

/* ---------- Privacy: what holding no patient data means for the practice ---------- */
.trust-intro > p.trust-note { max-width:440px; margin-top:30px; font-size:18px; line-height:1.6; color:#c9d6ea; }
.trust-note strong { display:block; margin-bottom:8px; font-size:21px; font-weight:620; letter-spacing:-.02em; line-height:1.3; color:white; }

/* ---------- Workspace: facts as a compact grid above a shorter sample ---------- */
.workspace-facts {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px 32px;
  padding-left:0;
}
.workspace-facts li {
  margin:0;
  padding:12px 0 0;
  border-top:1px solid var(--line);
  font-size:15px;
  line-height:1.5;
}

/* ---------- Tablet ---------- */
@media (max-width:1150px) {
  .stage-grid {
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"intro" "stage" "actions";
    row-gap:28px;
  }
  .stage-grid .hero-copy { padding-top:0; }
  .hero .hero-lede { max-width:68ch; }
  .stage { grid-template-columns:minmax(0,270px) minmax(0,1fr); }
  .why-lead { gap:36px; }
  .why-quote { padding:34px 30px; }
  .experience-block { padding:36px; }
  .workspace-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .handouts { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:32px; padding:36px; }
  .handouts-copy { grid-column:1 / -1; }
}

/* ---------- Phones ---------- */
@media (max-width:700px) {
  .hero { padding-block:24px 32px; }
  .hero h1 { font-size:32px; }
  .hero .hero-lede { font-size:16px; margin-top:14px; }
  .stage-grid { row-gap:20px; }

  .stage {
    grid-template-columns:minmax(0,1fr);
    gap:14px;
    padding:16px 0 0;
    border-radius:0;
  }
  .stage .optical-art { display:none; }
  .stage-player { width:min(100%,270px); margin-inline:auto; }
  .stage-controls { padding:0; background:transparent; }

  .stage-questions { padding:0; background:transparent; box-shadow:none; }
  .stage-questions h2 { font-size:22px; }
  .stage-questions h3 { margin-top:14px; }
  /* Questions scroll sideways so the list stays short under the tall player. */
  .stage-questions ul {
    grid-auto-flow:column;
    grid-auto-columns:min(78%,17rem);
    margin-inline:-20px;
    padding:2px 20px 8px;
    overflow-x:auto;
    scroll-snap-type:x proximity;
    scroll-padding-inline:20px;
    overscroll-behavior-x:contain;
  }
  .stage-questions li { scroll-snap-align:start; }
  .stage-questions a { height:100%; min-height:56px; }


  .why-lead { grid-template-columns:1fr; gap:22px; }
  .why-quote { position:static; padding:26px 22px; border-radius:20px; font-size:30px; }
  .why-primary li { grid-template-columns:34px minmax(0,1fr); padding:20px 0; }
  .why-primary li::before { font-size:30px; }
  .why-primary h3 { font-size:20px; }
  .why-primary p { font-size:16px; }

  .experience-block { margin-top:48px; padding:28px 0 0; border:0; border-top:1px solid var(--line); border-radius:0; background:transparent; }
  h2.block-title { font-size:26px; }
  .workspace-facts { grid-template-columns:1fr; }
  .handouts { grid-template-columns:1fr; gap:26px; margin-top:44px; padding:26px 20px; border-radius:20px; }
  .handout-sample { width:min(100%,300px); margin-inline:auto; }
  .handout-sample-card { width:min(100%,320px); }
  .trust-note strong { font-size:19px; }
}

/* The page gutter narrows to 16px here; keep the sideways question list inside it. */
@media (max-width:360px) {
  .stage-questions ul { margin-inline:-16px; padding-inline:16px; scroll-padding-inline:16px; }
}

@media print {
  .stage-play, .stage-controls, .stage .optical-art { display:none!important; }
  .sample-dialog { display:none!important; }
  .trust-intro > p.trust-note, .trust-note strong { color:var(--ink); }
}

/* Small spacing fixes around the guides and the workspace sample. */
.product-grid + p { margin-top:20px; color:var(--muted); }
.sample-readonly { margin-top:14px; }

/* Tighter vertical rhythm on wide screens, where the sections are short and the gaps read as empty. */
@media (min-width:1151px) {
  .section { padding:88px 0; }
  .intro-section { padding-top:80px; }
  .experience-block { margin-top:64px; }
}
