/* LUMI CASE STUDY, "How it thinks". Its own styles, all inside #thinks so no class can reach
   another section; the page-wide rules (body, .row) live in page.css. One look: the words centred
   above, Lumi and its chat window held in the middle, on Lumi's blue ground. Under the picture sits
   what Lumi runs on and the guides it stands on (.t-fold). */
#thinks {
  /* A band: the colour runs edge to edge and fills the page's one section padding too (page.css),
     so the air above and below the picture is inside the colour. The section carries data-band.
     Lumi's blue, --cs-blue (page.css), in place of the grey (his pick, 19 Nov 2026, chat CASE STUDY
     SCROLL). While the whole page fades the page carries it (page.css, trip.js); with Reduce motion
     the band paints it here. */
  background: var(--cs-blue);

  /* ---- the stage ---- */
  .t3 {
    --hh: clamp(40rem, 100svh, 54rem); --u: min(1cqw, calc(var(--hh) / 60)); --fh: 60;
    --pad: calc(5 * var(--u));
    --edge: calc((100% - 100 * var(--u)) / 2);
    --ink: var(--neutral-950);
    --sub: var(--neutral-600); --rule: var(--neutral-300);
    --ww: 22.5rem;
    /* the look: words centred, Lumi lower and smaller than the brief's because four jobs and a sentence sit above it;
       the window stands at its side (in front it covered the eyes) */
    --title: 5.6; --tsz: 1.2; --tx: center; --ta: center; --sx: center; --tw: 74;
    --ls: 56; --lx: 50; --ly: 0.68;
    --wx: 72; --wb: 0.03;
    --lumi-from: scale(0.88);
    --brain-k: 1.3; --brain-n: -0.06em;
    position: relative; z-index: 1; box-sizing: border-box;
    height: calc(var(--fh) * var(--u));
    color: var(--ink);   /* no ground of its own: the section's (or the page's, while it fades) shows through */
    scroll-margin-top: 34svh;
  }

  /* the words: one column, placed by the look */
  .t-type {
    position: absolute; z-index: 3; inset: var(--pad) calc(var(--edge) + var(--pad));
    display: flex; justify-content: var(--tx, flex-start); pointer-events: none;
  }
  .t-col {
    width: 100%; max-width: 100%; min-height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: var(--ty, flex-start); text-align: var(--ta, left);
    transition: opacity var(--duration-flourish) var(--ease-default), transform var(--duration-expressive) var(--ease-emphasized);
  }
  .t3:not([data-on~="type"]) .t-col { opacity: 0; transform: translateY(var(--space-500)); }
  .t-title {
    margin: 0; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: calc(min(var(--title) * var(--tsz), var(--tcap, 6.9)) * var(--u)); line-height: var(--line-display); letter-spacing: var(--display-tight); /* the cap keeps every size under the hero's title (6.2 x 1.16 = 7.19 units) */
    text-wrap: balance;
  }
  /* The brain stands in for the word, as the About heading has it (sections.css, .about-brain: 1.26em) */
  .t-brain {
    /* Measured, 15 Nov (his note: it sat too low). The picture's drawn part is 200 of its 256 pixels
       tall and sits 12 below the picture's middle; the capitals' middle is 0.429em above the baseline.
       So the drawn brain is as tall as the capitals (times --brain-k) and its middle sits on theirs
       (plus --brain-n). 1.18em tall puts the drawn part at 1.05 of the capital height. */
    --brain-h: calc(1.18em * var(--brain-k));
    display: inline-block; height: var(--brain-h); width: auto;
    vertical-align: calc(0.729em - 0.453 * var(--brain-h) + var(--brain-n)); /* 0.429em, plus the 0.3em the pulled-in bottom margin drops it */
    margin: -0.3em 0.02em; /* keeps the line as tall as a line of words */
  }
  .t-lead {
    margin: calc(var(--leadz, 1.5) * var(--u) * 0.8) 0 0; max-width: calc(var(--tw) * var(--u));
    font-size: calc(var(--leadz, 1.5) * var(--u)); font-weight: var(--weight-medium); line-height: var(--line-snug);
    color: var(--sub); text-wrap: pretty;
  }

  /* the four jobs: each swaps the window's name and plays its own exchange */
  .t-jobs {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: var(--sx, flex-start);
    gap: 0 calc(var(--jobz, 1.25) * var(--u) * 1.5);
    margin: calc(var(--jobz, 1.25) * var(--u) * 1.3) 0 0; padding: 0; list-style: none; pointer-events: auto;
  }
  .t-jobs li { display: flex; align-items: center; }
  .t-job {
    position: relative; display: inline-flex; align-items: center; min-height: 2.75rem;
    margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: calc(var(--jobz, 1.25) * var(--u)); font-weight: var(--weight-semibold); line-height: var(--line-title);
    color: var(--sub); white-space: nowrap;
  }
  .t-job::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0.45rem; height: 2px; background: var(--ink);
    transform: scaleX(0); transform-origin: left; transition: transform var(--duration-slow) var(--ease-emphasized);
  }
  .t-job[aria-selected="true"] { color: var(--ink); }
  .t-job[aria-selected="true"]::after { transform: scaleX(1); }
  .t-job:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: var(--radius-sm); }

  /* the picked job, in one sentence */
  .t-line {
    margin: calc(var(--jobz, 1.25) * var(--u) * 0.3) 0 0;
    font-size: calc(var(--jobz, 1.25) * var(--u)); line-height: var(--line-snug); color: var(--ink); text-wrap: pretty;
  }

  /* Lumi, very large. The wrapper holds its place; the canvas takes the entrance. */
  .t-lumi-w {
    position: absolute; z-index: 1; pointer-events: none;
    left: calc(50% + (var(--lx, 50) - 50) * var(--u)); top: calc(100% * var(--ly)); width: calc(var(--ls) * var(--u)); aspect-ratio: 1;
    translate: -50% -50%;
  }
  .t-lumi {
    display: block; width: 100%; height: 100%;
    transition: opacity var(--duration-flourish) var(--ease-default), transform var(--duration-expressive) var(--ease-emphasized);
  }
  .t3:not([data-on~="lumi"]) .t-lumi { opacity: 0; transform: var(--lumi-from, translateY(12%) scale(0.92)); }

  /* ONE LUMI, from the brief (thinks.js). This section's canvas carries Lumi on from the brief's
     place, in a box of its own inside this stage, so it is drawn over the grey and under these
     words and this window. It moves; it never scales in.
     Words are never read over Lumi: a line it passes behind waits, unseen (data-pass), then
     comes back. Only the lines just ahead of it clear, so they go quicker than they come back.
     A line that holds the keyboard's place always shows. */
  .t-title, .t-lead, .t-jobs, .t-line { transition: opacity var(--duration-slow) var(--ease-default); }
  [data-pass]:not(:focus-within) { opacity: 0; transition-duration: var(--duration-base); }

  /* The chat window: the real one, small, over Lumi. It grows up from its bottom edge. */
  .t-win { position: absolute; z-index: 4; left: calc(50% + (var(--wx, 50) - 50) * var(--u)); bottom: calc(100% * var(--wb)); translate: -50% 0; width: calc(var(--ww) * var(--k, 1)); }
  .t-win-m { zoom: var(--k, 1); position: relative; text-align: left; transition: opacity var(--duration-slow) var(--ease-default), transform var(--duration-expressive) var(--ease-emphasized); }
  .t3:not([data-on~="win"]) .t-win-m { opacity: 0; transform: translateY(var(--space-500)); }
  .t-win .ccs-win { position: relative; inset: auto; z-index: 3; }
  .t-win .ccs-log { justify-content: flex-start; -webkit-mask-image: none; mask-image: none; }
  .t-win .ccs-msg--bot { align-items: flex-start; }
  .t-src { display: block; margin-top: var(--space-100); font-size: var(--size-xs); color: var(--color-text-secondary); text-decoration: underline; text-underline-offset: 0.2em; }
  .t-mock { align-self: stretch; max-width: none; padding-top: var(--space-200); border-top: var(--border-hairline); font-size: var(--size-2xs); line-height: var(--line-snug); color: var(--color-text-tertiary); }

  /* Plates: the window's own glass, for the parts that stand with it */
  .t-plate {
    background: var(--glass-tint-scrolled);
    -webkit-backdrop-filter: blur(var(--glass-blur-webkit)) saturate(var(--glass-saturate));
    backdrop-filter: blur(var(--glass-blur-webkit)) saturate(var(--glass-saturate));
    box-shadow: var(--glass-shadow), var(--glass-specular);
  }

  /* One message, start to finish: four stops, each lights as the exchange reaches it. */
  .t-path { display: flex; align-items: center; justify-content: space-between; gap: var(--space-50); margin: 0 0 var(--space-200); padding: var(--space-200) var(--space-300); border-radius: var(--radius-lg); list-style: none; font-size: var(--size-xs); font-weight: var(--weight-semibold); line-height: var(--line-title); white-space: nowrap; color: var(--color-text-primary); }
  /* a stop not reached yet is quieter, never faint: at 40% see-through it read 2.69 to 1, a
     contrast fail, so it takes the secondary text colour instead */
  .t-path li { display: inline-flex; align-items: center; gap: var(--space-100); color: var(--color-text-secondary); transition: color var(--duration-base) var(--ease-default); }
  .t-path li + li::before { content: "\2192"; font-weight: var(--weight-regular); }
  .t-path li.on { color: var(--color-text-primary); }
  /* Claude's mark in Claude's own colour (real logos in brand colour); the file is the site's own colour logo */
  .t-logo { display: inline-block; width: 1.05em; height: 1.05em; }

  /* The three layers, as one stack of cards: the window on top is the job, the one that swaps;
     the patterns and the engine are the two cards tucked under it, and they stay. */
  .t-layers { display: grid; margin: 0; padding: 0; list-style: none; justify-items: center; }
  .t-layers li { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-300); box-sizing: border-box; margin-top: calc(-1 * var(--radius-xl)); padding: calc(var(--radius-xl) + var(--space-200)) var(--space-400) var(--space-200); border-radius: 0 0 var(--radius-xl) var(--radius-xl); font-size: var(--size-xs); line-height: var(--line-title); color: var(--color-text-primary); }
  .t-layers li:nth-child(1) { z-index: 2; width: 94%; }
  .t-layers li:nth-child(2) { z-index: 1; width: 88%; }
  .t-layers b { font-weight: var(--weight-semibold); }
  .t-layers em { font-style: normal; font-weight: var(--weight-regular); color: var(--color-text-secondary); }

  .t3[data-snap] *, .t3[data-snap] { transition: none !important; }

  @media (prefers-reduced-motion: reduce) { .t3 *, .t3 { transition: none !important; } }

  /* =====================================================================
     PHONE: its own stack. Words, then Lumi and its window.
     ===================================================================== */
  @container row (max-width: 1000px) {
    /* Phone picture 100 x 244: taller than the brief's, for the four jobs and the sentence under them.
       Lumi sits whole between the words and the window; the window stands over its lower half. */
    .t3 {
      --hh: clamp(48rem, 122svh, 76rem); --u: min(1cqw, calc(var(--hh) / 244)); --fh: 244;
      --pad: calc(6 * var(--u)); --ww: 18.75rem; --leadz: 4.27; --jobz: 3.47;
      --tx: flex-start; --tw: 88; --ta: left; --sx: flex-start;
      --ls: 104; --ly: 0.475; --lx: 50; --wx: 50; --wb: 0.127;
      --title: 10.5; --tcap: 12; /* the hero's phone title */
    }
    .t-col { align-items: stretch; }
    .t-jobs { flex-wrap: nowrap; justify-content: space-between; gap: 0; } /* one row always: a second row would sit on Lumi */
    .t-lead { text-wrap: balance; }
    .t-path { padding-inline: var(--space-200); gap: 0; font-size: var(--size-2xs); }
    .t-path li { gap: var(--space-50); }
  }

  /* What Lumi runs on and the guides it stands on, under the picture, centred: the two logos, then the
     guides line under them. Normal flow under the stage, on the section's own ground.
     --from-w sets how wide the guides line runs (his ask, 23 Nov 2026: "it's very squished in"; his pick on
     the review page: 960 pixels, two lines). */
  .t-fold { --from-w: var(--container-base); box-sizing: border-box; width: min(100%, var(--container-wide)); margin: 0 auto; padding: var(--space-800) var(--space-600) 0; display: grid; justify-items: center; gap: var(--space-500); text-align: center; color: var(--neutral-950); }
  /* My rules: a small label, then one line in place of the three Never swaps chips (his words, 23 Nov 2026:
     "the never swap section, it's hard to read. I just put that in a sentence"). Its first sentence holds one
     line and the rest wraps under it (his note on the review page). */
  .t-rules { display: grid; justify-items: center; gap: var(--space-200); max-width: var(--measure); margin: 0 auto var(--space-200); }
  .t-rq { margin: 0; font-size: var(--size-xl); font-weight: var(--weight-medium); line-height: var(--line-snug); text-wrap: balance; } /* its ink is the fold's */
  .t-rq-a { display: block; white-space: nowrap; }
  .t-k { margin: 0; font-weight: var(--weight-regular); font-family: var(--font-mono); font-size: var(--size-xs); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--neutral-600); }
  .t-facts { display: grid; justify-items: center; gap: var(--space-400); width: 100%; }
  .t-runs { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-600); margin: 0; padding: 0; list-style: none; }
  .t-runs li { display: flex; align-items: center; gap: var(--space-200); font-weight: var(--weight-semibold); }
  .t-runs img { width: auto; height: var(--space-700); }
  .t-runs img.t-wide { height: var(--space-600); }
  .t-from { margin: 0; font-size: var(--size-sm); line-height: var(--line-snug); color: var(--neutral-600); text-wrap: balance; max-width: var(--from-w); }
  .t-from a, .t-runs a { color: var(--neutral-950); }
  .t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .t-path .t-cf { width: auto; height: 0.9em; }
  @container row (max-width: 1000px) {
    .t-fold { width: 100%; gap: var(--space-500); padding: var(--space-600) var(--space-400) 0; }
    .t-rq-a { white-space: normal; } /* a phone is too narrow for it on one line */
  }
}
