/* Simon design tokens (brand design 2026-10-31). THE ONLY FILE WITH LITERAL COLORS, FONTS AND SIZES.
   Every stylesheet and every script that draws reads these names; change the brand here and nowhere else.
   Layers: palette (raw values) -> semantic tokens (what a value is for) -> legacy aliases (names the existing
   Part 7 stylesheets already use, pointed at the semantic tokens). */
/* the Inter webfont loads from theme/fonts.css, off the render path (index.html) */

:root {
  color-scheme: dark;

  /* palette */
  --palette-black: #0a0a0a;
  --palette-grey-900: #141414;
  --palette-grey-850: #1c1c1c;
  --palette-grey-800: #262626;
  --palette-grey-500: #9a9a92;
  --palette-white: #f4f4ef;
  --palette-pure-white: #ffffff;
  --palette-pure-black: #000000;
  --palette-lime: #c6f35a;
  --palette-coral: #ff6b4a;
  --palette-amber: #ffc83d;
  --palette-pink: #ff2d95;

  /* semantic: surfaces and text */
  --color-bg: var(--palette-black);
  --color-surface: var(--palette-grey-900);
  --color-raised: var(--palette-grey-850);
  --color-line: var(--palette-grey-800);
  --color-text: var(--palette-white);
  --color-text-muted: var(--palette-grey-500);
  --color-media-bg: var(--palette-pure-black);
  --color-on-media: var(--palette-pure-white);

  /* semantic: brand and states */
  --color-accent: var(--palette-lime);
  --color-on-accent: var(--palette-black);
  --color-accent-soft: rgb(198 243 90 / 14%);
  --color-good: var(--palette-lime);
  /* attention is pink, not orange (brand design 2026-11-01: lime is the pop, pink the only other colour) */
  --color-bad: var(--palette-pink);
  --color-bad-soft: rgb(255 45 149 / 14%);
  --color-bad-line: rgb(255 45 149 / 40%);
  --color-warn: var(--palette-pink);
  --color-warn-soft: rgb(255 45 149 / 10%);
  --color-warn-line: rgb(255 45 149 / 32%);
  /* one-letter.md: the credit's F to S scale on the share card: S with A and B (lime), E with F (pink) */
  --color-grade-s: var(--color-accent);
  --color-grade-e: var(--color-bad);

  /* depth (brand design 2026-11-01): lime is the only pop colour; pink lives in the back layer as smoke and halftone
     dots, and every grey card carries a faint halftone dot field that fades into its grey, so no surface is flat */
  --color-pink: var(--palette-pink);
  --color-pink-smoke: rgb(255 45 149 / 26%);
  --color-pink-smoke-soft: rgb(255 45 149 / 11%);
  --color-pink-dot: rgb(255 45 149 / 60%);
  --color-lime-dot: rgb(198 243 90 / 45%);
  --color-card-dot: rgb(255 255 255 / 6%);
  --color-card-sheen: rgb(255 255 255 / 4%);
  --color-content-veil: rgb(10 10 10 / 78%);
  --color-content-veil-phone: rgb(10 10 10 / 38%);   /* on a phone the column is the whole screen: a lighter veil */   /* behind the content column, so text on the page reads over the chalk */
  --mask-on: var(--palette-pure-black);
  --halftone-card-size: 6px;
  --halftone-back-size: 11px;
  --halftone-lime-size: 9px;
  --halftone-card: radial-gradient(circle, var(--color-card-dot) 0 1.1px, transparent 1.5px) 0 0 / var(--halftone-card-size) var(--halftone-card-size);
  --card-fade: linear-gradient(140deg, transparent 0%, transparent 15%, var(--color-surface) 75%);
  --card-fade-raised: linear-gradient(140deg, transparent 0%, transparent 15%, var(--color-raised) 75%);
  /* the backgrounds to use for a grey card: the halftone, faded toward the bottom right, over the grey */
  --card-fill: var(--card-fade), var(--halftone-card), var(--color-surface);
  /* inner cards (raised) carry no dots, only a soft sheen: halftone shows depth, so it never sits on halftone; the
     outer card has the dots and what sits inside it is smooth (team review 2026-11-01) */
  --card-sheen: linear-gradient(160deg, var(--color-card-sheen) 0%, transparent 60%);
  --card-fill-raised: var(--card-sheen), var(--color-raised);
  /* the page's back layer: chalk-powder bursts (generated images, pink on black, screen-blended so the black drops
     out) over soft pink smoke, under the halftone fields drawn by base.css; img/ is beside this file */
  --powder-a: url("img/powder-a.jpg");
  --powder-b: url("img/powder-b.jpg");
  --backdrop: var(--powder-a) right -16vw top -18vh / min(72vw, 1100px) auto no-repeat,
              var(--powder-b) left -18vw top 32vh / min(70vw, 1080px) auto no-repeat,
              radial-gradient(ellipse 38% 50% at 100% 8%, var(--color-pink-smoke) 0%, transparent 75%),
              radial-gradient(ellipse 38% 60% at 0% 60%, var(--color-pink-smoke) 0%, transparent 75%),
              var(--color-bg);
  --color-alert-bg: var(--palette-amber);  /* the test-server banner: loud on purpose */
  --color-on-alert: var(--palette-pure-black);
  --color-bad-text: #ff7ab8;  /* pink text on a pink-soft chip: the brand pink alone is under 4.5:1 there (axe) */
  --color-paper: var(--palette-pure-white);  /* the class handout sheet and its QR code: dark ink on white, as a camera reads best */
  --color-ink: var(--palette-pure-black);

  /* semantic: overlays on top of video or the page */
  --color-header-glass: rgb(10 10 10 / 92%);
  --color-scrim: rgb(0 0 0 / 70%);
  --color-scrim-soft: rgb(0 0 0 / 55%);

  /* semantic: paper, for a printed or saved progress sheet (theme/progress-sheet.css, TICKET-283) */
  --color-print-paper: var(--palette-pure-white);
  --color-print-ink: var(--palette-pure-black);
  --color-print-line: var(--palette-grey-500);

  /* typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sniglet", var(--font-sans);   /* the logo's face (Sniglet, OFL): the grade, the score, the score pops */
  --font-mono: "Geist Mono", "SF Mono", ui-monospace, monospace;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 22px;
  --text-xl: 32px;
  --text-display: 64px;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;

  /* shape and space */
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --page-width: max(960px, 60vw);   /* the content column: 60% of a wide screen, never narrower than 960 px */
  --brand-inset: 20px;         /* how far the header mark sits in from the left edge */
  --brand-mark: 100px;         /* the dog-and-sign mark in the header: the dog in the bar, the sign hanging below it */
  --brand-in-bar: 56px;        /* how much of the mark sits inside the bar */
  --brand-mark-phone: 90px;
  --brand-in-bar-phone: 44px;
  --brand-corner: 0.6084;      /* where the sign's top-left corner is, as a share of the mark's height (logoBar's frame) */
  --bar-divider-y: 63px;       /* the middle of the pink divider, from the top of the bar */
  --bar-divider-y-phone: 57px;
  --bar-min-height: 64px;      /* the bar is this tall (its 2 px divider included) so the bigger mark fits */
  --bar-min-height-phone: 58px;
  --tap-target: 44px;
  --button-height: 48px;
  --target-min: 44px;

  /* the paw print the loading trail is cut from (a mask: its own fill is never seen) */
  --paw-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='30,56 50,48 70,56 78,76 64,92 36,92 22,76'/%3E%3Cpolygon points='8,40 16,30 26,34 28,46 20,54 10,50'/%3E%3Cpolygon points='28,18 38,8 48,14 48,28 40,34 30,30'/%3E%3Cpolygon points='52,14 62,8 72,18 70,30 60,34 52,28'/%3E%3Cpolygon points='74,34 84,30 92,40 90,50 80,54 72,46'/%3E%3C/svg%3E");
  --paw-step-ms: 260ms;   /* time between footsteps */

  /* 3D and canvas drawing (read at runtime by theme-colors.js; three.js needs plain #rrggbb) */
  --3d-trainer: var(--palette-white);
  --3d-you: var(--palette-lime);
  --3d-hot: var(--palette-pink);
  --3d-grid: var(--palette-grey-800);
  --3d-grid-center: var(--palette-grey-850);
  --live-bone: rgb(244 244 239 / 85%);   /* live check: the bones drawn over your camera */
  --live-ok: var(--palette-lime);         /* live check: a joint within range */
  --live-off: var(--palette-pink);        /* live check: a joint more than the threshold off */
  --color-scrim: rgb(10 10 10 / 72%);     /* dark veil over video (countdown, trim mask, legends) */
  --color-scrim-light: rgb(10 10 10 / 45%);   /* the smallest tap target (WCAG 2.5.5; checked by a11y.browser.mjs) */
  --header-blur: 10px;
  --header-height: 88px; /* the sticky app header with its build line; a scroll to a screen part stops below it */

  /* the 3D bodies (web/mesh-view.js reads these) and the 2D skeleton over your video (views/skeleton-overlay.js) */
  --mesh-trainer: var(--palette-white);
  --mesh-you: var(--palette-lime);
  --mesh-fault: var(--palette-pink);
  --mesh-light: var(--palette-pure-white);
  --mesh-ground: var(--palette-grey-800);
  --mesh-bg: transparent;
  /* the heat ramp (TICKET-274): cool to hot, the cividis stops, which stay apart for the common colour-blindness types
     and rise steadily in lightness, so the order also reads in greyscale. Paints the body in the 3D view and its legend. */
  --palette-heat-0: #00224e;
  --palette-heat-1: #35456c;
  --palette-heat-2: #7c7b78;
  --palette-heat-3: #c3b369;
  --palette-heat-4: #fee838;
  --heat-0: var(--palette-heat-0);
  --heat-1: var(--palette-heat-1);
  --heat-2: var(--palette-heat-2);
  --heat-3: var(--palette-heat-3);
  --heat-4: var(--palette-heat-4);
  --qr-dark: var(--palette-pure-black);   /* the QR code (web/model/qr.js: the AR page and the class handout): dark modules on a light plate */
  --qr-light: var(--palette-pure-white);
  --skeleton-line: rgb(198 243 90 / 80%);
  --skeleton-joint: var(--palette-pure-white);
  --skeleton-hot: var(--palette-pink);
  --ghost-line: rgb(255 200 61 / 70%);   /* the trainer's ghost over your live camera (views/ghost.js, TICKET-264) */
  --ghost-joint: var(--palette-amber);

  /* motion */
  --splash-fade: 0.45s;
  --paw-size: 26px;              /* the splash's paw prints around the logo */
  --paw-r: min(46vw, 220px);     /* the radius of their walk around the mark */
  --paw-in: 0.25s;
  --meter-h: 10px;               /* the score bar at the top of a result */
  --meter-glow: 12px;
  --meter-grade: 56px;           /* the grade letter, pink, no badge */
  --meter-grade-stroke: 1.5px;   /* thickens Sniglet Regular a little (grade and score) */
  --pop-stroke: 0.75px;          /* the same for the smaller score pops */
  --meter-score: 40px;
  --meter-land: 1400ms;          /* the score and its grade grow, then settle (slow, repo owner 2026-11-02) */
  --paw-step: 70ms;              /* 12 prints within the 1.2 s splash */
  --paw-size-walk: 44px;         /* the processing screen's background walk (the loading trail's prints, larger) */
  --paw-step-walk: 260ms;        /* one print every 0.26 s */
  --paw-walk-opacity: 0.45;      /* faint, so the content stays readable */
  /* a video camera, used as a mask (its fill is never seen): the header's Record button */
  --icon-video: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='6' width='13' height='12' rx='2.5'/%3E%3Cpath d='M16.5 10.2 22 7v10l-5.5-3.2z'/%3E%3C/svg%3E");
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --grade-land: 0.4s;

  /* legacy aliases: the names the existing Part 7 stylesheets use */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-line);
  --soft: var(--color-raised);
  --blue-bg: var(--color-accent-soft); --blue-ink: var(--color-accent);
  --green-bg: var(--color-accent-soft); --green-ink: var(--color-good);
  --red-bg: var(--color-bad-soft); --red-ink: var(--color-bad);
  --font: var(--font-sans);
  --mono: var(--font-mono);
  --tap: var(--tap-target);
}

/* phone widths (brand design 2026-11-01): the content column is the whole screen, so the bursts are sized to the
   viewport and placed to show beside and behind the cards */
@media (max-width: 720px) {
  :root {
    --backdrop: var(--powder-a) right -45vw top -6vh / 150vw auto no-repeat,
                var(--powder-b) left -55vw top 48vh / 150vw auto no-repeat,
                radial-gradient(ellipse 70% 40% at 100% 4%, var(--color-pink-smoke) 0%, transparent 75%),
                radial-gradient(ellipse 70% 40% at 0% 70%, var(--color-pink-smoke) 0%, transparent 75%),
                var(--color-bg);
    --color-content-veil: var(--color-content-veil-phone);
  }
}
