/* Version 4, the mobile pass (4 November): the phone's own design. Every rule here sits inside a phone media query, so a
   desktop window never changes. "Phone" is a portrait window up to 760 px wide, or a phone held sideways (a coarse
   pointer and at most 500 px tall). The homepage's phone journey is built by js/journey.js (buildPhone), the menu
   sheet by js/mobile.js. Colours are the room's tokens. */

/* ---------- The menu: one calm row, a sheet of the room's glass for the pages ---------- */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  html:root body .site-head {
    position: fixed; top: 0; left: 0; right: 0; z-index: 30; flex-wrap: nowrap; align-items: center; gap: 8px;
    min-height: calc(env(safe-area-inset-top) + 60px); margin: 0;
    padding: calc(env(safe-area-inset-top) + 8px) max(10px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left));
    background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0;
    transition: translate 0.42s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.3s ease;
  }
  html:root body .site-head .site-brand { margin: 0; }
  html:root body .site-head .brand { gap: 10px; }
  html:root body .site-head .brand svg:first-child { width: 22px; height: 22px; }
  html:root body .site-head .brand svg:last-child { width: 86px; height: 16px; }
  html:root body .site-head .site-nav { display: none; }
  /* Request access: a quiet pill, its touch area a full 44 px. */
  html:root body .site-head .site-join {
    position: relative; margin-left: auto; display: inline-flex; align-items: center; height: 36px; padding: 0 15px;
    font-size: 14px; font-weight: 500; line-height: 1; border: 1px solid; border-radius: 999px; white-space: nowrap;
  }
  html:root body .site-head .site-join::after { content: ""; position: absolute; inset: -4px -2px; }
  /* Until js/mobile.js adds the menu button (at the end of the page), its place beside Request access is kept, so a
     first frame painted before it never moves the row (Lighthouse, 4 Nov). 44 px button + the row's 8 px gap. */
  html:root body .site-head:not(:has(> .m-menu-btn)) .site-join { margin-right: 52px; }
  .m-menu-btn {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%;
    background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .m-menu-lines { display: grid; gap: 6px; width: 20px; }
  .m-menu-lines i { display: block; height: 1.5px; border-radius: 1px; background: currentColor; }
  .m-menu-lines i:last-child { width: 13px; justify-self: end; }
  .m-menu-btn:focus-visible { outline: 2px solid #2b7a6f; outline-offset: -2px; }
  /* The row's surface: the room's light glass once the page moves under it, the night's glass at the close. */
  html:root body .site-head::before, html:root body .site-head::after {
    inset: 0; top: 0; left: 0; right: 0; bottom: 0; transition: opacity 0.35s ease;
    -webkit-backdrop-filter: blur(20px) saturate(1.15); backdrop-filter: blur(20px) saturate(1.15);
  }
  html:root body .site-head::before { background: rgba(236, 232, 224, 0.74); box-shadow: 0 1px 0 rgba(43, 39, 34, 0.07); }
  html:root body .site-head::after { background: rgba(18, 17, 18, 0.62); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06); }
  html:root body.nav-scrolled .site-head::before { opacity: calc(1 - var(--night, 0)); }
  html:root body.nav-scrolled .site-head::after { opacity: var(--night, 0); }
  html:root body:not(.nav-scrolled) .site-head::before, html:root body:not(.nav-scrolled) .site-head::after { opacity: 0; }
  /* While you read down the page the row steps aside; scrolling up brings it back. */
  html:root body.m-head-away .site-head { translate: 0 calc(-100% - 2px); }
  /* While the sheet is open the page stays where it was (only the root is held: on the homepage the body is a fixed
     height, and holding it would scroll the page back to the top). */
  html.m-menu-open { overflow: hidden; }

  .m-menu {
    position: fixed; inset: 0; z-index: 60; display: none; flex-direction: column; width: 100%; height: 100%; max-width: none; max-height: none;
    margin: 0; padding: calc(env(safe-area-inset-top) + 8px) max(10px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 22px) max(20px, env(safe-area-inset-left));
    border: 0; color: #2b2722; overflow-y: auto; overscroll-behavior: contain;
    background: rgba(236, 232, 224, 0.86); -webkit-backdrop-filter: blur(28px) saturate(1.1); backdrop-filter: blur(28px) saturate(1.1);
  }
  .m-menu[open] { display: flex; animation: m-fade 0.32s ease both; }
  .m-menu::backdrop { background: transparent; }
  .m-menu:focus { outline: none; }
  .m-menu.closing { animation: m-fade-out 0.22s ease both; }
  @keyframes m-fade { from { opacity: 0; } }
  @keyframes m-fade-out { to { opacity: 0; } }
  .m-menu-top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
  .m-menu-top .site-brand { display: inline-flex; color: inherit; text-decoration: none; }
  .m-menu-top .brand { gap: 10px; }
  .m-menu-top .brand svg:first-child { width: 22px; height: 22px; }
  .m-menu-top .brand svg:last-child { width: 86px; height: 16px; }
  .m-menu-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
  .m-menu-close svg { width: 22px; height: 22px; }
  .m-menu-nav { display: flex; flex-direction: column; margin: auto 0 0; padding: 28px 10px 0 0; }
  .m-menu-nav a, .m-menu-join {
    display: flex; align-items: center; justify-content: space-between; min-height: 64px; text-decoration: none; color: inherit;
    animation: m-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(80ms + var(--i, 0) * 45ms);
  }
  .m-menu-nav a { font: 500 38px/1.1 'Cormorant Garamond', serif; letter-spacing: -0.01em; border-bottom: 1px solid rgba(43, 39, 34, 0.1); }
  .m-menu-nav a svg, .m-menu-join svg { width: 22px; height: 22px; color: #8a857a; }
  .m-menu-nav a[aria-current="page"] { color: #2b7a6f; }
  .m-menu-nav a[aria-current="page"] svg { color: #2b7a6f; }
  .m-menu-foot { padding: 30px 10px 0 0; animation: m-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(80ms + var(--i, 0) * 45ms); }
  .m-menu-join {
    min-height: 54px; padding: 0 20px 0 22px; border-radius: 14px; font: 500 16px/1 'Hanken Grotesk', sans-serif; color: #fff; background: #2b7a6f;
    box-shadow: 0 12px 26px -16px rgba(43, 122, 111, 0.9); animation: none;
  }
  .m-menu-join svg { color: #fff; }
  .m-menu-small { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-size: 13px; color: #6e665b; }
  .m-menu-small a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
  @keyframes m-rise { from { opacity: 0; transform: translateY(14px); } }
}
@media (max-height: 500px) and (pointer: coarse) {
  .m-menu-nav { flex-direction: row; flex-wrap: wrap; column-gap: 28px; margin-top: 12px; }
  .m-menu-nav a { font-size: 30px; min-height: 52px; border: 0; }
  .m-menu-nav a svg { display: none; }
  .m-menu-foot { display: flex; align-items: center; gap: 24px; padding-top: 12px; }
  .m-menu-small { margin: 0; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 760px), (prefers-reduced-motion: reduce) and (max-height: 500px) and (pointer: coarse) {
  .m-menu[open], .m-menu.closing, .m-menu-nav a, .m-menu-foot { animation: none; }
  html:root body .site-head { transition: none; }
}

/* ---------- The homepage journey on a phone (js/journey.js, buildPhone) ---------- */
/* The two still steps: each a calm full-screen moment in the middle of the screen (its opacity and a small rise
   follow the scroll). */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  html[data-mode="stack"] .home .walls > .jwall:not(.wall-hero) {
    min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; max-width: 560px;
    margin: 0; padding: 72px max(var(--j-gutter, 24px), env(safe-area-inset-right)) 48px max(var(--j-gutter, 24px), env(safe-area-inset-left));
    transform: translateY(var(--pj-rise, 0px)); will-change: opacity, transform;
  }
  html[data-mode="stack"] .home .walls > .jwall .statement { font-size: clamp(34px, 9.4vw, 42px); line-height: 1.06; margin-bottom: 22px; }
  html[data-mode="stack"] .home .walls > .jwall .lead { font-size: 17px; line-height: 1.6; max-width: 32ch; }

  /* The window holds still; the words of the step under it; the cards rise over both. */
  html.phone-journey .pj { position: relative; }
  html.phone-journey .pj-stage {
    position: sticky; top: 0; z-index: 0; height: 100vh; height: 100svh; margin-bottom: -100vh; margin-bottom: -100svh; pointer-events: none;
  }
  html.phone-journey .pj-win {
    position: absolute; left: 50%; top: max(calc(env(safe-area-inset-top) + 72px), var(--pj-top, 72px)); width: var(--pj-d); height: var(--pj-d);
    margin-left: calc(var(--pj-d) / -2); will-change: opacity;
  }
  /* The window's glass: a light rim and a soft shadow on the wall around it. */
  html.phone-journey .pj-win::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: rgba(250, 248, 246, 0.08); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 0 1px rgba(43, 39, 34, 0.06), 0 26px 60px -34px rgba(67, 52, 36, 0.45);
  }
  html.phone-journey .pj-win .map { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform: none; opacity: 1; }
  html.phone-journey .pj-win .window-tag { opacity: 1; transition: none; }
  html.phone-journey .pj .map [data-key].pj-out { opacity: 0 !important; transition-duration: 0.25s; transition-delay: 0s; }
  html.phone-journey .pj-words {
    position: absolute; left: max(var(--j-gutter, 24px), env(safe-area-inset-left)); right: max(var(--j-gutter, 24px), env(safe-area-inset-right));
    top: calc(max(calc(env(safe-area-inset-top) + 72px), var(--pj-top, 72px)) + var(--pj-d) + 26px); bottom: calc(env(safe-area-inset-bottom) + 12px); will-change: opacity;
  }
  html.phone-journey .pj-words .pj-chapter { margin: 0 0 12px; font-size: 11px; letter-spacing: 0.2em; }
  html.phone-journey .pj-words .jwall {
    position: absolute; left: 0; right: 0; top: 27px; width: auto; max-width: 30rem; margin: 0; padding: 0; display: block;
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  }
  html.phone-journey .pj-words .jwall.is-on {
    opacity: 1; transform: none; pointer-events: auto;
    transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.12s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.12s;
  }
  html.phone-journey .pj-words .chapter-in { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
  html.phone-journey .pj-words .statement { font-size: clamp(30px, 8.4vw, 38px); line-height: 1.06; margin: 0 0 14px; }
  html.phone-journey .pj-words .lead { font-size: 16px; line-height: 1.55; max-width: 34ch; }
  html.phone-journey .pj-words .benefit-bottom { margin-top: 18px; }

  html.phone-journey .pj-flow { position: relative; z-index: 1; padding: 0 max(var(--j-gutter, 24px), env(safe-area-inset-right)) 14vh max(var(--j-gutter, 24px), env(safe-area-inset-left)); }
  html.phone-journey .pj-hold { height: 74vh; height: 74svh; }
  html.phone-journey .pj-hold:first-child { height: 118vh; height: 118svh; }
  html.phone-journey .pj-cards { display: grid; gap: 22px; justify-items: center; }
  html.phone-journey .pj .card { position: relative; left: auto; top: auto; width: 100%; max-width: calc(var(--w, 560) * 1px); transform: none; will-change: auto; }
  html.phone-journey .pj .card [data-card-surface], html.phone-journey .pj .card .chat, html.phone-journey .pj .card .pattern-card { opacity: 1; }
  /* Over the window the glass is nearly solid, so no name on the map reads through a card's words. */
  html.phone-journey .pj .card [data-card-surface] { background: rgba(250, 248, 246, 0.95); }
  html.phone-journey .pj .card [data-card-surface], html.phone-journey .pj .card .chat { box-shadow: 0 0 0 1px rgba(43, 39, 34, 0.06), 0 30px 60px -30px rgba(52, 40, 28, 0.5), 0 8px 18px -10px rgba(52, 40, 28, 0.18); }

  /* The cards on a phone, at their natural size, a little shorter: Noor's two nearest promises, the window without
     its three switches; the Focor block's tag no longer sits on its title. */
  html.phone-journey .pj .card[data-step="4"] [role="listitem"]:nth-child(n+3) { display: none !important; }
  html.phone-journey .pj .card-bring .bt-toggles { display: none; }
  html.phone-journey .pj .focor-block { padding-inline-end: 64px !important; }

  /* Her chat answers once it is seen: her message first, then the reply. */
  html.phone-journey .pj .chat-msg { opacity: 0; transform: translateY(8px); transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1); }
  html.phone-journey .pj .card-chat.pj-said .chat-msg { opacity: 1; transform: none; }
  html.phone-journey .pj .card-chat.pj-said .chat-you { transition-delay: 0.2s; }
  html.phone-journey .pj .card-chat.pj-said .chat-ai { transition-delay: 1.3s; }
  html.phone-journey .pj .bt-list li:not(.out) { min-height: 40px; display: flex; align-items: center; }
}
/* Held sideways: the window on the left, the words beside it. */
@media (max-height: 500px) and (pointer: coarse) {
  html.phone-journey .pj-side .pj-win { left: max(28px, env(safe-area-inset-left)); top: calc(60px + (100svh - 60px - var(--pj-d)) / 2); margin-left: 0; }
  html.phone-journey .pj-side .pj-words { left: calc(max(28px, env(safe-area-inset-left)) + var(--pj-d) + 40px); top: calc(50svh - 96px); bottom: 12px; }
  html[data-mode="stack"] .home .walls > .jwall:not(.wall-hero) { padding-top: 64px; padding-bottom: 24px; max-width: 640px; margin: 0 auto; }
  html.phone-journey .pj-hold { height: 90svh; }
  html.phone-journey .pj-hold:first-child { height: 130svh; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 760px), (prefers-reduced-motion: reduce) and (max-height: 500px) and (pointer: coarse) {
  html.phone-journey .pj-words .jwall, html.phone-journey .pj-words .jwall.is-on, html.phone-journey .pj .chat-msg { transition: none; }
  html[data-mode="stack"] .home .walls > .jwall:not(.wall-hero) { transform: none; }
}

/* ---------- The homepage after the journey, on a phone ---------- */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  /* The scroll cue rests above the home bar. */
  html[data-mode="stack"] .home .scroll-hint { bottom: calc(env(safe-area-inset-bottom) + 18px); }

  /* The comparison: the chart first, then what the chosen bar means right under it, so a tap shows its answer. */
  .home #research .research-columns { display: flex; flex-direction: column; }
  .home #research .research-columns > .wall { display: contents; }
  .home #research #chart-title { order: 1; }
  .home #research .lift-note { order: 2; }
  .home #research .chart { order: 3; margin-top: 30px; }
  .home #research .graph-explain { order: 4; margin-top: 22px; min-height: 0; }
  .home #research .ge-alt { font-size: 16px; }
  .chart .bar-labels button { min-height: 44px; font-size: 12.5px; }
  .chart .bar-labels small { font-size: 11px; }
  .chart .evidence-link { display: inline-flex; align-items: center; min-height: 44px; }

  /* Touch targets: every link and control that is not inside a sentence is at least 44 px tall. */
  .site-head .site-brand { display: inline-flex; align-items: center; min-height: 44px; }
  .text-link, .invite-cta { min-height: 44px; box-sizing: border-box; }
  .trust-links a, .calm-footer .cf-small a, .calm-footer .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .trust-links, .calm-footer .cf-small { align-items: center; }
  .calm-footer .cf-small { row-gap: 0; }
  .calm-footer .cf-brand > a, .page-footer > .brand { min-height: 44px; display: inline-flex; align-items: center; }
  .faq summary, details > summary { min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }
  .copy-button { min-height: 44px; }
}

/* ---------- Dialogs on a phone: sheets that rise from the bottom, above the keyboard ---------- */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  /* Request access: the whole width, rounded at the top, its fields kept above the keyboard (js/mobile.js sets
     --kb to the keyboard's height and --vvh to what is left of the screen). */
  .ad-dialog {
    inset: auto 0 var(--kb, 0px) 0; margin: 0 auto; width: 100%; max-width: 560px;
    max-height: calc(var(--vvh, 100svh) - env(safe-area-inset-top) - 10px);
  }
  .ad-dialog[open] { animation: m-sheet 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .ad-dialog .ad-glass { border-radius: 26px 26px 0 0; box-shadow: 0 0 0 1px rgba(43, 39, 34, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 -18px 50px -24px rgba(67, 52, 36, 0.35); }
  .ad-dialog .ad-glass::after { content: ""; position: absolute; left: 50%; top: 8px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: rgba(43, 39, 34, 0.16); }
  .ad-dialog .ad-scroll {
    max-height: calc(var(--vvh, 100svh) - env(safe-area-inset-top) - 10px);
    padding: 24px max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 18px) max(20px, env(safe-area-inset-left));
    scroll-padding-bottom: 24px;
  }
  .ad-dialog .ad-close { width: 44px; height: 44px; margin: -10px -12px -10px 4px; }
  .ad-dialog .ad-list li { height: 44px; }
  .ad-dialog .ad-chip { height: 36px; }
  .ad-dialog .ad-chip button { width: 32px; height: 32px; }
  .ad-dialog .ad-picker .ad-input input { min-height: 48px; }
  .ad-dialog .ad-field input, .ad-dialog .ad-field textarea { font-size: 16px; min-height: 48px; }
  .ad-dialog .ad-option span { height: 48px; }
  .ad-dialog .ad-quiet { min-height: 48px; }
  .ad-dialog .ad-primary { min-height: 48px; }

  /* About this comparison: the same sheet. */
  .cmp-dialog {
    inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 620px; max-height: calc(100svh - env(safe-area-inset-top) - 24px);
    padding: 34px max(22px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 26px) max(22px, env(safe-area-inset-left));
    border-radius: 26px 26px 0 0; overscroll-behavior: contain;
  }
  .cmp-dialog[open] { animation: m-sheet 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .cmp-dialog .cmp-close { top: 12px; right: 10px; width: 44px; height: 44px; }
  @keyframes m-sheet { from { transform: translateY(100%); } }
}
@media (prefers-reduced-motion: reduce) and (max-width: 760px), (prefers-reduced-motion: reduce) and (max-height: 500px) and (pointer: coarse) {
  .ad-dialog[open], .cmp-dialog[open] { animation: none; }
}

/* ---------- The product page on a phone ---------- */
@media (max-width: 760px) {
  /* Each product screen a little wider than the words, with a quiet "enlarge" mark: a tap opens it whole. */
  .subpage .product-shot { margin-inline: -12px; }
  .subpage .product-shot-open { position: relative; border-radius: 14px; }
  .subpage .product-shot-open::after {
    content: ""; position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%;
    background: rgba(250, 248, 246, 0.86) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b2722' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") no-repeat 50% 50% / 16px 16px;
    box-shadow: 0 0 0 1px rgba(43, 39, 34, 0.1), 0 6px 14px -8px rgba(43, 39, 34, 0.45);
  }
  .subpage .product-shot figcaption { padding-inline: 12px; font-size: 13px; }
}
/* The enlarged screen: the whole phone, dark, its controls a full 44 px, the screen in the middle (Actual size pans). */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .screenshot-dialog, .screenshot-dialog.is-portrait {
    width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; display: none;
  }
  .screenshot-dialog[open] { display: flex; flex-direction: column; }
  .screenshot-dialog > header {
    align-items: center; padding: calc(env(safe-area-inset-top) + 8px) max(12px, env(safe-area-inset-right)) 8px max(18px, env(safe-area-inset-left));
  }
  .screenshot-dialog h2 { font-size: 14px; max-width: none; }
  .screenshot-dialog button { min-height: 44px; min-width: 44px; padding: 0 14px; font-size: 13px; border-radius: 999px; }
  .screenshot-dialog .screenshot-viewport { flex: 1; max-height: none; display: grid; align-content: center; padding-bottom: env(safe-area-inset-bottom); }
  .screenshot-dialog .screenshot-viewport img { max-height: none; }
  .screenshot-dialog.is-zoomed .screenshot-viewport { align-content: start; }
}

/* ---------- The homepage hero on a phone ---------- */
/* The words rest high on the wall, under the menu's row, so the chair and the rug below the window stay clear. */
@media (max-width: 760px) {
  html[data-mode="stack"] .home .jwall.wall-hero .hero-copy { padding-top: calc(env(safe-area-inset-top) + clamp(96px, 15svh, 150px)); }
  html[data-mode="stack"] .home .jwall.wall-hero .hero-copy > p:not(.human) { margin-top: 20px; }
  html[data-mode="stack"] .home .jwall.wall-hero .text-link { margin-top: 18px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  html[data-mode="stack"] .home .jwall.wall-hero .hero-copy { padding-top: calc(env(safe-area-inset-top) + 84px); }
  html[data-mode="stack"] .home .jwall.wall-hero h1 { font-size: 41px; }
  html[data-mode="stack"] .home .jwall.wall-hero .hero-copy > p:not(.human) { font-size: 15px; margin-top: 14px; }
}
/* Held sideways the hero is one short screen: the words smaller and higher, the scroll cue left out. */
@media (max-height: 500px) and (pointer: coarse) {
  html[data-mode="stack"] .home .jwall.wall-hero { min-height: 100svh; }
  html[data-mode="stack"] .home .jwall.wall-hero .hero-copy { padding-top: 70px; max-width: 62%; }
  html[data-mode="stack"] .home .jwall.wall-hero h1 { font-size: 36px; }
  html[data-mode="stack"] .home .jwall.wall-hero .hero-copy > p:not(.human) { font-size: 14px; margin-top: 10px; max-width: 46ch; }
  html[data-mode="stack"] .home .jwall.wall-hero .text-link { margin-top: 6px; }
  html[data-mode="stack"] .home .jwall.wall-hero .human { margin-bottom: 8px; }
  html[data-mode="stack"] .home .scroll-hint { display: none; }
}

/* ---------- Safe areas ---------- */
/* The last line of every page rests above the home bar; held sideways, the words stay clear of the notch (the room,
   the menu's row and the sheets reach the edges themselves). */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .page-footer.calm-footer { padding-bottom: calc(34px + env(safe-area-inset-bottom)); }
}
@media (max-height: 500px) and (pointer: coarse) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  /* The body already keeps clear of the notch, so the journey's own gutters are plain here (not counted twice). */
  html.phone-journey .pj-flow { padding-left: var(--j-gutter, 24px); padding-right: var(--j-gutter, 24px); }
  html[data-mode="stack"] .home .walls > .jwall:not(.wall-hero) { padding-left: var(--j-gutter, 24px); padding-right: var(--j-gutter, 24px); }
  html.phone-journey .pj-side .pj-win { left: 28px; }
  html.phone-journey .pj-side .pj-words { left: calc(28px + var(--pj-d) + 40px); right: var(--j-gutter, 24px); }
}

/* Research's section links wrap onto two rows on a phone. Their line height is pinned at the one Hanken Grotesk gives
   (14.5 px at 11 px), so the rows keep their height while the font is still on its way (no shift when it swaps in). */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .anchor-nav a { line-height: 14.5px; }
}
