/* ===================================================================
   composer.css — the IF/THEN "realtime search" card  (HERO workstream)
   Owns: .composer* , .rule-line, .tag, .svc-chip, .response, .stream-chip
   Paired with js/composer.js.
   =================================================================== */
.composer-wrap{width:100%;max-width:720px;margin:40px auto 0;position:relative}
.composer-glow{position:absolute;inset:-40px;z-index:-1;background:radial-gradient(60% 70% at 50% 40%,rgba(247,248,250,0.05),transparent 70%);filter:blur(20px)}
.composer{
  background:var(--surface-card);
  border:1px solid var(--border-strong);
  border-radius:var(--radius-lg);
  box-shadow:var(--surface-card-shadow);
  backdrop-filter:blur(20px);
  overflow:hidden;
  text-align:left;
}
.composer-head{
  display:flex;align-items:center;gap:10px;
  padding:13px 18px;border-bottom:1px solid var(--border);
  font-family:var(--mono);font-size:11.5px;letter-spacing:.06em;color:var(--faint);text-transform:uppercase;
}
.composer-head .live{display:inline-flex;align-items:center;gap:7px;color:var(--muted)}
.composer-head .live b{width:6px;height:6px;border-radius:50%;background:var(--cursor);box-shadow:0 0 8px rgba(255,77,77,.7);animation:pulse 2s ease-in-out infinite}
.composer-head .streams{margin-left:auto;color:var(--faint)}

/* ---- in-composer camera preview (mobile/tablet only) ----
   The active camera plays inside the card as a live preview pane; on desktop
   the ambient feeds float around the composer instead, so this is hidden.
   Driven by js/composer.js (src swaps to the current rule's feed each cycle). */
.composer-preview{display:none}
@media(max-width:1240px){
  .composer-preview{
    display:block;position:relative;width:100%;aspect-ratio:16/7;
    overflow:hidden;background:#0b0d12;border-bottom:1px solid var(--border);
  }
  .composer-preview__video{
    width:100%;height:100%;object-fit:cover;display:block;
    filter:saturate(.96);opacity:0;transition:opacity .35s ease;
  }
  .composer-preview.ready .composer-preview__video{opacity:1}
  /* vignette + scanline grade so it reads as a real camera feed */
  .composer-preview__grade{
    position:absolute;inset:0;pointer-events:none;
    background:
      repeating-linear-gradient(to bottom,rgba(0,0,0,0) 0 2px,rgba(0,0,0,0.14) 2px 3px),
      radial-gradient(120% 120% at 50% 40%,transparent 55%,rgba(0,0,0,0.42));
    mix-blend-mode:multiply;
  }
  .composer-preview__bar{
    position:absolute;left:12px;bottom:11px;display:inline-flex;align-items:center;gap:7px;
    font-family:var(--mono);font-size:11px;letter-spacing:.04em;color:rgba(255,255,255,.9);
    text-shadow:0 1px 4px rgba(0,0,0,.7);text-transform:uppercase;white-space:nowrap;
  }
  .composer-preview__bar .rec{
    width:7px;height:7px;border-radius:50%;background:#ff4d4d;
    box-shadow:0 0 8px #ff4d4d;animation:blink 1.4s steps(2) infinite;flex:none;
  }
}
/* flex-start (not center): .composer-plain must anchor to a fixed position
   and never move — centering a stack whose siblings constantly change
   height (response reveal, cycle reset) recomputes the centering offset
   every time and visibly relocates the sentence.
   A genuinely fixed `height` (not just min-height) is what lets
   .composer-deploy be absolutely positioned and never move (see below).
   240px is a MEASURED value, not guessed: sampled #plainText/#response
   across every rule's full cycle (~50s), real worst case never exceeded
   plainH=56.7px / combined plain+response=94.7px — an earlier 340px guess
   left a large dead gap above the Deploy button. */
.composer-body{padding:26px 24px 20px;height:240px;position:relative;display:flex;flex-direction:column;justify-content:flex-start}

/* ---- EXPERIMENT: one continuous human-typed sentence for the composer's
   whole lifecycle — it never disappears or gets replaced. min-height reserves
   ~2 lines so the card doesn't visibly resize when the two slot spans convert
   from plain prose to (wider) technical chip content mid-sentence. ---- */
.composer-plain{
  font-size:clamp(16px,2.2vw,20px);line-height:1.5;font-weight:450;color:var(--text);
  min-height:2.8em;
}

/* the two convertible portions of the sentence: plain text (no styling at
   all, indistinguishable from surrounding prose) until Deploy adds
   .slot-chip, at which point they become small inline technical chips. */
.slot-chip{
  display:inline-flex;align-items:center;gap:6px;
  vertical-align:middle;
  line-height:1;border-radius:8px;border:1px solid var(--border-strong);
  white-space:nowrap;opacity:0;transform:scale(.92);
  transition:opacity .3s ease,transform .3s ease;
}
.slot-chip.show{opacity:1;transform:none}
.slot-chip.flash{animation:chipflash 1s ease-out}   /* reuses @keyframes chipflash below */

.slot-chip--place{
  font-family:var(--mono);font-size:0.72em;color:var(--text);
  background:var(--panel-2);padding:3px 9px;
}
.slot-chip--place .rec{width:6px;height:6px;border-radius:50%;background:#ff4d4d;box-shadow:0 0 6px #ff4d4d;flex:none}

.slot-chip--svc{
  background:var(--panel-2);border-radius:999px;padding:4px 11px 4px 7px;
  font-size:0.9em;font-weight:500;color:var(--text);
}
.slot-chip--svc img{height:15px;width:auto;max-width:90px;display:block}
.slot-chip--svc.slot-chip--wordmark img{height:13px}
/* logo-only THEN chip: the tool is shown as its mark alone, appended after the
   sentence — symmetric padding + a small left margin so it reads as a routing
   badge, not glued to the period. */
.slot-chip--svc.slot-chip--icononly{padding:4px 9px;margin-left:5px}
/* dark/mono marks (e.g. 7shifts wordmark) whitened so they show on the dark chip */
.slot-chip--svc img.lift{filter:brightness(0) invert(1)}

/* min-height reserves 2 text lines so the card never resizes as the IF/THEN
   text wraps 1<->2 lines or the stream chip appears */
.rule-line{display:flex;flex-wrap:wrap;align-items:center;gap:10px 11px;font-size:clamp(16px,2.2vw,20px);line-height:1.35;min-height:2.7em}
.rule-line + .rule-line{margin-top:16px}
.tag{
  font-family:var(--mono);font-size:12px;font-weight:500;letter-spacing:.08em;
  padding:5px 11px;border-radius:7px;flex:none;text-transform:uppercase;
}
.tag.if,.tag.then{color:var(--text);background:var(--panel-2);border:1px solid var(--border-strong)}

/* EXPERIMENT: inline IF/THEN tags inserted directly into the still-flowing
   composer sentence on Deploy — reuses .tag/.tag.if/.tag.then as-is, scoped
   here so this inline-display/fade-in override never touches the "How it
   works" section's own .rule-line .tag usage. */
.composer-plain .tag{
  display:inline-block;vertical-align:middle;margin:0 6px 0 2px;
  opacity:0;transform:scale(.92);
  transition:opacity .3s ease,transform .3s ease;
}
.composer-plain .tag.show{opacity:1;transform:none}
.rule-text{color:var(--text);font-weight:450}
.rule-text .stream{color:var(--faint);font-family:var(--mono);font-size:0.82em}
.caret{display:inline-block;width:2px;height:1.1em;background:var(--text);margin-left:1px;vertical-align:-2px;animation:caret 1s steps(1) infinite}
@keyframes caret{50%{opacity:0}}
.svc-chip{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 13px 6px 9px;border-radius:999px;
  background:var(--panel-2);border:1px solid var(--border-strong);
  font-size:14.5px;font-weight:500;color:var(--text);flex:none;
  opacity:0;transform:translateY(4px);transition:opacity .35s ease,transform .35s ease;
}
.svc-chip.show{opacity:1;transform:none}
.svc-chip img{height:18px;width:auto;max-width:110px;display:block}
.svc-chip.wordmark img{height:16px}

/* self-collapses to zero space when hidden (no .composer-reveal parent to
   hide it anymore — mirrors the same collapse technique used below for
   .composer-deploy.done) */
.response{
  display:flex;align-items:center;gap:10px;
  margin-top:0;padding-top:0;border-top:1px dashed transparent;
  max-height:0;overflow:hidden;
  font-size:14px;color:var(--muted);
  opacity:0;transform:translateY(6px);
  transition:opacity .4s ease,transform .4s ease,max-height .5s ease,margin-top .5s ease,padding-top .5s ease,border-color .5s ease;
}
.response.show{
  margin-top:22px;padding-top:16px;border-top-color:var(--border);
  max-height:60px;opacity:1;transform:none;
}
.response .check{
  width:20px;height:20px;border-radius:50%;flex:none;display:grid;place-items:center;
  background:var(--emphasis);color:var(--bg);
}
.response .check svg{width:12px;height:12px}
.response .meta{margin-left:auto;font-family:var(--mono);font-size:11.5px;color:var(--faint)}

.composer.cycling .composer-plain,.composer.cycling .response{opacity:.18;transition:opacity .4s ease}

/* "Deploy agent" button — pinned to a fixed screen position (position:absolute
   against .composer-body's now-fixed height above) so nothing above it —
   the typed sentence wrapping, .response revealing — can ever move it.
   Greyed out (not yet a real rule to deploy) until the IF/THEN typing finishes,
   then lights up to full color right before the cursor "clicks" it. */
.composer-deploy{position:absolute;right:24px;bottom:20px;font-family:var(--body);font-size:14px;font-weight:600;color:var(--bg);background:var(--emphasis);border:0;border-radius:999px;padding:14px 22px;opacity:.45;overflow:hidden;transition:opacity .3s ease,box-shadow .2s ease,transform .12s ease}
/* mobile tap ripple (js/composer.js tapDeploy) — dark-toned so it reads on the
   light button; clipped to the pill by the button's overflow:hidden above.
   box-shadow of .press is unaffected by overflow (renders outside the box). */
.deploy-ripple{position:absolute;left:50%;top:50%;width:12px;height:12px;border-radius:50%;background:rgba(10,11,14,.28);pointer-events:none;transform:translate(-50%,-50%) scale(0);animation:deployRipple .5s ease-out forwards}
@keyframes deployRipple{0%{transform:translate(-50%,-50%) scale(0);opacity:.55}100%{transform:translate(-50%,-50%) scale(26);opacity:0}}
.composer-deploy.ready{opacity:1}
.composer-deploy.press{transform:scale(.96);box-shadow:0 0 0 4px rgba(247,248,250,.14)}
/* EXPERIMENT: once clicked, the button fades out in place — the revealed
   block's own .response line already confirms "Automation live". No
   collapse/reflow needed now that it's out of flow entirely. */
.composer-deploy.done{opacity:0;pointer-events:none}

/* stream chip — pulled from a live feed into the IF line */
.stream-chip{display:none;align-items:center;gap:7px;font-family:var(--mono);font-size:13px;color:var(--text);background:var(--panel-2);border:1px solid var(--border-strong);padding:5px 11px;border-radius:8px;opacity:0;transform:scale(.92);transition:opacity .3s ease,transform .3s ease;vertical-align:middle}
.stream-chip.show{opacity:1;transform:none}
.stream-chip.flash{animation:chipflash 1s ease-out}
.stream-chip .rec{width:6px;height:6px;border-radius:50%;background:#ff4d4d;box-shadow:0 0 6px #ff4d4d;flex:none}
@keyframes chipflash{0%{box-shadow:0 0 0 0 rgba(247,248,250,.45)}100%{box-shadow:0 0 0 11px rgba(247,248,250,0)}}
.stream-chip.land{animation:chipflash 1s ease-out, chipland .42s cubic-bezier(0.16,1,0.3,1)}
@keyframes chipland{0%{transform:scale(1.14)}60%{transform:scale(.97)}100%{transform:scale(1)}}

/* flying stream chip: clone that travels from the clicked feed into the IF line */
.fly-chip{position:fixed;left:0;top:0;z-index:56;pointer-events:none;display:inline-flex;align-items:center;gap:7px;
  font-family:var(--mono);font-size:13px;color:var(--text);white-space:nowrap;
  background:var(--panel-2);border:1px solid var(--border-strong);padding:5px 11px;border-radius:8px;
  box-shadow:0 0 22px rgba(247,248,250,0.22),0 8px 24px rgba(0,0,0,.5);
  transition:transform .52s cubic-bezier(.5,0,.2,1),box-shadow .52s ease}
.fly-chip .rec{width:6px;height:6px;border-radius:50%;background:#ff4d4d;box-shadow:0 0 6px #ff4d4d;flex:none}
.fly-chip.arrive{box-shadow:0 0 8px rgba(247,248,250,0.18)}

/* ---- responsive ----
   Paired with hero.css's own @media(max-height:800px) block — same fix, this
   file's half of it. Trims the composer card's internal spacing so the hero
   fits one screen on shorter viewports; content/type scale untouched. Needs
   its own smaller fixed height (not just trimmed padding) to match the tighter
   .response margins here, same reasoning as the base .composer-body rule
   above — .composer-deploy's position:absolute/right/bottom don't need a
   per-breakpoint override since horizontal padding is unchanged here. */
@media(max-height:800px){
  .composer-wrap{margin-top:24px}
  .composer-body{padding:14px 24px 10px;height:200px}
  .composer-plain{min-height:2.4em}
  .response.show{margin-top:8px;padding-top:6px}
}
/* ---- phone tier ----
   On a portrait phone the fixed 240px card left a large empty band between the
   (top-aligned) rule and the (bottom-pinned, position:absolute) Deploy button —
   the "not enough spacing" complaint was partly this dead space inflating the
   hero. Switch to content height with a floor that still clears the absolutely
   positioned button: min-height must cover top padding + ~100px wrapped rule +
   the ~46px button + bottom gap, so ~190px. height:auto lets it grow if a rule
   wraps taller; it never needs the full 240px on mobile. */
@media(max-width:600px){
  .composer-wrap{margin-top:16px}
  /* shorter camera preview on phones — 16/7 was too tall on a narrow card */
  .composer-preview{aspect-ratio:16/5}
  /* tighter reserved height: the preview moved out of the body, so it only needs
     the typed rule (≤2 lines) + the bottom-pinned Deploy button / response line.
     174px left a dead gap AND pushed "Join Waitlist" below the fold on short
     phones (iPhone SE, small Android) — 128px clears both. */
  .composer-body{padding:16px;height:auto;min-height:128px}
  .composer-plain{font-size:15px;line-height:1.45}
  .composer-deploy{right:16px;bottom:14px;padding:12px 18px}
  .response.show{margin-top:10px;padding-top:8px}
  /* keep the confirmation line short on mobile — just the check + "Automation
     live", dropping the "· watching cam · loc" tail and the meta chip that
     otherwise overflow / wrap awkwardly in the narrow card */
  .response .response-detail,
  .response .meta{display:none}
}
