/* AgentDeck — Component patterns
 * Reusable component classes prefixed with `ad-` to avoid collision with
 * legacy site.css. Depends on tokens.css + patterns.css.
 */

/* === Base === */
.ad-body {
  background: var(--tide-50);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
.ad-mono {
  font-family: var(--font-mono);
  font-feature-settings: "zero", "ss01";
}

.ad-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* === Kickers & headings === */
.ad-kicker {
  font-family: var(--font-mono);
  font-size: var(--t-kicker);
  letter-spacing: var(--tr-kicker);
  text-transform: uppercase;
  color: var(--kelp-700);
  font-weight: 600;
  margin-bottom: 14px;
}
.ad-kicker--coral { color: var(--coral-700); }
.ad-kicker--kelp-light { color: var(--kelp-300); }

.ad-h1 {
  font-size: var(--t-hero);
  line-height: 0.94;
  font-weight: 600;
  letter-spacing: var(--tr-hero);
}
.ad-h1 em { color: var(--kelp-700); font-style: italic; font-weight: 500; }

.ad-h2 {
  font-size: var(--t-h2);
  line-height: 1.08;
  letter-spacing: var(--tr-h2);
  font-weight: 600;
  max-width: 22ch;
}

.ad-lede {
  font-size: var(--t-lede);
  color: var(--ink-700);
  max-width: 60ch;
  line-height: 1.55;
}

/* === Buttons === */
.ad-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--r-xl);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  transition: transform var(--d-fast) ease, box-shadow var(--d-base) ease;
  font-family: var(--font-sans);
}
.ad-btn:hover { transform: translateY(-1px); }

.ad-btn--primary {
  background: var(--ink-900);
  color: var(--tide-50);
  box-shadow: var(--sh-card);
}
.ad-btn--primary:hover { box-shadow: var(--sh-card-h); }

.ad-btn--ghost {
  background: transparent;
  color: var(--ink-900);
  border: 1px solid var(--ink-900);
}
.ad-btn--ghost:hover { background: var(--ink-900); color: var(--tide-50); }

.ad-btn--coral {
  background: var(--coral-500);
  color: var(--tide-50);
}
.ad-btn--coral:hover { background: var(--coral-700); }

.ad-btn .ad-btn-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--kelp-500);
  color: var(--ink-900);
  padding: 3px 7px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
}

/* === Tier badges === */
.ad-tier {
  font-family: var(--font-mono);
  font-size: var(--t-mono-badge);
  letter-spacing: var(--tr-badge);
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 5px;
  font-weight: 700;
  display: inline-block;
}
.ad-tier--store    { background: var(--ink-900);   color: var(--tide-50); }
.ad-tier--store-on-dark { background: var(--kelp-500); color: var(--ink-900); }
.ad-tier--dev      { background: var(--coral-500); color: var(--tide-50); }
.ad-tier--cli      { background: transparent; color: var(--coral-700); border: 1px solid var(--coral-500); }

/* === Hero kicker chip === */
.ad-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-500);
  letter-spacing: var(--tr-chip);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--tide-100);
}
.ad-chip::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--kelp-500);
  box-shadow: 0 0 0 4px rgba(47, 138, 124, 0.18);
}

/* === Status dot === */
.ad-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.ad-dot--idle       { background: var(--status-idle);       box-shadow: 0 0 0 2px rgba(124, 150, 148, 0.33); }
.ad-dot--processing { background: var(--status-processing); box-shadow: 0 0 0 2px rgba(47, 138, 124, 0.33); }
.ad-dot--awaiting   { background: var(--status-awaiting);   box-shadow: 0 0 0 2px rgba(200, 146, 58, 0.33); animation: ad-pulse 1.1s ease-in-out infinite; }
.ad-dot--error      { background: var(--status-error);      box-shadow: 0 0 0 2px rgba(192, 87, 58, 0.33); }

@keyframes ad-pulse {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

/* === Status row (for use in lists) === */
.ad-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* === Card primitives === */
.ad-card {
  background: var(--tide-50);
  border: 1px solid rgba(14, 31, 31, 0.08);
  border-radius: var(--r-2xl);
  padding: 24px 28px;
}
.ad-card--ink {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--tide-50);
}
.ad-card--dev {
  background: var(--tide-50);
  border: 1px solid rgba(14, 31, 31, 0.08);
  border-left: 3px solid var(--coral-500);
  border-radius: var(--r-xl);
  padding: 22px;
}

/* === Lang switch === */
.ad-lang {
  display: flex;
  background: var(--tide-100);
  border-radius: var(--r-pill);
  padding: 3px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ad-lang button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  color: var(--ink-500);
  font: inherit;
}
.ad-lang button[aria-pressed="true"],
.ad-lang button.on {
  background: var(--ink-900);
  color: var(--tide-50);
}

/* === Device tile === */
.ad-device {
  background: var(--tide-100);
  border: 1px solid rgba(14, 31, 31, 0.08);
  border-radius: var(--r-lg);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
}
.ad-device .ad-device-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  margin-top: auto;
}

/* === Code block === */
.ad-code {
  font-family: var(--font-mono);
  font-size: 15px;
  background: var(--ink-900);
  color: var(--tide-50);
  padding: 14px 18px;
  border-radius: var(--r-lg);
  display: inline-flex;
  gap: 12px;
  align-items: center;
}
.ad-code::before {
  content: "$";
  color: var(--kelp-300);
}

/* === Toast / inline notice === */
.ad-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  font-size: 14px;
  line-height: 1.5;
  background: var(--tide-100);
  border: 1px solid rgba(14, 31, 31, 0.08);
  color: var(--ink-700);
}
.ad-notice--awaiting { border-color: rgba(200, 146, 58, 0.4); background: rgba(200, 146, 58, 0.08); }
.ad-notice--error    { border-color: rgba(192, 87, 58, 0.4);  background: rgba(192, 87, 58, 0.08); }
.ad-notice--ok       { border-color: rgba(47, 138, 124, 0.4); background: rgba(47, 138, 124, 0.08); }
