/* UI v3 (owner 2026-10-29, docs/superpowers/specs/2026-10-29-ui-v3-design.md): the tokens and the motion both apps
   share, loaded after fonts.css and before each page's own skin (phone.css; the counter section of counter.css).
   The older names (--bg, --card, --text, --accent, --amber, the counter's --c-*) stay in the pages' own sheets as
   aliases; this file only defines the new ones. The counter can force a scheme with html[data-theme]; the customer
   page follows the phone. */
:root {
  --board: #ffd21f;
  --board-lit: radial-gradient(120% 170% at 0% 0%, #ffe66e 0%, #ffd21f 48%, #f2c000 100%);
  --ink: #2a2b86; --ink-deep: #1f2070; --on-ink: #ffffff;
  --ink-soft: color-mix(in srgb, #2a2b86 8%, #ffffff);
  --carbon: #20223a; --muted: #555873;
  --paper: #ffffff; --paper-2: #f6f7fb; --ground: #eef0f5; --line: #dde0ea; --line-2: #c9cdda;
  --red: #c62828; --red-soft: #fdecec; --green: #12805c; --green-soft: #e2f3ea; --amber-ink: #7a4b00; --amber-soft: #fff4cc;
  --glass: rgba(255, 255, 255, 0.82);
  --shadow-1: 0 1px 2px rgba(32, 34, 58, 0.06), 0 8px 24px -16px rgba(32, 34, 58, 0.35);
  --shadow-2: 0 12px 32px -12px rgba(32, 34, 58, 0.35), 0 2px 6px rgba(32, 34, 58, 0.08);
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-press: 120ms; --t-fast: 160ms; --t-base: 260ms; --t-slow: 360ms;
  --display: "Anek Tamil", system-ui, sans-serif;
}
/* the dark scheme: the same words twice, once for the phone's own setting and once for a forced choice */
:root[data-theme="dark"] {
  --board-lit: radial-gradient(120% 170% at 0% 0%, #ffe66e 0%, #ffd21f 48%, #e9b800 100%);
  --ink: #a9aaff; --ink-deep: #8f90f0; --on-ink: #14152b;
  --ink-soft: color-mix(in srgb, #a9aaff 18%, #1d1f3a);
  --carbon: #e6e7f2; --muted: #a9abc8;
  --paper: #1d1f3a; --paper-2: #25274a; --ground: #14152b; --line: #2f3260; --line-2: #3f4378;
  --red: #ff8a80; --red-soft: rgba(255, 138, 128, 0.14); --green: #5bd6a4; --green-soft: rgba(91, 214, 164, 0.14);
  --amber-ink: #ffd76a; --amber-soft: rgba(255, 210, 31, 0.14);
  --glass: rgba(29, 31, 58, 0.74);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -16px rgba(0, 0, 0, 0.7);
  --shadow-2: 0 14px 36px -12px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0, 0, 0, 0.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --board-lit: radial-gradient(120% 170% at 0% 0%, #ffe66e 0%, #ffd21f 48%, #e9b800 100%);
    --ink: #a9aaff; --ink-deep: #8f90f0; --on-ink: #14152b;
    --ink-soft: color-mix(in srgb, #a9aaff 18%, #1d1f3a);
    --carbon: #e6e7f2; --muted: #a9abc8;
    --paper: #1d1f3a; --paper-2: #25274a; --ground: #14152b; --line: #2f3260; --line-2: #3f4378;
    --red: #ff8a80; --red-soft: rgba(255, 138, 128, 0.14); --green: #5bd6a4; --green-soft: rgba(91, 214, 164, 0.14);
    --amber-ink: #ffd76a; --amber-soft: rgba(255, 210, 31, 0.14);
    --glass: rgba(29, 31, 58, 0.74);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -16px rgba(0, 0, 0, 0.7);
    --shadow-2: 0 14px 36px -12px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}
/* a forced light scheme on a dark phone says the light words again (an attribute beats :root alone) */
:root[data-theme="light"] {
  --board-lit: radial-gradient(120% 170% at 0% 0%, #ffe66e 0%, #ffd21f 48%, #f2c000 100%);
  --ink: #2a2b86; --ink-deep: #1f2070; --on-ink: #ffffff;
  --ink-soft: color-mix(in srgb, #2a2b86 8%, #ffffff);
  --carbon: #20223a; --muted: #555873;
  --paper: #ffffff; --paper-2: #f6f7fb; --ground: #eef0f5; --line: #dde0ea; --line-2: #c9cdda;
  --red: #c62828; --red-soft: #fdecec; --green: #12805c; --green-soft: #e2f3ea; --amber-ink: #7a4b00; --amber-soft: #fff4cc;
  --glass: rgba(255, 255, 255, 0.82);
  --shadow-1: 0 1px 2px rgba(32, 34, 58, 0.06), 0 8px 24px -16px rgba(32, 34, 58, 0.35);
  --shadow-2: 0 12px 32px -12px rgba(32, 34, 58, 0.35), 0 2px 6px rgba(32, 34, 58, 0.08);
}

/* ---- surfaces ---- */
/* a bar that floats over the page (the step rail, the bottom bar): frosted; a browser without the filter gets paper */
.ui-glass { background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
@supports not (backdrop-filter: blur(1px)) {
  .ui-glass { background: var(--paper); }
}
/* an inline icon: one stroke weight, the text's colour, never read aloud (aria-hidden in the markup) */
.ui-icon { display: inline-block; width: 24px; height: 24px; flex: none; vertical-align: middle; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---- motion: one family for both apps (the motion spec's curves; Emil Kowalski's timings) ---- */
@keyframes ui-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes ui-pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes ui-fade { from { opacity: 0; } }
@keyframes ui-slide-up { from { opacity: 0; transform: translateY(100%); } }
.ui-rise { animation: ui-rise var(--t-slow) var(--ease-out) both; }
.ui-pop { animation: ui-pop var(--t-base) var(--ease-spring) both; }
.ui-fade { animation: ui-fade var(--t-base) ease-out both; }
/* children that arrive together arrive one after another (40 ms apart, eight at most; decorative, never blocking) */
.ui-stagger > :nth-child(2) { animation-delay: 40ms; }
.ui-stagger > :nth-child(3) { animation-delay: 80ms; }
.ui-stagger > :nth-child(4) { animation-delay: 120ms; }
.ui-stagger > :nth-child(5) { animation-delay: 160ms; }
.ui-stagger > :nth-child(6) { animation-delay: 200ms; }
.ui-stagger > :nth-child(7) { animation-delay: 240ms; }
.ui-stagger > :nth-child(n + 8) { animation-delay: 280ms; }
/* a thing that can be pressed gives under the thumb (120 ms) and springs back */
.ui-press { transition: transform var(--t-press) var(--ease-spring); }
.ui-press:active:not(:disabled) { transform: scale(0.97); }

/* reduced motion: fades stay (they say what happened), movement goes */
@media (prefers-reduced-motion: reduce) {
  .ui-rise, .ui-pop, .ui-fade { animation: none; }
  .ui-stagger > * { animation-delay: 0ms; }
  .ui-press { transition: none; }
  .ui-press:active:not(:disabled) { transform: none; }
}

/* owner 2026-11-14: browsers without color-mix() (an iPhone on iOS 15 to 16.1, an Android 6 phone) get the same soft
   tint as a plain colour; without this every soft background on the page was empty there. Same order as the themes above. */
@supports not (color: color-mix(in srgb, red, blue)) {
  :root { --ink-soft: #eeeef5; }
  :root[data-theme="dark"] { --ink-soft: #36385d; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ink-soft: #36385d; } }
  :root[data-theme="light"] { --ink-soft: #eeeef5; }
}
/* owner 2026-11-14: in an open dialog, a finger that scrolls past the dialog's end (or scrolls on the dimmed part
   round it) scrolled the page underneath. The dialog and its backdrop keep the scroll to themselves. */
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; }
