/* Home: "Hero Primary" from Paper › Heros › Hero Finals, with the agent beats of
   "Hero Animations (Primary Hero)". The 1440x820 board is a stage scaled to the window, so every
   position matches Paper; the agent layer is placed in stage pixels by home.js. */

.home { overflow: hidden; }
.hero { position: relative; z-index: 1; height: 100vh; height: 100dvh; min-height: 520px; overflow: hidden; }
.stage { position: absolute; left: 50%; top: 50%; width: 1440px; height: 820px; transform: translate(-50%, -50%) scale(var(--s, 1)); transform-origin: 50% 50%;
         display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; }
.hero > .wordmark { position: absolute; z-index: 3; top: calc(var(--pad-top) + env(safe-area-inset-top, 0px)); left: 0; right: 0; width: max-content; margin: 0 auto; }
.statement { position: relative; width: 390px; display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.statement p { font-size: 24px; line-height: 28px; letter-spacing: -.03em; }
.part1 { color: var(--ink); display: flex; flex-direction: column; align-items: center; }
.part2 { color: var(--muted); width: 270px; transition: color .6s var(--arrive); }
.part1 .ln { transition: color .6s var(--arrive); }
.hero > .footer { position: absolute; z-index: 3; bottom: calc(var(--pad-bottom) + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center; }

/* ---------- agent layer ---------- */
.agents { position: absolute; inset: 0; pointer-events: none; }
.cursor { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; opacity: 0; will-change: transform; transition: opacity .6s var(--arrive); }
.cursor.on { opacity: 1; }
.cursor svg { display: block; }
.chip { transition: transform .45s var(--roll); }   /* a label changing sides slides across, never jumps */
.cursor.flip .chip { transform: translateX(calc(-100% + 12px)); }
.chip { background: var(--ink); color: var(--ground); border-radius: 2px; padding: 3px 7px; margin-left: 14px; }
.thread { position: absolute; display: flex; flex-direction: column; gap: 6px; transition: opacity .6s var(--arrive); }
.thread.out { opacity: 0; }   /* a finished request leaves as one, in 0.6 s */
.bubble { background: var(--bubble); color: var(--text); font-size: 13px; line-height: 18px; padding: 3px 7px; white-space: pre; display: inline-flex; align-items: center; align-self: flex-start;
          opacity: 0; transform: translateY(-4px); transition: opacity .25s var(--arrive), transform .25s var(--arrive); }
.bubble b { color: var(--ink); font-weight: 500; }
.reply { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--soft); white-space: pre;
         opacity: 0; transform: translateY(-4px); transition: opacity .3s var(--arrive), transform .3s var(--arrive); }
.bubble.on, .reply.on { opacity: 1; transform: none; }
.pav { width: 16px; height: 16px; background: var(--teal); color: var(--ground); font-family: var(--display); font-size: 9px; line-height: 9px; display: grid; place-items: center; flex-shrink: 0; }
.caret { display: inline-block; width: 7px; height: 15px; background: var(--teal); margin-left: 1px; opacity: 0; }
.typing .caret { opacity: 1; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.selbox { position: absolute; left: 0; top: 0; width: 0; height: 0; border: 1px solid var(--muted); opacity: 0; transition: opacity .25s var(--arrive); }   /* fades at the chat bubbles' speed */
.selbox.on { opacity: 1; }
.selbox i { position: absolute; width: 7px; height: 7px; background: var(--handle); }
.selbox i:nth-child(1) { left: -4px; top: -4px; } .selbox i:nth-child(2) { right: -4px; top: -4px; }
.selbox i:nth-child(3) { left: -4px; bottom: -4px; } .selbox i:nth-child(4) { right: -4px; bottom: -4px; }
.sel-meta { position: absolute; left: calc(100% + 12px); top: -1px; width: 170px; display: flex; flex-direction: column; gap: 3px; opacity: 0; transition: opacity .2s var(--arrive); }
.selbox.meta .sel-meta { opacity: 1; }
.sel-meta .swap { animation: zoneSwap .32s var(--arrive); }   /* a readout eases to its new words */
@keyframes zoneSwap { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
/* the claim's old place, dashed, fading once the box has moved up (John 11/21) */
.trail { position: absolute; border: 1px dashed var(--muted); opacity: 0; transition: opacity .8s var(--arrive); }
.trail.on { opacity: .45; }
/* the line under the box lifts to ink while it is selected (Paper beats 03 and 04) */
.hero.lift-a .part2 { color: var(--ink); }

body.instant *, body.instant *::before, body.instant *::after { transition: none !important; animation: none !important; }
body.instant .rise { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .cursor, .selbox, .bubble, .reply, .thread { transition: none !important; } }


/* ---------- survey (Agent Interaction 1): a box around the whole statement, rulers to both edges ---------- */
.survey { position: absolute; border: 1px solid var(--muted); opacity: 0; transition: opacity .25s var(--arrive); }
.survey.on { opacity: 1; }
.survey > i, .loupe > i { position: absolute; width: 7px; height: 7px; background: var(--handle); }
.survey > i:nth-child(1), .loupe > i:nth-of-type(1) { left: -4px; top: -4px; } .survey > i:nth-child(2), .loupe > i:nth-of-type(2) { right: -4px; top: -4px; }
.survey > i:nth-child(3), .loupe > i:nth-of-type(3) { left: -4px; bottom: -4px; } .survey > i:nth-child(4), .loupe > i:nth-of-type(4) { right: -4px; bottom: -4px; }
.ruler { position: absolute; top: 50%; height: 1px; background: rgba(242, 241, 240, .18); transform-origin: right center; }
.ruler--l { right: 100%; transform-origin: right center; }
.ruler--r { left: 100%; transform-origin: left center; }
.ruler b { position: absolute; left: 50%; top: -17px; transform: translateX(-50%); font-weight: 400; }
.survey__zone, .survey__size { position: absolute; top: -22px; white-space: nowrap; }
.survey__zone { left: -1px; } .survey__size { right: -1px; }

/* ---------- loupe (Agent Interaction 2 / Exploration 01) ---------- */
.loupe { position: absolute; left: 0; top: 0; width: 220px; height: 220px; border: 1px solid var(--handle); opacity: 0; transform-origin: 50% 50%; transition: opacity .2s var(--arrive); }
.loupe.on { opacity: 1; }
.loupe.slow { transition: opacity .8s var(--arrive); }   /* phones: the image left behind fades slowly */
.loupe__img { position: absolute; inset: 0; overflow: hidden; background: url("/img/hero/loupe.jpg") 50% 50% / 340px auto no-repeat; }
.loupe__x, .loupe__y { position: absolute; background: var(--teal); }
.loupe__x { left: calc(50% - 13px); top: 50%; width: 26px; height: 1px; } .loupe__y { left: 50%; top: calc(50% - 13px); width: 1px; height: 26px; }
.loupe--city .loupe__img { background-image: url("/img/hero/city.jpg"); background-size: 520px auto; }
.loupe__top, .loupe__bot { position: absolute; left: -1px; white-space: nowrap; }
.loupe__top { top: -22px; } .loupe__bot { bottom: -22px; }

/* ---------- brand rules (Exploration 04): decodes in like code ---------- */
.code { position: absolute; margin: 0; color: #5E5E64; white-space: pre; text-transform: uppercase; opacity: 0; transition: opacity .4s var(--arrive); }
.code.on { opacity: 1; }


/* ---------- phones and portrait tablets: the board is not scaled, the statement reflows, the agents work in the space above and below ---------- */
@media (max-width: 767px), (max-width: 1100px) and (orientation: portrait) {
  .stage { position: relative; left: auto; top: auto; width: 100%; height: 100%; transform: none; padding: 0 20px 63px; }   /* 63 = statement + CTA centred between the wordmark and the nav (John 11/21) */
  .statement { width: 100%; max-width: 350px; gap: 20px; }
  .statement p { font-size: 20px; line-height: 24px; }
  .part2 { width: auto; }
  .loupe { width: 110px; height: 110px; }
  .loupe__top { top: -18px; } .loupe__bot { bottom: -18px; }
  .loupe__top, .loupe__bot { font-size: 9px; }
  .loupe__img { background-size: 180px auto; }
  .loupe--city .loupe__img { background-size: 230px auto; }
  .code { display: none; }
  .sel-meta { left: -1px; top: calc(100% + 6px); width: auto; flex-direction: row; gap: 10px; white-space: nowrap; }
  .bubble { white-space: pre; max-width: none; }   /* one line, never wrapped (John 11/21) */
  /* the agents' type and its boxes run 10% smaller on phones (John 11/21) */
  .chip { font-size: 9px; line-height: 12px; letter-spacing: 0.36px; padding: 2.5px 6.5px; }
  .bubble, .reply { font-size: 11.7px; line-height: 16px; }
  .bubble { padding: 2.5px 6.5px; }
  .reply { gap: 7px; }
  .thread { gap: 5px; }
  .pav { width: 14.5px; height: 14.5px; font-size: 8px; line-height: 8px; }
  .caret { width: 6.3px; height: 13.5px; }
  /* the quieter phone layout (?m=2): one small image, bottom right */
  .mv2 .loupe { width: 96px; height: 96px; }
  .mv2 .loupe__img { background-size: 160px auto; }
  /* the readouts sit centred on the image and never run wider than it (John 11/21) */
  .mv2 .loupe__top, .mv2 .loupe__bot { left: 50%; right: auto; transform: translateX(-50%); font-size: 6.6px; letter-spacing: 0.02em; }
  .mv2 .loupe__top { top: -13px; } .mv2 .loupe__bot { bottom: -13px; }
  .mv2 .loupe__x { left: calc(50% - 9px); width: 18px; } .mv2 .loupe__y { top: calc(50% - 9px); height: 18px; }
}

/* ---------- the build-in alternative and its compare toggle (localhost / ?compare) ---------- */
.wire { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; }
.hero-build .statement .ln, .hero-build .part2 { will-change: filter, opacity; }
.hero-compare { position: fixed; z-index: 60; top: 42px; right: 32px; display: flex; align-items: center; gap: 6px; color: var(--dim); }
.hero-compare button { white-space: nowrap; font: inherit; color: var(--muted); background: none; border: 0; padding: 2px 2px; cursor: pointer; text-transform: uppercase; letter-spacing: inherit; transition: color .2s ease; }
.hero-compare button:hover { color: var(--ink); }
.hero-compare button[aria-pressed="true"] { color: var(--teal); }
.hero-compare i { font-style: normal; color: var(--dim); }
@media (max-width: 767px) { .hero-compare { top: calc(64px + env(safe-area-inset-top, 0px)); right: 50%; transform: translateX(50%); } }
