/* ============================================================
   AiryMedia Trigger — 音で動く体験デモ（モック）
   trigger.astro（Astro5 + Tailwind4）の amt-* / --color-accent
   と馴染むトークンを使用。.amt-demo 配下が移植対象。
============================================================ */

:root {
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-text: #1a1a2e;
  --color-text-muted: #666;
  --demo-radius: 16px;
}

/* ---------- 単体プレビュー用ラッパ（移植時は不要） ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans JP', system-ui, sans-serif;
  color: var(--color-text);
  background: #eef2f9;
  -webkit-font-smoothing: antialiased;
}
.standalone-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}
.standalone-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}
.standalone-note {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 28px;
}
.standalone-note code,
.standalone-footnote code {
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}
.standalone-footnote {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin: 22px 4px 0;
}

/* ============================================================
   .amt-demo — 移植対象本体
============================================================ */
.amt-demo {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--demo-radius);
  box-shadow: 0 10px 40px rgba(15, 30, 70, 0.10);
  overflow: hidden;
}
.amt-demo-sim-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: #eaf1ff;
  border: 1px solid #c5d8ff;
  padding: 4px 9px;
  border-radius: 999px;
}

/* ---------- ステージ ---------- */
.amt-demo-stage {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 28px 32px;
  background:
    radial-gradient(120% 90% at 50% -10%, #f4f8ff 0%, #ffffff 55%);
}
.amt-demo-screen {
  width: 100%;
  max-width: 520px;
  text-align: center;
  animation: amt-fade 0.45s ease;
}
@keyframes amt-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.amt-demo-head {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  margin: 18px 0 10px;
  text-wrap: balance;
}
.amt-demo-sub {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--color-text-muted);
  margin: 0 auto 22px;
  max-width: 420px;
  text-wrap: pretty;
}

/* ---------- ボタン ---------- */
.amt-demo-btn {
  display: inline-block;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.amt-demo-btn:active { transform: translateY(1px); }
.amt-demo-btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.amt-demo-btn--primary:hover { background: var(--color-accent-hover); }
.amt-demo-btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
}
.amt-demo-btn--ghost:hover { color: var(--color-accent); }
.amt-demo-screen--intro .amt-demo-btn--primary { display: block; margin: 0 auto 6px; }
.amt-demo-screen--intro .amt-demo-btn--ghost   { display: block; margin: 0 auto; }

.amt-demo-mic-note {
  font-size: 11.5px;
  color: #9aa3b2;
  margin: 14px auto 0;
  max-width: 320px;
  line-height: 1.6;
}

/* ---------- (1) イントロ：エンブレム ---------- */
.amt-demo-emblem {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto;
}
.amt-demo-emblem .emblem-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.amt-demo-emblem .ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  opacity: 0;
  animation: amt-ring 2.8s ease-out infinite;
}
.amt-demo-emblem .ring:nth-child(2) { animation-delay: 0.9s; }
.amt-demo-emblem .ring:nth-child(3) { animation-delay: 1.8s; }
@keyframes amt-ring {
  0%   { transform: scale(0.5); opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ---------- (2) リスニング ---------- */
.amt-listen-pulse {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 6px;
}
.amt-listen-pulse .mic {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  z-index: 2;
}
.amt-listen-pulse span:not(.mic) {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.18);
  animation: amt-pulse 1.8s ease-out infinite;
}
.amt-listen-pulse span:nth-child(2) { animation-delay: 0.6s; }
.amt-listen-pulse span:nth-child(3) { animation-delay: 1.2s; }
@keyframes amt-pulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.amt-visualizer {
  display: block;
  width: 100%;
  max-width: 480px;
  height: 110px;
  margin: 8px auto 18px;
}
.amt-level {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  margin: 0 auto 22px;
}
.amt-level-label { font-size: 11.5px; color: #9aa3b2; white-space: nowrap; }
.amt-level-bar {
  flex: 1;
  height: 8px;
  background: #eaeef5;
  border-radius: 999px;
  overflow: hidden;
}
.amt-level-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent), #60a5fa);
  border-radius: 999px;
  transition: width 0.08s linear;
}

/* ---------- (3) 検出演出 ---------- */
.amt-detect-burst {
  font-size: 64px;
  color: var(--color-accent);
  animation: amt-burst 0.7s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes amt-burst {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ---------- (E) エラー ---------- */
.amt-error-icon { font-size: 48px; line-height: 1; }
.amt-demo-screen--error .amt-demo-btn--primary { display: block; margin: 4px auto 0; }

/* ---------- (4) アクション結果 ---------- */
.amt-action-slot { margin-bottom: 14px; }

/* クーポン */
.amt-coupon {
  position: relative;
  background: linear-gradient(135deg, var(--color-accent), #1d4ed8);
  color: #fff;
  border-radius: 16px;
  padding: 30px 26px;
  max-width: 360px;
  margin: 0 auto;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
  animation: amt-pop 0.5s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes amt-pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.amt-coupon::before, .amt-coupon::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px; height: 22px;
  background: var(--demo-bg, #fff);
  border-radius: 50%;
  transform: translateY(-50%);
}
.amt-coupon::before { left: -11px; }
.amt-coupon::after  { right: -11px; }
.amt-coupon-label { font-size: 12px; letter-spacing: 0.12em; opacity: 0.85; }
.amt-coupon-value { font-size: 40px; font-weight: 800; margin: 6px 0 2px; }
.amt-coupon-desc  { font-size: 13px; opacity: 0.9; }
.amt-coupon-code {
  margin-top: 16px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.15em;
  background: rgba(255,255,255,0.18);
  border: 1px dashed rgba(255,255,255,0.6);
  border-radius: 8px;
  padding: 8px;
}

/* ---------- フロー・キャプション ---------- */
.amt-demo-flow {
  list-style: none;
  margin: 0;
  padding: 14px 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #eef1f6;
  background: #fafbfd;
}
.amt-demo-flow li {
  font-size: 12px;
  color: #9aa3b2;
  padding: 4px 12px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.amt-demo-flow li.is-active {
  color: var(--color-accent);
  background: rgba(37, 99, 235, 0.1);
  font-weight: 700;
}

/* ============================================================
   レスポンシブ
============================================================ */
@media (max-width: 560px) {
  .standalone-wrap { padding: 28px 14px 48px; }
  .amt-demo-stage { padding: 40px 18px 28px; min-height: 440px; }
  .amt-demo-head { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .amt-demo-emblem .ring,
  .amt-listen-pulse span:not(.mic),
  .amt-detect-burst,
  .amt-coupon { animation: none; }
}
