/* Zwilling AI quick demos — shared brand tokens & utility classes */
:root {
  /* Brand colors */
  --zw-red: #E2231A;
  --zw-red-dark: #B81B14;
  --zw-red-tint: #FBE9E8;
  --zw-ink: #14110F;
  --zw-charcoal: #2D2A26;
  --zw-stone: #5B544D;
  --zw-fog: #A8A29A;
  --zw-pearl: #F5F2EE;
  --zw-bone: #FAF8F4;
  --zw-line: #E6E1D9;
  --zw-gold: #B5945E;
  --zw-green: #4F6B3B;
  --shadow-soft: 0 1px 2px rgba(20,17,15,0.04), 0 8px 24px rgba(20,17,15,0.06);
  --shadow-card: 0 1px 2px rgba(20,17,15,0.06), 0 12px 36px rgba(20,17,15,0.10);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --font-serif: 'Cormorant Garamond', 'Noto Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', 'Helvetica Neue', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--zw-ink);
  background: var(--zw-bone);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--zw-red);
  outline-offset: 2px;
}

/* Typography */
.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.tracking-widest-xl { letter-spacing: 0.28em; }
.tracking-widest-lg { letter-spacing: 0.18em; }
.tracking-wide { letter-spacing: 0.05em; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; color: var(--zw-ink); margin: 0; }
p { line-height: 1.6; }

/* ── Top bar ────────────────────────────────────────────────────── */
.zw-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 2rem;
  background: var(--zw-bone);
  border-bottom: 1px solid var(--zw-line);
}
.zw-topbar-left {
  display: flex; align-items: center; gap: 1rem;
}
.zw-wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: 0.34em;
  font-size: 0.95rem;
  color: var(--zw-ink);
}
.zw-wordmark .twin {
  color: var(--zw-red);
  font-weight: 900;
}
.zw-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--zw-stone);
}
.zw-topbar-back {
  font-size: 0.85rem;
  color: var(--zw-stone);
  text-decoration: none;
  border: 1px solid var(--zw-line);
  background: white;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.18s;
}
.zw-topbar-back:hover { color: var(--zw-red); border-color: var(--zw-red); }

/* Language switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--zw-line);
  border-radius: 999px;
  background: white;
}
.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--zw-stone);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}
.lang-btn:hover { color: var(--zw-ink); }
.lang-btn.is-active {
  background: var(--zw-ink);
  color: white;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.zw-btn {
  appearance: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s;
}
.zw-btn-primary {
  background: var(--zw-red);
  color: white;
}
.zw-btn-primary:hover { background: var(--zw-red-dark); transform: translateY(-1px); }
.zw-btn-primary:disabled { background: var(--zw-fog); cursor: not-allowed; transform: none; }
.zw-btn-ghost {
  background: transparent;
  color: var(--zw-ink);
  border: 1px solid var(--zw-line);
}
.zw-btn-ghost:hover { border-color: var(--zw-ink); }
.zw-btn-dark {
  background: var(--zw-ink);
  color: white;
}
.zw-btn-dark:hover { background: var(--zw-charcoal); transform: translateY(-1px); }

/* ── Cards ───────────────────────────────────────────────────────── */
.zw-card {
  background: white;
  border: 1px solid var(--zw-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.zw-card-pad { padding: 1.75rem; }
.zw-card-elevated { box-shadow: var(--shadow-card); }

.zw-divider {
  height: 1px;
  background: var(--zw-line);
  border: none;
  margin: 1.25rem 0;
}

/* ── Tags / pills ───────────────────────────────────────────────── */
.zw-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--zw-pearl);
  color: var(--zw-charcoal);
}
.zw-tag-red {
  background: var(--zw-red-tint);
  color: var(--zw-red-dark);
}
.zw-tag-dark {
  background: var(--zw-ink);
  color: white;
}

/* ── Phone frame (Demo 1 & 2) ───────────────────────────────────── */
.phone-frame {
  width: 380px;
  max-width: 100%;
  height: 760px;
  background: var(--zw-ink);
  border-radius: 44px;
  padding: 14px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.phone-frame::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: var(--zw-ink);
  border-radius: 0 0 18px 18px;
  z-index: 5;
}
.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--zw-bone);
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-statusbar {
  height: 44px;
  flex-shrink: 0;
  background: var(--zw-bone);
}

/* ── Chat bubbles (Demo 1) ──────────────────────────────────────── */
.bubble {
  max-width: 85%;
  padding: 0.7rem 0.95rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble-user {
  background: var(--zw-ink);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.bubble-ai {
  background: white;
  color: var(--zw-ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--zw-line);
}
.bubble-system {
  align-self: center;
  font-size: 0.72rem;
  color: var(--zw-stone);
  background: transparent;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px dashed var(--zw-line);
  max-width: 90%;
  text-align: center;
}

/* Markdown-lite inside bubbles */
.bubble strong { font-weight: 700; color: var(--zw-red-dark); }

/* RAG hint */
.rag-hint {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--zw-stone);
  background: var(--zw-pearl);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.rag-hint .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--zw-red);
  animation: rag-pulse 1.2s infinite ease-in-out;
}
@keyframes rag-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Typing dots */
.typing {
  display: inline-flex; gap: 4px; align-items: center; padding: 0.4rem 0.6rem;
}
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--zw-fog);
  animation: typing-bounce 1s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* ── Sources card ───────────────────────────────────────────────── */
.source-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.source-item {
  background: var(--zw-pearl);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--zw-red);
  color: var(--zw-charcoal);
}
.source-item .src-title { font-weight: 600; color: var(--zw-ink); display: block; margin-bottom: 0.15rem; }
.source-item .src-url { color: var(--zw-stone); font-size: 0.7rem; font-family: ui-monospace, monospace; }

/* ── Score card (Demo 1 coach mode) ─────────────────────────────── */
.score-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
.score-row {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.score-bar {
  height: 6px;
  background: var(--zw-pearl);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.score-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--zw-red), var(--zw-gold));
  transition: width 0.6s ease;
}
.score-val { font-weight: 700; color: var(--zw-ink); text-align: right; font-variant-numeric: tabular-nums; }
.score-overall {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 500;
  color: var(--zw-red);
  line-height: 1;
}

/* ── Demo 2 — section card ──────────────────────────────────────── */
.section-card {
  background: white;
  border: 1px solid var(--zw-line);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
}
.section-card h4 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  color: var(--zw-ink);
  display: flex; align-items: center; gap: 0.5rem;
}

/* ── Demo 3 — variant cards ─────────────────────────────────────── */
.red-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--zw-line);
  display: flex; flex-direction: column;
}
.red-cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--zw-red-tint) 0%, var(--zw-pearl) 100%);
  padding: 1rem;
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
}
.red-cover .glyph {
  font-size: 4rem;
  align-self: center;
  margin-top: 1.2rem;
}
.red-cover .audience-pill {
  align-self: flex-start;
  font-size: 0.65rem;
  background: var(--zw-ink);
  color: white;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.red-cover .cover-caption {
  font-size: 0.7rem;
  color: var(--zw-stone);
  border-top: 1px dashed var(--zw-line);
  padding-top: 0.4rem;
}
.red-body {
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.red-headline {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.red-text {
  font-size: 0.78rem;
  color: var(--zw-charcoal);
  line-height: 1.55;
  white-space: pre-wrap;
}
.red-hashtags {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  margin-top: 0.25rem;
}
.red-hashtag {
  font-size: 0.7rem;
  color: var(--zw-red-dark);
  background: var(--zw-red-tint);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Amazon listing card */
.amazon-card {
  background: white;
  border: 1px solid #FF9900;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.amazon-card .amz-brand {
  font-size: 0.75rem;
  color: #FF9900;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.amazon-card .amz-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  color: #0F1111;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
.amazon-card ul.bullets {
  padding-left: 1.2rem;
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: #0F1111;
}
.amazon-card ul.bullets li { margin-bottom: 0.35rem; line-height: 1.45; }
.amazon-card ul.bullets li strong { color: #0F1111; }
.amazon-card .amz-keywords {
  font-size: 0.72rem;
  color: var(--zw-stone);
  font-family: ui-monospace, monospace;
  word-break: break-word;
}

/* ── Utility ────────────────────────────────────────────────────── */
.fade-in { animation: fade-in 0.4s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.skeleton {
  background: linear-gradient(90deg, var(--zw-pearl) 0%, white 50%, var(--zw-pearl) 100%);
  background-size: 200% 100%;
  animation: skel 1.4s infinite linear;
}
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Mobile responsive guard */
@media (max-width: 720px) {
  .phone-frame { width: 100%; height: 92vh; border-radius: 0; padding: 0; box-shadow: none; }
  .phone-frame::before { display: none; }
  .phone-screen { border-radius: 0; }
}
