/*
 * AI Meter menu bar demo. Ported from aiusagemeter.app and scoped under .aim
 * so its class names cannot collide with the site. The popover keeps the app's
 * own dark colors in both site themes, like the real menu bar extra.
 */
.aim {
  --mac: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  container-type: inline-size;
  text-align: left;
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.07) 0 2px, transparent 2px 14px);
}

.aim .aim-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.aim .icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aim p {
  margin: 0;
}

.aim .dot {
  display: inline-block;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4d3d;
}

.aim .c-green { color: #34d399; }
.aim .c-red { color: #f87171; }
.aim .c-orange { color: #fb923c; }
.aim .c-pink { color: #f472b6; }

/* Menu bar */

.aim .menubar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 8px 0 16px;
  background: rgba(30, 30, 33, 0.92);
  color: #eeeae2;
  font: 500 13px var(--mac);
  white-space: nowrap;
}

.aim .menubar-app {
  font-weight: 700;
}

.aim .menubar-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  margin-left: auto;
  padding: 0 9px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  cursor: pointer;
}

.aim .menubar-item:hover,
.aim .menubar-item[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
}

.aim .menubar-clock {
  padding-right: 8px;
  opacity: 0.85;
}

@container (max-width: 560px) {
  .aim .menubar-app,
  .aim .menubar-clock {
    display: none;
  }
}

/* Popover */

.aim .popover {
  position: absolute;
  top: 44px;
  right: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(380px, calc(100% - 32px));
  padding: 12px;
  border: 1px solid #3a3a3e;
  border-radius: 16px;
  background: #1f1f21;
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.8);
  color: #e5e7eb;
  font: 500 13px var(--mac);
  line-height: 1.35;
}

.aim .popover[hidden],
.aim .pane[hidden] {
  display: none;
}

.aim .tabs {
  display: flex;
  gap: 5px;
}

.aim .tabs [role="tab"] {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: #2c2c2e;
  color: #d4d4d8;
  font: 600 13px var(--mac);
  cursor: pointer;
}

.aim .tabs [role="tab"]:hover {
  background: #37373a;
}

.aim .tabs [role="tab"][aria-selected="true"] {
  background: rgba(10, 132, 255, 0.38);
  color: #ffffff;
}

.aim .tabs .icon {
  width: 14px;
  height: 14px;
}

@container (max-width: 420px) {
  .aim .tabs [role="tab"] {
    padding: 0 6px;
  }

  .aim .tabs .icon {
    display: none;
  }
}

.aim .pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aim .pane-label {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aim .pane-foot {
  color: #9ca3af;
  font-size: 12px;
}

.aim .pool {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #2a2a2d;
}

.aim .pool > p:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.aim .pool > p:first-child span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ffffff;
  font-weight: 700;
}

.aim .pool em {
  color: #9ca3af;
  font-style: normal;
  font-weight: 500;
}

.aim .pool b {
  font-weight: 700;
}

.aim .pool .icon {
  width: 14px;
  height: 14px;
}

.aim .pool-orange { background: #2d2521; }
.aim .pool-pink { background: #2d2529; }
.aim .pool-green { background: #232a27; }
.aim .pool-red { background: #2d2323; }

.aim .pool-note {
  gap: 4px;
  color: #d1d5db;
  font-size: 12px;
}

.aim .pool-sub {
  color: #d1d5db;
  font-size: 12px;
}

.aim .popover-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px 0;
  border-top: 1px solid #333336;
  color: #fb923c;
  font-size: 12px;
}

.aim .popover-word {
  color: #9ca3af;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.aim .bar {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #45454a;
}

.aim .bar span {
  display: block;
  width: var(--v);
  height: 100%;
}

.aim .bar-orange span { background: repeating-linear-gradient(135deg, #f97316 0 3px, #fdba74 3px 6px); }
.aim .bar-green span { background: repeating-linear-gradient(135deg, #10b981 0 3px, #6ee7b7 3px 6px); }
.aim .bar-red span { background: repeating-linear-gradient(135deg, #ef4444 0 3px, #fca5a5 3px 6px); }
.aim .bar-pink span { background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 1.2px, transparent 1.6px) 0 50% / 7px 100% repeat-x, #db5a9a; }

/* The same number on iPhone and Watch, beside the Mac popover. Case study only. */

.aim .aim-devices {
  position: absolute;
  left: clamp(24px, 5%, 72px);
  bottom: -40px;
  display: flex;
  align-items: flex-end;
  gap: clamp(16px, 2.5vw, 32px);
}

.aim .aim-devices img {
  display: block;
  height: auto;
  border-radius: 28px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
}

.aim .aim-devices .phone {
  width: clamp(200px, 20vw, 270px);
  border: 6px solid #0c0c0c;
  border-radius: 40px;
}

.aim .aim-devices .watch {
  width: clamp(120px, 11vw, 150px);
  margin-bottom: 64px;
  border: 8px solid #0c0c0c;
  border-radius: 34px;
}

@container (max-width: 860px) {
  .aim .aim-devices {
    display: none;
  }
}

/* Where the demo sits on this site */

.bay.live-aim {
  align-items: stretch;
  justify-content: stretch;
  height: clamp(440px, 38vw, 500px);
}

.cs-cover .bay.live-aim {
  height: clamp(520px, 52vw, 700px);
}

@media (prefers-reduced-motion: no-preference) {
  .aim .menubar-item .dot {
    animation: aim-ping 1.8s ease-out infinite;
  }
}

@keyframes aim-ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 61, 0.6); }
  80%, 100% { box-shadow: 0 0 0 6px rgba(255, 77, 61, 0); }
}
