/* The homepage's intelligence pieces: the hero film (assets/home/hero-film.js) and the sections built around
   invited agents, visiting agents, the library and presentations (docs/homepage-intelligence.md). */

/* ---- The hero film: over the stage (bar to foot) from the first paint, then over the frame's body once the
   runner has built it. Its poster is the Together still, wide or narrow by the stage's width. */
.hero-film { position: absolute; z-index: 4; inset: 0; overflow: hidden; background: #f5f1e5; pointer-events: none; transition: opacity .45s ease, visibility 0s 0s }
.hero-film[data-shown="false"] { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s }
.hero-film :is(.hero-film-poster, .hero-film-player, .hero-film-still) { position: absolute; inset: 0; width: 100%; height: 100% }
.hero-film-poster > svg, .hero-film-player > svg { display: block; width: 100%; height: 100% }
.hero-film[data-poster="off"] .hero-film-poster { visibility: hidden }
.hero-film-still { object-fit: contain }
.hero-film-poster > .hero-poster-n { display: none }
@container replay (max-width: 559px) {
  .hero-film-poster > .hero-poster-w { display: none }
  .hero-film-poster > .hero-poster-n { display: block }
}
.replay .rp-body:has(> .hero-film) { position: relative }
@media (scripting: enabled) {
  .replay:not([data-built]) > .hero-film { top: var(--rp-bar); bottom: calc(var(--rp-status) + var(--rp-label) + 1.4rem + 1px) }
  .replay:not([data-built]):has(> .hero-film) > .rp-account { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
}
@media (scripting: none) { .hero-film { display: none } }
@media (prefers-reduced-motion: reduce) { .hero-film, .hero-film[data-shown="false"] { transition: none } }
@media (max-width: 800px) {
  .hero > .session.replay:not([data-built]) > .hero-film { top: var(--rp-bar); bottom: calc(var(--rp-status-narrow) + var(--rp-label-narrow) + 1.4rem + 1px) }
}

/* ---- The intelligence sections: Invite any agent (gallery and four rooms), presentations, visiting agents and the
   library builder. Lotties are 328 × 410 and drawn no smaller than 328px wide, so their words stay at 12px or more. */
.intel { padding: clamp(44px,5.4vw,96px) var(--pad); border-bottom: 1px solid var(--line) }
.intel h2 { font-size: clamp(2.1rem,3.5vw,4rem); line-height: 1.02; letter-spacing: -.01em }
.intel-head { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: clamp(1.2rem,4vw,4.5rem); align-items: end; margin-bottom: clamp(26px,3vw,48px) }
.intel-head > p { font-size: 1.06rem; line-height: 1.55; color: #33493f }
.intel .lottie-loop { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f5f1e5; min-width: 0 }
.intel .lottie-loop img, .intel .lottie-loop .lottie-player svg { display: block; width: 100%; height: auto }
.intel-invite { display: grid; grid-template-columns: minmax(328px,440px) minmax(0,1fr); gap: clamp(1.5rem,4vw,4.5rem); align-items: center }
.intel-facts { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line) }
.intel-facts > div { display: grid; grid-template-columns: minmax(9rem,13rem) minmax(0,1fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line) }
.intel-facts dt { font-weight: 700; font-size: 1.15rem }
.intel-facts dd { margin: 0; color: #33493f; line-height: 1.5 }
.rooms-intro { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: clamp(.6rem,4vw,4.5rem); align-items: start; margin: clamp(40px,4.6vw,76px) 0 clamp(18px,2vw,28px) }
.rooms-head { margin: 0; font-size: clamp(1.5rem,2.2vw,2.3rem); line-height: 1.1 }
.rooms-intro > p { margin: .35rem 0 0; font-size: 1.02rem; line-height: 1.55; color: #33493f; max-width: 40rem }
.rooms { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(18px,2.2vw,36px) }
.room { display: grid; grid-template-columns: minmax(328px,360px) minmax(0,1fr); gap: 1.2rem; align-items: center; min-width: 0 }
@media (min-width: 1600px) { .rooms { grid-template-columns: repeat(4, minmax(0,1fr)) } .room { grid-template-columns: minmax(0,1fr); align-items: start } }
.room h3 { font-size: 1.35rem; line-height: 1.15; margin: .1rem 0 .45rem }
.room-copy p:not(.kicker) { color: #33493f; line-height: 1.5; font-size: .96rem }
.room-copy .kicker { margin-bottom: .2rem; color: #4a5f53 }
.intel-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(328px,440px); gap: clamp(1.5rem,5vw,6rem); align-items: center }
.intel-build .intel-split { grid-template-columns: minmax(328px,440px) minmax(0,1fr) }
.intel-copy > p:not(.kicker):not(.moment-links) { margin-top: 1.1rem; font-size: 1.06rem; line-height: 1.55; color: #33493f }
.intel-copy .receipt { margin-top: 1.4rem }
.intel-copy .moment-links { margin-top: 1.3rem }
.intel-visit { background: #f1efe4 }
.intel-present { background: #0f1a2b; color: #e8eef8 }
.intel-present .intel-copy > p:not(.kicker):not(.moment-links), .intel-present .receipt dd { color: #d5e0ef }
.intel-present .kicker, .intel-present .receipt dt { color: #b8c9e2 }
.intel-present a { color: #ffd28a }
.intel-present .lottie-loop { border-color: #2b3d5c; background: #0f1a2b }
/* The presentations section plays one of the Present page's decks in the app's own player (assets/home/present-autoplay.js)
   over its poster, with four styles to pick from under it. The poster stays in the flow and sizes the frame; the player,
   the progress line and the pause button lie over it, so nothing moves when the player arrives. */
.intel-present .intel-split { grid-template-columns: minmax(0,1fr) minmax(340px,600px) }
.present-posters { margin: 0; min-width: 0 }
.present-posters img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; background: #0b1320 }
.present-posters .pp-main { position: relative; border: 1px solid #2b3d5c; border-radius: 12px; box-shadow: 0 30px 60px -34px #000c; overflow: hidden; background: #0b1320 }
.pp-screen { position: relative }
.present-posters .pp-main img { border-radius: 0 }
.pp-player { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; background: #0b1320 }
.present-posters[data-live="true"] .pp-player { opacity: 1 }
.pp-board { position: absolute; inset: 0; visibility: hidden; overflow: hidden }
.pp-stage { position: absolute; inset: 0; z-index: 1 }
/* The player's own frame (as in assets/hubs/present/player.html), without its control bar: the section's pause button
   and progress line stand in for it. */
.pp-stage .presentation { height: 100%; display: grid; grid-template-rows: minmax(0,1fr) }
.pp-stage .presentation-screen { position: relative; min-height: 0; overflow: hidden }
.pp-stage .presentation-frame { position: absolute; inset: 0 }
.pp-stage .presentation-frame > div { overflow: clip !important }
.pp-stage .presentation-screen svg { pointer-events: none }
.pp-stage .presentation nav { display: none }
.present-posters .pp-style { position: absolute; z-index: 2; top: .55rem; left: .55rem; padding: .16rem .55rem; border-radius: 99px; background: #0b1320d9; color: #e8eef8; font: 600 .75rem/1.3 ui-monospace,Menlo,monospace }
.pp-progress { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 3px; background: #ffffff1f; opacity: 0; transition: opacity .3s }
.pp-progress i { display: block; height: 100%; background: #ffd28a; transform-origin: left; transform: scaleX(var(--pp-progress, 0)); transition: transform .6s ease }
.present-posters[data-live="true"] .pp-progress { opacity: 1 }
.pp-toggle { position: absolute; z-index: 3; right: .6rem; bottom: .7rem; display: inline-flex; align-items: center; gap: .35rem; min-height: 32px; padding: .3rem .7rem .3rem .55rem; border: 1px solid #ffffff38; border-radius: 99px; background: #0b1320cc; color: #e8eef8; font: 600 .75rem/1 ui-monospace,Menlo,monospace; cursor: pointer; opacity: .82; transition: opacity .2s }
.pp-toggle:hover, .pp-toggle:focus-visible { opacity: 1; background: #0b1320 }
.pp-toggle:focus-visible { outline: 2px solid #ffd28a; outline-offset: 2px }
.pp-toggle svg { width: 12px; height: 12px; fill: currentColor }
.present-posters:not([data-state="playing"]) .pp-i-pause, .present-posters[data-state="playing"] .pp-i-play { display: none }
/* Reduced motion, before Play: the poster with a large Play button in its middle. */
.present-posters[data-state="poster"] .pp-toggle { right: 50%; bottom: 50%; transform: translate(50%, 50%); min-height: 44px; padding: .55rem 1.1rem .55rem .9rem; background: #ffd28a; color: #0b1320; border-color: #ffd28a; font-size: .95rem; opacity: 1 }
.present-posters[data-state="poster"] .pp-toggle svg { width: 15px; height: 15px }
.pp-more { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .6rem; margin: .6rem 0 0; padding: 0 }
.pp-more li { min-width: 0 }
.pp-more a { position: relative; display: block; border: 1px solid #2b3d5c; border-radius: 10px; overflow: hidden; color: #e8eef8; text-decoration: none }
.pp-more a[aria-current="true"] { border-color: #ffd28a; box-shadow: 0 0 0 1px #ffd28a }
.pp-more a:hover img, .pp-more a:focus-visible img { filter: brightness(1.12) }
.pp-more a:focus-visible { outline: 2px solid #ffd28a; outline-offset: 2px }
.pp-more img { border-radius: 0 }
.pp-more span { position: absolute; top: .4rem; left: .4rem; padding: .14rem .5rem; border-radius: 99px; background: #0b1320d9; color: #e8eef8; font: 600 .75rem/1.3 ui-monospace,Menlo,monospace }
.present-posters figcaption { margin-top: .7rem; color: #b8c9e2; font-size: .85rem; line-height: 1.45 }
@media (prefers-reduced-motion: reduce) { .pp-player, .pp-progress, .pp-progress i { transition: none } }
/* A phone: the four styles stay one row, each name under its picture. */
@media (max-width: 560px) {
  .pp-more { gap: .4rem }
  .pp-more a { border-radius: 8px; background: #0b1320 }
  .present-posters:not([data-state="poster"]) .pp-toggle { right: .45rem; bottom: .5rem; width: 32px; padding: 0; justify-content: center }
  .present-posters:not([data-state="poster"]) .pp-toggle span { display: none }
  .pp-more span { position: static; display: block; padding: .3rem .2rem .35rem; border-radius: 0; background: none; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
}
@media (max-width: 1240px) { .rooms { grid-template-columns: minmax(0,1fr) } }
@media (max-width: 900px) {
  .intel-head, .intel-invite, .intel-split, .intel-build .intel-split, .intel-present .intel-split, .rooms-intro { grid-template-columns: minmax(0,1fr) }
  .intel-invite > .lottie-loop, .intel-split > .lottie-loop { max-width: 440px; width: 100%; justify-self: center }
  .intel-split > .present-posters { max-width: 600px; width: 100%; justify-self: center }
  .intel-build .intel-split > .lottie-loop { order: 2 }
}
@media (max-width: 720px) {
  .room { grid-template-columns: minmax(0,1fr); justify-items: center }
  .room > .lottie-loop { width: 100%; max-width: 440px }
  .room-copy { width: 100%; max-width: 440px }
  .intel-facts > div { grid-template-columns: minmax(0,1fr); gap: .25rem }
}
/* On the narrowest phones the loops reach into the gutter (16px each side), so they are drawn at 328px and up. */
@media (max-width: 400px) { .intel .lottie-loop { width: calc(100% + 2 * var(--pad) - 32px) !important; max-width: none !important; margin-inline: calc(16px - var(--pad)) } }
