/* ============================================================
   weavesynth.ai · v3 overlay  (motion + notices)
   Load AFTER styles.css and v2.css. Adds nothing structural —
   only motion that carries the argument, and the IP notices.
   Nothing here hides content when JS is absent.
   ============================================================ */

/* ---- 1. Rule draw ------------------------------------------
   Section rules draw left-to-right as they arrive. The design
   system is built on 1px rules; this animates what is already
   there rather than adding ornament. ------------------------- */
html.js .rule-draw { position: relative; }
html.js .rule-draw::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px;
  width: 0; background: var(--accent);
  transition: width 1.1s cubic-bezier(.19,1,.22,1) .1s;
}
html.js .rule-draw.in::after { width: 100%; }

/* ---- 2. Line-staggered display type -------------------------
   For hero and section headlines. Wrap each line in <span class="ln">. */
html.js .stagger .ln {
  display: block; opacity: 0; transform: translateY(14px);
  transition: opacity .9s cubic-bezier(.19,1,.22,1), transform .9s cubic-bezier(.19,1,.22,1);
}
html.js .stagger.in .ln { opacity: 1; transform: none; }
html.js .stagger.in .ln:nth-child(2) { transition-delay: .10s; }
html.js .stagger.in .ln:nth-child(3) { transition-delay: .20s; }
html.js .stagger.in .ln:nth-child(4) { transition-delay: .30s; }

/* ---- 3. Sequenced children ----------------------------------
   Add .seq to any grid/list; its direct children arrive in order. */
html.js .seq > * { opacity: 0; transform: translateY(12px);
  transition: opacity .75s ease, transform .75s ease; }
html.js .seq.in > * { opacity: 1; transform: none; }
html.js .seq.in > *:nth-child(2){transition-delay:.08s}
html.js .seq.in > *:nth-child(3){transition-delay:.16s}
html.js .seq.in > *:nth-child(4){transition-delay:.24s}
html.js .seq.in > *:nth-child(5){transition-delay:.32s}
html.js .seq.in > *:nth-child(6){transition-delay:.40s}

/* ---- 4. Figures: settle rather than slide ------------------- */
html.js .figimg img { opacity: 0; transform: scale(1.012);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.19,1,.22,1); }
html.js .figimg.in img, html.js .fig.in .figimg img { opacity: 1; transform: none; }

/* ---- 5. Counted figures -------------------------------------
   <span class="count" data-to="11">11</span> ------------------ */
.count { font-variant-numeric: tabular-nums; }

/* ---- 6. Three-state tally --------------------------------
   Colours taken from fig-gate.svg, which is authoritative:
   pass = accent-2 (teal), fail = ink (deliberately not
   alarmist), not established = solid accent block with paper
   text, the same violet as GATE HOLDS. ---------------------- */
.tally { display: grid; grid-template-columns: 1fr; gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); margin-top: var(--s-block, 2.5rem); }
@media (min-width: 820px) { .tally { grid-template-columns: repeat(3, 1fr); } }
.tally .t { background: var(--paper); padding: clamp(1.6rem, 3vw, 2.25rem);
  display: flex; flex-direction: column; gap: .5rem; }
.tally .t .k { font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.tally .t .v { font-family: var(--display); font-weight: 300;
  font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.02em;
  font-variation-settings: "opsz" 96; color: var(--ink); }
.tally .t p { font-size: .95rem; color: var(--ink-soft); margin: 0; max-width: 34ch; }

.tally .t.pass .k, .tally .t.pass .v { color: var(--accent-2); }
.tally .t.fail .k { color: var(--ink-mute); }
.tally .t.fail .v { color: var(--ink); }

.tally .t.ne { background: var(--accent); }
.tally .t.ne .k { color: rgba(255,255,252,.72); }
.tally .t.ne .v { color: var(--paper); }
.tally .t.ne p  { color: rgba(255,255,252,.86); }
html.js .tally .t.ne.lit { animation: ws-halo 2.2s cubic-bezier(.19,1,.22,1) 1; }
@keyframes ws-halo {
  0%   { box-shadow: inset 0 0 0 0 rgba(255,255,252,0); }
  35%  { box-shadow: inset 0 0 0 3px rgba(255,255,252,.38); }
  100% { box-shadow: inset 0 0 0 0 rgba(255,255,252,0); }
}

/* ---- 7. Verify demo: make the verdict change legible --------- */
.vfy-out { transition: color .3s ease, border-color .3s ease, background .3s ease; }
html.js .vfy-out.changed { animation: ws-verdict .55s ease-out 1; }
@keyframes ws-verdict { 0% { opacity: .2; transform: translateY(-2px); } 100% { opacity: 1; transform: none; } }
html.js .vfy-v.touched { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-q); }

/* ---- 8. Patents pending notice ------------------------------- */
.pp-mark { display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent); padding: .38rem .85rem; }
.pp-mark::before { content: ""; width: 5px; height: 5px; background: var(--accent); }
.pp-line { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-mute); }
.pp-line strong { color: var(--accent); font-weight: 500; }
.ip-notice { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: .68rem; line-height: 1.85; letter-spacing: .04em;
  color: var(--ink-mute); max-width: 76ch; }

/* ---- 9. Reduced motion: everything arrives, nothing moves ---- */
@media (prefers-reduced-motion: reduce) {
  html.js .rule-draw::after { width: 100%; transition: none; }
  html.js .stagger .ln, html.js .seq > *, html.js .figimg img { opacity: 1; transform: none; transition: none; }
  html.js .tally .t.ne.lit { animation: none; }
  html.js .vfy-out.changed { animation: none; }
}

/* ---- 10. Founders — lead and second --------------------------
   Not a two-up grid. Booni is the lead: full measure, accent
   rail, larger mark and name. Prabitha follows in a lighter
   weight. Hierarchy by scale and rule, never by centring a
   paragraph. ------------------------------------------------- */
.founders { margin-top: var(--s-block, 2.5rem); }

.fdr { background: var(--paper); border: 1px solid var(--rule); }
.fdr + .fdr { border-top: none; }

.fdr.lead { border-left: 3px solid var(--accent); padding: clamp(1.9rem, 3.4vw, 2.9rem); }
.fdr.second { background: var(--paper-2); padding: clamp(1.6rem, 2.6vw, 2.1rem); }

.fdr-head { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.35rem; }
.fdr.second .fdr-head { gap: 1rem; margin-bottom: 1rem; }

.fdr-portrait, .fdr-initial { border-radius: 50%; flex: none; }
.fdr-portrait { object-fit: cover; background: var(--paper-2); border: 1px solid var(--rule);
  filter: grayscale(1) contrast(1.04); transition: filter .5s ease; }
.fdr:hover .fdr-portrait { filter: grayscale(0) contrast(1); }
.fdr-initial { display: grid; place-items: center; background: var(--accent); color: var(--paper);
  font-family: var(--display); font-weight: 300; line-height: 1; }

.fdr.lead .fdr-portrait, .fdr.lead .fdr-initial { width: 104px; height: 104px; font-size: 2.6rem; }
.fdr.second .fdr-portrait, .fdr.second .fdr-initial { width: 68px; height: 68px; font-size: 1.7rem;
  background: var(--ink); }

.fdr h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.012em;
  margin: 0 0 .3rem; color: var(--ink); }
.fdr.lead h3   { font-size: clamp(1.75rem, 3.2vw, 2.45rem); }
.fdr.second h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }

.fdr .role { font-family: var(--mono); font-size: .69rem; font-weight: 500; letter-spacing: .17em;
  text-transform: uppercase; display: block; }
.fdr.lead .role   { color: var(--accent); }
.fdr.second .role { color: var(--accent-2); }
.fdr .whence { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em;
  color: var(--ink-mute); display: block; margin-top: .35rem; }

.fdr p { color: var(--ink-soft); margin: 0 0 .9rem; }
.fdr.lead p   { font-size: 1.08rem; line-height: 1.62; max-width: 62ch; }
.fdr.second p { font-size: .97rem;  line-height: 1.58; max-width: 66ch; }
.fdr p:last-of-type { margin-bottom: 1.2rem; }
.fdr p strong { color: var(--ink); font-weight: 500; }

.fdr .lnk { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.fdr .lnk:hover { border-color: var(--accent); }

@media (min-width: 900px) { .fdr.second { display: grid; grid-template-columns: 240px 1fr;
  gap: 2.25rem; align-items: start; } .fdr.second .fdr-head { margin-bottom: 0; } }

.split-note { margin-top: var(--s-block, 2.5rem); padding-left: 1.25rem;
  border-left: 3px solid var(--accent); max-width: 64ch; }
.split-note p { font-family: var(--display); font-weight: 400; font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.45; color: var(--ink); margin: 0; }
