/* ========================================
   Dify × AISPEECH · Nordic Minimalist Theme (Advanced)
   ======================================== */

:root {
  /* Brand Colors */
  --dify-blue: #0033ff;
  --dify-blue-light: rgba(0, 51, 255, 0.08);
  --dify-blue-medium: rgba(0, 51, 255, 0.15);
  --dify-gradient: linear-gradient(135deg, #0033ff 0%, #4f46e5 100%);
  --dify-blue-gradient: var(--dify-gradient);

  /* Editorial Palette */
  --paper: #f6f1e8;
  --paper-2: #fbf8f2;
  --ink: #0b0b0b;
  --muted: rgba(11, 11, 11, 0.62);
  --line: rgba(11, 11, 11, 0.10);

  /* Nordic Neutrals */
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  /* Accents */
  --green: #10b981;
  --orange: #f97316;
  --red: #ef4444;
  --purple: #8b5cf6;

  /* Typography - Larger for Presentation */
  --font-sans: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.75rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows & Glass */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: 1px solid rgba(255, 255, 255, 0.6);
  --glass-blur: blur(12px);
}

/* ========== Base Reset ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(0, 0, 0, 0.03) 0%, transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(0, 0, 0, 0.02) 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ========== Reveal.js Overrides - Larger Fonts ========== */
.reveal {
  font-family: var(--font-sans);
  font-size: 26px;
  color: var(--ink);
}

/* Center + safe area (avoid logo/lang overlay) */
.reveal .slides > section,
.reveal .slides > section > section {
  height: 100%;
  box-sizing: border-box;
  padding: 80px 0 60px;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1rem;
  line-height: 1.1;
}

.reveal h1 {
  font-family: var(--font-sans);
  font-size: clamp(2.6em, 4.8vw, 3.35em);
  letter-spacing: -0.05em;
  font-weight: 800;
}
.reveal h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.7em, 3.1vw, 2.15em);
  letter-spacing: -0.04em;
  font-weight: 800;
}
.reveal h3 { font-size: clamp(1.12em, 2.2vw, 1.28em); font-weight: 650; color: rgba(11,11,11,0.88); }
.reveal h4 { font-size: 1.2em; font-weight: 600; color: var(--gray-700); } /* ~38px */

.reveal p { line-height: 1.55; margin-bottom: 1rem; color: var(--muted); }
.reveal strong { font-weight: 700; color: var(--ink); }
.reveal ul, .reveal ol { margin: 1rem 0; }
.reveal li { margin-bottom: 0.42em; }

.reveal .slides section * { max-width: 100%; }

.reveal code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.1em 0.3em;
  border-radius: 0.2em;
  color: #d946ef;
}

.reveal pre {
  width: 100%;
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
}

.reveal pre code {
  padding: var(--space-md);
  font-size: 0.7em;
  line-height: 1.6;
  border-radius: var(--radius-lg);
  background: #1e1e1e; /* Darker bg for contrast */
}

/* ========== Advanced Components ========== */

/* Diffused Background Shapes */
#bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#bg-shapes .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.60;
  transform: translate3d(0, 0, 0);
}

#bg-shapes .s1 {
  background: radial-gradient(circle, rgba(196, 216, 255, 0.65) 0%, rgba(196, 216, 255, 0) 70%);
  width: 60vw;
  height: 60vw;
  top: -28%;
  left: -18%;
  animation: float 18s infinite ease-in-out;
}

#bg-shapes .s2 {
  background: radial-gradient(circle, rgba(153, 187, 255, 0.50) 0%, rgba(153, 187, 255, 0) 70%);
  width: 55vw;
  height: 55vw;
  bottom: -24%;
  right: -18%;
  animation: float 22s infinite ease-in-out reverse;
}

#bg-shapes .s3 {
  background: radial-gradient(circle, rgba(162, 222, 255, 0.45) 0%, rgba(255, 255, 255, 0) 70%);
  width: 44vw;
  height: 44vw;
  top: 32%;
  left: 26%;
  filter: blur(85px);
  opacity: 0.35;
  animation: pulse 10s infinite;
}

#bg-shapes .s4 {
  background: radial-gradient(circle, rgba(210, 239, 255, 0.48) 0%, rgba(255, 255, 255, 0) 70%);
  width: 38vw;
  height: 38vw;
  top: 58%;
  left: -12%;
  filter: blur(90px);
  opacity: 0.32;
  animation: pulse 12s infinite reverse;
}

@keyframes float {
  0% { transform: translate(0, 0); }
  50% { transform: translate(44px, 62px); }
  100% { transform: translate(0, 0); }
}

@keyframes pulse {
  0% { transform: scale(0.98); opacity: 0.28; }
  50% { transform: scale(1.05); opacity: 0.42; }
  100% { transform: scale(0.98); opacity: 0.28; }
}

/* Keep slides above shapes */
.reveal { position: relative; z-index: 2; }

/* Fixed Logo */
.deck-logo {
  position: fixed;
  top: 26px;
  left: 28px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.deck-logo img { height: 22px; width: auto; opacity: 0.95; }
.deck-logo span {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(11,11,11,0.85);
  letter-spacing: -0.02em;
}

.lang-switch {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: rgba(11,11,11,0.72);
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
.lang-switch a {
  color: rgba(11,11,11,0.72);
  font-weight: 600;
  text-decoration: none;
}
.lang-switch a.active {
  color: rgba(11,11,11,0.92);
}
.lang-switch span { color: rgba(11,11,11,0.45); }

/* Meta Hint */
.slide-meta {
  position: fixed;
  bottom: 22px;
  left: 28px;
  z-index: 100;
  font-size: 0.8rem;
  color: rgba(11,11,11,0.52);
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  font-weight: 500;
}

/* Card System - Glassmorphism */
.card {
  width: min(94vw, 1860px);
  margin: 0 auto;
  padding: 38px 48px;
  text-align: left;
  position: relative;
  isolation: isolate;
}

.card > * { position: relative; z-index: 1; }

/* Ghost number (Ive-ish tension, ultra subtle) */
.ghost-num {
  position: absolute;
  top: 6px;
  right: 14px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 6.2rem;
  letter-spacing: -0.06em;
  color: rgba(2, 6, 23, 0.06);
  user-select: none;
  pointer-events: none;
  z-index: 0;
  line-height: 1;
}

.card-ghost {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 30px 32px;
  box-shadow: 0 14px 44px rgba(11, 11, 11, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(11, 11, 11, 0.10);
  border-color: rgba(11, 11, 11, 0.14);
}

.card-ghost h3 {
  font-size: 1.2em;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-ghost h3 i { 
  background: var(--dify-blue-light);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.8em;
  color: var(--dify-blue); 
}

/* Stack Label */
.stack-label {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(90deg, var(--dify-blue-light), transparent);
  color: var(--dify-blue);
  border-left: 3px solid var(--dify-blue);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: var(--radius-md);
  font-size: 0.85em;
  font-weight: 600;
  border: 1px solid transparent;
}

/* Badge - Ghost (for dark hero) */
.badge--ghost {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  gap: 10px;
}

/* Grids */
.grid-2, .grid-3, .grid-4, .grid-5 {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Flow Diagram (Advanced) */
.flow {
  counter-reset: flowstep;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: var(--space-lg) 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(2, 6, 23, 0.06);
  box-shadow: 0 12px 34px rgba(2, 6, 23, 0.06);
}

.flow--compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 14px;
  gap: 12px;
}

.flow-step {
  min-width: 0;
  background: rgba(255,255,255,0.84);
  border: 1px solid rgba(2, 6, 23, 0.08);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  text-align: left;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.05);
  position: relative;
  z-index: 1;
}

.flow-step::before {
  counter-increment: flowstep;
  content: counter(flowstep);
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.82rem;
  color: rgba(2, 6, 23, 0.70);
  background: rgba(2, 6, 23, 0.06);
  border: 1px solid rgba(2, 6, 23, 0.06);
}

.flow-step h4 {
  font-size: 0.95em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-800);
}
.flow-step h4 i {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 51, 255, 0.10);
  border: 1px solid rgba(0, 51, 255, 0.14);
  color: var(--dify-blue);
  font-size: 0.95em;
}
.flow-step p { font-size: 0.7em; color: var(--gray-500); margin: 0; }

.flow-arrow {
  display: none;
}

@media (max-width: 1280px) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Node Grid (Advanced) */
.node-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.node-box {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: all 0.3s;
}

.node-box:hover {
  transform: translateY(-2px);
  border-color: var(--dify-blue);
}

.node-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--gray-900);
}

.node-title .icon {
  width: 48px;
  height: 48px;
  background: var(--dify-blue-gradient, linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%));
  color: var(--dify-blue);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}

/* Table (Advanced) */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.9em;
}
.table th, .table td { padding: 16px 24px; border-bottom: 1px solid var(--gray-100); }
.table thead th { background: var(--gray-50); font-weight: 700; color: var(--gray-600); text-transform: uppercase; font-size: 0.8em; letter-spacing: 0.05em; }
.table tbody tr:hover { background: #f8fafc; }

/* Lists (Advanced) */
.reveal ul.list-dot {
  list-style: none;
  padding-left: 0;
}

.reveal ul.list-dot li {
  list-style: none;
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
}

.reveal ul.list-dot li::marker {
  content: '';
}

.reveal ul.list-dot li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--dify-blue);
  box-shadow: 0 0 0 4px var(--dify-blue-light);
  border-radius: 99px;
}

.reveal ul.list-dot--compact li { margin-bottom: 10px; }

/* Hero Section */
.hero {
  padding: var(--space-2xl);
  text-align: center;
}
.hero h1 {
  font-size: 4em;
  background: linear-gradient(to right, #fff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Hero variants */
.hero--dark { color: rgba(255, 255, 255, 0.9); }
.hero--dark p { color: rgba(255, 255, 255, 0.82); }
.hero--dark h2 { color: #fff; }

.footer-note {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 12px;
}
.footer-note--hero { color: rgba(255, 255, 255, 0.58); }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.stat-item {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-xl);
  padding: 18px 18px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stat-item .number {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dify-blue);
  line-height: 1.1;
}

.stat-item .label {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 6px;
  font-weight: 600;
}

.stats-row--hero .stat-item {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.stats-row--hero .stat-item .number { color: #fff; }
.stats-row--hero .stat-item .label { color: rgba(255,255,255,0.72); }

/* Segment / Callout */
.segment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  margin-top: 14px;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, rgba(0, 51, 255, 0.08), rgba(255,255,255,0.0));
  border: 1px solid rgba(0, 51, 255, 0.14);
  color: var(--gray-800);
  font-weight: 600;
}

.segment i { color: var(--dify-blue); }

.segment--strong {
  background: linear-gradient(135deg, rgba(0, 51, 255, 0.12), rgba(79, 70, 229, 0.08));
  border-color: rgba(0, 51, 255, 0.22);
}

/* Pill */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
}

.pill--blue {
  background: rgba(0, 51, 255, 0.09);
  border-color: rgba(0, 51, 255, 0.18);
  color: #0f172a;
}

.pill--dark {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
}

/* Footnote / Mini note */
.footnote {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.mini-note {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--gray-700);
  line-height: 1.45;
}

.mini-note strong { color: var(--dify-blue); }

/* Big metrics (relaxed, wide cards) */
.big-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.big-metric {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(2, 6, 23, 0.06);
  border-radius: var(--radius-xl);
  padding: 28px 28px;
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.06);
}

.big-val {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 2.6rem;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

.big-lab {
  margin-top: 10px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.big-sub {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--gray-600);
}

/* Metrics - General (White Background) */
.metric {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.metric .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: var(--space-xs);
}
.metric .value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dify-blue);
  line-height: 1.1;
}
.metric .desc {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-600);
  margin-top: var(--space-xs);
}

/* Community Grid */
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.community-card {
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-xl);
  padding: 24px 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.community-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
}

.community-label {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--gray-500);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.community-label i {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.04);
  color: var(--dify-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.community-value {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 16px 0 6px;
}

.community-subtext {
  font-size: 0.92rem;
  color: var(--gray-600);
  font-weight: 600;
}

/* Metrics - Hero Context (Dark Background) */
.hero .metric {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: none;
}
.hero .metric .value { color: white; text-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.hero .metric .label { color: rgba(255,255,255,0.7); }
.hero .metric .desc { color: rgba(255,255,255,0.6); }

/* ========== New Slide Components ========== */

/* Tension layout */
.tension-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-lg);
  align-items: stretch;
  margin-top: var(--space-lg);
}

.tension-left, .tension-right { min-height: 100%; }

/* Formula panel */
.formula-panel {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-xl);
  padding: 22px 22px;
  box-shadow: var(--shadow-md);
}

.formula-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dify-blue);
  margin-bottom: 10px;
}

.formula-big {
  font-size: 1.25em;
  font-weight: 700;
  color: var(--gray-900);
}

.formula-sub {
  margin-top: 10px;
  font-size: 0.98rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.formula-inline {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--gray-900);
  padding: 14px 14px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.02);
  max-width: 100%;
  overflow-x: auto;
}

.formula-inline--big { font-size: 1.15em; }

/* Math renderers (KaTeX / MathJax) overflow safety */
.formula-inline .katex-display,
.formula-big .katex-display {
  margin: 0.2em 0;
}
.formula-inline mjx-container,
.formula-big mjx-container,
.formula-inline .katex-display,
.formula-big .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-xl);
  padding: 16px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(0, 51, 255, 0.18) 0%, rgba(0,0,0,0) 70%);
}

.kpi-top { display: flex; justify-content: flex-start; }

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 51, 255, 0.10);
  border: 1px solid rgba(0, 51, 255, 0.18);
  color: var(--gray-800);
  font-size: 0.82rem;
  font-weight: 700;
}

.kpi-badge i { color: var(--dify-blue); }

.kpi-value {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 10px;
  color: var(--gray-900);
}

.kpi-label {
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--gray-600);
  font-weight: 600;
}

/* Scene cards list */
.scene-cards { display: grid; gap: 12px; margin-top: 14px; }

.scene-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
}

.scene-card i {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 51, 255, 0.10);
  color: var(--dify-blue);
  flex-shrink: 0;
}

.scene-title { font-weight: 800; color: var(--gray-900); font-size: 1.05rem; }
.scene-sub { margin-top: 4px; color: var(--gray-600); font-size: 0.92rem; }

/* Bar chart */
.bar-chart {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.bar-chart--mini { gap: 10px; margin-top: 12px; }

.bar-row {
  --p: 50;
  --c: var(--dify-blue);
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 12px;
  align-items: center;
}

.bar-label {
  font-size: 0.95rem;
  color: var(--gray-800);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-label i { color: var(--dify-blue); }

.bar-track {
  height: 14px;
  background: rgba(0,0,0,0.06);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}

.bar-fill {
  height: 100%;
  width: calc(var(--p) * 1%);
  background: linear-gradient(90deg, var(--c), rgba(255,255,255,0.0));
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0, 51, 255, 0.10);
}

.bar-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--gray-700);
  font-weight: 700;
}

/* Donut chart (legacy, no longer used in aispeech/index.html) */

/* KPI lines + spark */
.kpi-line {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "k v"
    "b b";
  row-gap: 12px;
  column-gap: 14px;
  padding: 18px 18px;
  border-radius: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(11, 11, 11, 0.06);
  min-width: 0;
}

.kpi-key {
  grid-area: k;
  font-weight: 800;
  color: rgba(11,11,11,0.90);
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.kpi-key { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-val {
  grid-area: v;
  font-family: var(--font-mono);
  font-weight: 900;
  color: rgba(11,11,11,0.92);
  font-size: 0.96rem;
  white-space: nowrap;
}

.kpi-spark {
  grid-area: b;
  height: 12px;
  border-radius: 999px;
  background: rgba(11, 11, 11, 0.10);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.kpi-spark::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(100%, calc(var(--p) * 1%));
  background: linear-gradient(90deg, rgba(0, 51, 255, 0.92), rgba(0, 51, 255, 0.18));
  border-radius: inherit;
}

.kpi-lines { display: grid; gap: 16px; margin-top: 16px; }
.kpi-lines--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Compare card */
.compare-card {
  margin-top: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: rgba(255,255,255,0.8);
}

.compare-head {
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(0, 51, 255, 0.12), rgba(255,255,255,0));
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.compare-body { padding: 18px; }

/* Loop diagram */
.loop-diagram {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.loop-diagram--stack { flex-wrap: nowrap; }

.loop-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.86);
  font-weight: 800;
  color: var(--gray-900);
  font-size: 0.95rem;
}

.loop-dot {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(0, 51, 255, 0.12);
  border: 1px solid rgba(0, 51, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dify-blue);
  font-weight: 900;
  font-family: var(--font-mono);
}

.loop-arrow { color: rgba(0,0,0,0.22); }

/* Code blocks */
.code-block pre {
  margin: 18px 0 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Architecture diagram */
.arch-diagram {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-xl);
  border: 1px dashed rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.72);
}

.arch-diagram--large { padding: 22px; }

.arch-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.arch-box {
  padding: 14px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  font-weight: 800;
  color: var(--gray-900);
  min-width: 140px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.arch-box.primary {
  background: linear-gradient(135deg, rgba(0, 51, 255, 0.14), rgba(79, 70, 229, 0.08));
  border-color: rgba(0, 51, 255, 0.20);
}

.arch-box.secondary {
  background: rgba(0,0,0,0.02);
  color: var(--gray-800);
}

.arch-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: rgba(0,0,0,0.28);
  font-weight: 900;
  min-width: 38px;
}

.arch-arrow--down { font-size: 1.8rem; }

/* Platform diagram */
.platform-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr 0.85fr;
  gap: var(--space-lg);
  align-items: stretch;
  margin-top: var(--space-lg);
}

.platform-col {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.platform-title {
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.platform-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.06);
  margin-top: 10px;
  font-weight: 700;
  color: var(--gray-800);
}

.platform-item i { color: var(--dify-blue); }

.platform-core {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.platform-core::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 51, 255, 0.12), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(79, 70, 229, 0.10), transparent 45%);
  pointer-events: none;
}

.platform-core-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 51, 255, 0.22);
  background: rgba(0, 51, 255, 0.10);
  font-weight: 900;
  color: var(--gray-900);
}

.platform-core-items {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.platform-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.85);
  font-weight: 800;
  color: var(--gray-900);
}

.platform-chip i { color: var(--dify-blue); }

/* ROI breakeven chart */
.breakeven {
  position: relative;
  height: 260px;
  margin-top: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.00));
  overflow: hidden;
}

.breakeven-axis {
  position: absolute;
  inset: 0;
  padding: 16px;
}

.axis-label {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--gray-700);
}

.axis-grid {
  position: absolute;
  inset: 16px;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  border-radius: var(--radius-lg);
}

.breakeven-lines { position: absolute; inset: 0; }

.line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 4px;
  border-radius: 999px;
  opacity: 0.9;
}

.line.cost {
  top: 62%;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.75), rgba(239, 68, 68, 0.15));
}

.line.benefit {
  top: 62%;
  transform-origin: left center;
  transform: rotate(-18deg);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.75), rgba(16, 185, 129, 0.10));
}

.breakeven-point {
  position: absolute;
  left: 58%;
  top: 46%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 10px 12px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.point-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dify-blue);
  box-shadow: 0 0 0 6px rgba(0, 51, 255, 0.12);
}

.point-label {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--gray-800);
}

/* Dark card for closing slide */
.card-ghost--dark {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  backdrop-filter: blur(12px);
}

.card-ghost--dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.18);
  border-color: rgba(255,255,255,0.32);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #bg-shapes .shape { animation: none !important; }
  .card-ghost:hover { transform: none; }
}

/* Timeline (Vertical) - actually horizontal in slides */
.timeline {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}
.timeline-item {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}
.timeline-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: var(--dify-blue);
}
.timeline-item h4 { color: var(--dify-blue); font-size: 1.2em; margin-bottom: 8px; }

/* Responsive */
@media (max-width: 1024px) {
  .reveal { font-size: 24px; }
  .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
  .tension-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .big-metrics { grid-template-columns: 1fr; }
  .community-grid { grid-template-columns: 1fr; }
}
