/* Mission (new-plan 2.4): "Helping a generation stay connected to the world.", white on deep, alone. Every selector
   starts with #mission.

   Public: a band of about 60svh of the deep field with the line set large and centred in it, so "Try Fliq early."
   follows soon after. No pin, no photo, no second sentence, no number (C4). The line breaks only where its spans
   allow, so it reads in balanced lines: "Helping a generation / stay connected / to the world." on phones (about
   34 px at 375) and "Helping a generation / stay connected to the world." from 768 px. Its size is capped by its
   column (the band is a size container), so the longest unbroken phrase always fits.
   Draft (?draft, html.draft): the same stage becomes the window scene. On phones the art fills the stage and the line
   has its own band at the foot; from 900 px the line takes the left column and the art the right. The art (the SVG
   that section.js builds) always fills the whole stage behind the band; .mission-box is only the place the pulled-back
   scene must fit, so the line is never over the art once it shows. Pinned for 85svh, under no-preference only. */
#mission {
  --t-mission: clamp(2.25rem, 1.55rem + 3.4vw, 4.75rem);   /* the size where the column allows it: 74 px at 1440 */
  /* The widest phrase that never breaks, in em of the line's own face: "Helping a generation" measures 10.02em in
     Noto Sans 700 at this tracking, and "stay connected to the world." (one line from 768 px) 13.57em. A little over
     each, so a fallback face cannot push it out of the column. */
  --ml-w1: 10.2; --ml-w2: 13.75;
  position: relative;
}
/* The same measures in Portuguese ("Ajudando uma geração" 11.04em, "a se manter conectada ao mundo." 16.16em) and
   Chinese ("與世界保持聯繫。" 8em, set untracked), 17 Nov. */
html:lang(pt) #mission { --ml-w1: 11.25; --ml-w2: 16.4; }
html:lang(zh) #mission { --ml-w1: 8.15; --ml-w2: 8.15; }
/* 18 Nov: the longest no-wrap phrase and the second line whole. "Ayudamos a una generación" 13.52em, "a seguir
   conectada con el mundo." 15.93; "Aider une génération" 10.11, 14.16; "Wir helfen einer Generation," 13.48, "mit der
   Welt verbunden zu bleiben." 16.7; "Помогаем поколению" 11.04, 14.59. */
html:lang(es) #mission { --ml-w1: 13.75; --ml-w2: 16.15; }
html:lang(fr) #mission { --ml-w1: 10.3; --ml-w2: 14.4; }
html:lang(de) #mission { --ml-w1: 13.7; --ml-w2: 16.95; }
html:lang(ru) #mission { --ml-w1: 11.25; --ml-w2: 14.8; }
html:lang(zh) #mission .mission-line { letter-spacing: 0; line-height: 1.2; }
#mission .mission-stage {
  display: grid; align-content: center;
  min-height: 60svh;
}
#mission .mission-band {
  container-type: inline-size;   /* 100cqi: the column the line sits in, public or draft */
  padding-block: clamp(3.5rem, 2.5rem + 5vw, 7rem);
}
#mission .mission-line {
  line-height: 1.06; letter-spacing: -0.024em;
  font-size: min(var(--t-mission), var(--wrap-w) / var(--ml-w1));   /* before container units: the page's column */
  font-size: min(var(--t-mission), 100cqi / var(--ml-w1));
}
/* Where it may break: never inside "Helping a generation" (its own line), "stay connected" or "to the world.". */
#mission .mission-line .ml1 { display: block; }
#mission .mission-line .ml1, #mission .mission-line .nw { white-space: nowrap; }
@media (min-width: 48rem) {
  html:not(.draft) #mission .mission-line {
    font-size: min(var(--t-mission), var(--wrap-w) / var(--ml-w2));
    font-size: min(var(--t-mission), 100cqi / var(--ml-w2));
  }
  html:not(.draft) #mission .mission-line .ml2 { white-space: nowrap; }
}

/* ─── Draft: the window scene ─────────────────────────────────────────────────────────────────────────────── */
html.draft #mission .mission-stage {
  position: relative; overflow: clip;
  height: var(--stage-h); min-height: 0;
  padding-bottom: var(--stage-safe);   /* the phone join bar covers the foot of a full-screen stage */
  grid-template-rows: minmax(0, 1fr) auto; align-content: stretch;
}
@media (prefers-reduced-motion: no-preference) {
  html.draft #mission .mission-track { position: relative; height: calc(var(--stage-h) + 85svh); }
  html.draft #mission .mission-stage { position: sticky; top: var(--bar-top); }
  /* The line waits for the camera (section.js fades it in at the end of the pull-back); held back from the first
     paint so it does not show and then vanish when the art arrives. section.js shows it if the art cannot load. */
  html.draft #mission .mission-line { opacity: 0; }
}
html.draft #mission .mission-art { position: absolute; inset: 0; }
html.draft #mission .mission-art svg { display: block; width: 100%; height: 100%; }
html.draft #mission .mission-box { grid-area: 1 / 1; margin-top: 1rem; }
html.draft #mission .mission-band { grid-area: 2 / 1; position: relative; padding-block: 0.75rem 1.25rem; }
/* The draft line is the section headline's size, in three lines in every layout, capped by its column as above. */
html.draft #mission .mission-line {
  line-height: var(--lh-h2);
  font-size: min(var(--t-h2), var(--wrap-w) / var(--ml-w1));
  font-size: min(var(--t-h2), 100cqi / var(--ml-w1));
}
/* The draft label: a chip in the stage's top-left corner, on its own deep ground, so it reads over the art and takes
   no room from the band. */
html.draft #mission .mission-tag {
  position: absolute; top: 0.75rem; left: var(--wrap-x); z-index: 1;
  padding: 0.3rem 0.65rem; border-radius: var(--pill);
  background: var(--deep); box-shadow: inset 0 0 0 1px var(--rule-strong);
  font-size: var(--t-tiny); font-weight: 500; line-height: 1.3; color: var(--muted);
}

@media (min-width: 56.25rem) {
  html.draft #mission .mission-stage {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: minmax(0, 1fr);
    column-gap: clamp(2.5rem, 4vw, 5rem);
    padding-inline: var(--wrap-x);
  }
  html.draft #mission .mission-box { grid-area: 1 / 2; margin-block: 2.5rem; }
  html.draft #mission .mission-band { grid-area: 1 / 1; align-self: center; max-width: none; margin: 0; padding: 0; }
}
