/* PERFECT CIRCLE - the web runner's face (design/starters/perfect-circle/runner.css). Contract version 1.

   Everything round: pill bubbles, a ring of round answers, round pictures, a round launcher with a ring.

   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 the runner's root ([data-cv-face="runner"] - the <html> element). 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. */

[data-cv-face="runner"] {
  /* reference */
  --cv-color-brand: #6a4cf0;
  --cv-color-ink: #241c3a;
  --cv-color-paper: #fbf9ff;
  --cv-font-body: "Circle Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cv-font-display: "Circle Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cv-radius-s: 999px;
  --cv-radius-m: 999px;
  --cv-radius-l: 28px;
  --cv-shadow-1: 0 2px 6px rgba(106, 76, 240, .12);
  --cv-shadow-2: 0 8px 22px rgba(106, 76, 240, .16);
  --cv-shadow-3: 0 24px 60px rgba(36, 28, 58, .18);
  --cv-motion-fast: 120ms;
  --cv-motion-slow: 240ms;
  /* semantic */
  --cv-surface: #ffffff;
  --cv-on-surface: var(--cv-color-ink);
  --cv-accent: #6a4cf0;
  --cv-on-accent: #ffffff;
  --cv-muted: #5d5578;
  --cv-danger: #c4253a;
  --cv-focus: var(--cv-accent);
  --cv-bubble-me-bg: #6a4cf0;
  --cv-bubble-me-ink: #ffffff;
  --cv-bubble-them-bg: #ffffff;
  --cv-bubble-them-ink: #241c3a;
  --cv-field-font-size: 16px;
  /* component */
  --cv-header-bg: var(--cv-surface);
  --cv-color-scheme: light;
  --cv-signin-bg: #241c3a;
  --cv-signin-picture: radial-gradient(circle at 25% 25%, rgba(106, 76, 240, .55), transparent 40%), radial-gradient(circle at 75% 75%, rgba(255, 122, 198, .35), transparent 40%), linear-gradient(160deg, #241c3a, #3a2c66);
  /* the runner's palette - every tone the web runner paints with, from this design's surface, ink, accent and focus */
  --cv-on-surface-2: color-mix(in srgb, var(--cv-on-surface) 80%, var(--cv-surface));
  --cv-on-surface-strong: var(--cv-on-surface);
  --cv-placeholder: color-mix(in srgb, var(--cv-on-surface) 45%, var(--cv-surface));
  --cv-surface-subtle: color-mix(in srgb, var(--cv-on-surface) 5%, var(--cv-surface));
  --cv-surface-raised: var(--cv-surface);
  --cv-surface-hover: color-mix(in srgb, var(--cv-on-surface) 8%, var(--cv-surface));
  --cv-surface-active: color-mix(in srgb, var(--cv-on-surface) 13%, var(--cv-surface));
  --cv-panel: color-mix(in srgb, var(--cv-on-surface) 4%, var(--cv-surface));
  --cv-panel-muted: color-mix(in srgb, var(--cv-on-surface) 6%, var(--cv-surface));
  --cv-panel-hover: color-mix(in srgb, var(--cv-on-surface) 8%, var(--cv-surface));
  --cv-card-bg: var(--cv-bubble-them-bg);
  --cv-line: color-mix(in srgb, var(--cv-on-surface) 16%, var(--cv-surface));
  --cv-line-2: color-mix(in srgb, var(--cv-on-surface) 26%, var(--cv-surface));
  --cv-line-light: color-mix(in srgb, var(--cv-on-surface) 11%, var(--cv-surface));
  --cv-accent-hover: color-mix(in srgb, var(--cv-accent) 85%, var(--cv-on-surface));
  --cv-accent-muted: color-mix(in srgb, var(--cv-accent) 14%, transparent);
  --cv-accent-soft: color-mix(in srgb, var(--cv-accent) 24%, transparent);
  --cv-accent-strong: color-mix(in srgb, var(--cv-accent) 78%, black);
  --cv-focus-ring: 0 0 0 3px color-mix(in srgb, var(--cv-focus) 35%, transparent);
  --cv-buttons-bg: color-mix(in srgb, var(--cv-surface) 92%, transparent);
}

/* ── the page ──────────────────────────────────────────────────────────────────────────────────────────────────────
   The runner reads its colours from the tokens above on EVERY screen - the protected ones (the confirm, a payment,
   sign-in, the end) included, where a design sets colours only - so the page, the bar of buttons, the title and the pay
   button all wear this design. Shapes, pictures and motion stay on the conversation's own screen. */
[data-cv-face="runner"] body:has([data-cv-screen="thread"]) { background-color: var(--cv-surface); color: var(--cv-on-surface); }
[data-cv-screen="thread"] { background-color: var(--cv-surface); color: var(--cv-on-surface); font-family: var(--cv-font-body); }

/* ── the header (outside every screen - never protected) ───────────────────────────────────────────────────────── */
[data-cv-part="header"] { border-bottom-color: color-mix(in srgb, var(--cv-on-surface) 14%, transparent); }
[data-cv-part="header"] [data-cv-part="brand-name"] { color: var(--cv-accent); font-family: var(--cv-font-display); }
[data-cv-part="header"] button { background-color: transparent; color: var(--cv-on-surface); border-color: color-mix(in srgb, var(--cv-on-surface) 26%, transparent); }

/* ── a moment: its words, its choices, its answer ───────────────────────────────────────────────────────────── */
[data-cv-screen="thread"] [data-cv-part="question"] { color: var(--cv-on-surface); font-family: var(--cv-font-display); }
[data-cv-screen="thread"] [data-cv-part="extra-info"] { color: var(--cv-muted); }
[data-cv-screen="thread"] [data-cv-part="extra-info"] :is(a, button) { color: var(--cv-accent); }
[data-cv-screen="thread"] [data-cv-part="error"] { color: var(--cv-danger); }
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="option"] {
  background-color: var(--cv-surface); color: var(--cv-on-surface);
  border-color: color-mix(in srgb, var(--cv-on-surface) 24%, transparent); border-radius: var(--cv-radius-m);
}
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="option"] :is(i, svg) { color: var(--cv-accent); }
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="option"][data-cv-state="selected"] {
  background-color: color-mix(in srgb, var(--cv-accent) 14%, var(--cv-surface));
  border-color: var(--cv-accent); box-shadow: 0 0 0 1px var(--cv-accent);
}
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="answer"] :is(input, textarea, select) {
  background-color: var(--cv-surface); color: var(--cv-on-surface);
  border-color: color-mix(in srgb, var(--cv-on-surface) 26%, transparent); border-radius: var(--cv-radius-s);
  font-family: var(--cv-font-body);
}
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="answer"] button {
  background-color: var(--cv-surface); color: var(--cv-on-surface);
  border-color: color-mix(in srgb, var(--cv-on-surface) 18%, transparent); border-radius: var(--cv-radius-s);
  font-family: var(--cv-font-body);
}
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="answer"] button:disabled { color: color-mix(in srgb, var(--cv-on-surface) 38%, transparent); }

/* ── the moment kinds - each one looks like what it asks ────────────────────────────────────────────────────── */
/* A date, a date and a time: a page off a calendar - a band across the top. */
[data-cv-screen="thread"] :is([data-cv-moment="date"], [data-cv-moment="datetime"]) [data-cv-part="answer"] {
  border-top: 12px solid var(--cv-accent); border-radius: var(--cv-radius-m); padding: 14px 12px 12px;
  background-color: var(--cv-surface); color: var(--cv-on-surface); box-shadow: var(--cv-shadow-2);
}
/* The date's own figures sit on the page itself, in its ink. */
[data-cv-screen="thread"] :is([data-cv-moment="date"], [data-cv-moment="datetime"], [data-cv-moment="time"]) [data-cv-part="answer"] :is(div, span) {
  background-color: transparent; color: inherit;
}
/* A time: the face of a clock - a ring around the keys. */
[data-cv-screen="thread"] [data-cv-moment="time"] [data-cv-part="answer"] {
  border: 3px solid var(--cv-accent); border-radius: 28px; padding: 14px 12px;
}
/* A number, an amount: figures that line up. An amount sits on a ledger's double rule. */
[data-cv-screen="thread"] :is([data-cv-moment="number"], [data-cv-moment="currency"]) [data-cv-part="answer"] {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}
[data-cv-screen="thread"] [data-cv-moment="currency"] [data-cv-part="answer"] { border-bottom: 3px double var(--cv-accent); padding-bottom: 8px; }
/* A place and a person's card: the accent's edge. */
[data-cv-screen="thread"] :is([data-cv-moment="location"], [data-cv-moment="contact"]) [data-cv-part="answer"] {
  border-left: 4px solid var(--cv-accent); padding-left: 12px;
}

/* A SIGNATURE is ink on paper - COLOURS ONLY (a protected part: designer-css-plan 5.2). */
[data-cv-screen="thread"] [data-cv-moment="signature"] [data-cv-part="answer"] { background-color: #fffaf2; color: #1f2a5c; }
[data-cv-screen="thread"] [data-cv-moment="signature"] [data-cv-part="answer"] :is(canvas, div) { background-color: #fffaf2; border-color: #1f2a5c; color: #1f2a5c; }
[data-cv-screen="thread"] [data-cv-moment="signature"] [data-cv-part="answer"] button { background-color: #fffaf2; border-color: #1f2a5c; color: #1f2a5c; }

/* A PAYMENT is money - COLOURS ONLY (its screen and its pieces are protected): the amount due in the colours of a
   banknote; the pay button wears the accent and its ink, "Use a different card" the panel and the accent (the tokens). */
[data-cv-part="amount-due"] { background-color: #eef8f1; color: #0b3a23; border-color: #2d7a4e; }
[data-cv-part="amount-due"] strong { color: #0b3a23; }

/* ── Back and Next ─────────────────────────────────────────────────────────────────────────────────────────── */
[data-cv-part="buttons"] button { background-color: var(--cv-surface); color: var(--cv-on-surface); border-color: color-mix(in srgb, var(--cv-on-surface) 22%, transparent); }
[data-cv-part="buttons"] [data-cv-part="next"]:where(:not([data-cv-state="muted"])) { background-color: var(--cv-accent); color: var(--cv-on-accent); border-color: var(--cv-accent); }
[data-cv-screen="thread"] [data-cv-part="buttons"] button { border-radius: var(--cv-radius-m); font-family: var(--cv-font-body); }

/* ── Perfect Circle ─────────────────────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Circle Figtree";
  src: url("assets/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* The page: the same soft circles as the other faces' thread, while the conversation is on screen. */
[data-cv-screen="thread"] {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(106, 76, 240, .08) 0 70px, transparent 71px),
    radial-gradient(circle at 95% 70%, rgba(255, 122, 198, .08) 0 100px, transparent 101px);
}
[data-cv-screen="thread"] [data-cv-part="question"] { font-weight: 800; text-align: center; }
[data-cv-screen="thread"] [data-cv-part="extra-info"] { text-align: center; }

/* A ring of round answers. */
[data-cv-screen="thread"] [data-cv-moment="choice"] [data-cv-part="options"] {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
}
[data-cv-screen="thread"] [data-cv-moment="choice"] [data-cv-part="option"] {
  width: 150px; aspect-ratio: 1; border-radius: 50%; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border-width: 2px; box-shadow: var(--cv-shadow-1);
}
[data-cv-screen="thread"] [data-cv-moment="choice"] [data-cv-part="option"][data-cv-state="selected"] {
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 7px #6a4cf0, var(--cv-shadow-2);
}

/* A date: round keys like a phone's, the date itself in a pill. */
[data-cv-screen="thread"] :is([data-cv-moment="date"], [data-cv-moment="datetime"], [data-cv-moment="time"]) [data-cv-part="answer"] {
  border-top: 0; border-radius: 36px; box-shadow: 0 0 0 3px #6a4cf0, var(--cv-shadow-2);
}
[data-cv-screen="thread"] :is([data-cv-moment="date"], [data-cv-moment="datetime"], [data-cv-moment="time"]) [data-cv-part="answer"] button {
  border-radius: 999px;
}
[data-cv-screen="thread"] [data-cv-part="buttons"] button { border-radius: 999px; }
