/* atlas-modes_v1.css (2026-10-01). The v3 Atlas bubble shown live in every mode: one large bubble cycling through the states,
   and a row of small bubbles, each locked in one state and labelled. The state looks come from the hub v14 live-bubble panel
   (idle, thinking, fires, drafting, waiting on you) plus one new state, done. Red is reserved for Fires.
   Needs atlas-bubble_v3.css (the glass). Markup and behaviour: atlas-modes_v1.js. Every class here starts with am-. */

@property --ab3-g { syntax: "<color>"; inherits: true; initial-value: #2F8CFF; }
@property --ab3-g-hi { syntax: "<color>"; inherits: true; initial-value: #A8D8FF; }
@property --ab3-g-deep { syntax: "<color>"; inherits: true; initial-value: #0A4FE0; }
@property --ab-amp { syntax: "<number>"; inherits: true; initial-value: 0; }

.am-fig { margin: 0; min-width: 0; }
.am-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0B0C10;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .7), 0 22px 44px -18px rgba(0, 0, 0, .6), 0 3px 8px rgba(0, 0, 0, .25);
}
.am-fig figcaption { font-size: 12px; color: #5D646E; margin-top: 8px; line-height: 1.35; }
.am-cap-print { display: none; }

.am {
  --am-hero: clamp(150px, 15vw, 206px);
  --am-sm: 84px;
  display: grid;
  grid-template-columns: minmax(250px, 36%) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  color: #E7ECF2;
  font-family: inherit;
  line-height: 1.35;
  background: radial-gradient(ellipse 70% 70% at 30% 40%, #1A1F26 0%, #101318 60%, #0B0C10 100%);
}
.am * { box-sizing: border-box; }

/* ---------------------------------------------------------------- the live bubble (hero and every small one) */
.am-live {
  --bsz: var(--am-hero);
  --sd: #93A1B3;
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--bsz) * 1.32);
  height: calc(var(--bsz) * 1.32);
  flex: none;
}
.am-live > * { grid-area: 1 / 1; }
.am-live .abub3 { --ab-size: var(--bsz); position: relative; width: var(--bsz); height: var(--bsz); }
.am-live .ab3-head { max-width: none; }

.am-orbit {
  position: relative;
  width: calc(var(--bsz) * 1.24);
  height: calc(var(--bsz) * 1.24);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.am-orbit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 190deg, rgba(95, 168, 255, .08) 250deg, rgba(140, 194, 255, .85) 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px), #000 100%);
  mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px), #000 100%);
}
.am-orbit b {
  position: absolute;
  left: 50%;
  top: -4px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: #F2F8FF;
  box-shadow: 0 0 6px 2px #8CC2FF, 0 0 18px 5px rgba(47, 140, 255, .85);
}
.am-alert {
  width: calc(var(--bsz) * 1.1);
  height: calc(var(--bsz) * 1.1);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  border: 2px solid #FF6B3D;
  box-shadow: 0 0 14px 3px rgba(255, 77, 46, .85), 0 0 40px 10px rgba(255, 90, 40, .4), inset 0 0 16px 2px rgba(255, 120, 70, .6);
}
.am-check {
  position: absolute;
  right: 6%;
  bottom: 8%;
  z-index: 3;
  width: calc(var(--bsz) * .26);
  height: calc(var(--bsz) * .26);
  min-width: 18px;
  min-height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.4);
  pointer-events: none;
  color: #052A1D;
  background: linear-gradient(180deg, #C9F7E6, #34D399);
  box-shadow: 0 0 0 2px #0B0C10, 0 0 14px rgba(52, 211, 153, .85);
  transition: opacity .3s ease, transform .35s cubic-bezier(.2, 1.4, .4, 1);
}
.am-check svg { width: 62%; height: 62%; }

/* ---------------------------------------------------------------- the states */
.am [data-am="idle"] { --sd: #93A1B3; }
.am [data-am="thinking"] { --sd: #5FA8FF; }
.am [data-am="fires"] { --sd: #FF5A36; }
.am [data-am="drafting"] { --sd: #7FD3FF; }
.am [data-am="waiting"] { --sd: #EAF4FF; }
.am [data-am="done"] { --sd: #34D399; }

/* fires: the glass glows red (the only red in the set) */
.am-live[data-am="fires"] .abub3 { --ab3-g: #FF4D2E; --ab3-g-hi: #FFB08A; --ab3-g-deep: #C2260C; }
/* done: a calm green glow and a check */
.am-live[data-am="done"] .abub3 { --ab3-g: #2FD6A0; --ab3-g-hi: #B9F5E1; --ab3-g-deep: #0E8F66; }
.am-live[data-am="done"] .am-check { opacity: 1; transform: scale(1); }
/* waiting on you: a steady, brighter glow, no ping */
.am-live[data-am="waiting"] .abub3 { --ab-amp: .5; }
.am-live[data-am="waiting"] .abub3 .ab3-sphere {
  box-shadow: 0 0 0 max(1px, .6cqw) color-mix(in srgb, var(--ab3-g-hi) 85%, transparent), 0 0 max(8px, 5cqw) max(2px, 1.4cqw) color-mix(in srgb, var(--ab3-g) 95%, transparent),
    0 0 max(18px, 15cqw) max(3px, 3.5cqw) color-mix(in srgb, var(--ab3-g) 62%, transparent), 0 0 max(34px, 32cqw) max(6px, 7cqw) color-mix(in srgb, var(--ab3-g) 28%, transparent);
}
.am-live[data-am="waiting"] .abub3 .ab3-aura { opacity: 1; }
.am-live[data-am="waiting"] .abub3 .ab3-ring::after { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .am-live .abub3 { transition: --ab3-g .45s ease, --ab3-g-hi .45s ease, --ab3-g-deep .45s ease; }
  .am-live[data-am="idle"] .abub3 { animation: am-breathe 4.4s ease-in-out infinite; }
  .am-live[data-am="thinking"] .abub3 { animation: am-pulse .9s ease-in-out infinite; }
  .am-live[data-am="thinking"] .am-orbit { opacity: 1; animation: am-orbit 1.5s linear infinite; }
  .am-live[data-am="fires"] .am-alert { animation: am-alert .95s cubic-bezier(.2, .7, .3, 1) infinite; }
  .am-live[data-am="fires"] .abub3 .ab3-rim { animation: ab3-rim 10s linear infinite, am-rimflash .48s ease-in-out infinite alternate; }
  .am-live[data-am="drafting"] .abub3 { animation: am-type 1.25s linear infinite; }
  .am-live[data-am="drafting"] .abub3 .ab3-sweep i { animation: ab3-sweep 1.05s cubic-bezier(.45, .05, .25, 1) infinite; }
  .am-live[data-am="waiting"] .abub3 .ab3-aura { animation: none; }
  .am-live[data-am="waiting"] .abub3 .ab3-ring::after { animation: none; }
  .am-live .abub3 .ab3-sphere { transition: box-shadow .45s ease; }
}
@keyframes am-breathe { 0%, 100% { transform: scale(.985); } 50% { transform: scale(1.02); } }
@keyframes am-pulse { 0%, 100% { transform: scale(.99); filter: brightness(1); } 50% { transform: scale(1.035); filter: brightness(1.18); } }
@keyframes am-orbit { to { transform: rotate(360deg); } }
@keyframes am-alert { 0% { opacity: 0; transform: scale(.96); } 14% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.16); } }
@keyframes am-rimflash { 0% { filter: brightness(1) saturate(1); } 100% { filter: brightness(2.1) saturate(1.4); } }
@keyframes am-type {
  0% { --ab-amp: .12; } 10% { --ab-amp: .62; } 19% { --ab-amp: .22; } 31% { --ab-amp: .8; } 42% { --ab-amp: .3; }
  55% { --ab-amp: .7; } 64% { --ab-amp: .18; } 77% { --ab-amp: .58; } 88% { --ab-amp: .26; } 100% { --ab-amp: .12; }
}
@keyframes am-dot { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--sd) 0%, transparent), 0 0 14px var(--sd); } }
@keyframes am-blink { 50% { background: color-mix(in srgb, var(--sd) 35%, #000); box-shadow: none; } }
@keyframes am-typedot { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* ---------------------------------------------------------------- the large bubble and its caption */
.am-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 12px 12px 12px;
  border-radius: 12px;
  background: radial-gradient(ellipse 72% 60% at 50% 42%, #262C34 0%, #15181D 62%, #0E1013 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.am-hero .am-stagebub { flex: 1; display: grid; place-items: center; min-height: calc(var(--am-hero) * 1.4); }
.am-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 9px;
  row-gap: 3px;
  margin-top: 8px;
  padding: 9px 10px 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(9, 11, 15, .94), rgba(4, 5, 8, .97));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .075), inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 20px -12px #000;
}
.am-sdot {
  grid-row: 1;
  grid-column: 1;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sd, #93A1B3);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sd, #93A1B3) 20%, transparent), 0 0 10px var(--sd, #93A1B3);
  transition: background .3s, box-shadow .3s;
}
.am-slab {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-hero[data-am="fires"] .am-slab { color: #FFB59E; }
.am-pause {
  grid-row: 1;
  grid-column: 3;
  appearance: none;
  font-family:inherit;font-weight:800;font-size:9.5px;line-height:1;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #0B1830;
  background: linear-gradient(180deg, #D6EAFF, #86BEFF);
  border: 0;
  border-radius: 5px;
  padding: 4px 7px 4px 8px;
  cursor: pointer;
}
.am-pause:focus-visible, .am-cell:focus-visible { outline: 2px solid #A8D8FF; outline-offset: 2px; }
.am-sline {
  grid-row: 2;
  grid-column: 2 / 4;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: #C7D0DB;
}
.am-sdet { min-width: 0; font-variant-numeric: tabular-nums; }
.am-dots { display: none; flex: none; gap: 3px; align-items: center; }
.am-dots u { width: 4px; height: 4px; border-radius: 50%; background: #AFC9E8; text-decoration: none; }
.am-hero[data-am="drafting"] .am-dots { display: inline-flex; }
@media (prefers-reduced-motion: no-preference) {
  .am-hero[data-am="thinking"] .am-sdot { animation: am-dot .9s ease-in-out infinite; }
  .am-hero[data-am="fires"] .am-sdot { animation: am-blink .48s steps(1, end) infinite; }
  .am-hero[data-am="drafting"] .am-dots u { animation: am-typedot 1s ease-in-out infinite; }
  .am-hero[data-am="drafting"] .am-dots u:nth-child(2) { animation-delay: .15s; }
  .am-hero[data-am="drafting"] .am-dots u:nth-child(3) { animation-delay: .3s; }
}

/* ---------------------------------------------------------------- the row of six small bubbles, each locked in one state */
.am-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.am-grid > li { display: block; min-width: 0; }
.am-cell {
  appearance: none;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 12px;
  text-align: center;
  color: #E7ECF2;
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(180deg, #1A1E24, #12151A);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: box-shadow .2s, background .2s;
}
.am-cell:hover { box-shadow: inset 0 0 0 1px rgba(160, 200, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .1); }
.am-cell.is-pick { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sd) 70%, #fff), 0 0 18px -4px var(--sd); }
.am-cell .am-live { --bsz: var(--am-sm); }
.am-lab {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #FFFFFF;
}
.am-lab i { width: 8px; height: 8px; border-radius: 50%; background: var(--sd); box-shadow: 0 0 8px var(--sd); flex: none; }
.am-cell[data-am="fires"] .am-lab { color: #FFB59E; }
.am-note { font-size: 12.5px; line-height: 1.3; color: #AAB4C0; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 900px) {
  .am { grid-template-columns: minmax(0, 1fr); --am-hero: clamp(150px, 42vw, 200px); }
}
@media (max-width: 520px) {
  .am { padding: 10px; gap: 10px; --am-sm: 72px; }
  .am-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .am-note { font-size: 12px; }
}

/* ---------------------------------------------------------------- print: one still frame, every state laid out */
@media print {
  .am { grid-template-columns: minmax(0, 1fr); background: #0B0C10; }
  .am-pause { display: none; }
  .am-cap-live { display: none; }
  .am-cap-print { display: inline; }
  .am-live .abub3, .am-live .am-orbit, .am-live .am-alert { animation: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .am-live .abub3, .am-live .abub3 * { animation: none !important; }
  .am-live .am-orbit { opacity: 0; }
  .am-live[data-am="thinking"] .am-orbit { opacity: .9; }
  .am-live[data-am="fires"] .am-alert { opacity: .9; }
  .am-live .am-check { transition: none; }
}
