/* Scoped demo page styling.
   IMPORTANT: Do not override global :root or body. We inherit theme tokens from base.html.
*/

.demo-page {
  /* full-bleed breakout - simplified approach */
  width: 100%;
  max-width: 100%;
  position: relative;
  overflow-x: hidden;

  /* demo-scoped tokens */
  --demo-surface: var(--bg-white);
  --demo-surface-muted: var(--bg-gray);
  --demo-bg: var(--bg-light);
  --demo-text: var(--text-dark);
  --demo-text-muted: var(--text-light);
  --demo-border: var(--border-color);
  --demo-shadow: 0 10px 30px var(--shadow);
  --demo-shadow-soft: 0 8px 24px var(--shadow-light);

  color: var(--demo-text);
}

.demo-page a { text-decoration: none; }
.demo-page a:hover { text-decoration: none; }

/* Ensure all containers have consistent max-width and padding */
.demo-page .container {
  max-width: 1400px;
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.demo-section {
  padding: clamp(3rem, 5vw, 5.5rem) 2rem;
  background: transparent;
}

.demo-section > .container,
.demo-section > * {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.demo-section-muted {
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.06), rgba(var(--primary-rgb), 0));
}

.demo-section-header {
  text-align: center;
  max-width: 920px;
  margin: 0 auto 2.25rem;
  padding: 0 1rem;
  width: 100%;
}

.demo-section-title {
  font-weight: 900;
  line-height: 1.15;
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--demo-text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.demo-section-subtitle {
  margin: 0;
  font-size: 1.1rem;
  color: var(--demo-text-muted);
}

/* Hero */
.demo-hero {
  padding: clamp(3.5rem, 6vw, 6.5rem) 0;
  background:
    radial-gradient(800px 400px at 20% 10%, rgba(var(--primary-rgb), 0.28), transparent 60%),
    radial-gradient(700px 400px at 80% 30%, rgba(129, 164, 253, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0));
}

.demo-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  overflow: hidden;
}

@media (width <= 992px) {
  .demo-hero-grid { grid-template-columns: 1fr; }
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.10);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  color: var(--demo-text);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.demo-hero-title {
  font-weight: 950;
  letter-spacing: -0.03em;
  line-height: 1.03;
  font-size: clamp(2.25rem, 5vw, 4.1rem);
  margin: 0 0 1rem;
  word-break: break-word;
}

.demo-hero-title-break {
  display: inline;
}

.demo-hero-emphasis {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.demo-hero-subtitle {
  font-size: 1.15rem;
  color: var(--demo-text-muted);
  max-width: 56ch;
  margin: 0 0 1.25rem;
}

.demo-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}

.demo-cta-primary,
.demo-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@media (width <= 768px) {
  .demo-trust { grid-template-columns: 1fr; }
}

.demo-trust-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 0.9rem;
  padding: 0.85rem 0.9rem;
  color: var(--demo-text);
  font-weight: 650;
}

.demo-trust-item i {
  color: var(--success);
  margin-right: 0.35rem;
}

.demo-audience {
  margin-top: 0.25rem;
}

.demo-audience-label {
  font-size: 0.9rem;
  color: var(--demo-text-muted);
  margin-bottom: 0.5rem;
}

.demo-audience-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb), 0.20);
  background: rgba(var(--primary-rgb), 0.06);
}

.demo-audience-btn {
  border: 0;
  background: transparent;
  color: var(--demo-text);
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.92rem;
  transition: background 0.15s ease, transform 0.15s ease;
}

.demo-audience-btn:hover { background: rgba(var(--primary-rgb), 0.10); }

.demo-audience-btn.is-active {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.24), rgba(129, 164, 253, 0.18));
  border: 1px solid rgba(var(--primary-rgb), 0.25);
}

/* Browser + preview surfaces */
.demo-browser {
  border-radius: 1.1rem;
  overflow: hidden;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: var(--demo-surface);
  box-shadow: var(--demo-shadow);
}

.demo-browser-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.10), rgba(var(--primary-rgb), 0.04));
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
}

.demo-browser-dots { display: inline-flex; gap: 0.4rem; }
.demo-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.demo-dot-red { background: #ff5f56; }
.demo-dot-yellow { background: #ffbd2e; }
.demo-dot-green { background: #27c93f; }

.demo-browser-url {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--demo-text-muted);
  font-weight: 650;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-browser-body {
  padding: 1.25rem;
  background: rgba(var(--primary-rgb), 0.03);
}

.demo-browser-body--image {
  padding: 0;
  background: transparent;
}

.demo-browser-body--carousel {
  padding: 0;
  background: transparent;
}

.demo-product-image {
  width: 100%;
  height: auto;
  display: block;
}

.demo-carousel {
  display: flex;
  flex-direction: column;
}

.demo-carousel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 0.95rem;
  background: rgba(var(--primary-rgb), 0.03);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
}

.demo-carousel-tab {
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--demo-text);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-weight: 850;
  font-size: 0.88rem;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.demo-carousel-tab:hover {
  background: rgba(var(--primary-rgb), 0.10);
  transform: translateY(-1px);
}

.demo-carousel-tab.is-active {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(129, 164, 253, 0.12));
  border-color: rgba(var(--primary-rgb), 0.30);
}

.demo-carousel-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: rgba(var(--primary-rgb), 0.02);
  overflow: hidden;
}

@media (width <= 992px) {
  .demo-carousel-stage { aspect-ratio: 4 / 3; }
}

.demo-carousel-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  background: var(--demo-surface);
}

.demo-carousel-frame.is-active {
  display: block;
}

.demo-visual-caption {
  margin-top: 0.85rem;
  color: var(--demo-text-muted);
  font-size: 0.95rem;
}

/* Comparison cards */
.demo-compare {
  height: 100%;
  border-radius: 1.1rem;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: var(--demo-surface);
  box-shadow: var(--demo-shadow-soft);
  padding: 1.35rem;
}

.demo-compare-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.demo-compare-title {
  margin: 0;
  font-weight: 900;
  font-size: 1.3rem;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.demo-badge-old {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.22);
}

.demo-badge-new {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.22);
}

.demo-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  color: var(--demo-text);
}

.demo-list li {
  position: relative;
  padding-left: 1.6rem;
  margin: 0.6rem 0;
  color: var(--demo-text);
}

.demo-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 900;
}

.demo-list-tight li { margin: 0.45rem 0; }

.demo-callout {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-radius: 1.1rem;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: rgba(var(--primary-rgb), 0.06);
  padding: 1.15rem 1.25rem;
}

.demo-callout-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-rgb), 0.16);
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  color: var(--demo-text);
}

.demo-callout-title {
  font-weight: 900;
  margin-bottom: 0.25rem;
}

.demo-callout-text { color: var(--demo-text-muted); }

/* Walkthrough */
.demo-walkthrough {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (width <= 992px) {
  .demo-walkthrough { grid-template-columns: 1fr; }
}

.demo-steps {
  display: grid;
  gap: 0.55rem;
}

.demo-step {
  width: 100%;
  text-align: left;
  border-radius: 0.95rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: var(--demo-surface);
  box-shadow: 0 6px 18px var(--shadow-light);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--demo-text);
  font-weight: 850;
  transition: transform 0.15s ease, background 0.15s ease;
}

.demo-step:hover { transform: translateY(-1px); }

.demo-step.is-active {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.16), rgba(129, 164, 253, 0.10));
  border-color: rgba(var(--primary-rgb), 0.28);
}

.demo-step-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.20);
  font-weight: 950;
}

.demo-step-text { display: inline-block; }

.demo-preview-caption {
  margin-top: 0.9rem;
  color: var(--demo-text-muted);
  font-size: 1rem;
}

/* Preview panel widgets */
.demo-panel {
  border-radius: 1.0rem;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  background: var(--demo-surface);
  padding: 1.1rem;
}

.demo-panel-title {
  font-weight: 950;
  font-size: 1.2rem;
  margin: 0;
}

.demo-panel-sub {
  margin: 0.25rem 0 1rem;
  color: var(--demo-text-muted);
}

.demo-field {
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  background: rgba(var(--primary-rgb), 0.04);
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.75rem;
}

.demo-field-label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 850;
  color: var(--demo-text-muted);
  margin-bottom: 0.25rem;
}

.demo-field-value { font-weight: 800; }

.demo-panel-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  background: rgba(var(--primary-rgb), 0.05);
  font-weight: 750;
  font-size: 0.85rem;
}

.demo-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (width <= 576px) {
  .demo-split { grid-template-columns: 1fr; }
}

.demo-seq { display: grid; gap: 0.7rem; }

.demo-seq-item {
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  background: rgba(var(--primary-rgb), 0.03);
  padding: 0.85rem;
}

.demo-seq-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.demo-seq-badge {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  font-weight: 900;
  font-size: 0.75rem;
}

.demo-seq-subject { font-weight: 900; }
.demo-seq-body { color: var(--demo-text-muted); }

.demo-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0;
}

@media (width <= 576px) {
  .demo-kpis { grid-template-columns: 1fr; }
}

.demo-kpi {
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  background: rgba(var(--primary-rgb), 0.04);
  padding: 0.75rem 0.85rem;
}

.demo-kpi-num {
  font-weight: 950;
  font-size: 1.05rem;
}

.demo-kpi-label { color: var(--demo-text-muted); font-weight: 650; }

.demo-activity {
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  background: rgba(var(--primary-rgb), 0.02);
  padding: 0.85rem;
}

.demo-activity-title { font-weight: 900; margin-bottom: 0.5rem; }

.demo-activity-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0;
  color: var(--demo-text);
}

.demo-activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.demo-insights { display: grid; gap: 0.75rem; }

.demo-insight {
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  background: rgba(var(--primary-rgb), 0.03);
  padding: 0.85rem;
}

.demo-insight-title { font-weight: 900; }
.demo-insight-text { color: var(--demo-text-muted); }

/* AI section */
.demo-surface {
  border-radius: 1.1rem;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: var(--demo-surface);
  box-shadow: var(--demo-shadow-soft);
  padding: 1.25rem;
  height: 100%;
}

.demo-surface-title {
  font-weight: 950;
  margin-bottom: 0.9rem;
}

.demo-form-group { margin-bottom: 0.9rem; }

.demo-label {
  display: block;
  font-weight: 850;
  font-size: 0.9rem;
  color: var(--demo-text);
  margin-bottom: 0.35rem;
}

.demo-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 0.9rem;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  background: rgba(var(--primary-rgb), 0.04);
  padding: 0.85rem 0.9rem;
  color: var(--demo-text);
}

.demo-textarea {
  min-height: 130px;
  resize: vertical;
}

.demo-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.demo-note {
  margin-top: 0.85rem;
  color: var(--demo-text-muted);
  font-size: 0.92rem;
}

.demo-ai {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.demo-ai-placeholder {
  text-align: center;
  padding: 1.5rem 1rem;
}

.demo-ai-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-rgb), 0.14);
  border: 1px solid rgba(var(--primary-rgb), 0.20);
  margin: 0 auto 0.75rem;
}

.demo-ai-title { font-weight: 950; }
.demo-ai-sub { color: var(--demo-text-muted); margin-top: 0.25rem; }

.demo-ai-loading {
  border-radius: 1rem;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  background: rgba(var(--primary-rgb), 0.05);
  padding: 1rem;
  text-align: center;
}

.demo-ai-loading-icon {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.demo-ai-loading-title { font-weight: 950; }
.demo-ai-loading-sub { color: var(--demo-text-muted); }

.demo-ai-card {
  border-radius: 1rem;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  background: rgba(var(--primary-rgb), 0.02);
  padding: 1rem;
}

.demo-ai-card-title {
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.demo-ai-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--demo-text);
}

.demo-ai-success {
  border-radius: 1rem;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.08);
  padding: 1rem;
}

.demo-ai-success-title {
  font-weight: 950;
  margin-bottom: 0.75rem;
}

.demo-ai-success-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.9rem;
  color: var(--demo-text);
  font-weight: 650;
}

@media (width <= 576px) {
  .demo-ai-success-grid { grid-template-columns: 1fr; }
}

.demo-ai-success-cta {
  margin-top: 0.85rem;
}

/* Advantages */
.demo-adv {
  border-radius: 1.1rem;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: var(--demo-surface);
  box-shadow: var(--demo-shadow-soft);
  padding: 1.5rem;
  height: 100%;
}

.demo-adv-title { font-weight: 950; margin: 0 0 0.4rem; }
.demo-adv-text { color: var(--demo-text-muted); margin: 0 0 0.7rem; }

.demo-adv-wide {
  margin-top: 2rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.10), rgba(129, 164, 253, 0.06));
  box-shadow: var(--demo-shadow-soft);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (width <= 768px) {
  .demo-adv-wide { flex-direction: column; align-items: flex-start; }
}

.demo-adv-wide-title { font-weight: 950; }
.demo-adv-wide-text { color: var(--demo-text-muted); }

/* Accordion tweaks */
.demo-accordion .accordion-item {
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--demo-surface);
  box-shadow: 0 8px 20px var(--shadow-light);
  margin-bottom: 0.75rem;
}

.demo-accordion .accordion-button {
  font-weight: 900;
  background: transparent;
  color: var(--demo-text);
}

.demo-accordion .accordion-body { color: var(--demo-text-muted); }

/* Final CTA */
.demo-final {
  padding: clamp(3rem, 5vw, 5rem) 0;
  background:
    radial-gradient(900px 400px at 50% 10%, rgba(var(--primary-rgb), 0.22), transparent 65%),
    linear-gradient(180deg, rgba(var(--primary-rgb), 0.05), transparent);
}

.demo-final-card {
  border-radius: 1.25rem;
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  background: var(--demo-surface);
  box-shadow: var(--demo-shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.demo-final-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.10);
  border: 1px solid rgba(var(--primary-rgb), 0.20);
  font-weight: 900;
  margin-bottom: 0.9rem;
}

.demo-final-title { font-weight: 950; margin: 0 0 0.6rem; }
.demo-final-subtitle { color: var(--demo-text-muted); margin: 0 auto 1.1rem; max-width: 60ch; }

.demo-final-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.demo-final-fineprint {
  margin-top: 1rem;
  color: var(--demo-text-muted);
  font-size: 0.9rem;
}

/* Theme-specific refinements */
[data-theme='dark'] .demo-trust-item,
[data-theme='dark'] .demo-browser-url {
  background: rgba(255, 255, 255, 0.03);
}

/* Light mode: better card shadows and section depth */
[data-theme='light'] .demo-adv {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme='light'] .demo-adv:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
}

[data-theme='light'] .demo-section-muted {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

[data-theme='light'] .demo-adv-wide {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme='high-contrast'] .demo-hero,
[data-theme='high-contrast'] .demo-final,
[data-theme='high-contrast'] .demo-section-muted {
  background: transparent !important;
}

[data-theme='high-contrast'] .demo-browser,
[data-theme='high-contrast'] .demo-compare,
[data-theme='high-contrast'] .demo-surface,
[data-theme='high-contrast'] .demo-adv,
[data-theme='high-contrast'] .demo-final-card {
  box-shadow: none !important;
  border-width: 2px !important;
}

[data-theme='high-contrast'] .demo-badge-old,
[data-theme='high-contrast'] .demo-badge-new {
  background: transparent !important;
  color: var(--text-dark) !important;
  border-color: var(--border-color) !important;
}

/* ===== Demo Hero Video ===== */
.demo-browser-body--video {
  padding: 0;
  background: #000;
}

.demo-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1912 / 908;
}

.demo-video-container video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
  border-radius: 0 0 12px 12px;
}

/* Video uses native controls only — no custom overlay */

/* ===== Mobile Overflow Protection ===== */
.demo-walkthrough,
.demo-hero-grid,
.demo-split,
.demo-section-header,
.demo-compare,
.demo-surface,
.demo-browser {
  max-width: 100%;
  box-sizing: border-box;
}

.demo-steps {
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== Tablet/Large Phone Breakpoint ===== */
@media (width <= 768px) {
  .demo-hero-grid {
    padding: 0 1.25rem;
    gap: 2rem;
  }

  .demo-walkthrough {
    padding: 0 1rem;
  }

  .demo-split {
    padding: 0 1rem;
  }

  .demo-section {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* ===== Small Mobile Breakpoint ===== */
@media (width <= 480px) {
  /* Reduce section padding */
  .demo-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Reduce hero grid padding */
  .demo-hero-grid {
    padding: 0 1rem;
    gap: 1.5rem;
  }

  /* Reduce walkthrough padding */
  .demo-walkthrough {
    padding: 0 0.75rem;
    gap: 1rem;
  }

  /* Reduce split layout padding */
  .demo-split {
    padding: 0 1rem;
    gap: 1rem;
  }

  /* Smaller container padding */
  .demo-page .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Smaller title font for small screens */
  .demo-section-title {
    font-size: clamp(1.5rem, 6vw, 1.75rem);
  }

  /* Ensure demo-steps stays within bounds */
  .demo-steps {
    max-width: 100%;
  }

  /* Reduce comparison card padding */
  .demo-compare {
    padding: 1rem;
  }

  /* Reduce surface padding */
  .demo-surface {
    padding: 1rem;
  }

  /* Smaller buttons */
  .demo-hero-cta .btn-lg {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  /* Reduce final card padding */
  .demo-final-card {
    padding: 1rem;
  }

  /* Audience switch compact */
  .demo-audience-switch {
    padding: 0.25rem;
  }

  .demo-audience-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
}

/* ===== Extra-Small Mobile Breakpoint (400px) ===== */
@media (width <= 400px) {
  /* Override global padding to prevent accumulation */
  .demo-page .container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .demo-section {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .demo-hero-grid {
    padding: 0 0.5rem;
    gap: 1rem;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Prevent grid/flex children from expanding beyond container */
  .demo-hero-grid > * {
    min-width: 0;
    max-width: 100%;
  }

  .demo-hero-copy {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .demo-walkthrough {
    padding: 0 0.5rem;
    grid-template-columns: 1fr;
  }

  .demo-split {
    padding: 0 0.5rem;
  }

  .demo-section-header {
    padding: 0 0.25rem;
  }

  /* Typography scaling */
  .demo-hero-title {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .demo-section-title {
    font-size: clamp(1.35rem, 5.5vw, 1.5rem);
  }

  /* Audience switch: wrap and center */
  .demo-audience-switch {
    flex-wrap: wrap;
    justify-content: center;
  }

  .demo-audience-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }

  /* CTA buttons: stack vertically */
  .demo-hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .demo-hero-cta .btn-lg {
    width: 100%;
    justify-content: center;
  }

  /* Trust items: compact */
  .demo-trust-item {
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
  }

  /* Browser preview: contain */
  .demo-browser {
    max-width: 100%;
  }

  .demo-browser-url {
    font-size: 0.75rem;
  }

  /* Final CTA: stack */
  .demo-final-card {
    padding: 0.75rem;
  }

  .demo-final-cta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .demo-final-cta .btn-lg {
    width: 100%;
  }

  /* Form input mobile sizing */
  .demo-input {
    padding: 0.65rem 0.7rem;
    font-size: 0.9rem;
  }

  .demo-textarea {
    min-height: 100px;
  }

  .demo-generate {
    padding: 0.65rem 0.7rem;
    font-size: 0.9rem;
  }

  /* Overflow protection */
  .demo-surface {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Reduce Bootstrap row gap */
  #ai-generator .row.g-4 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }
}

/* ===== Ultra-Small Mobile Breakpoint (360px - iPhone SE, etc.) ===== */
@media (width <= 360px) {
  .demo-page .container {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }

  .demo-hero-grid {
    padding: 0 0.25rem;
    gap: 0.75rem;
  }

  /* Prevent child elements from causing overflow */
  .demo-hero-copy,
  .demo-hero-preview {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .demo-hero-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .demo-section {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .demo-section-header {
    padding: 0 0.125rem;
  }

  .demo-walkthrough {
    padding: 0 0.25rem;
  }

  .demo-split {
    padding: 0 0.25rem;
  }

  /* Smaller typography */
  .demo-hero-title {
    font-size: clamp(1.5rem, 7vw, 1.75rem);
  }

  .demo-section-title {
    font-size: clamp(1.25rem, 5vw, 1.35rem);
  }

  /* More compact trust items */
  .demo-trust-item {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  /* Compact audience buttons */
  .demo-audience-btn {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
  }

  .demo-audience-switch {
    padding: 0.2rem;
  }

  /* Smaller CTA buttons */
  .demo-hero-cta .btn-lg {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Smaller browser URL */
  .demo-browser-url {
    font-size: 0.7rem;
  }

  /* Compact final card */
  .demo-final-card {
    padding: 0.5rem;
  }
}

/* ===== Extra-Narrow Mobile Breakpoint (320px - Galaxy Fold, etc.) ===== */
@media (width <= 320px) {
  .demo-page .container {
    padding-left: 0.125rem !important;
    padding-right: 0.125rem !important;
  }

  .demo-hero-grid {
    padding: 0 !important;
    gap: 0.5rem;
  }

  .demo-hero-grid > * {
    max-width: 100%;
    min-width: 0;
  }

  .demo-hero-copy {
    padding: 0 0.25rem;
  }

  .demo-hero-title {
    font-size: clamp(1.25rem, 6vw, 1.5rem);
  }

  .demo-section {
    padding-left: 0.125rem;
    padding-right: 0.125rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .demo-page * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}













