/* The logo's face, Sniglet Regular (SIL Open Font License, fonts/Sniglet-OFL.txt; basic Latin only), served with the app:
   the grade letter, the score and the score pops (--font-display) */
@font-face { font-family: "Sniglet"; font-weight: 400; font-display: swap; src: url("fonts/sniglet-regular.woff2") format("woff2"); }

/* App-wide components on the brand tokens (theme/tokens.css). No literal colors or sizes here. */
body { background: var(--backdrop); background-attachment: fixed; background-blend-mode: screen; color: var(--color-text); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
/* the back layer (brand design 2026-11-01): pink halftone fields fading out of the smoke, lime halftone in two corners;
   fixed behind everything and never hit by a tap */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background: radial-gradient(circle, var(--color-pink-dot) 0 1.7px, transparent 2.2px) 0 0 / var(--halftone-back-size) var(--halftone-back-size);
  -webkit-mask-image: radial-gradient(ellipse 26% 36% at 100% 6%, var(--mask-on) 0%, transparent 72%), radial-gradient(ellipse 24% 40% at 0% 68%, var(--mask-on) 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 26% 36% at 100% 6%, var(--mask-on) 0%, transparent 72%), radial-gradient(ellipse 24% 40% at 0% 68%, var(--mask-on) 0%, transparent 70%);
}
body::after {
  background: radial-gradient(circle, var(--color-lime-dot) 0 1.3px, transparent 1.8px) 0 0 / var(--halftone-lime-size) var(--halftone-lime-size);
  -webkit-mask-image: radial-gradient(circle at 100% 100%, var(--mask-on) 0%, transparent 28%), radial-gradient(circle at 0% 0%, var(--mask-on) 0%, transparent 20%);
  mask-image: radial-gradient(circle at 100% 100%, var(--mask-on) 0%, transparent 28%), radial-gradient(circle at 0% 0%, var(--mask-on) 0%, transparent 20%);
}
@media (prefers-reduced-transparency: reduce) { body::before, body::after { display: none; } }
h1 { font-size: var(--text-xl); font-weight: var(--weight-black); letter-spacing: -0.02em; }
h2 { font-weight: var(--weight-bold); letter-spacing: -0.01em; }
.lede, .hint, .rc-hint { color: var(--color-text-muted); }

/* header: the Exercise / Dance switch in the middle, quiet links at the sides */
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--color-header-glass);
  border-bottom: 2px solid var(--color-pink); backdrop-filter: blur(var(--header-blur)); min-height: var(--bar-min-height); }   /* the bright pink divider */
/* explicit cells: styles.css gives these flex orders that would otherwise reshuffle the grid */
.brand { grid-area: 1 / 1; justify-self: start; font-weight: var(--weight-black); letter-spacing: -0.02em; color: var(--color-accent); }
#kind-switch { grid-area: 1 / 2; }
.bar-nav { grid-area: 1 / 3; justify-self: end; }
.bar-nav { display: flex; align-items: center; } /* Record and the sign-in link share one row */
.bar-nav a { color: var(--color-text-muted); }
/* Record stands out: a lime pill with a video camera */
.bar-nav a[data-testid="nav-record"] { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-4);
  border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-on-accent); font-weight: var(--weight-semibold); text-decoration: none; }
.bar-nav a[data-testid="nav-record"]::before { content: ""; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: var(--icon-video) center / contain no-repeat; mask: var(--icon-video) center / contain no-repeat; }
.bar-nav a[data-testid="nav-record"]:hover { filter: brightness(1.08); }
.build { grid-area: 2 / 1 / 3 / 4; color: var(--color-text-muted); }
/* Account links after Record: Me and Sign in signed out, Me alone signed in. Phones wrap them (the rule below). */

.kind-switch { display: inline-flex; gap: 2px; padding: var(--space-1); border-radius: var(--radius-pill);
  background: var(--card-fill); border: 1px solid var(--color-line); }
.kind-switch button { min-height: var(--target-min); padding: 0 var(--space-4); border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--color-text-muted); font: var(--weight-semibold) var(--text-sm)/1 var(--font-sans); cursor: pointer; }
.kind-switch button[aria-pressed="true"] { background: var(--color-accent); color: var(--color-on-accent); }
/* Phones: the header never makes the page wider than the screen. The three-column row above needs about 460 px with
   Record and Sign in (more signed in), so a 412 px phone laid the whole page out wider and zoomed it out, and taps
   landed off their buttons (staging verify on 47d79a8: Continue under the trim editor's Set end). Here the row wraps:
   brand, switch and links stay on one line when they fit, else the links, then the switch, move to a line below. */
@media (max-width: 480px) {
  body .bar { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-2); }
  body .bar > * { order: 4; flex: 1 0 100%; }
  body .bar > .brand { order: 1; flex: none; }
  body .bar > #kind-switch { order: 2; flex: none; margin-inline: auto; }
  body .bar > .bar-nav { order: 3; flex: none; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  body .kind-switch button { padding: 0 var(--space-2); }
  body .bar .bar-nav a { padding-left: var(--space-2); padding-right: 0; }
}

/* buttons and fields */
.btn { border-radius: var(--radius-md); font-family: var(--font-sans); font-weight: var(--weight-bold); min-height: var(--button-height); }
.btn.primary { background: var(--color-accent); color: var(--color-on-accent); border-color: var(--color-accent); }
.btn.secondary { background: var(--card-fill); color: var(--color-text); border: 1px solid var(--color-line); }
.btn.danger { background: var(--color-bad-soft); color: var(--color-bad); border-color: transparent; }
.input, select.input, input[type="search"] { background: var(--card-fill); color: var(--color-text);
  border: 1px solid var(--color-line); border-radius: var(--radius-md); }
.state, .figure, .frame { background: var(--card-fill); border-color: var(--color-line); }
.chip, .badge { background: var(--card-fill-raised); color: var(--color-text-muted); }
.cam { background: var(--color-media-bg); border-radius: var(--radius-lg); }

/* splash */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--color-bg);
  transition: opacity var(--splash-fade) ease; }
.splash[data-done="true"] { opacity: 0; pointer-events: none; }
.splash-inner { display: grid; justify-items: center; gap: var(--space-3); }
/* the mark: the golden over the simon sign (views/logo.js); lines take the accent, knockouts the surface behind */
.logo-sign, .logo-head { display: block; color: var(--color-accent); --logo-ink: var(--color-on-accent); }
/* logo 2026-11-01: the outline and sign take the accent, the dog is see-through, the word is ink */
.logo-sign .logo-line, .logo-head .logo-line { fill: currentColor; }
.logo-sign .logo-stroked { stroke: currentColor; }
.logo-sign .logo-ink { fill: var(--logo-ink); }

.splash-mark .logo-sign { width: min(64vw, 280px); height: auto; }
/* paw prints walking around the mark in the bright pink (views/splash.js places them on a circle of --paw-r) */
.splash-mark { position: relative; display: block; }
.splash-paw { position: absolute; left: 50%; top: 50%; width: var(--paw-size); height: var(--paw-size); background: var(--color-pink);
  -webkit-mask: var(--paw-mask) center / contain no-repeat; mask: var(--paw-mask) center / contain no-repeat; pointer-events: none;
  transform: translate(-50%, -50%) translate(calc(var(--ux) * var(--paw-r)), calc(var(--uy) * var(--paw-r))) rotate(var(--r));
  opacity: 0; animation: splash-paw-in var(--paw-in) ease-out forwards; animation-delay: calc(var(--i) * var(--paw-step)); }
@keyframes splash-paw-in { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .splash-paw { animation: none; opacity: 1; } }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; }
/* the dog sits in the header and the sign hangs below it, over the pink divider (sketch 2026-11-01): the mark is
   taller than the bar and its lower part overflows downward without making the bar taller */
header.bar .brand { position: relative; z-index: 3; align-self: start; align-items: flex-start; height: var(--brand-in-bar); margin-left: var(--brand-inset); }
.brand .logo-bar { height: var(--brand-mark); width: auto; margin-top: calc(var(--bar-divider-y) - var(--brand-mark) * var(--brand-corner)); pointer-events: auto; }   /* the sign's top-left corner sits on the divider */
.brand .brand-word { display: none; }   /* the word is on the sign */
.splash-tag { color: var(--color-text); font-size: var(--text-md); }
@media (prefers-reduced-motion: reduce) { .splash { transition: none; } }

/* TICKET-204: the test-server banner sits in the sticky header, so it stays on every screen */
.test-banner { grid-area: 3 / 1 / 4 / 4; background: var(--color-alert-bg); color: var(--color-on-alert);
  font-weight: var(--weight-black); font-size: 15px; line-height: 1.3; padding: 8px 16px; margin: 0 -16px; text-align: center; }
.review-note { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--color-warn-line); background: var(--color-warn-soft);
  color: var(--color-text); border-radius: var(--radius-lg); }

/* the content column sits on a soft dark veil, so text placed straight on the page stays readable over the chalk;
   the veil fades out at both sides and the chalk stays dense in the margins (brand design 2026-11-01) */
main#app { position: relative; }
main#app::before { content: ""; position: absolute; top: 0; bottom: 0; left: -64px; right: -64px; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, transparent 0, var(--color-content-veil) 64px, var(--color-content-veil) calc(100% - 64px), transparent 100%); }

/* phone header: the dog badge carries the brand, so the word hides; nothing wraps */
@media (max-width: 520px) {
  header.bar .brand { height: var(--brand-in-bar-phone); }
  .bar { min-height: var(--bar-min-height-phone); }
  main#app { padding-top: calc(var(--brand-mark-phone) - var(--brand-in-bar-phone) + var(--space-4)); }   /* the content clears the hanging sign */
  .brand .logo-bar { height: var(--brand-mark-phone); margin-top: calc(var(--bar-divider-y-phone) - var(--brand-mark-phone) * var(--brand-corner)); }
  .brand .brand-word { display: none; }
  .bar-nav a { white-space: nowrap; }
  .bar { column-gap: var(--space-1); padding-left: var(--space-2); padding-right: var(--space-2); }
  .kind-switch button { padding-left: var(--space-2); padding-right: var(--space-2); font-size: var(--text-xs); }
  .bar-nav { gap: var(--space-2); font-size: var(--text-sm); }
  .bar-nav a[data-testid="nav-record"] { font-size: 0; gap: 0; padding: 0 var(--space-3); }   /* phones: the camera alone; the link still reads "Record" */
}

/* the content column takes 60% of a wide screen (brand design 2026-11-01); phones and laptops keep the full width */
body main#app, body .simon-result { max-width: var(--page-width); }
body .simon-result .sr-cmp { max-width: none; }

/* phones: the content veil above reaches 64px past the column, which widened the page past the screen (phone_width test);
   on a phone the column is the screen, so the veil stays inside it */
@media (max-width: 520px) {
  main#app::before { left: 0; right: 0; }
  /* the test-server banner bleeds to the header's edges; the phone header above pads by space-2, not 16px */
  .test-banner { margin-left: calc(-1 * var(--space-2)); margin-right: calc(-1 * var(--space-2)); }
}

/* a 44 px tap target for the Record button (a11y test), beside the rule above; it still fits a 390 px header */
.bar-nav a[data-testid="nav-record"] { min-height: var(--target-min, 44px); min-width: var(--target-min, 44px); justify-content: center; }
