/* ============================================================
   THE THREAD — film system, Act I (beats 01–02).
   Loaded after main.css: these rules win over the editorial kit.
   Z-order law: ghosts 0 · thread 10 · content 20 · grain 30 · chrome 50.
   ============================================================ */

main > section.beat{max-width:none;margin:0;padding:0;position:relative;overflow:hidden}

/* grain: static paper noise — multiply on light frames, screen on the stage */
.beat::before{
  content:"";position:absolute;inset:0;z-index:30;pointer-events:none;opacity:.5;mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* the pinned stage repaints every frame — plain low opacity, no blend mode */
.beat-02::before{mix-blend-mode:normal;opacity:.12}

.marg{position:absolute;z-index:20;font-size:10px;letter-spacing:.22em;text-transform:uppercase;color:var(--faint,#8a9079);margin:0}
.marg--tl{top:26px;left:64px}
.marg--tr{top:26px;right:64px;text-align:right}
.marg .marg-kicker{color:var(--acc)}
.marg--stage,.marg--stage .marg-kicker{color:var(--mut)}
/* the stage pins at the viewport top: its margs live below the fixed topbar */
.stage .marg--tl,.stage .marg--tr{top:calc(var(--topbar-h) + 14px)}

.ghost{position:absolute;z-index:0;font-family:var(--font-d);font-weight:700;line-height:1;color:transparent;-webkit-text-stroke:1px var(--line);pointer-events:none;user-select:none}

.thread{position:absolute;inset:0;z-index:10;pointer-events:none;overflow:visible}
.thread-path{fill:none;stroke:var(--acc);stroke-width:3;stroke-linecap:round}

/* ---------- beat 01: title card — the split ----------
   Paper left, stage right, the name on the seam. The two asks flank the top
   corners — the same two workflows the stage below builds — and the copy and
   signup answer from the bottom corners. Grid rows keep the three bands from
   ever colliding, at any viewport. */
.beat.beat-01{
  min-height:100vh;position:relative;
  background:linear-gradient(90deg, var(--bg) 50%, var(--dark-bg) 50%);
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto 1fr auto;
  column-gap:56px;padding:calc(var(--topbar-h) + 28px) 28px 28px;
  /* name size: width-fit with height steps so the middle row always holds it */
  --wmf:min(10.4vw, 150px);
}
@media (max-height:830px) and (min-width:1024px){.beat.beat-01{--wmf:min(10.4vw, 118px)}}
@media (max-height:720px) and (min-width:1024px){.beat.beat-01{--wmf:min(10.4vw, 96px)}}

.hg{position:relative;z-index:20;min-width:0}
.hg--q1{grid-column:1;grid-row:1;width:min(440px,100%)}
.hg--q2{grid-column:2;grid-row:1;justify-self:end;width:min(440px,100%)}
.hg--copy{grid-column:1;grid-row:3;align-self:end;width:min(480px,100%);
  border-left:2.5px solid var(--acc);padding:4px 0 4px 18px}
.hg--join{grid-column:2;grid-row:3;align-self:end;justify-self:end;width:min(467px,100%)}

.hg-cap{margin:0 0 13px;font-size:10.5px;letter-spacing:.24em;text-transform:uppercase;color:var(--mut)}
.hg--q2 .hg-cap,.hg--join .hg-cap{color:var(--on-dark-mut)}

.hg-prompt{background:#fff;border:1.5px solid var(--ink);padding:18px 20px;
  font-family:var(--font-m);font-size:14px;line-height:1.7;color:var(--ink);min-height:104px}
.hg-prompt .caret{width:3px;height:1.05em;margin-left:3px;background:var(--acc);
  box-shadow:0 0 6px var(--caret-glow);vertical-align:middle}

.wm-hero{grid-column:1 / -1;grid-row:2;position:relative;z-index:10;margin:0;max-width:none;
  min-height:calc(var(--wmf) * 0.8)}
.wm-hero span{position:absolute;top:50%;transform:translateY(-50%);
  font-family:var(--font-d);font-weight:700;font-size:var(--wmf);
  line-height:1;letter-spacing:-.05em;white-space:nowrap}
.wm-hero .wm-w1{right:50%;color:var(--ink);padding-right:2px}
.wm-hero .wm-w1 b{color:var(--acc);font-weight:700}
.wm-hero .wm-w2{left:50%;color:var(--on-dark);padding-left:2px}

.hg--copy .lede{
  border-top:0;padding:0;margin:0;max-width:none;
  font-family:var(--font-m);font-size:13.5px;font-weight:500;line-height:1.85;color:var(--mut);
}
.hero-sig{
  margin:14px 0 0;font-family:var(--font-d);font-weight:700;
  font-size:26px;letter-spacing:-.03em;line-height:1.2;color:var(--ink);
}
.hero-sig b{color:var(--acc)}

.hg--join form{display:flex;flex-wrap:nowrap;max-width:none;gap:0;margin:0}
.hg--join input{font-family:var(--font-m);font-size:13.5px;border:1.5px solid var(--ink);border-right:0;background:#fff;padding:14px 16px;width:290px;flex:1 1 auto;min-width:0;color:var(--mut);border-radius:0}
.hg--join .btn{background:var(--acc);color:#fff;border:1.5px solid var(--acc);border-radius:0;padding:14px 22px;font-size:12px;flex-shrink:0}
.hg--join .btn:hover{background:var(--acc-hover)}
.hg--join .microcopy{font-size:11.5px;margin-top:10px;max-width:440px;color:var(--on-dark-mut)}

/* the topbar hides while the film plays; any scroll-up (or the top) brings it back */
#topbar{transition:transform .28s var(--ease)}
#topbar.is-hidden{transform:translateY(-100%)}

/* ---------- beat 02: the stage ---------- */
.beat-02{background:var(--bg)}
.stage{position:relative;height:100vh;background:var(--dark-bg);overflow:hidden}
.stage-inner{position:absolute;inset:0;will-change:transform}
.ghost--stage{left:-40px;bottom:-150px;font-size:clamp(320px,46vw,640px);-webkit-text-stroke:1.5px var(--dark-line)}
.stage h2{
  position:absolute;z-index:20;top:calc(var(--topbar-h) + 40px);left:64px;margin:0;max-width:none;
  font-size:clamp(44px,6.2vw,88px);line-height:.94;letter-spacing:-.035em;color:var(--on-dark);
}
.stage h2 .h-solid{display:block}
.stage h2 .h-outline{display:block;color:transparent;-webkit-text-stroke:2px var(--on-dark-acc)}
@supports not (-webkit-text-stroke:1px black){.stage h2 .h-outline{color:var(--on-dark-acc)}}

.stage-chrome{position:absolute;z-index:20;top:calc(var(--topbar-h) + 40px);right:64px;margin:0;
  font-size:12px;color:var(--on-dark-mut);letter-spacing:.05em;max-width:340px;text-align:right}
.stage-chrome strong{color:var(--on-dark)}
.stage-chrome__hint{display:block;margin-top:6px;color:var(--on-dark-faint)}
.stage-chrome__who{display:inline-block;margin:10px 8px 0 0;border:1px solid var(--dark-line);border-radius:99px;padding:.25em .8em;font-size:10.5px;color:var(--on-dark-mut)}
.stage-run{background:var(--run);color:#fff;border:0;border-radius:4px;padding:.45em 1.1em;font-family:var(--font-m);font-weight:700;font-size:11px;letter-spacing:.08em;text-transform:uppercase;cursor:pointer}
.stage-run:hover{background:var(--run-hover)}

/* the wire, drawn like the app's canvas: thick, rounded, flat — no glow */
.stage .thread--stage .thread-path--base{stroke:var(--dark-wire);stroke-width:9}
.stage .thread--stage .thread-path--hot{stroke:var(--on-dark-acc);stroke-width:9;opacity:0;transition:opacity .16s ease-in}
.stage .thread--stage .thread-socket{fill:var(--dark-2);stroke:var(--dark-line);stroke-width:1.5}

.pucks{position:absolute;inset:0;z-index:20}
/* flat matte circles, the app's node shape — no gradient, no shadow, no ring */
.puck{
  position:absolute;width:114px;height:114px;border-radius:50%;transform:translate(-50%,-50%);
  background:var(--dark-2);border:1.5px solid var(--dark-line);
  display:flex;align-items:center;justify-content:center;opacity:0;
}
.puck img{width:44px;filter:invert(1) brightness(1.35);opacity:.92;pointer-events:none}
/* two lines, label over type: the tag stays narrower than the puck gap, so
   the wire's dips between pucks never cross it */
.puck .puck__tag{position:absolute;left:50%;transform:translateX(-50%);top:calc(100% + 12px);font-size:11px;color:var(--on-dark-mut);white-space:nowrap;letter-spacing:.06em;text-align:center;line-height:1.6}
.puck .puck__tag b{display:block;color:var(--on-dark);font-weight:700}

#build .stage .chips{position:absolute;z-index:20;left:auto;right:64px;bottom:56px;top:auto;margin:0;display:flex;gap:0}
/* one caption line, bottom-left — mirrors the chips' corner across the stage */
#build .stage .stage-cap{position:absolute;z-index:20;left:64px;bottom:68px;margin:0;font-size:12.5px;letter-spacing:.06em;color:var(--on-dark-mut)}
.stage .chip{font-size:11.5px;letter-spacing:.12em;padding:12px 18px;border:1.5px solid var(--dark-line);border-radius:0;color:var(--on-dark-mut);background:none}
.stage .chip.is-active{background:var(--on-dark-acc);color:var(--dark-bg);border-color:var(--on-dark-acc);font-weight:700}
.stage .chip:not(.is-active):hover{color:var(--on-dark);border-color:var(--on-dark-acc)}

/* ---------- responsive (<1024): the film reflows, corridors simplify ---------- */
@media (max-width:1023px){
  /* the split turns horizontal: the first ask and "work." stay on paper, then
     "flow" opens the stage and the rest of the hero answers on dark, flowing
     seamlessly into section 2's stage below */
  .beat.beat-01{grid-template-columns:minmax(0,1fr);grid-template-rows:none;column-gap:0;
    padding:calc(var(--topbar-h) + 20px) 0 0;background:var(--bg);--wmf:min(21vw,150px)}
  .hg--q1{grid-column:1;grid-row:1;width:auto;padding:0 24px 10px}
  .wm-hero{grid-column:1;grid-row:2;min-height:0}
  .wm-hero span{position:static;transform:none;display:block}
  .wm-hero .wm-w1{padding:22px 24px 0}
  .wm-hero .wm-w2{background:var(--dark-bg);color:var(--on-dark);padding:12px 24px 2px;margin-top:16px}
  .hg--q2{grid-column:1;grid-row:3;justify-self:stretch;width:auto;background:var(--dark-bg);padding:24px 24px 0}
  .hg--copy{grid-column:1;grid-row:4;align-self:auto;width:auto;background:var(--dark-bg);
    border-left:0;padding:30px 24px 0}
  .hg--copy .lede{color:var(--on-dark-mut)}
  .hg--copy .lede strong{color:var(--on-dark)}
  .hg--copy .hero-sig{color:var(--on-dark)}
  .hg--copy .hero-sig b{color:var(--on-dark-acc)}
  .hg--join{grid-column:1;grid-row:5;align-self:auto;justify-self:stretch;width:auto;
    background:var(--dark-bg);padding:30px 24px 44px}
  /* left gutter (x<=40) is the thread's corridor on narrow layouts */
  .marg--tl{left:56px}.marg--tr{display:none}
  /* left:56 keeps the h2 box (and its 24px keep-out) clear of the x=16 gutter */
  /* the stage kicker sits at topbar-height + 14 ≈ 78px — the headline starts
     below its line so the two never overlap on phones */
  .stage h2{left:56px;top:104px;font-size:clamp(32px,7.4vw,54px)}
  .stage-chrome{display:none}
  #build .stage .chips{left:24px;right:auto;bottom:28px}
  /* the chips take the caption's corner on narrow layouts */
  #build .stage .stage-cap{display:none}
  /* spacing between pucks is 12.5vh (film.js): the puck must stay well under it */
  .puck{width:min(64px, 12.5vh - 20px);height:min(64px, 12.5vh - 20px)}
  .puck img{width:39%}
  /* labels sit beside the pucks on the phone — the wire's column stays clear */
  .puck .puck__tag{font-size:10px;bottom:auto;top:50%;left:calc(100% + 14px);transform:translateY(-50%);text-align:left}
  .puck .puck__tag b{display:block}
}

/* tags: the registry type string is the wide part — it needs generous puck
   spacing, so it rides only on wide screens (label stays everywhere) */
@media (max-width:1279px){
  .puck .puck__type{display:none}
}

/* reduced motion: the film is fully developed and still (film.js paints state 1) */
@media (prefers-reduced-motion: reduce){
  .subtitle-bar .caret{display:none}
}
