/* ==========================================================================
   § 05 AI 名片 · the scroll-driven phone
   Left: four step blocks in the normal flow (the paper docks live here).
   Right: one phone, pinned with position: sticky. The phone is authored at a logical
   360 px width; its screen height (--screen-h) and scale (--fit) depend on the viewport
   only, never on what it shows. Every phase is stacked in one grid cell and changes by
   opacity / transform, so playing the demo never changes a layout box.
   ========================================================================== */

.card-story {
  --card-layout: split;
  --bezel: 10px;
  --ctrl-h: 82px;                                   /* controls + note under the phone */
  --avail-h: calc(100svh - var(--header) - 32px - var(--ctrl-h));
  --screen-h: clamp(600px, calc(var(--avail-h) - 2 * var(--bezel)), 740px);
  --fit: 0.88;
  --phone-w: calc((360px + 2 * var(--bezel)) * var(--fit));
  --phone-h: calc((var(--screen-h) + 2 * var(--bezel)) * var(--fit));
}
/* A unitless ratio of two lengths: tan(atan2(a, b)) = a / b. */
@supports (width: calc(1px * tan(atan2(1px, 1px)))) {
  .card-story { --fit: min(1, tan(atan2(calc(var(--avail-h) - 2 * var(--bezel)), 600px))); }
}

/* ------------------------------------------------------------------ layout */
.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--phone-w);
  grid-template-rows: auto 1fr;
  column-gap: clamp(36px, 7vw, 128px);
}
.card-intro { grid-column: 1; grid-row: 1; padding-bottom: clamp(56px, 9svh, 112px); }
.card-intro .lead { margin: clamp(18px, 2vw, 28px) 0 14px; }
.card-steps { grid-column: 1; grid-row: 2; }
.card-stage { grid-column: 2; grid-row: 1 / 3; position: relative; }
.card-pin {
  position: sticky;
  top: max(calc(var(--header) + 12px), calc(var(--header) + (100svh - var(--header) - var(--phone-h) - var(--ctrl-h)) / 2));
  display: grid; justify-items: center;
  grid-template-columns: minmax(0, 1fr); /* on short screens the note is wider than the phone: keep the phone centred in its column */
}
.card-strip { display: none; }

/* ------------------------------------------------------------- step blocks */
.card-steps { position: relative; padding-left: 40px; }
.card-steps::before, .card-steps::after { content: ""; position: absolute; left: 6px; top: 6px; bottom: 0; width: 1px; pointer-events: none; }
.card-steps::before { background: linear-gradient(var(--hair-3), var(--hair-2) 80%, transparent); }
.card-steps::after { background: linear-gradient(var(--blue-soft), var(--blue)); transform-origin: top; transform: scaleY(var(--card-rail, 0)); }
.card-step {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start; justify-items: start;
  min-height: 76svh;
}
.card-step:last-child { min-height: 96svh; }
.card-step-copy { max-width: 27em; transition: opacity 0.5s var(--ease-out); }
.card-step[data-state="waiting"] .card-step-copy { opacity: 0.36; }
.card-step[data-state="done"] .card-step-copy { opacity: 0.56; }
.card-step-num { display: flex; align-items: center; gap: 14px; font: 500 12px/1 var(--mono); letter-spacing: 0.08em; color: var(--blue-soft); }
.card-step-num::before {
  content: ""; position: absolute; left: -40.5px; top: -0.5px; width: 13px; height: 13px; box-sizing: border-box;
  border-radius: 50%; border: 1px solid var(--hair-3); background: var(--ink-2);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.card-step[data-state="active"] .card-step-num::before { border-color: var(--blue-soft); background: var(--blue); box-shadow: 0 0 0 5px rgba(36, 111, 241, 0.2); }
.card-step[data-state="done"] .card-step-num::before { border-color: var(--blue); background: var(--blue); }
.card-step-bar { position: relative; width: 112px; height: 1px; overflow: hidden; background: var(--hair-2); }
.card-step-bar i { position: absolute; inset: 0; background: var(--blue-soft); transform-origin: left; transform: scaleX(var(--step-progress, 0)); }
.card-step h3 { margin-top: 16px; font: 500 clamp(28px, 2.6vw, 40px)/1.2 var(--serif); letter-spacing: -0.025em; }
.card-step-copy > p:not([class]) { margin-top: 10px; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.75; color: var(--text-2); }
.card-step-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.card-step-legend span {
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--hair-2);
  font: 500 11px/1.3 var(--mono); letter-spacing: 0.04em; color: var(--text-3);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.card-step-legend span.is-on { color: var(--text-1); border-color: rgba(156, 193, 255, 0.6); background: rgba(36, 111, 241, 0.18); }
.card-step-legend .is-note { border-style: dashed; }
.card-step .paper-dock { --w: 62px; margin: 28px 0 0 2px; }

/* ------------------------------------------------------------- the phone */
.card-phone { position: relative; width: var(--phone-w); height: var(--phone-h); }
.card-phone::before {
  content: ""; position: absolute; inset: 6% -26% -4%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(36, 111, 241, 0.3), transparent 72%);
}
.cc-device {
  position: absolute; left: 0; top: 0;
  width: calc(360px + 2 * var(--bezel)); height: calc(var(--screen-h) + 2 * var(--bezel));
  padding: var(--bezel); border-radius: calc(44px + var(--bezel));
  background: linear-gradient(160deg, #2a4064, #0c1729 38%, #070f1d 70%, #1c3050);
  box-shadow: var(--shadow-lift), inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: scale(var(--fit)); transform-origin: 0 0;
}
.cc-screen {
  position: relative; width: 360px; height: var(--screen-h); overflow: hidden; isolation: isolate;
  border-radius: 44px; background: #04070d; color: var(--text-1); font-family: var(--sans);
  container: phone / size;
}
.cc-screen p, .cc-screen li, .cc-screen span { word-break: normal; }
.cc-island { position: absolute; z-index: 6; top: 11px; left: 50%; width: 100px; height: 29px; margin-left: -50px; border-radius: 15px; background: #000; }
.cc-status {
  position: absolute; z-index: 5; inset: 0 0 auto; height: 50px; display: flex; align-items: center; justify-content: space-between;
  padding: 3px 28px 0 36px; font: 600 15px/1 var(--sans); color: #fff; pointer-events: none; transition: color 0.4s;
}
.cc-status-icons { display: flex; align-items: center; gap: 5px; }
.cc-status-icons i { display: block; height: 11px; background: currentColor; }
.cc-status-icons i:nth-child(1) { width: 17px; clip-path: polygon(0 100%, 22% 100%, 22% 70%, 0 70%, 0 100%, 26% 100%, 26% 52%, 48% 52%, 48% 100%, 52% 100%, 52% 30%, 74% 30%, 74% 100%, 78% 100%, 78% 0, 100% 0, 100% 100%); }
.cc-status-icons i:nth-child(2) { width: 15px; border-radius: 15px 15px 0 0; clip-path: polygon(50% 100%, 0 20%, 100% 20%); }
.cc-status-icons i:nth-child(3) { width: 25px; height: 12px; border-radius: 3.5px; box-sizing: border-box; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 72%, transparent 72%) content-box; padding: 1.5px; opacity: 0.92; }
.card-story[data-card-phase="summary"]:not([data-card-chat="true"]) .cc-status { color: var(--paper-ink); }

.cc-scenes { position: absolute; inset: 0; display: grid; }
.cc-scene {
  grid-area: 1 / 1; position: relative; min-height: 0; overflow: hidden;
  opacity: 0; visibility: hidden; transition: opacity 0.42s var(--ease-out), visibility 0s linear 0.42s;
}
.card-story:not([data-card-phase]) .cc-profile,
.card-story[data-card-phase="profile"] .cc-profile,
.card-story[data-card-phase="tap"] .cc-profile,
.card-story[data-card-phase="dialing"] .cc-call,
.card-story[data-card-phase="greeting"] .cc-call,
.card-story[data-card-phase="english"] .cc-call,
.card-story[data-card-phase="switch"] .cc-call,
.card-story[data-card-phase="summary"] .cc-summary { opacity: 1; visibility: visible; transition: opacity 0.42s var(--ease-out), visibility 0s; }

/* ---- brand homepage (client's view): dark, editorial ---- */
.cc-profile { background: #05080f; }
.cc-profile::before {
  content: ""; position: absolute; z-index: 1; inset: 0 0 auto; height: 58px; pointer-events: none;
  background: linear-gradient(#05080f 64%, rgba(5, 8, 15, 0)); opacity: min(1, calc(var(--cc-scroll, 0) * 8));
}
.cc-page {
  position: absolute; left: 0; right: 0; top: 0; padding-bottom: 112px;
  transform: translate3d(0, calc((var(--screen-h) - 100%) * var(--cc-scroll, 0)), 0);
}
.cc-hero { position: relative; height: 340px; overflow: hidden; background: radial-gradient(90% 70% at 64% 30%, #17428a 0%, #0b1d3d 46%, #05080f 80%); }
.cc-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(156, 193, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(156, 193, 255, 0.07) 1px, transparent 1px);
  background-size: 30px 30px; -webkit-mask-image: radial-gradient(70% 60% at 60% 34%, #000, transparent); mask-image: radial-gradient(70% 60% at 60% 34%, #000, transparent);
}
.cc-portrait { position: absolute; left: 50%; top: 34px; width: 292px; max-width: none; height: auto; transform: translateX(-40%); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45)); }
.cc-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 60%; background: linear-gradient(rgba(5, 8, 15, 0), rgba(5, 8, 15, 0.84) 54%, #05080f); }
.cc-hero-tag {
  position: absolute; z-index: 2; top: 60px; left: 18px; padding: 5px 9px; border-radius: 999px;
  border: 1px solid rgba(156, 193, 255, 0.3); background: rgba(5, 8, 15, 0.5);
  font: 500 10px/1 var(--mono); letter-spacing: 0.06em; color: var(--blue-mist);
}
.cc-hero-name { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 16px; }
.cc-en { font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.2em; color: var(--blue-soft); }
.cc-name { margin-top: 6px; font: 500 38px/1.1 var(--serif); letter-spacing: -0.02em; color: #fff; }
.cc-role { margin-top: 8px; font-size: 13px; color: var(--text-2); }
.cc-bio { padding: 14px 20px 0; font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.cc-flags { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 20px 0; }
.cc-flags li { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--hair-2); font-size: 11.5px; line-height: 1; color: var(--text-2); transition: background 0.35s, border-color 0.35s, box-shadow 0.35s; }
.cc-flags .is-call { border-color: rgba(76, 139, 255, 0.6); background: rgba(36, 111, 241, 0.22); color: #fff; }
.cc-flags .is-call::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--blue-soft); vertical-align: 1px; }
.cc-block { margin: 24px 20px 0; padding-top: 16px; border-top: 1px solid var(--hair); }
.cc-block-title { display: flex; align-items: baseline; gap: 10px; font: 500 18px/1.3 var(--serif); }
.cc-block-title b { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--blue-soft); }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cc-chips li { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--hair); background: rgba(156, 193, 255, 0.07); font-size: 12.5px; line-height: 1.2; }
.cc-timeline { margin-top: 8px; }
.cc-timeline li { position: relative; display: grid; gap: 2px; padding: 9px 0 9px 18px; border-bottom: 1px solid rgba(156, 193, 255, 0.07); }
.cc-timeline li::before { content: ""; position: absolute; left: 0; top: 15px; width: 7px; height: 7px; box-sizing: border-box; border-radius: 50%; border: 1px solid var(--blue-soft); }
.cc-timeline strong { font-size: 13.5px; font-weight: 600; }
.cc-timeline span { font-size: 12px; color: var(--text-3); }
.cc-contact { display: grid; gap: 6px; margin-top: 12px; }
.cc-contact li { display: flex; justify-content: space-between; padding: 11px 14px; border-radius: 12px; background: rgba(156, 193, 255, 0.07); font-size: 13px; }
.cc-contact li::after { content: "→"; color: var(--blue-soft); }
.cc-powered { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 26px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.08em; color: var(--text-3); }
.cc-powered .mark-mini { transform: scale(0.72); }
.cc-profile .mark-mini::before { border-color: var(--text-2); }

.cc-bar {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 9px;
  padding: 12px 14px 24px 16px; border-top: 1px solid var(--hair);
  background: rgba(7, 12, 22, 0.88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.cc-bar-avatar {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: linear-gradient(150deg, #2f7bff, #1446b8); font: 500 17px/1 var(--serif); color: #fff;
}
.cc-bar-copy { flex: 1; min-width: 0; display: grid; gap: 3px; }
.cc-bar-copy strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-bar-copy small { font-size: 11px; color: var(--text-3); }
.cc-bar-chat {
  flex: none; height: max(40px, calc(44px / var(--fit))); padding: 0 14px; border-radius: 999px;
  background: var(--paper); color: var(--paper-ink); font-size: 13px; font-weight: 600;
}
.cc-bar-call {
  position: relative; flex: none; display: grid; place-items: center; width: max(40px, calc(44px / var(--fit))); aspect-ratio: 1;
  border-radius: 50%; background: var(--blue); color: #fff; transition: background 0.3s, box-shadow 0.3s;
}
.cc-bar-call svg { width: 18px; height: 18px; fill: currentColor; }
.cc-tap { position: absolute; inset: 0; pointer-events: none; }
.cc-tap::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); opacity: 0; transition: opacity 0.25s; }
.cc-tap i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(156, 193, 255, 0.9); opacity: 0; }
.cc-tip {
  position: absolute; right: -6px; bottom: calc(100% + 14px); padding: 8px 12px; border-radius: 10px;
  background: var(--paper); color: var(--paper-ink); font-size: 12px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.7); opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s, transform 0.35s var(--ease-out);
}
.cc-tip::after { content: ""; position: absolute; right: 22px; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: rotate(45deg); }
.card-story[data-card-phase="tap"] .cc-tip { opacity: 1; transform: none; }
.card-story[data-card-phase="tap"] .cc-tap::before { opacity: 1; }
.card-story[data-card-phase="tap"] .cc-bar-call { background: #3b82ff; box-shadow: 0 0 0 6px rgba(36, 111, 241, 0.3); }
.card-story[data-card-phase="tap"] .cc-flags .is-call { box-shadow: 0 0 0 4px rgba(36, 111, 241, 0.25); }
.card-story[data-card-live="true"][data-card-phase="tap"] .cc-tap i { animation: cc-tap 1.6s var(--ease-out) infinite; }
.card-story[data-card-live="true"][data-card-phase="tap"] .cc-tap i:nth-child(2) { animation-delay: 0.55s; }
@keyframes cc-tap { from { transform: scale(0.7); opacity: 0.95; } to { transform: scale(2.1); opacity: 0; } }

/* ---- the AI call ---- */
.cc-call { display: flex; flex-direction: column; padding-top: 50px; background: radial-gradient(120% 70% at 50% 16%, #163a72 0%, #0a1a35 46%, #050a14 82%); }
.cc-call-top { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; }
.cc-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); font-size: 12px; font-weight: 600; }
.cc-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-soft); }
.cc-tag { padding: 4px 7px; border-radius: 6px; border: 1px dashed var(--hair-3); font: 500 10px/1 var(--mono); letter-spacing: 0.08em; color: var(--text-3); }
.cc-timer { margin-left: auto; font: 500 13px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--blue-mist); }
.cc-callee {
  flex: none; height: 178px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  transform-origin: 50% 0; transition: transform 0.6s var(--ease-out);
}
.cc-orb { position: relative; display: grid; place-items: center; width: 78px; height: 78px; }
.cc-orb-face {
  position: relative; z-index: 1; width: 78px; height: 78px; overflow: hidden; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #1f4f9e, #0a1730);
  box-shadow: 0 0 0 1px rgba(156, 193, 255, 0.4), 0 16px 34px -12px rgba(0, 0, 0, 0.75); transition: box-shadow 0.35s;
}
.cc-orb-face img { position: absolute; left: -15px; top: -4px; width: 110px; max-width: none; height: auto; }
.cc-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(156, 193, 255, 0.5); opacity: 0; transition: opacity 0.4s; }
.cc-callee-name { margin-top: 10px; font: 500 18px/1.3 var(--serif); }
.cc-callee-state { height: 18px; margin-top: 3px; font-size: 12.5px; line-height: 18px; color: var(--blue-mist); }
.cc-callee-badge { margin-top: 7px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--hair-2); background: rgba(255, 255, 255, 0.07); font-size: 10.5px; line-height: 1.3; color: var(--text-2); }
.cc-langs { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 12px; transition: opacity 0.4s; }
.cc-langs span { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--hair-2); font-size: 11.5px; line-height: 1; color: var(--text-3); transition: background 0.35s, border-color 0.35s, color 0.35s, box-shadow 0.35s; }
.cc-langs span.is-on { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 6px 16px -6px rgba(36, 111, 241, 0.9); }
.cc-langs em { padding: 4px 6px; border-radius: 6px; border: 1px dashed var(--hair-3); font: 500 9.5px/1 var(--mono); font-style: normal; letter-spacing: 0.08em; color: var(--text-3); }
.cc-wave { flex: none; display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; transition: opacity 0.4s; }
.cc-wave i { width: 3px; height: calc(4px + var(--amp) * 24px); border-radius: 3px; background: var(--blue-soft); opacity: 0.3; transform: scaleY(0.2); transition: transform 0.35s var(--ease-out), opacity 0.35s, background 0.35s; }
.card-story[data-card-speaking="ai"] .cc-wave i { opacity: 0.95; transform: scaleY(1); }
.card-story[data-card-speaking="visitor"] .cc-wave i { opacity: 0.8; transform: scaleY(0.75); background: #e7effc; }
.card-story[data-card-speaking="ai"] .cc-orb-face { box-shadow: 0 0 0 3px rgba(76, 139, 255, 0.75), 0 0 34px rgba(36, 111, 241, 0.6); }
.cc-captions {
  flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 6px 14px 0; padding: 12px 14px;
  border-radius: 20px; border: 1px solid rgba(156, 193, 255, 0.1); background: rgba(255, 255, 255, 0.055);
  transition: border-color 0.4s, background-color 0.4s;
}
.cc-captions-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 22px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.1em; color: var(--text-3); transition: opacity 0.4s; }
.cc-detected {
  padding: 5px 8px; border-radius: 999px; background: rgba(36, 111, 241, 0.3); white-space: nowrap;
  font: 500 10.5px/1 var(--sans); letter-spacing: 0; color: var(--blue-mist);
  opacity: 0; transform: translateY(4px); transition: opacity 0.3s, transform 0.3s var(--ease-out);
}
.cc-detected.is-on { opacity: 1; transform: none; }
.cc-captions-body {
  position: relative; flex: 1; min-height: 0; display: grid; margin-top: 8px; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 18px); mask-image: linear-gradient(transparent, #000 18px);
}
.cc-cap { grid-area: 1 / 1; }
.cc-cap {
  position: relative; align-self: start; padding: 14px 0 6px;
  transform: translate3d(0, calc(var(--cap-shift, 0) * -1px), 0);
  opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0s linear 0.35s;
}
.cc-cap.is-on { opacity: 1; visibility: visible; transition: opacity 0.35s, visibility 0s; }
.cc-call-note { position: absolute; left: 0; right: 0; bottom: 6px; padding: 0 12px; text-align: center; font: 500 10.5px/1.6 var(--mono); color: var(--text-3); opacity: 0; transition: opacity 0.35s; }
.cc-line { display: grid; gap: 3px; transition: opacity 0.3s; }
.cc-line + .cc-line { margin-top: 12px; }
.cc-line:not(.is-said) { opacity: 0; }
.cc-who { font: 500 10px/1.3 var(--mono); letter-spacing: 0.08em; color: var(--text-3); }
.cc-line[data-who="ai"] .cc-who { color: var(--blue-soft); }
.cc-text { font-size: 15px; line-height: 1.55; color: #fff; }
.cc-line[data-who="visitor"] .cc-text { color: var(--text-2); }
.cc-trans { font-size: 12px; line-height: 1.55; color: var(--text-3); }
.unsaid { color: transparent; }
/* A zero-advance caret, so typing never shifts a line break. */
.cc-line[data-speaking="true"] .cc-text .said::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-right: -2px; vertical-align: -0.16em; background: var(--blue-soft); }
.cc-controls { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; height: 98px; padding: 14px 18px 24px; }
.cc-controls span { display: grid; justify-items: center; align-content: start; gap: 6px; font-size: 10.5px; color: var(--text-3); }
.cc-controls i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.cc-controls svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cc-controls .is-end i { background: #e5484d; }
.cc-controls .is-end svg { fill: #fff; stroke: none; }

/* dialing: the callee is large and centred; captions wait */
.card-story[data-card-phase="dialing"] .cc-callee { transform: translateY(calc(var(--screen-h) * 0.15 - 14px)) scale(1.14); }
.card-story[data-card-phase="dialing"] .cc-captions { border-color: transparent; background-color: transparent; }
.card-story[data-card-phase="dialing"] .cc-ring { opacity: 0.32; }
.card-story[data-card-phase="dialing"] .cc-ring:nth-child(2) { transform: scale(1.36); opacity: 0.2; }
.card-story[data-card-phase="dialing"] .cc-ring:nth-child(3) { transform: scale(1.72); opacity: 0.1; }
.card-story[data-card-phase="dialing"] :is(.cc-langs, .cc-wave, .cc-captions-head) { opacity: 0; }
.card-story[data-card-phase="dialing"] .cc-call-note { opacity: 1; }
.card-story[data-card-live="true"][data-card-phase="dialing"] .cc-ring { animation: cc-ring 2.1s var(--ease-out) infinite; }
.card-story[data-card-live="true"][data-card-phase="dialing"] .cc-ring:nth-child(2) { animation-delay: 0.7s; }
.card-story[data-card-live="true"][data-card-phase="dialing"] .cc-ring:nth-child(3) { animation-delay: 1.4s; }
@keyframes cc-ring { from { transform: scale(1); opacity: 0.6; } to { transform: scale(1.9); opacity: 0; } }
.card-story[data-card-live="true"]:is([data-card-phase="greeting"], [data-card-phase="english"], [data-card-phase="switch"]) .cc-pill i { animation: cc-live 1.6s ease-in-out infinite; }
@keyframes cc-live { 50% { opacity: 0.3; } }
.card-story[data-card-live="true"]:is([data-card-speaking="ai"], [data-card-speaking="visitor"]) .cc-wave i { animation: cc-wave 1.05s ease-in-out infinite alternate; animation-delay: calc(var(--bar) * -71ms); }
@keyframes cc-wave { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }

/* ---- after the call: what reaches the lawyer (paper) ---- */
.cc-summary { display: flex; flex-direction: column; gap: 12px; padding: 54px 16px 18px; background: linear-gradient(180deg, #dfe8f5, var(--paper) 30%); color: var(--paper-ink); }
.cc-sum-head { flex: none; display: flex; align-items: center; justify-content: space-between; height: 26px; font: 500 11px/1 var(--mono); letter-spacing: 0.12em; color: var(--paper-ink-3); }
.cc-sum-head em, .cc-lead-top em { padding: 4px 7px; border-radius: 6px; border: 1px dashed #9fb2c9; font: 500 10px/1 var(--mono); font-style: normal; letter-spacing: 0.08em; color: var(--paper-ink-3); }
.cc-ended { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(14, 31, 58, 0.06), 0 10px 24px -18px rgba(14, 31, 58, 0.45); }
.cc-ended-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--blue); }
.cc-ended-icon svg, .cc-handoff svg { width: 18px; height: 18px; flex: none; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cc-ended strong { display: block; font-size: 14.5px; font-weight: 600; }
.cc-ended small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--paper-ink-3); }
.cc-points { padding: 2px 2px 0; }
.cc-sec-title { display: flex; align-items: baseline; gap: 8px; font: 500 17px/1.3 var(--serif); }
.cc-sec-title small { font: 500 10.5px/1 var(--mono); letter-spacing: 0.06em; color: var(--paper-ink-3); }
.cc-points ol { counter-reset: point; margin-top: 6px; }
.cc-points li { position: relative; padding: 7px 0 7px 28px; border-bottom: 1px solid var(--paper-line); counter-increment: point; font-size: 13px; line-height: 1.55; }
.cc-points li::before { content: counter(point, decimal-leading-zero); position: absolute; left: 0; top: 8px; font: 500 10.5px/1.6 var(--mono); color: var(--blue); }
.cc-lead { padding: 14px; border-radius: 18px; border: 1px solid #d6e0ec; background: #fff; box-shadow: 0 1px 2px rgba(14, 31, 58, 0.06), 0 16px 30px -22px rgba(14, 31, 58, 0.55); }
.cc-lead-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cc-lead-kind { margin-right: 2px; font: 500 16px/1 var(--serif); }
.cc-hot { padding: 4px 8px; border-radius: 999px; background: #fdead3; color: #9a4a0c; font-size: 11px; font-weight: 600; line-height: 1.2; }
.cc-src { padding: 4px 8px; border-radius: 999px; background: #e3edfb; color: #1f4f9e; font-size: 11px; line-height: 1.2; }
.cc-lead-top em { margin-left: auto; }
.cc-lead dl { display: grid; gap: 6px; margin-top: 12px; }
.cc-lead dl div { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 8px; font-size: 12.5px; line-height: 1.5; }
.cc-lead dt { color: var(--paper-ink-3); }
.cc-lead dd { margin: 0; }
.cc-lead-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.cc-lead-actions span { display: grid; place-items: center; height: 36px; border-radius: 10px; border: 1px solid #c9d6e6; font-size: 12.5px; font-weight: 600; color: var(--paper-ink-2); }
.cc-lead-actions span + span { border-color: var(--blue); background: var(--blue); color: #fff; }
.cc-handoff { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--paper-ink); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.4; }
.cc-handoff svg { stroke: var(--blue-soft); }
.cc-summary .cc-powered { margin-top: auto; color: var(--paper-ink-3); }
.cc-summary [data-part] { transition: opacity 0.45s var(--ease-out), transform 0.5s var(--ease-out); }
.cc-summary [data-part][data-shown="false"] { opacity: 0; transform: translate3d(0, 8px, 0); }

/* ---- text consultation (private message, local example) ---- */
.cc-chat { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; padding-top: 50px; background: #070d19; }
.cc-chat[hidden] { display: none; }
.cc-chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 4px 14px 12px 8px; border-bottom: 1px solid var(--hair); }
.cc-chat-back { display: grid; place-items: center; flex: none; width: max(40px, calc(44px / var(--fit))); aspect-ratio: 1; border-radius: 50%; color: var(--text-1); }
.cc-chat-back:hover { background: rgba(255, 255, 255, 0.08); }
.cc-chat-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cc-chat-head .cc-bar-avatar { width: 34px; height: 34px; font-size: 15px; }
.cc-chat-who { min-width: 0; }
.cc-chat-who strong { display: block; font-size: 14px; font-weight: 600; }
.cc-chat-who small { display: block; font: 500 10px/1.5 var(--mono); color: var(--text-3); }
.cc-chat-log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 16px 14px 8px; overscroll-behavior: contain; }
.cc-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.65; }
.cc-msg[data-from="ai"] { align-self: flex-start; border-top-left-radius: 4px; background: rgba(255, 255, 255, 0.08); }
.cc-msg[data-from="visitor"] { align-self: flex-end; border-top-right-radius: 4px; background: var(--blue); color: #fff; }
.cc-turns { display: grid; }
.cc-turn { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; }
.cc-turn[hidden] { display: flex; visibility: hidden; }
.cc-chat-quick { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 4px; }
.cc-chat-quick button {
  min-height: max(40px, calc(44px / var(--fit))); padding: 6px 14px; border-radius: 999px; border: 1px solid var(--hair-3);
  font-size: 12.5px; line-height: 1.35; color: var(--blue-mist); transition: background 0.2s, border-color 0.2s;
}
.cc-chat-quick button:hover { background: rgba(156, 193, 255, 0.08); }
.cc-chat-quick button[aria-pressed="true"] { border-color: var(--blue-soft); background: rgba(36, 111, 241, 0.24); color: #fff; }
.cc-chat-input { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 46px; margin: 4px 14px 22px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); font-size: 13px; color: var(--text-3); }
.cc-chat-input small { font: 500 10px/1 var(--mono); }

/* ---- short screens (the logical screen height is fixed per viewport) ---- */
@container phone (max-height: 650px) {
  .cc-hero { height: 300px; }
  .cc-callee { height: 146px; }
  .cc-orb, .cc-orb-face { width: 62px; height: 62px; }
  .cc-orb-face img { left: -12px; width: 88px; }
  .cc-callee-name { margin-top: 8px; font-size: 16px; }
  .cc-callee-badge { margin-top: 5px; }
  .cc-langs { height: 36px; }
  .cc-wave { height: 28px; }
  .cc-controls { height: 84px; padding: 10px 18px 18px; }
  .cc-controls i { width: 42px; height: 42px; }
  .cc-text { font-size: 14px; }
  .cc-trans { font-size: 11.5px; }
  .cc-summary { gap: 9px; padding-top: 52px; }
  .cc-points li { padding-block: 5px; }
  .cc-lead { padding: 12px; }
  .cc-lead dl { margin-top: 9px; gap: 4px; }
  .cc-handoff { margin-top: 9px; }
  .cc-lead-actions { display: none; }
  .cc-chat-input { margin-bottom: 16px; }
  .cc-chat-log { padding-top: 12px; }
}

/* ------------------------------------------------------- controls under it */
.card-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: var(--phone-w); height: 44px; margin-top: 14px; }
.card-jumps { display: flex; }
.card-jumps button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; }
.card-jumps button:hover i { background: var(--blue-mist); }
.card-jumps i { display: block; width: 26px; height: 3px; border-radius: 3px; background: var(--hair-3); transition: background 0.3s, width 0.3s; }
.card-jumps [data-state="done"] i { background: rgba(156, 193, 255, 0.55); }
.card-jumps [data-state="active"] i { width: 34px; background: var(--blue-soft); }
.card-chat-open {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--hair-3); color: var(--text-1); font-size: 14px; white-space: nowrap; transition: background 0.2s, border-color 0.2s;
}
.card-chat-open:hover, .card-chat-open[aria-expanded="true"] { border-color: var(--blue-soft); background: rgba(156, 193, 255, 0.1); }
.card-chat-open svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card-note { height: 18px; margin-top: 6px; font: 500 11px/18px var(--mono); letter-spacing: 0.04em; color: var(--text-3); text-align: center; white-space: nowrap; }
.card-note sup a { color: var(--blue-soft); }

/* ----------------------------------------------------------- reduced motion */
.card-story[data-card-reduced="true"] *,
.card-story[data-card-reduced="true"] *::before,
.card-story[data-card-reduced="true"] *::after { transition: none !important; animation: none !important; }
.card-story[data-card-reduced="true"] .cc-captions-body { overflow-y: auto; -webkit-mask-image: none; mask-image: none; overscroll-behavior: contain; }
.card-story[data-card-reduced="true"] .cc-cap { transform: none; }
.card-story[data-card-reduced="true"] .cc-wave { display: none; }

/* ------------------------------------------- short screens (phones held sideways)
   The phone shrinks with the height; its controls and note keep their size, so the
   column is at least as wide as they are. */
@media (max-height: 460px) and (min-width: 760px) {
  .card-grid { grid-template-columns: minmax(0, 1fr) max(var(--phone-w), 300px); column-gap: 32px; }
  .card-controls { width: 300px; }
}

/* --------------------------------------------------------------- tablet */
@media (max-width: 1080px) {
  .card-step h3 { font-size: 28px; }
}

/* ---------------------------------------------------------------- phones
   The phone pins at the top with a caption strip; step 01 reads above it and step 04
   after it, so both paper docks sit in the normal flow where nothing covers them. Steps
   02–03 are the pinned runway: their text is shown in the strip (and stays readable for
   assistive technology in place). */
@media (max-width: 759.98px) {
  .card-story {
    --card-layout: stack;
    --bezel: 6px;
    --strip-h: 56px;
    --avail-h: calc(100svh - var(--header) - 8px - var(--strip-h) - 8px - 12px);
    --avail-w: calc(100vw - 2 * var(--gutter));
    --screen-h: 600px;
    --fit: 0.78;
  }
  .card-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(5, auto); column-gap: 0; }
  .card-intro { grid-row: 1; padding-bottom: 8px; }
  .card-steps { grid-row: 2 / 6; grid-column: 1; display: grid; grid-template-rows: subgrid; padding-left: 0; }
  .card-steps::before, .card-steps::after, .card-step-num::before { display: none; }
  .card-step, .card-step:last-child { min-height: 0; padding: 30px 0; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }
  .card-step h3 { margin-top: 12px; font-size: 24px; }
  .card-step-copy > p:not([class]) { font-size: 15.5px; }
  .card-step .paper-dock { --w: 52px; margin: 28px 0 0; }
  .card-step:last-child { padding-bottom: 12px; }
  .js .card-step:is([data-card-step="1"], [data-card-step="2"]) { min-height: 128svh; }
  .js .card-step:is([data-card-step="1"], [data-card-step="2"]) .card-step-copy { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
  .card-stage { grid-row: 3 / 5; grid-column: 1; z-index: 2; }
  .card-pin {
    top: calc(var(--header) + 8px);
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "strip ctrl" "phone phone";
    align-items: center; row-gap: 8px; column-gap: 10px;
  }
  .card-strip { grid-area: strip; justify-self: stretch; display: flex; align-items: center; gap: 10px; min-width: 0; height: var(--strip-h); }
  .card-strip b { font: 500 11px/1 var(--mono); letter-spacing: 0.04em; color: var(--blue-soft); white-space: nowrap; }
  .card-strip > span { display: grid; gap: 4px; min-width: 0; }
  .card-strip strong { font: 500 16px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-strip small { font-size: 11.5px; line-height: 1.3; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-controls { grid-area: ctrl; width: auto; height: auto; margin: 0; }
  .card-jumps, .card-note { display: none; }
  .card-chat-open { padding: 0 14px; font-size: 13px; }
  .card-phone { grid-area: phone; }
}
@media (max-width: 759.98px) {
  @supports (width: calc(1px * tan(atan2(1px, 1px)))) {
    .card-story {
      --fit: min(1, tan(atan2(calc(var(--avail-h) - 2 * var(--bezel)), 560px)), tan(atan2(calc(var(--avail-w) - 2 * var(--bezel)), 360px)));
      --screen-h: clamp(560px, calc((var(--avail-h) - 2 * var(--bezel)) / var(--fit)), 740px);
    }
  }
}

/* ------------------------------------------------------------- without JS
   No scroll story: the brand homepage and the call summary, one after the other. */
html:not(.js) .card-pin { position: static; }
html:not(.js) .card-step, html:not(.js) .card-step:last-child { min-height: 0; padding-bottom: 48px; }
html:not(.js) .card-step-copy { opacity: 1 !important; }
html:not(.js) .card-phone { width: min(380px, 100%); height: auto; }
html:not(.js) .cc-device { position: relative; width: 100%; height: auto; transform: none; }
html:not(.js) .cc-screen { width: 100%; height: auto; container-type: normal; }
html:not(.js) .cc-scenes { position: static; display: block; }
html:not(.js) .cc-scene { opacity: 1; visibility: visible; }
html:not(.js) :is(.cc-call, .cc-chat, .card-controls, .card-strip) { display: none; }
html:not(.js) .cc-page { position: static; transform: none; padding-bottom: 0; }
html:not(.js) .cc-bar { position: static; }
html:not(.js) .cc-summary { padding-top: 24px; }
html:not(.js) .cc-summary [data-part] { opacity: 1; transform: none; }
@media (max-width: 759.98px) {
  html:not(.js) .card-steps { grid-row: 2; display: block; }
  html:not(.js) .card-stage { grid-row: 3; }
}
