/* GEODESIC - the RCS emulator's face (design/starters/geodesic/rcs.css). Contract version 1.

   Faceted and crystalline: cut-glass bubbles, polygon cards, a triangulated wall, a hexagonal launcher.

   A STARTER DESIGN (designer-css-plan section 2.6): ours, read-only, loaded and changed and saved as a workspace's own
   design. Written ONLY against the --cv-* tokens and the data-cv-* parts, moments, turns, states and screens of
   design/contract.json - never a class name, never an !important. A design's CSS lands in the cascade layer cv.design (the
   server wraps it; on the go site's stage, Tests/Design/ShotCases.Starters.cs does), so it beats our default bundle
   without a specificity war. url() reaches only this package's own files.

   1. THE TOKENS - on :root (the page around the phone - the bezel, the toast), the phone's screen and the bottom
      sheet: the screen and the sheet declare their own tokens, so a token set on :root alone never reaches the
      phone. They equal manifest.json's tokens, value for value (Tests/Design/StarterLibraryTests).
   2. THE LOOK - every shape, glow, picture and motion is scoped to the conversation's own screen
      ([data-cv-screen="thread"]). A protected screen (confirm, consent, payment, sign-in) and a protected part (the
      verified note, Powered by, a signature, an action's confirm) take COLOURS ONLY, inside the contrast floor - so when
      the locked layer lands (P1) nothing here has to move. Motion runs only when the reader has not asked for less. */

:root,
[data-cv-part="screen"],
[data-cv-part="sheet"] {
  /* reference */
  --cv-color-brand: #0f8f7e;
  --cv-color-ink: #14213d;
  --cv-color-paper: #f4f7fb;
  --cv-font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cv-font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cv-radius-s: 0px;
  --cv-radius-m: 0px;
  --cv-radius-l: 0px;
  --cv-shadow-1: 0 1px 2px rgba(20, 33, 61, .12);
  --cv-shadow-2: 0 6px 18px rgba(20, 33, 61, .14);
  --cv-shadow-3: 0 24px 60px rgba(20, 33, 61, .2);
  --cv-motion-fast: 120ms;
  --cv-motion-slow: 240ms;
  /* semantic */
  --cv-surface: #ffffff;
  --cv-on-surface: var(--cv-color-ink);
  --cv-accent: #0f8f7e;
  --cv-on-accent: #ffffff;
  --cv-muted: #4a5a78;
  --cv-danger: #b3261e;
  --cv-focus: var(--cv-accent);
  --cv-bubble-me-bg: #0f8f7e;
  --cv-bubble-me-ink: #ffffff;
  --cv-bubble-them-bg: #ffffff;
  --cv-bubble-them-ink: #14213d;
  --cv-field-font-size: 16px;
  /* component */
  --cv-header-bg: var(--cv-surface);
  --cv-header-ink: var(--cv-on-surface);
  --cv-header-line: color-mix(in srgb, var(--cv-on-surface) 12%, transparent);
  --cv-header-shadow: var(--cv-shadow-1);
  --cv-avatar-bg: var(--cv-accent);
  --cv-bubble-radius: var(--cv-radius-l);
  --cv-bubble-tail-radius: 0px;
  --cv-bubble-font-size: 14.5px;
  --cv-bubble-them-shadow: var(--cv-shadow-1);
  --cv-typing-dot: var(--cv-muted);
  --cv-card-radius: var(--cv-radius-l);
  --cv-chip-bg: #dff3ef;
  --cv-chip-ink: #0a6b5e;
  --cv-chip-border: transparent;
  --cv-chip-radius: 999px;
  --cv-chip-hover-bg: #c7ebe4;
  --cv-composer-bg: var(--cv-surface);
  --cv-composer-ink: var(--cv-on-surface);
  --cv-composer-placeholder-ink: var(--cv-muted);
  --cv-composer-line: transparent;
  --cv-send-bg: var(--cv-accent);
  --cv-send-ink: var(--cv-on-accent);
  --cv-sheet-bg: var(--cv-surface);
  --cv-sheet-backdrop: rgba(0, 0, 0, .45);
  --cv-verified-bg: color-mix(in srgb, var(--cv-accent) 9%, transparent);
  --cv-verified-ink: var(--cv-muted);
  --cv-verified-icon: var(--cv-accent);
  --cv-verified-shield: var(--cv-accent);
  --cv-daymark-bg: color-mix(in srgb, var(--cv-on-surface) 7%, transparent);
  --cv-daymark-ink: var(--cv-muted);
  --cv-receipt-ink: var(--cv-muted);
  --cv-thread-bg: #eef3f9;
  --cv-card-bg: var(--cv-bubble-them-bg);
  --cv-card-title-ink: var(--cv-bubble-them-ink);
  --cv-card-text-ink: var(--cv-muted);
  --cv-card-line: color-mix(in srgb, var(--cv-on-surface) 12%, transparent);
  --cv-card-shadow: var(--cv-shadow-2);
  --cv-card-button-hover-bg: color-mix(in srgb, var(--cv-accent) 8%, transparent);
  --cv-tile-ink: var(--cv-muted);
  --cv-chip-hover-shadow: var(--cv-shadow-1);
  /* the answers as a list: one cut-glass panel, a small triangle pointing on from each reply */
  --cv-reply-list-ink: #0a6b5e;
  --cv-reply-list-line: rgba(15, 143, 126, .2);
  --cv-reply-list-radius: 0px;
  --cv-reply-list-shadow: none;
  --cv-reply-list-font-weight: 600;
  --cv-reply-list-align: left;
  --cv-reply-list-row-padding: 11px 32px 11px 18px;
  --cv-reply-list-hover-bg: #dff3ef;
  --cv-reply-list-selected-bg: var(--cv-accent);
  --cv-reply-list-selected-ink: #ffffff;
  --cv-reply-list-chevron: "\25B8";
  --cv-composer-icon-ink: var(--cv-muted);
  --cv-composer-icon-hover-bg: color-mix(in srgb, var(--cv-on-surface) 6%, transparent);
  --cv-composer-shadow: var(--cv-shadow-1);
  --cv-home-bar: color-mix(in srgb, var(--cv-on-surface) 30%, transparent);
  --cv-sheet-ink: var(--cv-on-surface);
  --cv-sheet-muted: var(--cv-muted);
  --cv-sheet-line: color-mix(in srgb, var(--cv-on-surface) 12%, transparent);
  --cv-sheet-row-line: color-mix(in srgb, var(--cv-on-surface) 7%, transparent);
  --cv-sheet-row-hover: color-mix(in srgb, var(--cv-accent) 7%, var(--cv-surface));
  --cv-sheet-field: color-mix(in srgb, var(--cv-on-surface) 22%, transparent);
  --cv-toast-bg: var(--cv-on-surface);
  --cv-toast-ink: var(--cv-surface);
  --cv-toast-line: transparent;
  --cv-toast-shadow: var(--cv-shadow-3);
  --cv-device-bezel: linear-gradient(135deg, #dfe7f1 0%, #9fb2c8 25%, #eef3f9 50%, #8aa0b8 75%, #d5dfeb 100%);
  --cv-device-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 40px 80px -24px rgba(20, 33, 61, .55);
}

/* ── Geodesic ─────────────────────────────────────────────────────────────────────────────────────── */

/* The wall: a seamless tile of pale triangles (assets/facets.svg). */
[data-cv-part="thread"] { background-image: url("assets/facets.svg"); background-size: 240px 240px; }
[data-cv-part="brand-name"] { letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
[data-cv-part="brand-logo"] { clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); border-radius: 0; }

/* Cut glass: every bubble and card chamfered at its corners. */
[data-cv-screen="thread"] :is([data-cv-part="bubble-me"], [data-cv-part="bubble-them"]) { clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); padding-inline: 16px; }
[data-cv-screen="thread"] [data-cv-part="bubble-me"] { background-image: linear-gradient(135deg, rgba(255, 255, 255, .16) 0 50%, transparent 50%); }
[data-cv-screen="thread"] [data-cv-part="bubble-them"] { background-image: linear-gradient(135deg, transparent 0 50%, rgba(15, 143, 126, .06) 50%); }
[data-cv-screen="thread"] [data-cv-part="card"] { clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px); }
[data-cv-screen="thread"] [data-cv-part="card-media"] { clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%); }

/* Answers are hexagons, filled - a facet has no outline to follow. */
[data-cv-screen="thread"] [data-cv-part="chip"] { clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%); border-radius: 0; padding-inline: 22px; font-weight: 600; }
[data-cv-screen="thread"] [data-cv-part="composer"] { clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); border-radius: 0; }
[data-cv-screen="thread"] [data-cv-part="send"] { clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); border-radius: 0; }

/* The list: one panel chamfered like the bubbles, the facet's shade across it. */
[data-cv-screen="thread"] [data-cv-part="reply-list"] {
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  background-image: linear-gradient(135deg, transparent 0 50%, rgba(15, 143, 126, .06) 50%);
}
