/* ── THE SHOWCASE COMPOSITION, ONE DEFINITION, TWO SURFACES ──────────────────
 *
 * This file is COPIED to nightlight.us verbatim; `scripts/showcase-checksum.sh`
 * is what keeps the copies from drifting. It carries every visual decision, so
 * the two renderers (React here, ~40 lines of vanilla there) differ only in how
 * they emit the markup.
 *
 * PORTED FROM CD's `Composition Mobile`, not integrated from it: CD's runtime
 * fetches React 18 and @babel/standalone from unpkg at page load, which neither
 * a React-19 PWA nor a flat marketing page can take. The geometry below is CD's,
 * re-expressed against the captures' own coordinate space.
 */

/* ══ THE STORY IS A COLUMN OF CARDS, NOT A DOCUMENT ═════════════════════════
 * Rebuilt against CD's `Patient Story Mobile` after Ross compared the two. The
 * first port took the composition's GEOMETRY and invented the shell around it,
 * which was the whole error: the callouts landed correctly on a page that read
 * like prose. Each screen is a dark card on cream, the type is display-sized and
 * centred, the phone wears a bezel, and the intro is a lit hero rather than a
 * heading. Those are the design, not decoration.
 */
.sc-story { max-width: 560px; margin: 0 auto; padding: 44px 16px 70px; box-sizing: border-box;
            display: flex; flex-direction: column; gap: 36px; }
.sc-screen { display: flex; flex-direction: column; gap: 16px; }

/* THE CAROUSEL'S SLIDE IS ITS OWN CARD, so its inner column has to match the
 * story card's TWO load-bearing properties: children centred, and a 24px gap.
 * The bracket's `top: -24px` is that gap measured from the other side — with the
 * carousel at 16px the L started 8px above the rail's end, and with the column
 * not centring, the phrase sat 56px left of the phone it belonged to. Neither is
 * a style choice; both are the geometry the bracket is drawn against. */
.sc-screen--carousel { align-items: center; gap: 24px; }

/* THE SPINE. Rules on both sides, teal-deep rather than amber: on cream the
 * amber that reads as "lit" inside a dark card reads as washed-out here. */
.sc-marker { display: flex; align-items: center; gap: 14px; }
.sc-marker::before,
.sc-marker::after { content: ""; flex: 1; height: 1px; background: rgba(10, 42, 56, 0.16); }
.sc-marker span {
  font: 600 13px/1 Inter, system-ui, sans-serif; letter-spacing: 0.14em;
  text-transform: uppercase; color: #0A536A; white-space: nowrap;
}

/* THE CARD. The ground is a radial that lifts toward the top-centre, so the
 * phone sits in light and the corners fall away. */
.sc-card {
  border-radius: 18px; overflow: hidden; box-shadow: 0 18px 44px rgba(10, 42, 56, 0.16);
  background: radial-gradient(130% 120% at 50% 30%, #0E6A84 0%, #0A536A 48%, #0A2A38 100%);
  padding: 36px 22px 40px; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}

.sc-intro-mark { position: relative; width: min(72%, 320px); margin-top: 28px; }
.sc-intro-sub {
  text-align: center; font: 400 22px/1.3 Fraunces, Georgia, serif;
  color: #FAF7F2; margin: 0 0 24px; text-wrap: pretty;
}

/* THE LAMP, SPELLED INTO A WORD. A dotless letter with the aura sitting where
 * its tittle would be — the same radial the wordmark uses, at the size the type
 * calls for. It pops in once, after the line has settled; under
 * prefers-reduced-motion the rule at the foot of this file stops it and the
 * light simply is. */
.sc-lit { position: relative; display: inline-block; }
.sc-tittle {
  position: absolute; left: 50%; top: 3px; width: 28px; height: 28px;
  transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle closest-side,
    rgba(232, 192, 112, 0.86) 0%, rgba(200, 150, 74, 0.30) 32%, rgba(200, 150, 74, 0) 100%);
  animation: sc-tittle-pop 0.65s cubic-bezier(0.2, 0.8, 0.3, 1.2) 0.55s both;
}
@keyframes sc-tittle-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
  62%  { opacity: 1; transform: translate(-50%, -50%) scale(1.22); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.sc-head { display: flex; flex-direction: column; gap: 10px; align-items: center;
           text-align: center; max-width: 520px; }
.sc-eyebrow { font: 600 13px/1 Inter, system-ui, sans-serif; letter-spacing: 0.18em; color: #E8C070; }
.sc-title   { font: 500 30px/1.15 Fraunces, Georgia, serif; color: #FAF7F2; margin: 0; text-wrap: pretty; }
.sc-sub     { font: 400 20px/1.35 Fraunces, Georgia, serif; color: #FAF7F2; margin: 0; text-wrap: pretty; }

/* THE BEZEL. A screenshot without one reads as a picture of a website. */
.sc-frames { display: flex; gap: 14px; justify-content: center; width: 100%; }
.sc-frame  { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.sc-frames--one .sc-frame { width: min(74%, 330px); }
.sc-frames--two .sc-frame { width: min(46%, 240px); }
.sc-bezel {
  width: 100%; box-sizing: border-box; background: #071E29;
  border: 1px solid rgba(250, 247, 242, 0.22); border-radius: 38px; padding: 11px;
  box-shadow: 0 26px 60px rgba(4, 20, 28, 0.5);
}
.sc-frames--two .sc-bezel { border-radius: 26px; padding: 8px; }

/* THE SCREEN INSIDE IT. `aspect-ratio` comes from the capture's own pixels — set
 * inline by the renderer, not the fixed 361/780 CD used — so `cover` has nothing
 * to crop. CD's box was 0.46282 against a capture of 0.46025 and was shaving
 * 4.4px off the bottom of every frame in silence. */
.sc-shot { position: relative; width: 100%; border-radius: 28px; overflow: hidden; background: #FAF7F2; }
.sc-frames--two .sc-shot { border-radius: 19px; }
.sc-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

.sc-label { font: 600 12px/1 Inter, system-ui, sans-serif; letter-spacing: 0.16em; color: #E8C070; text-align: center; }

/* ── THE LIT POINT SITS OUTSIDE THE FRAME, AND THE BRACKET WALKS TO THE TEXT ─
 * CD's treatment, ported (drop of 2026-09-07). We arrived at the same idea from
 * opposite ends and theirs is better, so theirs is what ships.
 *
 * The history is the argument for it. An amber dot ON the screenshot read as
 * part of the app, because `#E8C070` is the interface's own lit accent. My fix
 * was to move the mark out AND drop the amber — which solved the collision by
 * throwing away the lamp, the one piece of brand language the annotation had.
 * CD kept the lamp and moved it outside the frame instead: on the teal card
 * nothing competes with it, so it can be the lit point it always was, and the
 * mark still says Nightlight.
 *
 * The rule then runs down the right edge and turns INTO the sentence, ending
 * just past its first line rather than at a block edge — because a block's width
 * lies as soon as the text wraps, and a bracket that stops short of the words is
 * pointing at a rectangle instead of at what it says.
 */
.sc-shot-outer { position: relative; }

/* The lamp: a solid amber core inside its own aura, the same two-stop radial the
 * wordmark's tittle uses. */
.sc-point {
  position: absolute; right: -44px; width: 48px; height: 48px; pointer-events: none;
  background:
    radial-gradient(circle closest-side, #E8C070 0 5px, rgba(232, 192, 112, 0) 6px),
    radial-gradient(circle closest-side, rgba(232, 192, 112, 0.9) 0%, rgba(200, 150, 74, 0.32) 38%, rgba(200, 150, 74, 0) 100%);
}
.sc-vrule {
  position: absolute; right: -21px; width: 2px;
  background: rgba(232, 192, 112, 0.6); pointer-events: none;
}
/* The L. One element, so the corner is a single box corner and the two segments
 * cannot overshoot each other — border-right is collinear with the rule above. */
.sc-stub {
  position: absolute; pointer-events: none; box-sizing: border-box;
  /* Collinear with `.sc-vrule`, and the 12px is not arbitrary: the phrase is the
     BEZEL's width, while the rail hangs off the SCREEN inside it, which the
     bezel's 11px padding and 1px border set back. -21 + 12 = -9. Measured as a
     12px offset on all three callouts before it was reasoned out. */
  right: -9px;
  /* The rail stops at the bezel's bottom, which is exactly the card's 24px gap
     above this box. A constant, now that the two boxes share a width. */
  top: -24px;
  border-right: 2px solid rgba(232, 192, 112, 0.6);
  border-bottom: 2px solid rgba(232, 192, 112, 0.6);
}

/* THE PHRASE IS THE PHONE'S WIDTH, AND THAT IS WHAT MAKES THE BRACKET WORK.
 * The rail descends beside the screen; the L turns in beside the sentence. While
 * the two boxes had different widths (330px against 440px) their right edges
 * were 55px apart, so making the corner meet the rail meant measuring both boxes
 * and subtracting — and that measurement was correct only for whichever callout
 * happened to be laid out when it ran. Three callouts, three different offsets,
 * on one page at one width.
 * Same width, and they are collinear by construction: `right: -21px` on each,
 * against the same containing width, needs no arithmetic and cannot drift. The
 * sentence also reads as belonging to the phone it is about. */
.sc-callout {
  position: relative;
  display: flex; gap: 14px; align-items: flex-start;
  width: min(74%, 330px);
}
.sc-callout-num {
  flex: none; width: 18px; height: 18px; border-radius: 50%; background: #E8C070;
  box-shadow: 0 0 0 5px rgba(232, 192, 112, 0.2); margin-top: 5px;
  display: flex; align-items: center; justify-content: center;
  font: 700 11px/1 Inter, system-ui, sans-serif; color: #0A2A38;
}
.sc-callout-body { display: flex; flex-direction: column; gap: 4px; }
.sc-callout-k { font: 600 12px/1 Inter, system-ui, sans-serif; letter-spacing: 0.16em; color: #E8C070; }
.sc-callout-t { font: 500 21px/1.3 Fraunces, Georgia, serif; color: #FAF7F2; text-wrap: pretty; }

/* ── THE TWO FAILURES THAT MUST NOT BE SILENT ────────────────────────────────
 * A missing capture and a capture of the wrong size both render something that
 * looks deliberate unless it is made loud. */
.sc-missing {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 16px;
  background: repeating-linear-gradient(45deg, #FBEAE5 0 10px, #F7DCD4 10px 20px);
  color: #A5402E; font: 600 11px/1.4 Inter, system-ui, sans-serif; text-align: center;
}
.sc-mismatch {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px;
  background: #A5402E; color: #fff; font: 600 10px/1.3 Inter, system-ui, sans-serif; text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .sc-story *, .sc-carousel * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── THE CAROUSEL CHROME (nightlight.us only) ────────────────────────────────
 * Lives here rather than in the marketing page because this file is the ONE
 * definition of how a composition looks, and the two surfaces should not drift
 * over a dot. The app never renders these classes; carrying them costs a few
 * hundred bytes and buys one place to change.
 *
 * THE READER HERE IS A PRACTICE, NOT A PATIENT. The per-screen annotations stay
 * in the patient's voice — they label a patient's screen and reading them as
 * address would be the error — and the THIRD-PERSON framing is the section
 * heading and subhead the carousel supplies around them.
 */
.sc-carousel { max-width: 1240px; margin: 0 auto; }
.sc-carousel-frame {
  position: relative; overflow: hidden; border-radius: 20px;
  box-shadow: 0 30px 70px rgba(10, 42, 56, 0.22); background: #0A2A38;
}
/* CENTRED, NOT STRETCHED (Ross, option 3, 2026-09-07). The frame is as tall as
 * the TALLEST slide — nine portrait compositions of unequal height — and with
 * the default stretch every shorter slide put all of its slack underneath: the
 * two-up frames are 426px of content in a 703px box, so 225px of dead ground sat
 * below them and read as a hole rather than as padding.
 * Centring splits the slack top and bottom. It costs nothing, and crucially the
 * CONTROLS DO NOT MOVE — they sit below the frame, so any scheme that fits the
 * frame to the active slide would twitch them on every 7-second advance, which
 * is worse than the gap it fixes.
 * The frame's ground lives on `.sc-carousel-frame`, so the slack is teal either
 * way; only where it sits changes. */
.sc-carousel-track { display: flex; align-items: center; transition: transform 520ms cubic-bezier(0.22, 0.7, 0.2, 1); }
.sc-carousel-slide { flex: 0 0 100%; min-width: 0; padding: 26px; box-sizing: border-box; }
.sc-carousel-slide .sc-title,
.sc-carousel-slide .sc-callout-t { color: #FAF7F2; }
.sc-carousel-slide .sc-sub { color: rgba(250, 247, 242, 0.75); }

.sc-carousel-controls { display: flex; align-items: center; gap: 18px; margin-top: 20px; }

/* THE ARROWS FLANK THE SLIDE, VERTICALLY CENTRED ON IT (Ross, 2026-09-07).
 * Overlaid on the frame's edges rather than given columns of their own: the
 * frame is a fixed max-width and every pixel of it is composition, so reserving
 * space would shrink the thing the arrows exist to page through.
 *
 * 44px SQUARE, WHICH IS THE FLOOR AND NOT A STYLE CHOICE — the smallest target
 * a thumb reliably hits. They were 40px in the control row, where a miss cost
 * nothing; on the frame edge a miss lands on the slide.
 *
 * TRANSLUCENT WHITE OVER A DARK FRAME, so what is behind them stays legible as
 * context while the glyph stays readable: #0A2A38 on rgba(255,255,255,0.86)
 * measures far past AA, and the shadow separates the disc from a light capture
 * behind it. `backdrop-filter` is a progressive enhancement — the alpha alone
 * carries the contrast where it is unsupported.
 *
 * `translateY(-50%)` centres on the FRAME, which is the same box the track is
 * centred in, so the arrows and the composition share a midline at every
 * breakpoint. */
.sc-carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.55);
  /* SEE-THROUGH (Ross, 2026-09-07). At 0.86 the disc was a solid white plug over
   * the composition; at 0.42 the slide reads through it and the control still
   * reads as a control. The glyph stays DARK rather than turning white with the
   * fill, and that is the load-bearing half: a translucent white disc LIGHTENS
   * whatever is behind it, dark teal frame or cream phone screen alike, so one
   * dark glyph is legible over both grounds while a white one would vanish the
   * moment an arrow crossed a screenshot. The blur is what keeps it legible over
   * busy content; where `backdrop-filter` is unsupported the alpha alone still
   * lightens the ground. */
  background: rgba(255, 255, 255, 0.42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(10, 42, 56, 0.18);
  color: #0A2A38; font: 600 19px/1 Inter, system-ui, sans-serif;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.sc-carousel-btn--prev { left: 12px; }
.sc-carousel-btn--next { right: 12px; }
.sc-carousel-btn:hover { background: #fff; color: #0E6A84; }
.sc-carousel-btn:focus-visible { outline: 2px solid #FAF7F2; outline-offset: 2px; }
.sc-carousel-dots { display: flex; gap: 8px; margin-left: auto; }
.sc-carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(10, 42, 56, 0.22);
}
.sc-carousel-dot[aria-current="true"] { background: #0E6A84; width: 22px; border-radius: 99px; }
