/*
 * Phones. One switch, the same as main.js: portrait up to 900 px wide (a phone, or an iPad stood upright)
 * stacks the film — the chapter's name and its head-turner in the top band, the device as the hero of the
 * middle, the control at the bottom; a phone on its side gets a compact split. Desktop never reads past the
 * first block below.
 */

/* what only phones show */
.m-h, .m-chips, .m-note, .m-t, .sl-m, .hero-msub, .hero-trial { display: none; }
/* the reminder's card that grows into the app (phones only; never drawn elsewhere) */
.lk-grow { left: 0; top: 0; width: 0; height: 0; opacity: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
/* the app switcher's labels (icon and name over each card): phones only */
.sw-lab { position: absolute; left: 0; top: 0; opacity: 0; display: flex; align-items: center; gap: 9px; font-family: var(--sf); font-size: 19px; font-weight: 600; color: #fff; white-space: nowrap; pointer-events: none; }
.sw-lab img, .sw-nic { width: 26px; height: 26px; border-radius: 7px; }
.sw-nic { background: linear-gradient(180deg, #ffd23f 0 30%, #fbfbf8 30%); box-shadow: inset 0 -9px 0 -8px rgba(0, 0, 0, 0.08); }
/* the opening's two phone lines are a chapter's words without a control */
.hero-cap .seg, .hero-cap .ch-get { display: none; }

@media (orientation: portrait) and (max-width: 900px), (orientation: landscape) and (max-height: 520px) {
  html, body { overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
  .sl-d { display: none; }
  .sl-m { display: inline; }

  /* ——— nav: the Pixello mark, GHIM, Get — slim, over the safe area ——— */
  .nav { height: calc(env(safe-area-inset-top) + 50px); padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); grid-template-columns: 1fr auto 1fr; }
  .nav-mark { font-size: 0; gap: 0; width: 34px; height: 34px; justify-content: center; margin-left: -8px; }
  .nav-logo { width: 18px; height: 18px; }
  .nav-app { font-size: 14px; gap: 8px; }
  .nav-app img { width: 24px; height: 24px; border-radius: 6.5px; }
  .nav-get { height: 32px; padding: 0 14px; font-size: 13.5px; font-weight: 680; }

  /* ——— the rail: a slim progress line under the nav, one stroke per chapter ——— */
  .rail { left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); top: calc(env(safe-area-inset-top) + 48px); bottom: auto; transform: none; padding: 0; gap: 3px; border-radius: 0; }
  .rail button { flex: 1 1 0; min-width: 0; height: 14px; padding: 0; font-size: 0; color: transparent; }
  .rail button::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 1px; background: rgba(var(--rail-rgb), 0.2); }
  .rail button i { top: 6px; bottom: auto; height: 2px; opacity: 1; }

  /* ——— a chapter's words: name and head-turner on top, the control at the bottom of what is always visible ——— */
  .ch {
    top: calc(env(safe-area-inset-top) + 72px); bottom: auto; left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); width: auto;
    height: calc(var(--hs, 100svh) - env(safe-area-inset-top) - 72px); padding-bottom: max(16px, env(safe-area-inset-bottom));
    justify-content: flex-start; align-items: stretch; gap: 12px; pointer-events: none;
  }
  .ch > * { pointer-events: auto; }
  .ch-head { gap: 10px; }
  .ch-ic { width: 30px; height: 30px; border-radius: 9px; }
  .ch-head b { font-size: 14.5px; font-weight: 720; letter-spacing: 0; }
  .ch-head p > span, .ch-head p.has-mt > b:first-child { display: none; }
  .ch-head p > b.m-t { display: block; }
  .ch-stmts { height: var(--stmt-h, 150px); }
  .stmt h2, .stmt ul { display: none; }
  .m-h {
    display: block; font-size: clamp(30px, 9.3vw, 44px); font-weight: 820; font-stretch: 125%; line-height: 1.0; letter-spacing: -0.035em;
    color: var(--ink); text-wrap: balance;
  }
  .m-h .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0 0.1em; margin: -0.04em 0 -0.1em; }
  .m-h .w > span { display: inline-block; will-change: transform, opacity; }
  .m-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  .m-chip {
    display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 4px; border-radius: 999px; white-space: nowrap;
    font-size: 13px; font-weight: 640; letter-spacing: -0.005em; color: var(--ink);
    background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); will-change: transform, opacity;
  }
  .m-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--acc); background: color-mix(in oklab, var(--acc) 20%, transparent); }
  .m-ic .i { width: 13px; height: 13px; }
  .seg { margin-top: auto; align-self: center; --sh: 36px; --sp: 13px; --segf: 13.5px; }
  .ch-get { display: none; }
  .m-note { display: flex; align-items: center; justify-content: center; gap: 8px; align-self: center; margin-top: -2px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
  .m-note.soon::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px color-mix(in oklab, var(--acc) 24%, transparent); }

  /* ——— the old way, on a phone: Notes set large enough to read, each pain highlighted as its words arrive ——— */
  .app-notes .nt-in { left: 20px; right: 20px; }
  .app-notes .nt-date { font-size: 14px; margin: 6px 0 12px; }
  .app-notes .nt-h { font-size: 36px; margin-bottom: 12px; }
  .app-notes .nt-l { font-size: 23px; line-height: 1.38; }
  .app-notes .nt-shot { display: none; }
  .app-notes .nt-gap { height: 30px; }
  .nt-mk { --m: 0; border-radius: 4px; padding: 0 2px; margin: 0 -2px; background: linear-gradient(rgba(230, 180, 34, 0.42), rgba(230, 180, 34, 0.42)) no-repeat 0 60% / calc(var(--m) * 100%) 72%; }
  .nt-mk.r { background-image: linear-gradient(rgba(255, 107, 94, 0.46), rgba(255, 107, 94, 0.46)); }

  /* ——— the opening ——— */
  .hero-head { top: calc(env(safe-area-inset-top) + 66px); padding: 0 max(16px, env(safe-area-inset-left)); }
  .hero-h1 { font-size: clamp(48px, 16.4vw, 92px); line-height: 0.93; }
  .hero-sub { display: none; }
  .hero-msub { display: block; max-width: 22em; margin: 14px auto 0; font-size: 16px; line-height: 1.4; font-weight: 440; color: rgba(var(--ink-rgb), var(--soft)); text-wrap: balance; }
  .hero-msub b { color: var(--ink); font-weight: 680; }
  .curtain .hero-msub { color: rgba(241, 243, 238, 0.8); }
  .curtain .hero-msub b { color: #f1f3ee; }
  .hero-get { margin-top: 16px; gap: 12px; font-size: 13px; }
  .hero-get > span:not(.hero-trial) { display: none; }
  .hero-trial { display: inline; font-weight: 620; color: var(--ink-2); }
  .hero-get .badge { height: 36px; }

  /* ——— the close ——— */
  .close { padding: 0 max(20px, env(safe-area-inset-left)); }
  .close-icon { width: 84px; height: 84px; }
  .close h2 { font-size: clamp(44px, 14.6vw, 80px); margin-top: 20px; }
  .close-sub { font-size: 15.5px; margin-top: 14px; }
  .close-facts { flex-direction: column; gap: 6px; font-size: 13.5px; }
  .foot { flex-direction: column; gap: 10px; padding: 20px 0 max(20px, env(safe-area-inset-bottom)); font-size: 12px; text-align: center; }
  .foot nav { gap: 6px 16px; }
}

/* an iPad stood upright: the same stack, set larger */
@media (orientation: portrait) and (min-width: 600px) and (max-width: 900px) {
  .ch { top: calc(env(safe-area-inset-top) + 84px); left: 32px; right: 32px; height: calc(var(--hs, 100svh) - env(safe-area-inset-top) - 84px); gap: 16px; padding-bottom: max(26px, env(safe-area-inset-bottom)); }
  .ch-ic { width: 36px; height: 36px; border-radius: 11px; }
  .ch-head b { font-size: 17px; }
  .m-h { font-size: clamp(44px, 7.4vw, 64px); }
  .m-chips { gap: 10px; margin-top: 18px; }
  .m-chip { height: 38px; padding: 0 16px 0 6px; font-size: 15.5px; gap: 9px; }
  .m-ic { width: 28px; height: 28px; }
  .m-ic .i { width: 16px; height: 16px; }
  .seg { --sh: 42px; --sp: 18px; --segf: 15.5px; }
  .m-note { font-size: 14px; }
  .nav { height: calc(env(safe-area-inset-top) + 60px); padding-left: 32px; padding-right: 32px; }
  .rail { top: calc(env(safe-area-inset-top) + 58px); left: 32px; right: 32px; }
  .hero-msub { font-size: 20px; }
}

/* a phone on its side: the words in a compact column on the left, the device beside them */
@media (orientation: landscape) and (max-height: 520px) {
  .nav { height: calc(env(safe-area-inset-top) + 44px); }
  .rail { top: calc(env(safe-area-inset-top) + 42px); }
  .ch {
    top: 58px; left: max(20px, env(safe-area-inset-left)); right: auto; width: min(46vw, 400px); height: calc(var(--hs, 100svh) - 58px);
    padding-bottom: max(12px, env(safe-area-inset-bottom)); gap: 8px; justify-content: center;
  }
  .ch-head { display: none; }
  .m-h { font-size: clamp(24px, 6.4vh, 30px); }
  .m-chips { margin-top: 10px; }
  .seg { margin-top: 6px; align-self: flex-start; --sh: 32px; --sp: 11px; --segf: 12.5px; }
  .m-note { align-self: flex-start; }
  .hero-head { top: 54px; }
  .hero-h1 { font-size: clamp(40px, 13vh, 60px); }
  .hero-msub { margin-top: 8px; font-size: 14px; }
  .hero-get { margin-top: 10px; }
  .close-icon { display: none; }
  .close h2 { font-size: 40px; margin-top: auto; }
  .close-facts { flex-direction: row; gap: 18px; }
}
