/* The closing block of a customer story page (markup: scripts/build-story-closing.mjs, words:
   marketing/content/story-closing.json). Two offers side by side, each with its own picture, so the end of the page
   is not two forms stacked under a column of text:
     .sc-ask     "Tell us about yours": a short conversation, the visitor's one sentence and the team's reply.
     .sc-notes   the build notes: the one-page document itself, its sections ticking in.
     .sc-ticket  Praktika only: the illustrated refund ticket as a scene (assets/workflow-scenes.css).
   The forms inside are the shared inline form (assets/capture.css). Theme tokens only. Without the script, or with
   reduced motion, every picture shows its finished state; all motion sits in the block at the end. */

.sc { display: grid; gap: 16px; }
.sc-pair { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 16px; }

/* ---- A card: picture on top, words and the form under it ---- */
.sc-card {
  container: sc-card / inline-size;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--bg-subtle);
}
.sc-body { display: grid; align-content: start; gap: 10px; min-width: 0; padding: clamp(20px, 2.4vw, 30px); }
.sc-body .m1-capture { max-width: none; margin-top: 8px; }
.sc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--fg-3);
  font: 500 12.5px/1.2 var(--font-sans);
}
.sc-eyebrow .icon { flex: none; width: 15px; height: 15px; }
.sc-title {
  margin: 0;
  color: var(--fg);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: var(--h-weight);
  line-height: 1.14;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.sc-sub { margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.5; }
/* The notes field is the lighter of the two: a shorter field, and the privacy line is already beside it in the ask. */
.sc-notes .m1-capture { --cap-h: 46px; }
.sc-notes .m1-capture-note { display: none; }
/* Beside the taller ask, the notes card gives its spare height to the picture: the whole page shows. */
.sc-notes { grid-template-rows: minmax(212px, 1fr) auto; }
.sc-notes .sc-motif { height: auto; }
/* The paid refund ads land on the ask's form (#refund-inquiry). Beside its picture the form starts under the
   headline: leave room for that. Stacked (further down), the headline and the whole form fit one phone screen. */
.sc-ask .m1-capture { scroll-margin-top: 14rem !important; }

/* One ask on its own (the homepage): the same card laid out wide, the picture beside the words. */
.sc-wide { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); grid-template-rows: none; }
.sc-wide .sc-motif { height: auto; min-height: 320px; border-right: 1px solid var(--line-2); border-bottom: 0; }
.sc-wide .sc-body { align-content: center; padding: clamp(24px, 3.4vw, 46px); }
.sc-wide .sc-title { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.12; }
.sc-wide .sc-chat { gap: 16px; padding-inline: clamp(20px, 3.4vw, 46px); }
.sc-wide .sc-bub { padding: 12px 16px; font-size: 15.5px; }
.sc-wide .sc-faces img { width: 32px; height: 32px; }

/* ---- The picture area ---- */
.sc-motif {
  position: relative;
  height: 212px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-2);
  background: radial-gradient(110% 120% at 100% 0%, var(--horizon-soft), transparent 62%), var(--bg-sunken);
}
.sc-motif::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(var(--line-3) 1px, transparent 1.3px) 0 0 / 18px 18px;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 92%);
  mask-image: linear-gradient(180deg, #000, transparent 92%);
}

/* The ask: one sentence out, a reply back. */
.sc-chat { display: grid; grid-auto-rows: auto; align-content: center; gap: 12px; padding: 18px clamp(18px, 2.4vw, 30px); }
.sc-bub {
  position: relative;
  max-width: min(88%, 400px);
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 0 var(--glow), 0 14px 28px -22px rgba(0, 0, 0, 0.55);
}
.sc-bub-you { grid-area: 1 / 1; justify-self: end; display: grid; gap: 3px; border-bottom-right-radius: 5px; }
.sc-bub-you small { color: var(--fg-3); font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.sc-bub-team { grid-area: 2 / 1; justify-self: start; display: flex; align-items: center; gap: 10px; border-bottom-left-radius: 5px; }
.sc-faces { display: flex; flex: none; }
.sc-faces img { width: 28px; height: 28px; border: 1.5px solid var(--bg-elev); border-radius: 50%; object-fit: cover; }
.sc-faces img + img { margin-left: -10px; }
.sc-bub-text { display: grid; gap: 1px; min-width: 0; }
.sc-bub-text b { color: var(--fg-3); font-size: 12px; font-weight: 500; }
/* What the reply leads to. Only the wide card has the room for this third line. */
.sc-next { display: none; }
.sc-wide .sc-next {
  grid-area: 3 / 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  padding: 7px 12px 7px 10px;
  border: 1px dashed var(--line-3);
  border-radius: 999px;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.2;
}
.sc-next .icon { flex: none; width: 14px; height: 14px; color: var(--fg-3); }
/* The team is typing: only ever seen while the picture plays. */
.sc-typing {
  grid-area: 2 / 1;
  justify-self: start;
  align-self: center;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px 16px 16px 5px;
  background: var(--bg-elev);
  opacity: 0;
}
.sc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); }

/* The notes: the page itself, a second sheet behind it. It runs on under the fold of the picture area. */
.sc-sheet { display: grid; justify-items: center; align-items: center; padding: 28px 0; }
.sc-page {
  position: relative;
  grid-area: 1 / 1;
  width: min(80%, 340px);
  min-height: 268px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--bg-elev);
  box-shadow: 0 1px 0 var(--glow), 0 22px 44px -26px rgba(0, 0, 0, 0.6);
  rotate: -2deg;
  transform-origin: 50% 100%;
}
.sc-page.is-back { rotate: 3.5deg; translate: 16px 10px; opacity: 0.6; box-shadow: none; }
/* The foot of the page: where it came from. */
.sc-page-foot { position: absolute; left: 16px; right: 16px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-2); color: var(--fg-3); font-size: 10.5px; }
.sc-page-foot svg { flex: none; width: 13px; height: 11px; fill: currentColor; }
.sc-page-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.sc-page-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-elev);
}
.sc-page-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Customer marks keep their true colours, so in dark mode they sit on a light chip (as in the header menu). */
html[data-theme="dark"] .sc-page-mark { border-color: transparent; background: #f6f6f7; }
.sc-page-title { display: grid; min-width: 0; line-height: 1.2; }
.sc-page-title b { overflow: hidden; color: var(--fg); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sc-page-title small { color: var(--fg-3); font-size: 11px; }
.sc-page-tab {
  flex: none;
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--fg-3);
  font-size: 10.5px;
  white-space: nowrap;
}
.sc-rows { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.sc-rows li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 5px 9px; align-items: center; margin: 0; }
.sc-tick { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--fg); color: var(--bg-elev); }
.sc-tick svg { width: 11px; height: 11px; }
.sc-row-label { color: var(--fg); font-size: 12.5px; font-weight: 500; line-height: 1.25; }
.sc-line { grid-column: 2; width: var(--w); height: 5px; border-radius: 3px; background: var(--line-2); transform-origin: 0 50%; }

/* ---- Praktika: the illustrated refund ticket ---- */
.sc-ticket {
  padding: clamp(18px, 2.6vw, 32px);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--bg-subtle);
  scroll-margin-top: 6rem;
}
.sc-ticket-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(20px, 3.6vw, 52px); align-items: center; }
.sc-ticket-copy { display: grid; align-content: center; justify-items: start; gap: 16px; min-width: 0; }
.sc-ticket-title {
  margin: 0;
  color: var(--fg);
  font-size: clamp(30px, 3.5vw, 46px);
  font-weight: var(--h-weight);
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.sc-figure {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  justify-self: stretch;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}
/* The Horizon gradient marks what the agent handles: here, the share of tickets Mira resolves. */
.sc-figure strong {
  background: linear-gradient(90deg, var(--horizon-1), var(--horizon-2), var(--horizon-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: var(--h-weight);
  line-height: 1;
  letter-spacing: -0.04em;
}
.sc-figure span { color: var(--fg-2); font-size: 14px; line-height: 1.45; }
.sc-film {
  display: flex;
  align-items: center;
  justify-self: stretch;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
}
.sc-film-play { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--invert-bg); color: var(--invert-fg); }
.sc-film-play .icon { width: 13px; height: 13px; margin-left: 1px; }
.sc-film > .icon { flex: none; margin-left: auto; color: var(--fg-3); }
.sc-ticket-scene { min-width: 0; }
/* The notes for this example, inside its panel: one line, one field. */
.sc-ticket-notes {
  container: sc-tnotes / inline-size;
  display: grid;
  gap: 8px;
  justify-self: stretch;
  min-width: 0;
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
}
.sc-ticket-notes-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--fg); font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
.sc-ticket-notes-title .icon { flex: none; width: 16px; height: 16px; color: var(--fg-3); }
.sc-ticket-notes .sc-sub { font-size: 14px; }
.sc-ticket-notes .m1-capture { --cap-h: 46px; max-width: none; margin-top: 6px; }
.sc-ticket-notes .m1-capture-note { display: none; }

/* ---- Narrower ---- */
/* A narrow card: the field sits above its button. */
@container sc-tnotes (max-width: 370px) {
  .m1-capture-row { flex-direction: column; }
  .m1-capture-submit { width: 100%; }
  .m1-capture { --cap-h: 48px; }
}
@container sc-card (max-width: 460px) {
  .m1-capture-row { flex-direction: column; }
  .m1-capture-submit { width: 100%; }
  .sc-notes .m1-capture { --cap-h: 48px; }
}
@media (max-width: 960px) {
  .sc-pair { grid-template-columns: minmax(0, 1fr); }
  /* Stacked, the notes picture is as short as the ask's: the page runs on under the fold, one line a section. */
  .sc-notes { grid-template-rows: auto 1fr; }
  .sc-notes .sc-motif { height: 212px; }
  .sc-sheet { align-items: start; padding: 24px 0 0; }
  .sc-line + .sc-line, .sc-page-foot { display: none; }
  .sc-ticket-grid { grid-template-columns: minmax(0, 1fr); }
  /* Headline, then the scene, then the number and the film. */
  .sc-ticket-copy { display: contents; }
  .sc-ticket-copy > .sc-eyebrow { order: 1; }
  .sc-ticket-title { order: 2; margin-top: -8px; }
  .sc-ticket-scene { order: 3; }
  .sc-figure { order: 4; }
  .sc-film { order: 5; }
  .sc-ticket-notes { order: 6; }
  .sc-ask .m1-capture { scroll-margin-top: 16rem !important; }
  .sc-wide { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sc-wide .sc-motif { height: 212px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .sc-wide .sc-body { align-content: start; padding: clamp(20px, 2.4vw, 30px); }
  .sc-wide .sc-chat { gap: 12px; padding-inline: clamp(18px, 2.4vw, 30px); }
  .sc-wide .sc-bub { padding: 10px 14px; font-size: 14px; }
  .sc-wide .sc-faces img { width: 28px; height: 28px; }
  .sc-wide .sc-next { display: none; }
}
@media (max-width: 520px) {
  .sc-card, .sc-ticket { border-radius: var(--radius-lg); }
  .sc-motif, .sc-notes .sc-motif, .sc-wide .sc-motif { height: 196px; }
  .sc-sheet { padding-top: 20px; }
  .sc-film { justify-self: stretch; }
  .sc-bub { font-size: 13.5px; }
  .sc-figure { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sc-film { border-radius: var(--radius-lg); }
}

/* ---- Motion ---- */
@media (hover: hover) {
  .sc-film:hover { border-color: var(--line-3); }
}
@media (prefers-reduced-motion: no-preference) {
  .sc-film > .icon { transition: translate var(--dur-2) var(--ease-out); }
  .sc-page { transition: rotate var(--dur-3) var(--ease-out), translate var(--dur-3) var(--ease-out); }
  @media (hover: hover) {
    .sc-film:hover > .icon { translate: 3px 0; }
    .sc-notes:hover .sc-page:not(.is-back) { rotate: -0.5deg; translate: 0 -5px; }
    .sc-notes:hover .sc-page.is-back { rotate: 5deg; translate: 20px 8px; }
  }
  /* Each picture plays once, when its card scrolls into view (theme.css sets .is-visible on a .reveal). Every
     animation runs from a start value to the resting style above. */
  html.js.motion-ready .sc-card.reveal.is-visible .sc-bub-you { animation: sc-pop 560ms var(--ease-spring) 320ms both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-typing { animation: sc-typing 1500ms var(--ease) 980ms both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-typing i { animation: sc-dot 600ms var(--ease) 1100ms 2; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-typing i:nth-child(2) { animation-delay: 1220ms; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-typing i:nth-child(3) { animation-delay: 1340ms; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-bub-team { animation: sc-pop 560ms var(--ease-spring) 2400ms both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-next { animation: sc-pop 560ms var(--ease-spring) 3100ms both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-page { animation: sc-rise 760ms var(--ease-out) 260ms both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-page.is-back { animation: sc-rise-back 760ms var(--ease-out) 380ms both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-row-label { animation: sc-fade 420ms var(--ease-out) calc(820ms + var(--i) * 300ms) both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-line { animation: sc-grow 620ms var(--ease-out) calc(900ms + var(--i) * 300ms) both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-line + .sc-line { animation-delay: calc(980ms + var(--i) * 300ms); }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-tick { animation: sc-tick 520ms var(--ease-spring) calc(1240ms + var(--i) * 300ms) both; }
  html.js.motion-ready .sc-card.reveal.is-visible .sc-page-tab { animation: sc-pop 520ms var(--ease-spring) 2200ms both; }
}
@keyframes sc-pop { from { opacity: 0; translate: 0 10px; scale: 0.96; } }
@keyframes sc-fade { from { opacity: 0; } }
@keyframes sc-grow { from { scale: 0 1; } }
@keyframes sc-tick { from { opacity: 0; scale: 0.2; } }
@keyframes sc-rise { from { opacity: 0; translate: 0 44px; rotate: 0deg; } }
@keyframes sc-rise-back { from { opacity: 0; translate: 0 44px; rotate: 0deg; } }
@keyframes sc-typing { 0% { opacity: 0; translate: 0 6px; } 14%, 82% { opacity: 1; translate: 0 0; } 100% { opacity: 0; } }
@keyframes sc-dot { 50% { translate: 0 -3px; opacity: 0.5; } }
