/* ── AWC Apps launcher ────────────────────────────────────────────────────────────────
 *
 * Shared by the Web CAD studio and any other page that opens it. The palette is stated
 * HERE rather than borrowed from whichever host it lands on: the two pages name their
 * surfaces differently (--canvas/--text-1 against --chrome/--text), and reading whichever
 * exists put the launcher on the studio's #292926 panel grey instead of the black ground
 * it was designed on. This is one surface and it should look the same wherever it opens.
 *
 * The values are the ones the launcher shipped with — Anvil's own: pure-black ground,
 * teal-tinted hairlines, paper ink, mint labels. Only the accent is taken from the host,
 * and both hosts set the same emerald anyway.
 */
.apps-ov {
  --_bg:     #fefefe;
  --_ink:    #070707;
  --_dim:    #5a5a55;
  --_line:   #c9c2b4;
  --_fill:   rgba(7, 7, 7, .05);
  --_accent: var(--accent, #10a37e);
}
[data-theme="dark"] .apps-ov {
  --_bg:   #000000;
  --_ink:  #ece7d0;
  --_dim:  #7fc0ac;                    /* the mint label tier, Anvil's signature */
  --_line: rgba(44, 71, 64, .55);      /* teal-tinted, so it reads on black */
  --_fill: rgba(236, 231, 208, .08);
}

.apps-ov {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  overflow: auto;
  background: var(--_bg);
  font-family: var(--font, inherit);
}
.apps-ov.on { display: block; }

.apps-in {
  max-width: 1000px;
  margin: 0 auto;
  padding: 46px 26px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.apps-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 300;
  letter-spacing: -.01em;
  color: var(--_ink);
}
.apps-eyebrow {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--_dim);
  margin: 0 0 6px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 12px;
}

/* ── the card ──────────────────────────────────────────────────────────────────────────
   A name, its mark, and what you may do with it. Everything else was removed on review:
   the blurbs described each studio to a room that had just been shown it. What is left has
   to carry the page on its own, so the weight is in the spacing and in one state change -
   the whole card lifts to the accent on hover, rather than six competing decorations. */
.app-card {
  position: relative;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 15px;
  min-height: 148px;
  border: 1px solid var(--_line);
  border-radius: 3px;
  background: var(--_card, transparent);
  transition: border-color .16s ease, background .16s ease, transform .16s ease,
              box-shadow .16s ease;
}
/* An accent TINT, not --_fill. The studio has no --fill, so that fell through to
   --chrome-2, which is near-black on the dark theme: the card being pointed at went darker
   than the page and read as switched off. A tint of the accent means the same thing on both
   palettes and in both themes. */
.app-card:hover:not(:disabled),
.app-card:focus-visible {
  border-color: var(--_accent);
  background: color-mix(in srgb, var(--_accent) 8%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px -12px var(--_accent);
}

.app-card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
/* The mark sits in its own square. Loose on the card it read as a stray glyph; bounded, the
   six of them line up and the grid stops looking like a list of links. */
.app-card .card-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--_line);
  border-radius: 3px;
  color: var(--_accent);
  transition: border-color .16s ease, background .16s ease;
}
.app-card:hover .card-tile,
.app-card:focus-visible .card-tile {
  border-color: var(--_accent);
  background: color-mix(in srgb, var(--_accent) 12%, transparent);
}
.app-card .ico { width: 21px; height: 21px; display: block; }

.app-card .beta {
  flex: none;
  font-family: ui-monospace, monospace;
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--_accent);
  border: 1px solid color-mix(in srgb, var(--_accent) 55%, transparent);
  border-radius: 999px;
  padding: 4px 7px;
}

.app-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.005em;
  line-height: 1.25;
  color: var(--_ink);
  flex: 1 1 auto;
}

.app-card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 11px;
  border-top: 1px solid var(--_line);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--_dim);
}
.app-card .st { display: inline-flex; align-items: center; gap: 7px; }
.app-card .st i {
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor;
  opacity: .7;
}
/* The arrow is the affordance, and it only appears when the card is actually the target. */
.app-card .go {
  color: var(--_accent);
  font-size: 12px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .16s ease, transform .16s ease;
}
.app-card:hover .go,
.app-card:focus-visible .go { opacity: 1; transform: none; }
.app-card:disabled { cursor: not-allowed; opacity: .62; }

.app-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px;
  min-height: 148px;
  border: 1px dashed var(--_line);
  border-radius: 3px;
  background: transparent;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.app-slot .slot-ico { width: 22px; height: 22px; color: var(--_dim); }
.app-slot h3 { margin: 0; font-size: 13px; color: var(--_dim); font-weight: 500; }
.app-slot p { margin: 0; font-size: 11px; color: var(--_dim); max-width: 24ch; }

.apps-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--_line);
  padding-top: 14px;
  font-family: ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--_dim);
}
.apps-foot .apps-bar { color: var(--_line); }
.apps-foot .kbd { border: 1px solid var(--_line); background: var(--_fill); padding: 2px 6px; }

/* The trigger's own badge, wherever a page puts it. */
.apps-badge {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  line-height: 1;
  padding: 2px 4px;
  background: var(--accent, #10a37e);
  color: #06251c;
  font-weight: 600;
  border-radius: 2px;
}
[data-apps-open].is-open { background: var(--accent, #10a37e); color: #06251c; }
[data-apps-open].is-open .apps-badge { background: #06251c; color: var(--accent, #10a37e); }
