/* Together (E3): chapter 01, "Your data is worth more together."  SPEC 4.3.
   Every selector starts with #together. Only transform and opacity animate (set from together.js).
   Desktop (>=1100): copy cols 1-5, stage cols 6-12, lower-third caption under the stage.
   Under 1100: one column (copy, stage, caption). Under 760: stage 50svh, the slot under it holds
   the subline (opening), the captions, then the two answers. */
#together{--tg-rowh:38px;--tg-core:96px}
#together .tg{position:relative;height:100%;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));
  grid-template-rows:minmax(0,1fr) auto;column-gap:var(--gap);row-gap:10px;
  padding-top:calc(var(--top-safe) + 8px);padding-bottom:4svh}
/* the copy column's slate sits on the same line in every chapter: var(--top-safe) + 14svh (the grid's
   padding-top is --top-safe + 8px), whatever the height of the copy under it */
#together .tg-copy{grid-column:1 / span 5;grid-row:1;align-self:start;margin-top:calc(14svh - 8px);position:relative;z-index:var(--z-overlay);
  display:flex;flex-direction:column;align-items:flex-start;gap:20px;padding-right:12px}
#together .tg-copy .h2{max-width:11.5em}
#together .tg-copy .sub{max-width:40ch;margin:0;text-wrap:balance}
#together .tg-nw{white-space:nowrap}
#together .tg-stage{grid-column:6 / span 7;grid-row:1;align-self:center;position:relative;height:100%;max-height:var(--stage-h);
  z-index:var(--z-stage)}
#together .tg-slot{grid-column:6 / span 7;grid-row:2;position:relative;display:grid;min-height:74px}
#together .tg-slot>*{grid-area:1 / 1}
#together .tg-cap{display:flex;justify-content:center;align-items:flex-start}
/* a fixed caption box (two lines tall, full width): a caption that wraps never moves the ticks or itself */
#together .tg-cap .caps{width:100%}
#together .tg-cap .caps-text{width:100%;min-height:calc(2 * 1.35 * 1.25rem)}
#together .tg-cap .cap{width:100%;justify-self:center;align-self:start;text-wrap:balance}
#together .tg-foot{grid-column:1 / span 5;grid-row:2;align-self:end;max-width:44ch;margin:0}

/* everything on the stage is placed by transform from (0,0) */
#together .tg-stage>*:not(.fm-canvas){position:absolute;left:0;top:0}
#together .fm-canvas{z-index:0}

/* the record (ledger) */
#together .tg-ledger{z-index:3;width:min(420px,100%);padding:14px 18px 8px;background:var(--night-2);border:1px solid var(--hair-2);
  border-radius:16px;transform-origin:50% 50%;opacity:0;visibility:hidden}
#together .tg-lhead{display:flex;align-items:center;gap:14px;padding-bottom:12px;border-bottom:1px solid var(--hair-2)}
#together .tg-thumb{flex:none;width:64px;height:64px;border-radius:8px;background-color:#1C221D;background-repeat:no-repeat;
  outline:1px solid rgba(236,234,222,.14);outline-offset:-1px}
#together .tg-lhtxt{min-width:0;display:grid;gap:4px}
#together .tg-lname{color:var(--ink)}
#together .tg-lmeta{color:var(--ink-3)}
#together .tg-rows{margin-top:2px}
#together .tg-row{display:grid;grid-template-columns:4.6rem minmax(0,1fr) auto;column-gap:12px;align-items:center;
  min-height:var(--tg-rowh);padding:4px 0;border-bottom:1px solid var(--hair);opacity:0;visibility:hidden}
#together .tg-row:last-child{border-bottom:0}
#together .tg-row.is-pub{grid-template-columns:minmax(0,1fr) auto}
#together .tg-row.is-first{border-top:1px solid var(--hair-2);margin-top:6px}
#together .tg-d{font:500 .875rem/1.2 var(--f-mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);white-space:nowrap}
#together .tg-w{font:400 1rem/1.3 var(--f-sans);color:var(--ink);min-width:0}
#together .tg-a{font:400 .9375rem/1.3 var(--f-sans);color:var(--ink-2);text-align:right;white-space:nowrap}
#together .tg-a .num,#together .tg-lhtxt .num{font-family:var(--f-mono);font-weight:500;font-variant-numeric:tabular-nums;color:var(--ink)}
#together .tg-bars{grid-column:1 / -1;display:grid;gap:3px;padding:6px 0 4px}
#together .tg-bars i{display:block;height:3px;border-radius:2px;background:var(--water);transform-origin:0 50%;transform:scaleX(0)}
#together .tg-bars i+i{opacity:.45}

/* scattered record cards (sources are generic words, never brands) */
#together .tg-cards{z-index:5;width:100%;height:100%;pointer-events:none}
#together .tg-card{position:absolute;left:0;top:0;padding:10px 14px;background:var(--night-2);border:1px solid var(--hair-2);
  border-radius:12px;white-space:nowrap;transform-origin:50% 50%;opacity:0;visibility:hidden}
#together .tg-card .label{display:block;color:var(--ink-3);margin-bottom:3px}
#together .tg-cv{display:block;font:400 1rem/1.35 var(--f-sans);color:var(--ink)}
#together .tg-edge{position:absolute;inset:-1px;border:1px solid var(--lime);border-radius:12px;opacity:0;pointer-events:none}

/* public data streams (desktop) */
#together .tg-streams{z-index:2;width:100%;height:100%;overflow:visible;pointer-events:none;opacity:0;visibility:hidden}
#together .tg-streams path{fill:none;stroke:var(--lime);stroke-width:1;stroke-linecap:round}
#together .tg-slabel{z-index:2;max-width:236px;color:var(--ink);opacity:0;visibility:hidden;letter-spacing:.1em}
#together .tg-slabel b{display:block;font-weight:500;color:var(--lime)}
#together .tg-slabel span{display:block;color:var(--ink-2);text-wrap:balance}
#together.tg-nostreams .tg-streams,#together.tg-nostreams .tg-slabel{display:none}

/* scan line (base .scan: 2px lime core + falloff trailing left) */
#together .tg-scan{z-index:6;opacity:0;visibility:hidden}

/* the core: the FieldMatrix mark on night with a lime rim, and one ping ring */
#together .tg-core,#together .tg-ping{width:var(--tg-core);height:var(--tg-core);border-radius:22px;transform-origin:50% 50%}
#together .tg-core{z-index:4;display:grid;place-items:center;background:var(--night);border:1px solid var(--lime);opacity:0;visibility:hidden}
#together .tg-mark{width:64%;height:64%}
#together .tg-ping{z-index:4;border:1px solid var(--lime);opacity:0;visibility:hidden}

/* answers (stage right column; the slot on phones) */
#together .tg-ans{z-index:7;display:grid;gap:12px;width:300px}
#together .tg-an{padding:16px 20px;background:rgba(17,22,18,.95);display:grid;gap:8px;opacity:0;visibility:hidden}
#together .tg-an .readout-s{color:var(--ink);white-space:nowrap;transform-origin:0 60%}
#together .tg-an .readout-s small{font:500 1.125rem/1 var(--f-mono);color:var(--ink-2);letter-spacing:0}
#together .tg-an .body{color:var(--ink-2);font-size:1.0625rem;line-height:1.45}
#together .tg-badge{z-index:7;opacity:0;visibility:hidden}
/* desktop + tablet: the badge closes the answers column, flush with both its edges, 16px under answer 2 */
#together .tg-stage .tg-ans .tg-badge{justify-self:stretch;margin-top:4px;white-space:normal;align-items:flex-start;text-wrap:balance}
#together .tg-stage .tg-ans .tg-badge::before{margin-top:.42em}
/* short screens: the answers column can't hold it under the core, so it signs off the copy column */
#together .tg-copy .tg-badge{margin-top:4px}

/* the opener: a duplicate title, centred and huge, that moves onto the column H2 (aria-hidden) */
/* it is set on the H2's own line breaks (one nowrap block per line), max-content wide, and the box is
   centred, so its midpoint is the viewport's centre; the slate sits on the title's left edge */
#together .tg-open{position:absolute;inset:0;z-index:var(--z-caption);display:flex;align-items:center;justify-content:center;
  pointer-events:none;padding-top:var(--top-safe);padding-bottom:6svh}
#together .tg-obox{display:flex;flex-direction:column;align-items:flex-start;gap:22px;max-width:100%}
#together .tg-big{margin:0;width:max-content;color:var(--ink);transform-origin:0 0}
#together .tg-bl{display:block;white-space:nowrap}
#together .tg-copy .slate,#together .tg-copy .h2{opacity:0}

/* ---------- one column under 1100 ---------- */
@media (max-width:1099px){
  #together .tg{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;row-gap:14px;
    padding-top:calc(var(--top-safe) + 16px);padding-bottom:3svh}
  #together .tg-copy{grid-column:1;grid-row:1;gap:12px;padding-right:0;margin-top:0}
  #together .tg-copy .h2{max-width:none}
  #together .tg-copy .sub{max-width:60ch}
  #together .tg-stage{grid-column:1;grid-row:2;max-height:640px}
  #together .tg-slot{grid-column:1;grid-row:3;min-height:70px}
  #together .tg-foot{grid-column:1;grid-row:4;max-width:none}
}

/* ---------- phones (under 760): stage 50svh, the slot under it ---------- */
@media (max-width:759px){
  #together{--tg-rowh:34px;--tg-core:68px}
  #together .tg{grid-template-rows:auto auto minmax(0,1fr) auto;row-gap:12px;
    padding-top:calc(var(--nav-h) + var(--bar-h) + 14px);padding-bottom:12px}
  #together .tg-copy{gap:6px}
  #together .tg-copy .h2{font-size:clamp(1.9rem,8vw,2.4rem)}
  #together .tg-stage{height:min(50svh,calc(100svh - 380px));max-height:none;align-self:start}
  #together .tg-slot{grid-row:3;align-content:start;min-height:0}
  #together .tg-slot .tg-cap{align-items:flex-start;padding-top:6px}
  #together .tg-psub{opacity:0;visibility:hidden;max-width:none;font-size:1.0625rem;line-height:1.45}
  #together .tg-slot .tg-ans{position:absolute;left:0;right:0;bottom:0;width:auto;gap:8px}
  #together .tg-slot .tg-ans .tg-badge{position:static;justify-self:start}
  #together .tg-thumb{width:52px;height:52px}
  #together .tg-lhead{gap:12px;padding-bottom:10px}
  #together .tg-lhtxt .label{letter-spacing:.08em}
  #together .tg-slot .tg-an{grid-template-columns:5.6rem minmax(0,1fr);align-items:baseline;column-gap:12px;padding:10px 14px}
  #together .tg-slot .tg-an .readout-s{font-size:1.625rem}
  #together .tg-slot .tg-an .readout-s small{font-size:.9375rem}
  #together .tg-slot .tg-an .body{font-size:1rem;line-height:1.4}
  #together .tg-foot{grid-row:4}
  #together .tg-card{padding:8px 12px}
  #together .tg-cv{font-size:.9375rem}
  #together .tg-ledger{padding:12px 14px 6px}
  #together .tg-row{grid-template-columns:4.2rem minmax(0,1fr) auto;column-gap:8px}
  #together .tg-w{font-size:.9375rem}
  #together .tg-a{font-size:.875rem}
  #together .tg-badge{font-size:.9375rem;padding:8px 12px;white-space:normal;max-width:100%}
  #together .tg-core{border-radius:18px}
  #together .tg-ping{border-radius:18px}
}

/* ---------- reduced motion / ?static=1: the final composition, no cards ---------- */
#together.is-static .tg{height:auto;padding-bottom:64px}
#together.is-static .tg-open,#together.is-static .tg-cards,#together.is-static .tg-scan,#together.is-static .tg-core,
#together.is-static .tg-ping,#together.is-static .tg-streams,#together.is-static .tg-slabel,#together.is-static .tg-slot{display:none}
#together.is-static .tg-copy .slate,#together.is-static .tg-copy .h2{opacity:1}
#together.is-static .tg-stage{height:var(--stage-h);max-height:none}
#together.is-static .tg-ledger,#together.is-static .tg-row,#together.is-static .tg-an,#together.is-static .tg-badge{opacity:1;visibility:visible}
#together.is-static .tg-bars i{transform:none}
#together.is-static .tg-ans{position:static;width:100%;max-width:420px;margin-top:8px}
#together.is-static .tg-copy .tg-badge{position:static;white-space:normal}
#together.is-static .tg-foot{grid-row:2;align-self:start;margin-top:8px}
/* desktop: the record's top meets the copy column's slate line (the same 14svh offset), as in the animated frames */
@media (min-width:1100px){
  #together.is-static .tg-stage{align-self:start;margin-top:calc(14svh - 8px)}
}
@media (max-width:1099px){
  #together.is-static .tg-foot{grid-row:3}
}
@media (max-width:759px){
  #together.is-static .tg-stage{height:auto}
  #together.is-static .tg-ans{max-width:none}
}
