/* T-503 (site file): the homepage at `/`. Ported from the mockup's css/thread.css (docs/superpowers/live/thread-r2),
   without its :root (the tokens are tokens.css's) and without its stage and pin rules (T-504, T-505), every class with
   the hm- prefix. Two layouts, as the mockup's main.js:186: desktop at 980 px wide and 700 px tall or more (the hero in
   two columns, the phone on the right, whole under the 64 px header), stacked otherwise (copy first, the phone below
   it, the Excel slot below the phone, the rows one column). Section gaps 96 px desktop, 64 px stacked; content width
   .wrap (base.css). */

/* ---------------------------------------------------------------- the header's place */
/* home.js (a module, so it may run after the first paint) fills the header: its height (site.css: 64 px, 56 px under
   720) is held from the start, so the page below never shifts when it is drawn */
body[data-page="home"] > header[data-site-header] { min-height: 64px; }
@media (max-width: 719.98px) { body[data-page="home"] > header[data-site-header] { min-height: 56px; } }

/* ---------------------------------------------------------------- display type */
.hm .hm-l1, .hm .hm-l2 { display: block; }
.hm .hm-l2 { color: var(--tint); } /* --tint: display-size text only (4.1:1 on the ground) */
.hm-h1 { font-size: clamp(46px, 12.6vw, 72px); line-height: .95; text-wrap: balance; }
.hm-h1 .hm-l1 { margin-bottom: .04em; }
.hm-h2 { font-size: clamp(38px, 10.4vw, 56px); line-height: .98; text-wrap: balance; }

/* ---------------------------------------------------------------- the story and its stage */
/* the stage is laid over the hero and the "Four things" rows; the phone is placed on the hero's slot by home.js (the
   scroll turn, T-505, takes it over from there). Nothing in it takes a pointer. The second layer (.hm-over, after the
   hero in the page's order) holds the Excel window under the phone and the key buttons and the tag over it. Each layer
   draws inside a pin (.hm-pin): a zero-height box at the story's top-left here, sticky while the turn is armed
   (home-scroll.css), so the browser holds what is pinned still as the page scrolls, in the same frame as the scroll. */
.hm-story { position: relative; }
.hm-stage { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hm-over { position: absolute; inset: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); pointer-events: none; }
.hm-pin { position: relative; height: 0; }
.hm-over > .hm-pin { grid-area: 1 / 1; align-self: start; }
.hm-pin-sheet { z-index: 1; } /* under the phone: the window slides out from behind it */
.hm-pin-keys { z-index: 3; } /* over the phone */
.hm-phone { position: absolute; left: 0; top: 0; }

/* ---------------------------------------------------------------- hero (stacked first) */
.hm-hero-in { padding-top: 32px; padding-bottom: 64px; }
.hm-lede { margin-top: 20px; max-width: 34.5em; font-size: 18px; line-height: 1.5; color: var(--body); text-wrap: pretty; }
.hm-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 28px; }
/* Start free trial, the hero's and the close's (Mason, 2026-11-20): a little bigger than the site's .btn (58 px, 20 px
   words), and in the text face, bold: the display face's f and r carry notches that read as cut out on a button. A
   least height, not a height (controls.css R271: under 600 px a long label still wraps and the button grows) */
.hm-cta .btn, .hm-close-act .btn {
  height: auto; min-height: 62px; padding-inline: 36px;
  font-family: var(--text); font-size: 22px; font-weight: 700; letter-spacing: -.01em;
}
/* by the button: the price line (written by home.js), and under it how soon it works; the pair sits a little above the
   button's middle */
.hm-cta-side { flex: 1 1 18em; display: grid; gap: 4px; padding-bottom: 6px; }
.hm-price { min-height: 1.35em; font-size: 18px; line-height: 1.35; color: var(--body); }
.hm-ready { font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--ink); }
/* a phone: under the full-width button, the price on two lines, broken before "Cancel anytime.", both reserved, so
   writing it moves nothing. Set close (16 and 15 px, tight lines and gaps) so the Excel window under the copy keeps
   row 12 in the first screen at 390x844 (the owner's word of 2026-11-16; home-demo.test.mjs) */
@media (max-width: 599.98px) {
  .hm-cta { row-gap: 10px; }
  .hm-cta-side { gap: 2px; padding-bottom: 0; }
  .hm-price { min-height: 2.6em; font-size: 16px; line-height: 1.3; }
  .hm-price .hm-nb { display: block; }
  .hm-ready { font-size: 15px; line-height: 1.3; }
}
/* wider: beside the button, the price on one line at 16 px; the pair keeps the room that line needs from the first
   paint (so writing it moves nothing), and where the row has less it goes under the button whole */
@media (min-width: 600px) {
  .hm-cta-side { flex: 0 1 auto; min-width: 384px; }
  .hm-price { font-size: 16px; white-space: nowrap; }
}

/* the phone's place: the iPhone 18 Pro's proportions (7.19 x 15.0), an ink outline of the phone until a stage mounts */
.hm-phone-slot { position: relative; width: min(88vw, 360px); aspect-ratio: 7.19 / 15; margin: 40px auto 0; }
.hm-phone-slot::before {
  content: ''; position: absolute; inset: 16px;
  border: 2px solid var(--ink); border-radius: 14% / 6.7%;
}
body.hm-has-phone .hm-phone-slot::before { display: none; }
/* the Excel window's place in the stacked layout: under the copy and above the phone, so the row it writes is in the
   first window (the owner's word of 2026-11-16); stage.js fills it. Empty on desktop (the window sits in .hm-over). */
.hm-strip-slot { position: relative; }

/* ---------------------------------------------------------------- four things */
.hm-four-in { padding-block: 64px; }
.hm-rows { list-style: none; margin-top: 40px; counter-reset: hm-row; }
.hm-row {
  counter-increment: hm-row;
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 20px;
  padding: 34px 0 38px; border-top: 1.5px solid var(--line);
}
.hm-row:last-child { border-bottom: 1.5px solid var(--line); }
.hm-cap {
  font-family: var(--display); font-optical-sizing: auto; font-weight: 650; font-size: clamp(26px, 2.15vw, 34px);
  line-height: 1.12; letter-spacing: -.03em; color: var(--ink); text-wrap: balance;
}
/* the row's number: muted, not --tint, at 16 px (body-size text keeps 4.5:1) */
.hm-cap::before {
  content: counter(hm-row, decimal-leading-zero); display: block; margin-bottom: 12px;
  font-family: var(--text); font-size: 16px; font-weight: 600; letter-spacing: .02em; color: var(--muted);
}
.hm-chip {
  display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 14px 0 11px; border-radius: 9px;
  background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 16px; font-weight: 500; line-height: 1.3; color: var(--ink); font-variant-numeric: tabular-nums;
}
.hm-chip svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 1.6; stroke-linejoin: round; }
.hm-row[data-row="email"] .hm-chip svg { stroke: #0f6cbd; } /* the mockup's Outlook blue, an icon's stroke only */

/* the two-bubble exchanges: the Telegram replica's own bubbles (telegram.css) on its chat ground, no phone frame. The
   custom properties are the ones .phone-screen gives the chat on the phone; the chat text is 18 px (R137) */
.hm-ex {
  --tg-bg: #dfe7ee; --tg-bar: #f6f6f7; --tg-hair: rgba(60, 60, 67, .2); --tg-accent: #2481cc; --tg-gray: #8e8e93;
  --tg-out: #e1ffc7; --tg-out-meta: #5fae5a; --tg-in-meta: #a0a8b1;
  position: relative; width: 100%;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px;
  border-radius: var(--r-l); background: var(--tg-bg);
  color: #000; font-family: var(--device), 'Chat Emoji', 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 18px; line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
.hm-ex .msg { max-width: 88%; }
.hm-ex .msg.notify { max-width: 94%; }
.hm-ex .ph { width: 236px; height: 214px; }
.hm-ex .ph .rc { transform: translate(-50%, -50%) rotate(-3.2deg) scale(.86); }
.hm-ex .msg.voice .bub { min-width: 0; }

/* ---------------------------------------------------------------- promises */
.hm-promises-in { padding-block: 64px; }
/* --tint at rest (SR20), ink once each passes 72 % of the window (home.js); reduced motion: ink at once, no fade */
.hm-pr {
  font-family: var(--display); font-optical-sizing: auto; font-weight: 750; font-size: clamp(40px, 6vw, 96px);
  line-height: 1; letter-spacing: -.045em; color: var(--tint); text-wrap: balance;
  transition: color .6s ease;
}
.hm-pr + .hm-pr { margin-top: .2em; }
.hm-pr.is-on { color: var(--ink); }
html.rm .hm-pr { transition: none; }

/* ---------------------------------------------------------------- questions */
.hm-faq-in { padding-block: 64px; }
.hm-qas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 40px; }
.hm-qa h3 { font-size: 24px; line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
.hm-qa p { margin-top: 10px; max-width: 34em; font-size: 18px; line-height: 1.5; color: var(--body); text-wrap: pretty; }
/* written by home.js: one line of height reserved */
.hm-qa .hm-price-faq { min-height: 1.5em; }

/* ---------------------------------------------------------------- close */
.hm-close { border-top: 1.5px solid var(--line); }
.hm-close-in { padding-block: 64px; }
.hm-close .hm-h2 { font-size: clamp(36px, 9.4vw, 56px); line-height: 1; max-width: 14.5em; }
.hm-close .hm-h2 .hm-l2 { margin-top: .06em; }
/* the compose bar replica (spike index.html:123-127): one link, its parts hidden from readers */
.hm-compose {
  display: flex; align-items: center; gap: 12px;
  width: min(660px, 100%); margin-top: 40px; padding: 12px 12px 12px 16px;
  border-radius: 22px; background: #f6f6f7; color: #000; text-decoration: none;
  box-shadow: 0 0 0 1px rgba(14, 27, 44, .06), 0 14px 34px -16px rgba(30, 24, 12, .25);
  font-family: var(--device);
}
.hm-cp-ico { flex: none; }
.hm-cp-ico svg { width: 30px; height: 30px; fill: none; stroke: #8e8e93; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hm-cp-field {
  flex: 1; min-width: 0; display: flex; align-items: center; height: 50px; padding: 0 18px; border-radius: 25px;
  background: #fff; box-shadow: inset 0 0 0 .75px rgba(60, 60, 67, .3); font-size: 21px; white-space: nowrap;
}
.hm-cp-caret { flex: none; width: 2px; height: 26px; margin-left: 2px; border-radius: 1px; background: #2481cc; animation: hm-caret 1.05s steps(1) infinite; }
@keyframes hm-caret { 50% { opacity: 0; } }
html.rm .hm-cp-caret { animation: none; }
.hm-cp-send { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #2481cc; transition: background-color .2s ease; }
.hm-compose:hover .hm-cp-send { background: #1d6fb0; }
.hm-cp-send svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hm-close-act {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px;
  margin-top: 48px; padding-top: 32px; border-top: 1.5px solid var(--line);
}
/* written by home.js: one line of height reserved */
.hm-buy { min-height: 1.35em; font-size: 18px; line-height: 1.35; color: var(--body); }
.hm-help { flex-basis: 100%; font-size: 16px; line-height: 1.5; color: var(--muted); }
.hm-help a { color: var(--ink); text-underline-offset: 3px; }

/* ---------------------------------------------------------------- desktop: 980 px wide and 700 px tall or more */
@media (min-width: 980px) and (min-height: 700px) {
  /* the hero fills the first window under the header: the copy on the left, the phone's slot on the right, whole and
     24 px clear of the header and of the window's foot */
  .hm-hero-in {
    --hm-phone-h: min(calc(100svh - 64px - 48px), 820px);
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "copy phone" "strip phone"; column-gap: 48px;
    min-height: calc(100svh - 64px); padding-top: 24px; padding-bottom: 24px;
  }
  /* the copy at the top of its column and the headline sized by the window's height as well as its width, so the copy,
     the Excel window under it and the row it writes all fit in the first window (the owner's word of 2026-11-16: the
     row was written below the fold at 1366 x 768 and under) */
  .hm-copy { grid-area: copy; align-self: start; padding-top: clamp(8px, 2.4svh, 32px); padding-bottom: 24px; }
  .hm-h1 { font-size: clamp(48px, min(7.6vw, 10.5svh - 20px), 128px); line-height: .93; }
  .hm-lede { margin-top: clamp(16px, 2.6svh, 28px); font-size: 20px; }
  .hm-cta { margin-top: clamp(20px, 3.4svh, 36px); }
  .hm-phone-slot { grid-area: phone; align-self: start; width: calc(var(--hm-phone-h) * 7.19 / 15); height: var(--hm-phone-h); margin: 0; }
  .hm-strip-slot { grid-area: strip; }

  .hm-h2 { font-size: clamp(44px, 4.7vw, 82px); }
  /* the rows in a left column of at most 620 px: the right side stays clear for the pinned phone (T-505) */
  .hm-four-in { padding-block: 96px; }
  .hm-four-in > * { max-width: 620px; }
  .hm-rows { margin-top: 56px; }
  .hm-row { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); grid-template-areas: "cap ex" "cap chip"; column-gap: 32px; row-gap: 16px; padding: 44px 0 48px; }
  .hm-cap { grid-area: cap; padding-top: 6px; }
  .hm-ex { grid-area: ex; }
  .hm-chip { grid-area: chip; }

  .hm-promises-in { padding-block: 96px; }
  .hm-faq-in { padding-block: 96px; }
  .hm-qas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; margin-top: 56px; }
  .hm-close-in { padding-block: 96px; }
  .hm-close .hm-h2 { font-size: clamp(40px, 4.4vw, 78px); }
  .hm-compose { margin-top: 56px; }
  .hm-close-act { margin-top: 64px; padding-top: 40px; }
}

/* R272: in a contrast theme the phone's outline, the chat card, the chip and the compose bar keep an edge */
@media (forced-colors: active) {
  .hm-phone-slot::before { border-color: CanvasText; }
  .hm-ex, .hm-chip, .hm-compose { border: 1px solid CanvasText; }
  .hm-pr, .hm-pr.is-on { color: CanvasText; }
}
