/* ============================================================
   Madison Reed QR POC — modern brand UI
   Original brand palette. Clean, geometric, contemporary.
   ============================================================ */

@font-face {
  font-family: "Averta MR";
  src: url("assets/averta-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Averta MR";
  src: url("assets/averta-bold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Original Madison Reed palette */
  --mr-logo-purple: #5a1947;
  --mr-purple:      #3a2d4a;
  --mr-purple-700:  #2c2238;
  --mr-purple-500:  #4a3a5e;
  --mr-purple-300:  #8b7c9e;
  --mr-muted-purple:#735e73;
  --mr-magenta:     #911885;
  --mr-magenta-600: #7b1471;
  --mr-magenta-400: #b53fab;
  --mr-magenta-100: #f5e1f1;
  --mr-magenta-050: #fbf3f9;
  --mr-dark-plum:   #53284f;

  --mr-ink:         #1f1827;
  --mr-text:        #2c2438;
  --mr-text-soft:   #5b4f6b;
  --mr-text-muted:  #8b7f95;

  --mr-canvas:      #fafafb;
  --mr-surface:     #ffffff;
  --mr-surface-2:   #f6f4f8;
  --mr-surface-3:   #ecebf0;

  --mr-border:      #e6e3eb;
  --mr-border-soft: #efedf2;
  --mr-border-strong:#d3cedb;

  --mr-pill: #ecebf0;
  --mr-border-light: var(--mr-border-soft);
  --mr-soft-surface: var(--mr-surface-2);
  --mr-muted-text: var(--mr-text-muted);
  --mr-white: var(--mr-surface);

  /* Status */
  --success: #1f8a5b;
  --success-bg: #e6f4ed;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadow — soft contemporary elevation */
  --shadow-xs: 0 1px 2px rgba(58, 45, 74, 0.06);
  --shadow-sm: 0 2px 4px rgba(58, 45, 74, 0.05),
               0 4px 12px rgba(58, 45, 74, 0.04);
  --shadow-md: 0 4px 8px rgba(58, 45, 74, 0.05),
               0 16px 32px -8px rgba(58, 45, 74, 0.10);
  --shadow-lg: 0 8px 16px rgba(58, 45, 74, 0.06),
               0 32px 64px -16px rgba(58, 45, 74, 0.18);
  --shadow-focus: 0 0 0 4px rgba(145, 24, 133, 0.18);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  --container: 1200px;

  --transition-fast: 160ms cubic-bezier(.2,.7,.2,1);
  --transition: 240ms cubic-bezier(.2,.7,.2,1);
  --transition-slow: 420ms cubic-bezier(.2,.7,.2,1);

  --font-display: "Averta MR", "Avenir Next", system-ui, sans-serif;
  --font-body:    "Averta MR", "Avenir Next", system-ui, sans-serif;
  --font-mono:    "SF Mono", "JetBrains Mono", Consolas, monospace;

  color-scheme: light;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--mr-canvas);
  color: var(--mr-text);
  line-height: 1.55;
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Soft brand gradient — subtle ambient color, no glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(145, 24, 133, 0.05), transparent 60%),
    radial-gradient(50% 35% at 0% 100%, rgba(58, 45, 74, 0.04), transparent 60%);
}

img { display: block; max-width: 100%; }
a   { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--mr-ink);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.025em;
  line-height: 1.02;
}

h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.022em;
}

h3 {
  font-size: clamp(20px, 1.6vw, 24px);
  letter-spacing: -0.015em;
}

p { margin: 0 0 1em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--space-4);
  padding: 6px 12px;
  background: var(--mr-magenta-050);
  border: 1px solid var(--mr-magenta-100);
  border-radius: var(--r-pill);
  color: var(--mr-magenta);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--mr-magenta);
  border-radius: 50%;
}

.lead {
  max-width: 60ch;
  color: var(--mr-text-soft);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  font-weight: 400;
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 251, 0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--mr-border-soft);
}

.header-shell {
  width: min(var(--container), 100%);
  min-height: 72px;
  margin: 0 auto;
  padding: 16px clamp(20px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-shell--centered { justify-content: center; }

.brand-mark--text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mr-ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-mark--text::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--mr-magenta) 0%, var(--mr-purple) 100%);
  box-shadow: var(--shadow-xs);
}

.madison-logo {
  display: inline-flex;
  align-items: center;
  width: 232px;
  min-height: 42px;
}

.madison-logo--small { width: 180px; }

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 20px);
  font-size: 14px;
  font-weight: 600;
  color: var(--mr-text);
}

.header-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  text-decoration: none;
  color: var(--mr-text);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--mr-magenta);
  background: var(--mr-magenta-050);
}

.text-link {
  color: var(--mr-magenta);
  text-decoration: none;
  font-weight: 700;
  position: relative;
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: opacity var(--transition-fast);
}

.text-link:hover { opacity: 0.7; }

/* ============================================================
   Page shells
   ============================================================ */

.scan-page,
.assistant-page,
.deck {
  width: min(var(--container), 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
}

/* ============================================================
   Scan page — hero
   ============================================================ */

.scan-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(48px, 7vw, 96px) 0 var(--space-12);
  align-items: stretch;
}

.scan-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 4vw, 56px);
  background: linear-gradient(135deg, var(--mr-purple-700) 0%, var(--mr-purple) 55%, var(--mr-logo-purple) 100%);
  border-radius: var(--r-xl);
  color: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  isolation: isolate;
}

/* Mesh accent — modern, NOT AI-cyan glow */
.scan-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40% 50% at 100% 0%, rgba(145, 24, 133, 0.55), transparent 60%),
    radial-gradient(40% 50% at 0% 100%, rgba(83, 40, 79, 0.5), transparent 60%);
  z-index: -1;
}

.scan-copy::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  z-index: -1;
}

.scan-copy h1 {
  color: #fff;
  margin: 0 0 var(--space-5);
  max-width: 18ch;
}

.scan-copy .eyebrow {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f5d3ee;
  backdrop-filter: blur(8px);
}

.scan-copy .eyebrow::before { background: #f5d3ee; }

.scan-copy .lead {
  color: rgba(255, 255, 255, 0.78);
  max-width: 52ch;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding: 6px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  font-size: 13px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.workflow-step.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.workflow-step.is-active .step-number {
  background: var(--mr-magenta);
  color: #fff;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 800;
  transition: background var(--transition-fast), color var(--transition-fast);
}

/* ============================================================
   Order card
   ============================================================ */

.order-card {
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.order-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--mr-border-soft);
}

.order-card__top strong {
  color: var(--mr-ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.order-product {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  background: var(--mr-surface-2);
  border-radius: var(--r-md);
}

.order-product__image {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 8px;
  background: var(--mr-surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
}

.order-product h2 {
  font-size: 18px;
  margin: 0 0 2px;
  color: var(--mr-ink);
  letter-spacing: -0.01em;
}

.order-product p {
  margin: 0;
  color: var(--mr-text-soft);
  font-size: 14px;
  font-weight: 600;
}

.mini-label {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 8px;
  background: var(--mr-magenta-050);
  border-radius: var(--r-pill);
  color: var(--mr-magenta);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-facts {
  margin: 0;
  display: grid;
  gap: 0;
}

.order-facts div {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--mr-border-soft);
}

.order-facts div:last-child { border-bottom: 0; }

.order-facts dt {
  color: var(--mr-text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-facts dd {
  margin: 0;
  color: var(--mr-ink);
  font-size: 15px;
  font-weight: 700;
}

.order-facts--compact { padding: 0; }
.order-facts--compact div { grid-template-columns: 120px 1fr; }

/* ============================================================
   Scan station
   ============================================================ */

.scan-station {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
  gap: var(--space-6);
  padding: var(--space-8) 0 var(--space-12);
}

.scan-panel,
.qr-panel {
  position: relative;
  padding: clamp(28px, 3vw, 40px);
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.scan-panel:hover,
.qr-panel:hover {
  box-shadow: var(--shadow-md);
}

.section-heading { margin-bottom: var(--space-6); }
.section-heading h2 { margin-bottom: 0; }

.po-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--mr-ink);
  font-size: 13px;
  font-weight: 700;
}

.input-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.input-row input { flex: 1 1 200px; }

input {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1.5px solid var(--mr-border-strong);
  border-radius: var(--r-md);
  background: var(--mr-surface);
  color: var(--mr-ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.005em;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input::placeholder { color: var(--mr-text-muted); font-weight: 500; }

input:hover { border-color: var(--mr-purple-300); }

input:focus {
  outline: 0;
  border-color: var(--mr-magenta);
  box-shadow: var(--shadow-focus);
}

/* ============================================================
   Buttons
   ============================================================ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
  transition: transform var(--transition-fast),
              background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast);
  white-space: nowrap;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible { box-shadow: var(--shadow-focus); }

.button--primary {
  background: var(--mr-magenta);
  color: #fff;
  border-color: var(--mr-magenta);
  box-shadow: 0 1px 2px rgba(145, 24, 133, 0.3),
              0 4px 12px rgba(145, 24, 133, 0.2);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--mr-magenta-600);
  border-color: var(--mr-magenta-600);
  box-shadow: 0 2px 4px rgba(145, 24, 133, 0.35),
              0 8px 20px rgba(145, 24, 133, 0.28);
}

.button--secondary {
  background: var(--mr-surface);
  color: var(--mr-ink);
  border-color: var(--mr-border-strong);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: var(--mr-surface-2);
  border-color: var(--mr-ink);
}

.button.is-playing {
  background: var(--mr-purple);
  border-color: var(--mr-purple);
}

.full-button { width: 100%; }

.form-help {
  margin: var(--space-3) 0 0;
  color: var(--mr-text-muted);
  font-size: 13px;
}

.status-message {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: var(--space-5) 0 0;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: var(--mr-surface-2);
  border: 1px solid var(--mr-border-soft);
  color: var(--mr-text-soft);
  font-size: 13px;
  font-weight: 600;
}

.status-message::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mr-text-muted);
}

.status-message.is-success {
  background: var(--success-bg);
  border-color: rgba(31, 138, 91, 0.2);
  color: var(--success);
}

.status-message.is-success::before { background: var(--success); }

/* ============================================================
   QR panel
   ============================================================ */

.qr-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.qr-card {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 28px;
  background: linear-gradient(135deg, #fff 0%, var(--mr-surface-2) 100%);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-lg);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.qr-card:hover {
  transform: translateY(-3px) scale(1.005);
  border-color: var(--mr-magenta);
  box-shadow: var(--shadow-lg);
}

.qr-card img {
  width: min(100%, 280px);
  transition: transform var(--transition);
}

.qr-card:hover img { transform: scale(1.02); }

.qr-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--mr-text-soft);
  font-size: 13px;
  font-weight: 600;
}

.qr-target {
  margin: 0;
  padding: 10px 14px;
  background: var(--mr-surface-2);
  border-radius: var(--r-sm);
  color: var(--mr-text-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

body[data-po-matched="true"] .qr-panel {
  border-color: var(--mr-magenta);
  box-shadow: 0 0 0 1px var(--mr-magenta),
              0 32px 64px -16px rgba(145, 24, 133, 0.25);
}

body[data-po-matched="true"] .qr-card {
  background: linear-gradient(135deg, #fff 0%, var(--mr-magenta-050) 100%);
}

/* Pill */
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--mr-pill);
  color: var(--mr-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill--accent {
  background: var(--mr-magenta);
  color: #fff;
}

/* ============================================================
   Database preview
   ============================================================ */

.database-preview {
  margin: 0 0 var(--space-20);
  padding: clamp(28px, 3vw, 40px);
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--mr-border-soft);
  border-radius: var(--r-md);
  background: var(--mr-surface-2);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--mr-surface);
}

th, td {
  padding: 14px 18px;
  text-align: left;
}

th {
  background: var(--mr-surface-2);
  color: var(--mr-text-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--mr-border);
}

td {
  color: var(--mr-text);
  font-family: var(--font-mono);
  font-size: 13px;
  border-bottom: 1px solid var(--mr-border-soft);
}

tr:last-child td { border-bottom: 0; }

tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--mr-surface-2); }

/* ============================================================
   Assistant page
   ============================================================ */

.brand-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 36px);
  padding: 10px clamp(20px, 4vw, 40px);
  background: var(--mr-purple);
  background: linear-gradient(90deg, var(--mr-purple) 0%, var(--mr-logo-purple) 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-ribbon span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-ribbon span + span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  margin-right: 4px;
}

.site-header--madison { background: rgba(255, 255, 255, 0.9); }

.assistant-page {
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: var(--space-20);
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

/* Product stage */
.product-stage {
  position: sticky;
  top: 100px;
  display: grid;
  gap: var(--space-4);
}

.product-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(420px, 60vh, 600px);
  padding: clamp(32px, 4vw, 56px);
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(145, 24, 133, 0.08), transparent 70%),
    linear-gradient(160deg, var(--mr-surface-2) 0%, var(--mr-surface) 100%);
  border: 1px solid var(--mr-border-soft);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.product-image {
  max-height: 500px;
  filter: drop-shadow(0 30px 50px rgba(58, 45, 74, 0.18));
  transition: transform var(--transition-slow);
}

.product-image-wrap:hover .product-image { transform: scale(1.03); }

.product-tags {
  position: absolute;
  z-index: 2;
  left: 20px;
  top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 40px);
}

.product-tags span {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--mr-border-soft);
  border-radius: var(--r-pill);
  color: var(--mr-purple);
  font-size: 11px;
  font-weight: 700;
}

.video-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: var(--space-8);
  text-align: center;
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-xl);
  color: var(--mr-ink);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.video-placeholder:hover {
  border-color: var(--mr-magenta);
  background: var(--mr-magenta-050);
}

.video-placeholder strong { font-size: 16px; font-weight: 800; }

.video-placeholder span {
  color: var(--mr-text-muted);
  font-size: 13px;
}

.play-symbol {
  width: 56px;
  height: 56px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--mr-magenta);
  background: linear-gradient(135deg, var(--mr-magenta) 0%, var(--mr-magenta-600) 100%);
  position: relative;
  box-shadow: 0 8px 20px rgba(145, 24, 133, 0.35);
  transition: transform var(--transition);
}

.video-placeholder:hover .play-symbol {
  transform: scale(1.08);
}

.play-symbol::after {
  content: "";
  position: absolute;
  top: 50%; left: 56%;
  transform: translate(-50%, -50%);
  width: 0; height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid #fff;
}

/* Right column */
.assistant-content {
  display: grid;
  gap: var(--space-5);
  padding-top: var(--space-3);
}

.assistant-content h1 {
  margin: 0;
  color: var(--mr-ink);
  font-size: clamp(40px, 5vw, 64px);
}

.assistant-content h1 .name { color: var(--mr-magenta); }

.assistant-script {
  color: var(--mr-text-soft);
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.6;
  max-width: 56ch;
}

/* Voice card — modern player */
.voice-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: linear-gradient(135deg, var(--mr-purple) 0%, var(--mr-logo-purple) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  border: 0;
}

.voice-card > div:first-child { display: grid; gap: 2px; }
.voice-card strong { font-size: 15px; font-weight: 800; color: #fff; }
.voice-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.voice-card .button--primary {
  background: #fff;
  color: var(--mr-purple);
  border-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.voice-card .button--primary:hover {
  background: var(--mr-magenta-050);
  border-color: var(--mr-magenta-050);
  color: var(--mr-magenta);
}

.voice-card .button.is-playing {
  background: var(--mr-magenta);
  color: #fff;
  border-color: var(--mr-magenta);
}

.waveform {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 56px;
  height: 32px;
  justify-self: end;
}

.waveform span {
  width: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
}

.waveform span:nth-child(1) { height: 38%; }
.waveform span:nth-child(2) { height: 72%; }
.waveform span:nth-child(3) { height: 50%; }
.waveform span:nth-child(4) { height: 88%; }
.waveform span:nth-child(5) { height: 32%; }

.voice-card:has(.button.is-playing) .waveform span {
  animation: wave 700ms cubic-bezier(.4,0,.2,1) infinite alternate;
}

.voice-card:has(.button.is-playing) .waveform span:nth-child(2) { animation-delay: 80ms; }
.voice-card:has(.button.is-playing) .waveform span:nth-child(3) { animation-delay: 160ms; }
.voice-card:has(.button.is-playing) .waveform span:nth-child(4) { animation-delay: 240ms; }
.voice-card:has(.button.is-playing) .waveform span:nth-child(5) { animation-delay: 320ms; }

@keyframes wave {
  from { transform: scaleY(0.55); }
  to   { transform: scaleY(1.45); }
}

@media (prefers-reduced-motion: reduce) {
  .voice-card:has(.button.is-playing) .waveform span { animation: none; }
}

/* Product summary card */
.product-summary {
  padding: var(--space-6);
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.summary-header span:last-child {
  color: var(--mr-ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.product-summary h2 {
  font-size: clamp(22px, 2vw, 28px);
  margin: 4px 0 12px;
}

.product-summary p {
  color: var(--mr-text-soft);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: var(--space-5);
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

/* How-to strip */
.how-to-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-16) 0 var(--space-12);
  counter-reset: step;
}

.how-to-strip > div {
  position: relative;
  padding: var(--space-6);
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-lg);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.how-to-strip > div:hover {
  transform: translateY(-3px);
  border-color: var(--mr-magenta-100);
  box-shadow: var(--shadow-md);
}

.how-to-strip > div::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-4);
  background: var(--mr-magenta-050);
  border-radius: 10px;
  color: var(--mr-magenta);
  font-size: 14px;
  font-weight: 800;
}

.how-to-strip span {
  display: block;
  margin-bottom: 6px;
  color: var(--mr-ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.how-to-strip p {
  margin: 0;
  color: var(--mr-text-soft);
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================================
   Deck (demo.html)
   ============================================================ */

.deck {
  display: grid;
  gap: var(--space-6);
  padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 40px) var(--space-20);
}

.slide {
  position: relative;
  min-height: clamp(480px, 65vh, 660px);
  padding: clamp(36px, 5vw, 64px);
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.slide--title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: clamp(32px, 5vw, 64px);
  align-items: end;
  background: linear-gradient(135deg, var(--mr-purple-700) 0%, var(--mr-purple) 60%, var(--mr-logo-purple) 100%);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.slide--title::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 50% at 100% 0%, rgba(145, 24, 133, 0.5), transparent 60%),
    radial-gradient(40% 50% at 0% 100%, rgba(83, 40, 79, 0.45), transparent 60%);
  z-index: -1;
}

.slide--title h1 { color: #fff; font-size: clamp(40px, 6vw, 80px); }
.slide--title .lead { color: rgba(255, 255, 255, 0.75); }

.slide--title .eyebrow {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f5d3ee;
}

.slide--title .eyebrow::before { background: #f5d3ee; }

.slide-logo {
  width: 100%;
  padding: 28px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--r-lg);
}

/* Flow grid */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.flow-card {
  padding: var(--space-6);
  background: var(--mr-surface-2);
  border: 1px solid var(--mr-border-soft);
  border-radius: var(--r-lg);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.flow-card:hover {
  transform: translateY(-3px);
  border-color: var(--mr-magenta-100);
  box-shadow: var(--shadow-md);
  background: var(--mr-surface);
}

.flow-card .step-number {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-4);
  background: var(--mr-magenta);
  color: #fff;
  font-size: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(145, 24, 133, 0.25);
}

.flow-card h3 { font-size: 20px; margin-bottom: 8px; }
.flow-card p { color: var(--mr-text-soft); font-size: 14px; margin: 0; line-height: 1.5; }

/* Brand system */
.brand-system-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: var(--space-8);
  align-items: start;
  margin-top: var(--space-6);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.swatches span {
  display: flex;
  align-items: flex-end;
  min-height: 160px;
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--swatch);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-xs);
}

.swatches span:nth-child(4) {
  color: var(--mr-ink);
  border: 1px solid var(--mr-border);
}

.component-sample {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--mr-surface-2);
  border: 1px solid var(--mr-border-soft);
  border-radius: var(--r-lg);
  align-content: start;
}

.mini-card {
  padding: var(--space-4);
  background: var(--mr-surface);
  border: 1px solid var(--mr-border);
  border-radius: var(--r-md);
}

.mini-card strong {
  display: block;
  color: var(--mr-ink);
  font-size: 16px;
  font-weight: 800;
}

.mini-card span {
  display: block;
  margin-top: 2px;
  color: var(--mr-text-soft);
  font-size: 13px;
}

.table-wrap--large table { min-width: 860px; }

.slide-note {
  margin-top: var(--space-5);
  color: var(--mr-text-muted);
  font-size: 14px;
  max-width: 60ch;
}

/* ============================================================
   Page entrance motion
   ============================================================ */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scan-hero > *,
.scan-station > *,
.assistant-content > *,
.product-stage,
.slide > *,
.flow-card,
.how-to-strip > div {
  animation: rise 600ms cubic-bezier(.2,.7,.2,1) both;
}

.scan-hero > *:nth-child(2)     { animation-delay: 80ms; }
.scan-station > *:nth-child(2)  { animation-delay: 80ms; }
.flow-card:nth-child(2)         { animation-delay: 80ms; }
.flow-card:nth-child(3)         { animation-delay: 160ms; }
.how-to-strip > div:nth-child(2){ animation-delay: 70ms; }
.how-to-strip > div:nth-child(3){ animation-delay: 140ms; }
.how-to-strip > div:nth-child(4){ animation-delay: 210ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Responsive
   ============================================================ */

/* Large tablet — tighten deck before single-column collapse */
@media (max-width: 1024px) {
  .deck { padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 32px) var(--space-16); }

  .slide { padding: clamp(28px, 4vw, 48px); }
  .slide--title h1 { font-size: clamp(36px, 5.5vw, 64px); }
}

/* Tablet — collapse two-column hero & deck layouts */
@media (max-width: 960px) {
  .scan-hero,
  .scan-station,
  .assistant-layout,
  .slide--title,
  .brand-system-grid {
    grid-template-columns: 1fr;
  }

  .product-stage { position: static; }
  .flow-grid     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-to-strip  { grid-template-columns: repeat(2, 1fr); }
  .voice-card    { grid-template-columns: 1fr; text-align: left; }
  .voice-card .waveform { justify-self: start; }

  .slide { min-height: 0; }
  .slide-logo { width: 100%; max-width: 280px; justify-self: start; padding: 24px; }

  .brand-system-grid { gap: var(--space-6); }
  .component-sample  { padding: var(--space-5); }
}

/* Small tablet / large phone */
@media (max-width: 720px) {
  .flow-grid { grid-template-columns: 1fr; }
  .swatches  { grid-template-columns: 1fr; }
  .swatches span { min-height: 120px; }

  .slide { padding: clamp(24px, 5vw, 32px); border-radius: var(--r-lg); }
  .slide--title { gap: var(--space-5); }
  .slide--title h1 { font-size: clamp(32px, 7vw, 48px); }

  .deck { gap: var(--space-4); }
}

/* Phone */
@media (max-width: 640px) {
  .header-shell {
    min-height: 64px;
    padding: 14px 20px;
    flex-direction: column;
    gap: 12px;
  }

  .header-nav { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .header-nav a { padding: 6px 10px; font-size: 13px; }

  .madison-logo,
  .madison-logo--small { width: 180px; }

  .input-row { flex-direction: column; align-items: stretch; }

  .order-product { grid-template-columns: 80px 1fr; padding: var(--space-3); }
  .order-product h2 { font-size: 16px; }

  .brand-ribbon {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    text-align: center;
    font-size: 11px;
  }

  .how-to-strip   { grid-template-columns: 1fr; }
  .workflow-steps { grid-template-columns: 1fr; }

  /* Tables — shrink padding so monospace fits */
  th, td { padding: 12px 14px; font-size: 12px; }
  table  { min-width: 560px; }
  .table-wrap--large table { min-width: 640px; }

  .slide-logo { max-width: 100%; padding: 20px; }

  .product-summary { padding: var(--space-5); }
  .assistant-actions { gap: var(--space-3); }
  .assistant-actions .button { width: 100%; }
}

/* Tiny phones */
@media (max-width: 380px) {
  .slide { padding: var(--space-5); }
  .deck { padding-left: 12px; padding-right: 12px; }
  .scan-page, .assistant-page { padding-left: 14px; padding-right: 14px; }
  .scan-copy { padding: var(--space-6); }
  .button { font-size: 14px; padding: 12px 18px; }
}

/* Selection + focus */
::selection { background: var(--mr-magenta); color: #fff; }
::-moz-selection { background: var(--mr-magenta); color: #fff; }

:focus-visible {
  outline: 2px solid var(--mr-magenta);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
