/* ==========================================================================
   APPROACH · SOFT ORGANIC FIELDS & LIVING ECHOES  (revision of The Sonder Thread)
   --------------------------------------------------------------------------
   A quiet abstract layer on the one ivory canvas shared by the philosophies
   and the three forms. Artwork: tools/build_thread.py (writes the SVG into
   approach.html and scripts/thread-design.js). Pointer response:
   scripts/thread.js; the echoes move with their forms in scripts/living.js.

   Layers, back to front
     1 · fields   pale organic colour fields, a few small marks    (quietest)
     2 · echoes   one softer form behind each development form
     3 · forms, illustration, text                                 (dominant)

   html[data-thread]: a (minimal, default) | b (slightly richer) | off.
   Pieces tagged data-th-v="B" show only in b.
   ========================================================================== */

.th-stage, .th-corner, .th-narrow { display: none; }
html[data-thread="off"] .lv-echo { display: none; }
/* Small accents (drawn by living.js): the ink contour mark is retired in both studies; the
   two coloured marks (yellow seed, orange stroke) stay. */
html:is([data-thread="a"], [data-thread="b"]) .lv-accent[data-accent="contour"] { display: none; }
/* the small cobalt loop is retired too: the pale cobalt field now carries that area on its own */
html:is([data-thread="a"], [data-thread="b"]) .lv-accent[data-accent="loop"] { display: none; }

html:is([data-thread="a"], [data-thread="b"]) {
  /* every piece is decoration: never a target, never announced */
  & :is(.th-stage, .th-corner, .th-narrow) { pointer-events: none; overflow: visible; }
  & :is(.th-stage, .th-corner, .th-narrow) [data-th-v="B"] { display: none; }
  & .th-line { fill: none; stroke: #17151B; stroke-width: 1.7px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

  /* the forms' section lets the thread reach up into the philosophy space and out to the page
     edges; it still clips sideways so nothing can widen the page */
  & .offers[data-mode="living"] { overflow-x: clip; overflow-y: visible; }
}
html[data-thread="b"] :is(.th-stage, .th-corner, .th-narrow) [data-th-v="B"] { display: inline; }

/* ---------- desktop: one composition frame with the three forms --------------------- */
@media (min-width: 1180px) {
  html:is([data-thread="a"], [data-thread="b"]) .offers[data-mode="living"] .th-stage {
    display: block;
    position: absolute; inset: 0;
    width: 100%; height: 100%;
  }
}

/* ---------- the cobalt field hung from the top-left corner (700 px and up) ----------- */
@media (min-width: 700px) {
  html:is([data-thread="a"], [data-thread="b"]) .phil { position: relative; }
  html:is([data-thread="a"], [data-thread="b"]) .phil > .th-corner {
    display: block;
    position: absolute; top: 0; left: 0;
    width: clamp(16rem, 34vw, 36rem);
    height: auto; aspect-ratio: 480 / 300;
    overflow: hidden;              /* cropped by the page edge and the header line */
  }
  html:is([data-thread="a"], [data-thread="b"]) .phil > .phil__inner { position: relative; }
}

/* ---------- phones and tablets: a separate, simpler arrangement per form ------------- */
@media (max-width: 1179.98px) {
  html:is([data-thread="a"], [data-thread="b"]) .offers[data-mode="living"] .th-narrow {
    display: block;
    position: absolute; inset: 0;
    width: 100%; height: 100%;
  }
  html:is([data-thread="a"], [data-thread="b"]) .offers[data-mode="living"] .offers__list { position: relative; }
}
@media (min-width: 700px) and (max-width: 1179.98px) { .th-narrow [data-th-size="phone"] { display: none !important; } }
@media (max-width: 699.98px) { .th-narrow [data-th-size="tablet"] { display: none !important; } }
