/* GRAPHICA Flow site — copy.css — v1.20 (the stream's words sit lower, out of the spark's way; before: v1.19, the first text is back under the logo; each scene's words have their own size share, --scale-*; before: v1.18, the first text stood to the right of the logo; v1.17, a phone: the stream's text has its own lift again, --phone-stream-lift; before:
   v1.16, a phone: the first text goes up with the logo, the stream's text sits at the day's height; before: v1.15, a phone moves the day's text, the sentence, the signature copy and the
   method: tokens.css --phone-*; before: v1.14,the shore takes the screen's height: the call in the middle, its foot at the
   bottom; before: v1.13, a transparency for every kind of text: --alpha-*; before: v1.12, the switch for every text: html[data-copy-shown='0']; before: v1.11, every kind of text has its own size and colour: tokens.css --size-*, --color-*; before: the method title's drop: --method-title-drop)
   The text over the world: where each block sits on the screen, its scrim, and the shared type styles.
   The engine fades every [data-sc-copy] block in and out with the scroll (opacity, and a drift of at most 4vh);
   scripts/copy-motion.js moves the parts inside a block (translate, filter), so each title line is its own box.
   Each block has its own anchor (centre, top right, bottom right, left, full width, right beside each example
   tablet, left), so no two
   neighbours sit in the same place; only the statement and the signature copy share the left column beside the
   galaxy: they are read there one after the other (the statement leaves as the signature comes in, in step with the
   galaxy's core). Scrims are separate blocks with the same window, only behind the text. */

.copy {
  position: absolute;
  margin: 0;
}

/* ---- shared type ---- */
.copy__title,
.hero__title,
.statement {
  margin: 0;
  font-weight: var(--weight-thin);
  font-stretch: var(--stretch-wide);
  letter-spacing: var(--track-title);
  line-height: var(--leading-title);
  text-wrap: balance;
}

.copy__title {
  color: color-mix(in srgb, var(--color-title) calc(var(--alpha-title) * 100%), transparent);
  font-size: calc(var(--t-title) * var(--size-title) * var(--copy-scale, 1));
}

/* every title line is its own box, so it can come in on its own (a transform needs a box, not inline text) */
.copy__title .weight-thin,
.copy__title .weight-bold,
.statement .weight-thin,
.statement .weight-bold {
  display: block;
}

.hero__title > span {
  display: inline-block;
}

.copy__body {
  margin: 1.1em 0 0;
  max-width: 40ch;
  color: color-mix(in srgb, var(--color-body) calc(var(--alpha-body) * 100%), transparent);
  font-size: calc(var(--t-body) * var(--size-body) * var(--copy-scale, 1));
  line-height: var(--leading-body);
  text-wrap: pretty;
}

.copy__fine {
  margin: 1.4em 0 0;
  max-width: 46ch;
  color: color-mix(in srgb, var(--color-fine) calc(var(--alpha-fine) * 100%), transparent);
  font-size: calc(var(--t-fine) * var(--size-fine) * var(--copy-scale, 1));
  line-height: 1.5;
  text-wrap: balance;
}

.eyebrow {
  margin: 0;
  color: color-mix(in srgb, var(--color-label) calc(var(--alpha-label) * 100%), transparent);
  font-size: calc(var(--t-label) * var(--size-label));
  font-weight: var(--weight-medium);
  font-stretch: var(--stretch-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

/* the homepage river keeps its points away from the box between these two marks (under the hero text) */
.keepout {
  display: block;
  height: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
}

/* ---- scrims: soft dark light only where text sits ---- */
.scrim {
  /* strength is written by scripts/copy-timing.js (config.js SCRIMS); its size and place are the scale and translate
     properties, which that script writes too. The engine does not touch a scrim (it has no data-sc-copy), so a scrim
     never drifts and never shows its cut edge as a band at the edge of the screen. */
  --scrim-strength: 1;
  --scrim-core: rgba(
    var(--ground-scrim-red),
    var(--ground-scrim-green),
    var(--ground-scrim-blue),
    calc(var(--ground-scrim-alpha) * var(--scrim-strength))
  );
  --scrim-soft: rgba(
    var(--ground-scrim-red),
    var(--ground-scrim-green),
    var(--ground-scrim-blue),
    calc(var(--ground-scrim-soft-alpha) * var(--scrim-strength))
  );

  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.scrim--chaos {
  background: radial-gradient(ellipse 48% 44% at 80% 28%, var(--scrim-core), var(--scrim-soft) 55%, transparent);
  transform-origin: 80% 28%;
}

.scrim--stream {
  background: radial-gradient(ellipse 48% 44% at 80% 74%, var(--scrim-core), var(--scrim-soft) 55%, transparent);
  transform-origin: 80% 74%;
}

.scrim--statement,
.scrim--signature {
  background: radial-gradient(ellipse 40% 62% at 20% 50%, var(--scrim-core), var(--scrim-soft) 58%, transparent);
  transform-origin: 20% 50%;
}

.scrim--method {
  background:
    radial-gradient(ellipse 46% 30% at 24% 18%, var(--scrim-core), transparent),
    linear-gradient(to bottom, transparent 36%, var(--scrim-soft) 46%, var(--scrim-soft) 84%, transparent 96%);
  transform-origin: 24% 50%;
}

.scrim--demo {
  background: radial-gradient(ellipse 40% 62% at 78% 50%, var(--scrim-core), var(--scrim-soft) 58%, transparent);
  transform-origin: 78% 50%;
}

.scrim--shore {
  background: radial-gradient(ellipse 42% 64% at 22% 52%, var(--scrim-core), var(--scrim-soft) 58%, transparent);
  transform-origin: 22% 52%;
}

/* ---- where each block sits: wide screens ---- */
/* the first text stands in the middle, right under the logo (Martin, 2026-11-16) */
.copy--hero {
  left: 50%;
  top: calc(50% + var(--lh) / 2 + clamp(26px, 6vh, 64px));
  translate: -50% 0;
  width: min(44rem, calc(100% - 2 * var(--gutter)));
  text-align: center;
}

/* wide screens: each scene's block of words is made smaller by its own share (tokens.css --scale-*): the day's and the
   stream's words keep out of the logo, which stands in the middle, and every one of them keeps its room in step */
@media (min-aspect-ratio: 21/20) {
  .copy--chaos {
    --copy-scale: var(--scale-chaos);
  }

  .copy--stream {
    --copy-scale: var(--scale-stream);
  }

  .copy--statement {
    --copy-scale: var(--scale-statement);
  }

  .copy--signature {
    --copy-scale: var(--scale-signature);
  }

  .copy--method {
    --copy-scale: var(--scale-method);
  }
}

.copy--chaos {
  right: var(--gutter);
  top: calc(var(--header-h) + 7vh);
  width: calc(min(29rem, 36vw) * var(--copy-scale, 1));
}

/* lower than before (3vh, was 7vh): the spark that runs in from the logo passes above the words, never through them */
.copy--stream {
  right: var(--gutter);
  bottom: calc(var(--map-h) + 3vh);
  width: calc(min(29rem, 36vw) * var(--copy-scale, 1));
}

/* the statement and the signature copy: the left column, the galaxy on the right */
.copy--statement {
  left: var(--gutter);
  top: 50%;
  translate: 0 -50%;
  width: calc(min(36rem, 40vw) * var(--copy-scale, 1));
}

.copy--signature {
  left: var(--gutter);
  top: 50%;
  translate: 0 -50%;
  width: calc(min(30rem, 36vw) * var(--copy-scale, 1));
}

.copy--method {
  inset: calc(var(--header-h) + 5vh) var(--gutter) calc(var(--map-h) + 4vh);

  /* the thread runs through the step marks: no drift on this block, so they stay exactly on the line */
  transform: none !important;
}

/* the method title sits lower than the block's top edge; the steps are placed on their own (sections.css .steps),
   so only the title moves (--method-title-drop, in vh, is a Look Studio dial) */
.copy--method .copy__title {
  margin-top: calc(var(--method-title-drop, 3) * 1vh);
}

/* each example tablet's copy: on the right, the tablet in the room left of it (config.js LAYOUT demo) */
.copy--demo {
  right: var(--gutter);
  top: 50%;
  translate: 0 -50%;
  width: min(27rem, 33vw);
}

/* the call on the left; the river runs through its button into the big logo on the right. The block takes the
   screen's height: the call sits in the middle of the room, its foot (the sign-off, the small print last) at the
   bottom of the screen */
.copy--shore {
  --copy-scale: var(--scale-shore); /* title, text and small print follow it; sections.css does the same for the rest */

  top: calc(var(--header-h) + 3vh);
  bottom: calc(var(--map-h) + 3vh);
  left: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(30rem, 40vw);

  /* the thread runs through the call button: no drift on this block, so the button stays on the river */
  transform: none !important;
}

.copy--shore .copy__title {
  margin-top: auto;
}

.copy--shore .sign-off {
  margin-top: auto;
}

/* ---- narrow (portrait) screens: the world takes the top, the text the bottom ---- */
@media (max-aspect-ratio: 21/20) {
  .copy--chaos,
  .copy--stream {
    inset: auto var(--gutter) calc(var(--map-h) + 3vh) var(--gutter);
    width: auto;
  }

  /* the day's text and the stream's text: each moved up or down from its place at the bottom (tokens.css --phone-*) */
  .copy--chaos {
    bottom: calc(var(--map-h) + 3vh + var(--phone-chaos-lift) * 1px);
  }

  .copy--stream {
    bottom: calc(var(--map-h) + 3vh + var(--phone-stream-lift) * 1px);
  }

  /* the first text goes up with the logo (world.css), so the two stay together */
  .copy--hero {
    top: calc(50% + var(--lh) / 2 + clamp(26px, 6vh, 64px) - var(--phone-hero-lift) * 1px);
    width: min(44rem, calc(100% - 2 * var(--gutter)));
  }

  .copy--statement {
    left: var(--gutter);
    right: var(--gutter);
    top: calc(var(--header-h) + 3vh + var(--phone-statement-drop) * 1px);
    translate: none;
    width: auto;
  }

  /* signature: copy at the top, the galaxy below it (config.js LAYOUT.portrait) */
  .copy--signature {
    left: var(--gutter);
    right: var(--gutter);
    top: calc(var(--header-h) + 3vh + var(--phone-signature-drop) * 1px);
    translate: none;
    width: auto;
  }

  /* the title and the six steps all sit higher, so the last step is never cut at the bottom; the thread follows the
     step marks, which are measured where they sit */
  .copy--method {
    inset: calc(var(--header-h) + 1vh) var(--gutter) calc(var(--map-h) + 1vh);
    translate: 0 calc(var(--phone-method-lift) * -1px);
  }

  /* the copy at the top, its tablet below it */
  .copy--demo {
    left: var(--gutter);
    right: var(--gutter);
    top: calc(var(--header-h) + 1vh);
    translate: none;
    width: auto;
  }

  .scrim--demo {
    background: linear-gradient(to bottom, var(--scrim-core) 0%, var(--scrim-soft) 40%, transparent 54%);
  }

  /* the call at the top, its foot (the sign-off, the small print) at the bottom; the finale logo sits in the room
     between them (scripts/world-layout.js measures the button and the sign-off and centres the logo there) */
  .copy--shore {
    inset: calc(var(--header-h) + 3vh) var(--gutter) calc(var(--map-h) + 3vh);
    width: auto;
  }

  .copy--shore .copy__title {
    margin-top: 0;
  }

  .scrim--chaos,
  .scrim--stream {
    background: linear-gradient(to top, var(--scrim-core) 0%, var(--scrim-soft) 34%, transparent 52%);
  }

  .scrim--statement {
    background: linear-gradient(to bottom, var(--scrim-core) 0%, var(--scrim-soft) 30%, transparent 46%);
  }

  .scrim--signature {
    background: linear-gradient(to bottom, var(--scrim-core) 0%, var(--scrim-soft) 40%, transparent 54%);
  }

  .scrim--shore {
    background:
      linear-gradient(to bottom, var(--scrim-core) 0%, var(--scrim-soft) 40%, transparent 54%),
      linear-gradient(to top, var(--scrim-soft) 0%, transparent 24%);
  }

  .scrim--method {
    background: linear-gradient(to right, var(--scrim-core) 0%, var(--scrim-soft) 70%, transparent);
  }
}

/* short phones: the small print gives its room to the tablet below
   (each block keeps its "example system" label, so the honesty note is not lost) */
@media (max-aspect-ratio: 21/20) and (max-height: 720px) {
  .copy--demo .copy__fine {
    display: none;
  }

  .scrim--demo {
    background: linear-gradient(to bottom, var(--scrim-core) 0%, var(--scrim-soft) 44%, transparent 56%);
  }
}

/* the whole site with the film scene (?hub=1): the three old example tablets are not played, so their words are not
   shown either (the box stays, so the layout is measured as always) */
html.is-hub-film [data-demo-copy],
html.is-hub-film .scrim--demo {
  visibility: hidden;
}

/* ---- the switch for every text (scripts/copy-switch.js): off = the texts and their scrims are not seen and take no click.
   The engine writes the blocks' own opacity, so this wins with !important; the layout is not touched ---- */
html[data-copy-shown='0'] .copy-layer > * {
  opacity: 0 !important;
  pointer-events: none !important;
}

html[data-copy-shown='0'] .copy-layer * {
  pointer-events: none !important;
}
