/* ============================================================================
   Token of Trust — /product/ composed scenes
   ----------------------------------------------------------------------------
   Composition, responsive art direction and scene-specific motion for the
   registered /product/ scenes in docs/scenes.md. One labelled section per
   canonical scene ID.

   SOURCE ORDER: loaded last on /product/, so a scene can override the
   primitives it composes.

   `data-tot-scene` on the roots is a documentation and visual-QA handle only —
   styling always hooks the classes, never the ID.

   Motion: the page-wide reveal (.reveal / .in) lives in the page composition
   source; these rules only respond to the .in state. The no-JavaScript
   fail-safe must stay inline in the page head so it applies only when scripting
   is off.

   `.scene` on the getting-started module is a historical layout class, NOT a
   registered scene — see docs/marketing-components.md.
   ========================================================================== */

/* --- Scene tokens: tints read only by the scenes below ----------------------- */
:root {
  --teal-08: rgba(13, 147, 145, .08);
  --navy-10: rgba(16, 41, 75, .10);
  --mint-40: rgba(127, 227, 184, .40);
}

/* ===== product-storefront-product-search ================================= */
.sf-scene { position: relative; width: 100%; min-width: 0; margin-top: 56px; }
.sf-scene { flex-shrink: 0; }
.sf-page { width: 78%; margin-left: 0; border-radius: 14px 14px 0 0; border-bottom: 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
.sf-page .sf-body { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; }
.sf-page .totui-prod { height: 118px; }
.sf-page .totui-price { font-size: 1rem; font-weight: 800; color: var(--navy); margin: 4px 0 8px; }
.sf-page .sf-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sf-page .totui-btn { width: 100%; }
.sf-search { position: absolute; right: 0; bottom: 34px; width: 52%; padding: 12px 14px; border-radius: 12px; }
.sf-search .s-title { color: #1a4bb5; font-weight: 700; font-size: .84rem; line-height: 1.3; }
.sf-search .s-url { font-size: .68rem; color: var(--muted); margin: 2px 0 4px; font-family: var(--mono); }
.sf-search .s-desc { font-size: .74rem; color: var(--ink); line-height: 1.4; }
.sf-search .totui-label { margin-bottom: 4px; }
.page-product .sf-search { opacity: 0; transform: translateY(12px); }
.page-product .reveal.in .sf-search { opacity: 1; transform: none; transition: opacity .6s .5s ease, transform .6s .5s cubic-bezier(.2, .7, .2, 1); }

/* ===== product-existing-platform-connector =============================== */
.cx-scene { flex-shrink: 0; }
.cx-scene { position: relative; width: 100%; margin-top: 56px; }
.cx-panel { width: 88%; margin: 0 auto; border-radius: 14px 14px 0 0; border-bottom: 0; box-shadow: 0 -10px 40px rgba(16, 41, 75, .14); }
.cx-panel .totui-bar { justify-content: space-between; }
.cx-panel .totui-row { padding: 11px 14px; }
.cx-plat { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff; border-bottom: 1px solid var(--ui-line); }
.cx-plat .totui-mark { background: var(--navy-10); border: 1px solid var(--ui-line); }
.cx-plat b { color: var(--navy); font-size: .86rem; }
.cx-plat small { display: block; color: var(--muted); font-size: .72rem; }

/* ===== product-mcp-integration-guidance ================================== */
.mcp-ui { max-width: 420px; margin-left: auto; }
.mcp-ui .totui-row { align-items: flex-start; }
.mcp-ui .totui-row .totui-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--teal-08); flex-shrink: 0; }
.mcp-ui .totui-row .totui-ic svg { width: 14px; height: 14px; stroke: var(--teal-ink); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mcp-ui .totui-row > div { flex: 1; }

/* ===== product-services-transaction-workflow ============================= */
.dgm { position: relative; margin-top: 56px; }
.flow { list-style: none; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto auto auto auto; gap: 0 28px; }
.flow::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 31px; height: 2px; background: linear-gradient(90deg, var(--mint), rgba(127, 227, 184, .55)); transform-origin: left center; }
.page-product .col { position: relative; display: grid; grid-template-rows: subgrid; grid-row: span 4; text-align: center; min-width: 0; }
.node { position: relative; z-index: 1; justify-self: center; width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 0 0 8px var(--navy), 0 0 0 10px var(--mint-40), 0 14px 30px rgba(0, 0, 0, .28); }
.node svg { width: 28px; height: 28px; stroke: var(--navy); stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.page-product .stage { margin-top: 22px; }
.page-product .stage h3 { font-size: 1.1rem; line-height: 1.25; font-weight: 800; color: #fff; letter-spacing: -.015em; }
.page-product .stage p { font-size: .9rem; color: var(--on-navy); line-height: 1.5; margin: 6px auto 0; max-width: 26ch; }
.branch { justify-self: center; width: 0; height: 26px; margin: 14px 0 0; border-left: 2px dotted var(--teal); transform-origin: top center; position: relative; }
.svc { margin-top: 14px; padding: 0 4px; width: 100%; }
.svc .cap, .page-product .span .cap { display: block; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--mint); margin-bottom: 8px; line-height: 1.45; }
.svc .cap { min-height: 2.2rem; }
.svc p, .page-product .span p { font-size: .92rem; color: var(--on-navy); line-height: 1.55; margin: 0; max-width: 32ch; }
.svc p { margin: 0 auto; }
.snip { margin: 14px auto 0; max-width: 262px; text-align: left; border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
.snip .totui-row { padding: 8px 12px; gap: 10px; }
.snip .totui-row b { font-size: .78rem; }
.snip .totui-row small { font-size: .7rem; }
.snip .totui-label { padding: 8px 12px 0; }
.page-product .span { position: relative; margin-top: 40px; padding: 20px 24px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; text-align: left; border-radius: 16px; background: rgba(127, 227, 184, .10); border: 1px solid rgba(127, 227, 184, .35); }
.page-product .span .sp-ic { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--mint); stroke: var(--navy); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; box-sizing: border-box; }
.page-product .span .cap { margin-bottom: 4px; font-size: .84rem; color: #fff; }
.page-product .span p { max-width: 70ch; color: #e3ebf5; }
.page-product .flow::before { transform: scaleX(0); }
.page-product .flow .node { opacity: 0; transform: scale(.6); }
.page-product .flow .branch { transform: scaleY(0); }
.page-product .flow .stage, .page-product .flow .svc { opacity: 0; transform: translateY(10px); }
.page-product .flow.in::before { animation: track 1.1s cubic-bezier(.4, 0, .2, 1) forwards; }
.page-product .flow.in .node { animation: settle .6s cubic-bezier(.34, 1.4, .64, 1) forwards; animation-delay: calc(.15s + var(--i) * .22s); }
.page-product .flow.in .stage { animation: rise .6s ease forwards; animation-delay: calc(.35s + var(--i) * .22s); }
.page-product .flow.in .branch { animation: grow .45s ease forwards; animation-delay: calc(1.15s + var(--i) * .16s); }
.page-product .flow.in .svc { animation: rise .6s ease forwards; animation-delay: calc(1.45s + var(--i) * .16s); }
@keyframes track { to { transform: scaleX(1); } }
@keyframes settle { to { opacity: 1; transform: none; } }
@keyframes grow { to { transform: scaleY(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ===== product-privacy-result-and-record ================================= */
.priv-scene { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; padding: 28px; border-radius: 22px; background: linear-gradient(145deg, var(--lavender) 0%, var(--sky) 100%); border: 1px solid var(--line-lav); }
.priv-scene::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(16, 41, 75, .14); border-radius: 12px; pointer-events: none; }
.priv-result { box-shadow: var(--shadow-lift); }
.priv-scene .totui-lane { position: relative; }
.priv-scene .totui-lane-label { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-ink); margin-bottom: 10px; }
.priv-scene .totui-lane.totui-protected .totui-lane-label { color: var(--navy); }
.priv-result .totui-row { padding: 10px 14px; }
.priv-result .totui-verdict { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-bottom: 1px solid var(--ui-line); }
.priv-result .totui-verdict .totui-title { font-size: 1rem; }
.priv-doc { background: #fff; }
.priv-doc .totui-doc { margin: 12px 14px 4px; padding: 12px; border-radius: 10px; background: #f4f1fc; border: 1px solid rgba(123, 98, 201, .5); display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.priv-doc .totui-doc .totui-photo { width: 44px; height: 54px; border-radius: 6px; background: linear-gradient(180deg, #cfd6e0, #e1e6ee); position: relative; overflow: hidden; }
.priv-doc .totui-doc .totui-photo::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .55) 0 4px, transparent 4px 8px); }
.priv-doc .totui-doc .totui-lines { display: grid; gap: 7px; }
.priv-doc .totui-doc .totui-lines .totui-mask { display: block; }
.priv-doc .totui-row { padding: 9px 14px; }
.page-product .priv-result { opacity: 0; transform: translateY(14px); }
.page-product .reveal.in .priv-result { opacity: 1; transform: none; transition: opacity .6s .35s ease, transform .6s .35s cubic-bezier(.2, .7, .2, 1); }
.priv-arrow { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: #fff; border: 1px solid var(--line-cool); display: grid; place-items: center; box-shadow: var(--shadow-soft); }
.priv-arrow svg { width: 16px; height: 16px; stroke: var(--teal-ink); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   Responsive and reduced-motion — scene rules only
   Ordered as in the original stylesheet so the cascade is unchanged.
   ========================================================================== */
@media (max-width: 1100px) {
  .sf-search { width: 58%; }
  .page-product .stage h3 { font-size: 1.02rem; }
  .svc p { font-size: .88rem; }
}
@media (max-width: 980px) {
  .mcp-ui { margin-left: 0; max-width: 480px; }
}
@media (max-width: 900px) {
  .dgm { margin-top: 36px; }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .flow::before { left: 27px; right: auto; top: 28px; bottom: 28px; width: 2px; height: auto; background: linear-gradient(180deg, var(--mint), rgba(127, 227, 184, .55)); transform-origin: top center; }
  .page-product .flow::before { transform: scaleY(0); }
  .page-product .flow.in::before { animation: trackv 1.1s cubic-bezier(.4, 0, .2, 1) forwards; }
  .page-product .col { display: grid; grid-row: auto; grid-template-columns: 56px 1fr; grid-template-rows: auto auto auto; column-gap: 18px; align-items: start; text-align: left; }
  .node { width: 56px; height: 56px; grid-row: 1; grid-column: 1; justify-self: start; box-shadow: 0 0 0 6px var(--navy), 0 0 0 8px var(--mint-40), 0 12px 26px rgba(0, 0, 0, .3); }
  .node svg { width: 24px; height: 24px; }
  .page-product .stage { grid-row: 1; grid-column: 2; margin-top: 4px; }
  .page-product .stage p { margin: 4px 0 0; max-width: none; }
  .branch { grid-row: 2; grid-column: 2; justify-self: start; height: 26px; margin: 8px 0 0 12px; }
  .svc { grid-row: 3; grid-column: 2; margin-top: 10px; padding: 0; }
  .svc .cap { min-height: 0; }
  .svc p { margin: 0; max-width: none; }
  .snip { margin: 12px 0 0; max-width: 300px; }
  .page-product .span { margin-top: 32px; }
}
@keyframes trackv { to { transform: scaleY(1); } }
@media (max-width: 560px) {
  .sf-scene { margin-top: 18px; }
  .sf-page { width: 100%; }
  .sf-page .sf-body { grid-template-columns: 72px 1fr; }
  .sf-page .totui-prod { height: 96px; }
  .sf-meta .totui-chip { white-space: normal; }
  .sf-search { position: relative; width: 100%; bottom: auto; margin: -8px 0 18px; }
  .cx-scene { margin-top: 18px; }
  .cx-panel { width: 100%; }
  .page-product .span { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .page-product .span .sp-ic { width: 40px; height: 40px; padding: 9px; }
  .priv-scene { grid-template-columns: 1fr; padding: 18px; gap: 26px; }
  .priv-scene::after { inset: 7px; border-radius: 15px; }
  .priv-arrow { position: static; margin: -8px auto; transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .page-product .sf-search { opacity: 1; transform: none; transition: none; }
  .page-product .flow::before, .page-product .flow.in::before { transform: none; animation: none; }
  .page-product .flow .node, .page-product .flow .branch, .page-product .flow .stage, .page-product .flow .svc { opacity: 1; transform: none; animation: none; }
  .page-product .priv-result { opacity: 1; transform: none; transition: none; }
}
