/* ScalifAI v3 animation kit. One look for all six value animations (BRIEF-animations.md).
   Ground #06080B, surface #0E1116, hairline rgba(255,255,255,.09), white and #A1A1A1 text, one accent #20E69F
   (black text on it), Instrument Sans from the page, corners 10 px. No other colours.

   Sizing: every part is in em. The stage sets its font size from its own width (container query units), so an
   animation drawn for 360 px scales to 640 px with nothing moving out of place. */

@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/InstrumentSans-latin-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

.anim {
  font-family: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --a-ground: #06080B;
  --a-surface: #0E1116;
  --a-surface-2: #151922;
  --a-line: rgba(255, 255, 255, .09);
  --a-line-2: rgba(255, 255, 255, .16);
  --a-ink: #FFFFFF;
  --a-quiet: #A1A1A1;
  --a-accent: #20E69F;
  --a-accent-soft: rgba(32, 230, 159, .14);
  --a-on-accent: #000000;
  --a-radius: 10px;
  --a-ease: cubic-bezier(.2, .7, .2, 1);
  --a-ratio: 1 / 1;
  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
}
.anim-stage {
  position: relative;
  aspect-ratio: var(--a-ratio);
  font-size: calc(100cqw / 28);   /* 12.5 px at 350 px wide, 22.9 px at 640 px */
  line-height: 1.25;
  color: var(--a-ink);
  background: var(--a-ground);
  border: 1px solid var(--a-line);
  border-radius: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.anim-scene {
  position: absolute;
  inset: 0;
  padding: 1.4em;
  transition: opacity .45s var(--a-ease);
}
.anim-scene.is-fading { opacity: 0; }
.a-instant, .a-instant * { transition: none !important; }

/* Entering and leaving: add .a-enter when built, remove it to bring the part in. */
.a-fade { transition: opacity .5s var(--a-ease), transform .5s var(--a-ease); }
.a-enter { opacity: 0; transform: translateY(.6em); }
.a-gone { opacity: 0; transform: scale(.96); }

/* Small text roles */
.a-label { font-size: .78em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--a-quiet); }
.a-quiet { color: var(--a-quiet); }

/* Teammate glyph: a small ring of dots, the brand mark's idea, no initials. Working: the dots light in turn.
   Done: an accent disc with a tick. */
.a-glyph {
  position: relative;
  flex: none;
  width: 2.3em; height: 2.3em;
  border-radius: 50%;
  background: var(--a-surface-2);
  border: 1px solid var(--a-line-2);
  display: grid; place-items: center;
  transition: background .35s var(--a-ease), border-color .35s var(--a-ease);
}
.a-glyph svg { width: 70%; height: 70%; overflow: visible; }
.a-glyph .a-dot { fill: var(--a-quiet); opacity: .55; transition: fill .3s, opacity .3s; }
.a-glyph .a-core { fill: var(--a-ink); }
.a-glyph .a-check { position: absolute; inset: 0; margin: auto; width: 55%; height: 55%; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .35s var(--a-ease); }
.is-working > .a-glyph, .a-glyph.is-working { border-color: rgba(32, 230, 159, .55); }
.is-working > .a-glyph .a-dot, .a-glyph.is-working .a-dot { fill: var(--a-accent); opacity: 1; animation: a-blink 1.2s linear infinite; }
.is-done > .a-glyph, .a-glyph.is-done { background: var(--a-accent); border-color: var(--a-accent); }
.is-done > .a-glyph svg:not(.a-check), .a-glyph.is-done svg:not(.a-check) { opacity: 0; }
.is-done > .a-glyph .a-check, .a-glyph.is-done .a-check { opacity: 1; transform: none; }
.a-glyph .a-dot:nth-child(2) { animation-delay: -1.05s; } .a-glyph .a-dot:nth-child(3) { animation-delay: -.9s; }
.a-glyph .a-dot:nth-child(4) { animation-delay: -.75s; } .a-glyph .a-dot:nth-child(5) { animation-delay: -.6s; }
.a-glyph .a-dot:nth-child(6) { animation-delay: -.45s; } .a-glyph .a-dot:nth-child(7) { animation-delay: -.3s; }
.a-glyph .a-dot:nth-child(8) { animation-delay: -.15s; }
@keyframes a-blink { 0%, 100% { opacity: .25; } 12% { opacity: 1; } 40% { opacity: .25; } }
.a-glyph.is-lead { width: 2.8em; height: 2.8em; border-width: 2px; border-color: var(--a-accent); }

/* Teammate chip: glyph, role, status line, optional progress bar */
.a-chip { display: flex; align-items: center; gap: .65em; min-width: 0; }
.a-chip-text { min-width: 0; flex: 1; }
.a-role { display: block; font-weight: 600; font-size: .95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-status { display: block; position: relative; height: 1.25em; margin-top: .15em; font-size: .85em; color: var(--a-quiet); overflow: hidden; }
.a-status > span { position: absolute; left: 0; right: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .35s var(--a-ease), transform .35s var(--a-ease); }
.a-status > span.is-out { opacity: 0; transform: translateY(-.8em); }
.a-status > span.is-in { opacity: 0; transform: translateY(.8em); }
.is-working .a-status { color: var(--a-ink); }
.is-done .a-status { color: var(--a-accent); }

/* Progress bar */
.a-bar { height: 3px; border-radius: 2px; background: var(--a-line); overflow: hidden; margin-top: .45em; }
.a-bar > i { display: block; height: 100%; width: 100%; background: var(--a-accent); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform var(--a-bar-ms, 1.6s) linear; }

/* Department frame */
.a-dept { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: .7em .9em .8em; }
.a-dept-head { display: flex; align-items: center; justify-content: space-between; gap: .5em; margin-bottom: .55em; }

/* Task card */
.a-card { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: var(--a-radius); padding: .7em .8em; transition: border-color .35s, background .35s, transform .6s var(--a-ease), opacity .45s var(--a-ease); }
.a-card-title { font-weight: 600; font-size: .95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-card-meta { font-size: .8em; color: var(--a-quiet); margin-top: .2em; }
.a-card.is-working { border-color: rgba(32, 230, 159, .5); }
.a-card.is-done { border-color: var(--a-line); }

/* State pill: To do, Working, Done */
.a-pill { display: inline-flex; align-items: center; gap: .35em; height: 1.7em; padding: 0 .6em; border-radius: 99px; font-size: .75em; font-weight: 600; white-space: nowrap; border: 1px solid var(--a-line-2); color: var(--a-quiet); transition: background .3s, color .3s, border-color .3s; }
.a-pill::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; opacity: .7; }
.a-pill.is-working { color: var(--a-accent); border-color: rgba(32, 230, 159, .5); }
.a-pill.is-working::before { animation: a-pulse 1s ease-in-out infinite; opacity: 1; }
.a-pill.is-done { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-on-accent); }
.a-pill.is-done::before { display: none; }
@keyframes a-pulse { 0%, 100% { transform: scale(.6); opacity: .4; } 50% { transform: scale(1); opacity: 1; } }

/* Tick: draws itself when .is-on is added */
.a-tick { width: 1.2em; height: 1.2em; flex: none; }
.a-tick path { fill: none; stroke: var(--a-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .45s var(--a-ease); }
.a-tick.is-on path { stroke-dashoffset: 0; }
.a-tick.on-accent path { stroke: var(--a-on-accent); }

/* Approve button, and its quieter partner */
.a-approve, .a-secondary { display: inline-flex; align-items: center; justify-content: center; height: 2.4em; padding: 0 1.1em; border-radius: 8px; font-weight: 600; font-size: .9em; transition: transform .15s var(--a-ease), box-shadow .3s, background .3s; }
.a-approve { background: var(--a-accent); color: var(--a-on-accent); }
.a-approve.is-glow { box-shadow: 0 0 0 .35em var(--a-accent-soft); }
.a-approve.is-pressed { transform: scale(.94); }
.a-secondary { border: 1px solid var(--a-line-2); color: var(--a-ink); }

/* Phone frame: a plain rounded body, a screen and a small speaker slot */
.a-phone { position: relative; width: 58%; aspect-ratio: 9 / 18.5; margin: 0 auto; border-radius: 2.2em; background: #000; border: 1px solid var(--a-line-2); padding: .55em; box-sizing: border-box; }
.a-phone-screen { position: relative; height: 100%; border-radius: 1.75em; background: var(--a-ground); overflow: hidden; padding: 2.4em .8em .8em; box-sizing: border-box; }
.a-phone-screen::before { content: ""; position: absolute; top: .8em; left: 50%; width: 28%; height: .45em; border-radius: 99px; background: var(--a-surface-2); transform: translateX(-50%); }

/* Thumb: a soft round touch mark that moves to a target and presses */
.a-thumb { position: absolute; width: 2.6em; height: 2.6em; margin: -1.3em 0 0 -1.3em; border-radius: 50%; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .5); opacity: 0; pointer-events: none; transition: left .7s var(--a-ease), top .7s var(--a-ease), opacity .3s, transform .15s; }
.a-thumb.is-on { opacity: 1; }
.a-thumb.is-press { transform: scale(.82); background: rgba(255, 255, 255, .35); }

/* Counter: a number that rolls when it changes */
.a-count { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 600; }
.a-count.is-bump { animation: a-bump .35s var(--a-ease); }
@keyframes a-bump { 40% { transform: translateY(-.15em); color: var(--a-accent); } }

/* Typed text and its caret */
.a-caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -.12em; background: var(--a-accent); animation: a-caret 1s steps(1) infinite; }
@keyframes a-caret { 50% { opacity: 0; } }

/* Reduced motion: the still frame each animation sets with end(); nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .anim *, .anim *::before, .anim *::after { transition: none !important; animation: none !important; }
}
