/* =========================================================================
   رد ذكي — Design system & components
   Tokens → base → layout → components → sections → utilities.
   Light / dark themes are driven by [data-theme] on <html> (see theme.js).
   ========================================================================= */

/* ---------- Fonts: Cairo (Arabic) + Inter (Latin & digits), self-hosted variable ---------- */
@font-face {
  font-family: "Cairo";
  src: url("/fonts/cairo-arabic-var.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;
  --font: "Inter", "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;

  /* Neutrals (zinc) */
  --bg: #fafafa;            /* zinc-50 */
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;     /* zinc-100 */
  --surface-3: #e4e4e7;
  --border: #e4e4e7;        /* zinc-200 */
  --border-strong: #d4d4d8; /* zinc-300 */
  --text: #09090b;          /* zinc-950 */
  --text-2: #3f3f46;        /* zinc-700 */
  --text-3: #71717a;        /* zinc-500 */

  /* The one primary (CTA) colour: emerald */
  --primary: #047857;       /* emerald-700 */
  --primary-hover: #065f46; /* emerald-800 */
  --on-primary: #ffffff;
  --primary-soft: #ecfdf5;  /* emerald-50 */
  --primary-soft-2: #d1fae5;
  --primary-text: #047857;
  --ring: rgba(4, 120, 87, .32);

  /* Elevation: soft, layered */
  --shadow-xs: 0 1px 2px rgba(9, 9, 11, .05);
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, .04), 0 2px 6px -1px rgba(9, 9, 11, .05);
  --shadow-md: 0 1px 2px rgba(9, 9, 11, .04), 0 6px 16px -4px rgba(9, 9, 11, .07), 0 16px 32px -12px rgba(9, 9, 11, .08);
  --shadow-lg: 0 1px 3px rgba(9, 9, 11, .05), 0 12px 28px -6px rgba(9, 9, 11, .10), 0 32px 64px -24px rgba(9, 9, 11, .14);

  /* Shape & motion */
  --r-sm: 8px;
  --r-md: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 150ms;
  --t: 200ms;
  --t-slow: 300ms;

  --header-h: 64px;
  --container: 1120px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;            /* zinc-950 */
  --bg-elev: #111113;
  --surface: #131316;
  --surface-2: #1c1c21;
  --surface-3: #27272a;
  --border: #27272a;        /* zinc-800 */
  --border-strong: #3f3f46;
  --text: #fafafa;
  --text-2: #d4d4d8;        /* zinc-300 */
  --text-3: #a1a1aa;        /* zinc-400 */

  --primary: #34d399;       /* emerald-400 */
  --primary-hover: #6ee7b7; /* emerald-300 */
  --on-primary: #022c22;    /* emerald-950 */
  --primary-soft: rgba(52, 211, 153, .10);
  --primary-soft-2: rgba(52, 211, 153, .16);
  --primary-text: #6ee7b7;
  --ring: rgba(52, 211, 153, .35);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px -2px rgba(0, 0, 0, .35);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 24px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 1px 3px rgba(0, 0, 0, .5), 0 16px 40px -8px rgba(0, 0, 0, .6), 0 40px 80px -32px rgba(0, 0, 0, .6);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; }
bdi, [dir="ltr"] { unicode-bidi: isolate; }
::selection { background: var(--primary-soft-2); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }

/* Theme switch without a colour flash on every element */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color var(--t-slow) var(--ease), border-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease) !important;
}

/* ---------- Typography scale ---------- */
.h1, .h2 { text-wrap: balance; }
.h1 { font-size: clamp(2.125rem, 6vw, 3.75rem); line-height: 1.22; font-weight: 800; letter-spacing: -.01em; }
.h2 { font-size: clamp(1.625rem, 3.6vw, 2.375rem); line-height: 1.3; font-weight: 700; letter-spacing: -.005em; }
.h3 { font-size: 1.125rem; line-height: 1.5; font-weight: 700; }
.lead { font-size: clamp(1.0625rem, 1.9vw, 1.25rem); line-height: 1.8; color: var(--text-2); font-weight: 400; }
.body { color: var(--text-2); }
.muted { color: var(--text-3); font-size: .9375rem; }
.accent { color: var(--primary-text); }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: "Inter", var(--font); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(64px, 9vw, 112px); }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 680px; margin-inline: auto; text-align: center; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head .h2 { margin-top: 12px; }
.section-head .lead { margin-top: 12px; font-size: 1.0625rem; }

/* ---------- Icon ---------- */
.ic { width: 1.25em; height: 1.25em; flex: none; }
.ic-sm { width: 1em; height: 1em; flex: none; }
.ic-lg { width: 24px; height: 24px; flex: none; }
.flip-rtl { transform: scaleX(-1); }

/* ---------- Pill / badge ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; line-height: 1.6;
  color: var(--primary-text); background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}
.pill-neutral { color: var(--text-2); background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-xs); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft-2); }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--btn-h); padding: 0 18px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: .9375rem; font-weight: 600; line-height: 1.3; white-space: nowrap;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn-lg { --btn-h: 52px; padding: 0 22px; font-size: 1rem; }
.btn-sm { --btn-h: 38px; padding: 0 12px; font-size: .875rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .12); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn[disabled], .btn.is-inactive { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:hover { background: var(--surface); border-color: var(--border); }

/* Two-line Telegram button: label + full link (Ayoub rule: link always visible) */
.btn-stack { padding-block: 8px; text-align: start; }
.btn-stack .stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.btn-stack .url { font-size: .75rem; font-weight: 500; opacity: .85; direction: ltr; font-family: "Inter", var(--font); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn .ic { width: 20px; height: 20px; }

/* Theme toggle: show the icon of the theme you would switch to */
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- Header (glass, sticky) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.site-header .bar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.125rem; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--primary); color: var(--on-primary);
  font-size: 1.125rem; font-weight: 800; line-height: 1;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.brand-sub { font-family: "Inter", var(--font); font-size: .8125rem; font-weight: 500; color: var(--text-3); }
.nav { display: none; align-items: center; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: var(--r-sm); font-size: .9375rem; font-weight: 500; color: var(--text-2); transition: color var(--t) var(--ease), background-color var(--t) var(--ease); }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .hide-sm { display: none; }

/* Mobile menu */
.menu-toggle .i-x { display: none; }
.menu-open .menu-toggle .i-x { display: block; }
.menu-open .menu-toggle .i-list { display: none; }
.mobile-menu {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49;
  padding: 12px 20px 20px;
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-8px); pointer-events: none; visibility: hidden;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t);
}
.menu-open .mobile-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.mobile-menu a.link { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; font-weight: 600; border-bottom: 1px solid var(--border); color: var(--text); }
.mobile-menu a.link .ic { color: var(--text-3); }
.mobile-menu .actions { display: grid; gap: 10px; margin-top: 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 10vw, 120px) clamp(40px, 5vw, 64px); text-align: center; isolation: isolate; }
.hero::before { /* calm grid, faded at the edges */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px), linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: .55;
}
.hero::after { /* soft primary glow */
  content: ""; position: absolute; z-index: -1; inset-inline: 0; top: -240px; height: 520px; margin-inline: auto; max-width: 900px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 16%, transparent), transparent);
  filter: blur(8px);
}
.hero .h1 { margin: 20px auto 0; max-width: 16ch; }
.hero .lead { margin: 20px auto 0; max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.hero-secondary { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; margin-top: 12px; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 32px; color: var(--text-3); font-size: .875rem; font-weight: 500; }
.trust li { display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.trust .ic { color: var(--primary-text); }
.trust { padding: 0; }

/* ---------- Demo / chat ---------- */
.demo-grid { display: grid; gap: 32px; align-items: start; }
.hero + .section { padding-top: clamp(40px, 5vw, 64px); }
.demo-intro .h2 { margin-top: 12px; }
.demo-intro .lead { margin-top: 12px; font-size: 1.0625rem; }
.demo-intro .note { margin-top: 20px; }

.segmented {
  display: inline-flex; gap: 4px; padding: 4px; margin-top: 24px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented .tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-3); font-size: .9375rem; font-weight: 600;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.segmented .tab:hover { color: var(--text); }
.segmented .tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .tab[aria-selected="true"] .ic { color: var(--primary-text); }

.chat {
  display: flex; flex-direction: column;
  width: 100%; max-width: 460px; margin-inline: auto;
  height: min(640px, calc(100svh - var(--header-h) - 48px)); min-height: 520px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.avatar {
  position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-text);
  font-weight: 800; font-size: 1.0625rem;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}
.avatar .ic { width: 20px; height: 20px; }
.avatar::after { content: ""; position: absolute; bottom: 0; inset-inline-end: 0; width: 10px; height: 10px; border-radius: 50%; background: #10b981; border: 2px solid var(--bg-elev); }
.chat-name { font-weight: 700; font-size: .9375rem; line-height: 1.4; }
.chat-status { font-size: .8125rem; color: var(--text-3); line-height: 1.4; }
.chat-head .head-ic { margin-inline-start: auto; color: var(--text-3); }

.chat-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 0) 0 0 / 18px 18px,
    var(--surface-2);
  scroll-behavior: smooth;
}
.msg {
  max-width: 84%; padding: 9px 13px 6px; border-radius: var(--r-md);
  font-size: .9375rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: var(--shadow-xs);
  animation: msg-in var(--t-slow) var(--ease);
}
.msg.bot { align-self: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-start-start-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-start-end-radius: 4px; }
.msg .time { display: block; margin-top: 2px; font-size: .6875rem; opacity: .6; text-align: end; font-family: "Inter", var(--font); }
.msg.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite ease-in-out; }
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Quick replies from the orders/bookings engine */
.qr { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 92%; }
.qr-b {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px;
  border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  background: var(--surface); color: var(--primary-text); font-size: .875rem; font-weight: 600; line-height: 1.5;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.qr-b:hover:not([disabled]) { background: var(--primary-soft); border-color: var(--primary); }
.qr-b[disabled] { opacity: .5; cursor: default; }
.qr-b.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); opacity: 1; }
.qr-u { text-decoration: none; }
.qr-b .ic { width: 16px; height: 16px; }

.chips { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--border); background: var(--surface); }
.chips:empty { display: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 4px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  font-size: .8125rem; font-weight: 500; white-space: nowrap;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.chip-ops { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); color: var(--primary-text); background: var(--primary-soft); font-weight: 600; }
.chip-ops:hover { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-text); }
.chip-ops .ic { width: 16px; height: 16px; }

.composer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.composer input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2);
  font-size: 1rem; /* 16px avoids iOS zoom */
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t) var(--ease);
}
.composer input::placeholder { color: var(--text-3); }
.composer input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); background: var(--surface); }
.send {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm);
  background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm);
  transition: background-color var(--t) var(--ease), opacity var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.send:hover { background: var(--primary-hover); }
.send:active { transform: scale(.96); }
.send:disabled { opacity: .5; cursor: default; }
.send .ic { width: 20px; height: 20px; transform: scaleX(-1); }

/* ---------- Feature cards ---------- */
.grid-3 { display: grid; gap: 16px; }
.card {
  position: relative; padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.card .tile {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm);
  background: var(--primary-soft); color: var(--primary-text);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
}
.card .tile .ic { width: 22px; height: 22px; }
.card .h3 { margin-top: 18px; }
.card p { margin-top: 8px; color: var(--text-2); font-size: .9375rem; line-height: 1.8; }
.section-note { margin: 28px auto 0; max-width: 720px; text-align: center; color: var(--text-3); font-size: .9375rem; }
.section-note a, .text-link { color: var(--primary-text); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); text-underline-offset: 3px; transition: text-decoration-color var(--t) var(--ease); }
.section-note a:hover, .text-link:hover { text-decoration-color: currentColor; }

/* ---------- Pricing ---------- */
.plans { display: grid; gap: 16px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; padding: 28px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease), border-color var(--t) var(--ease);
}
.plan:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.plan.featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg); }
.plan .badge { position: absolute; top: -13px; inset-inline-start: 24px; }
.plan .badge.pill { background: var(--primary); color: var(--on-primary); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.plan .h3 { color: var(--text-2); font-weight: 600; font-size: 1rem; }
.price { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.price b { font-size: 2.25rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.price span { color: var(--text-3); font-size: .9375rem; font-weight: 500; }
.monthly { margin-top: 4px; color: var(--text-2); font-size: .9375rem; font-weight: 600; }
.plan hr { width: 100%; height: 1px; border: 0; background: var(--border); margin: 20px 0; }
.checklist { list-style: none; padding: 0; display: grid; gap: 12px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: .9375rem; line-height: 1.7; }
.checklist .ck { display: grid; place-items: center; flex: none; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); }
.checklist .ck .ic { width: 12px; height: 12px; }
.pricing-meta { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 32px; text-align: center; }
.pricing-meta .pay { display: inline-flex; align-items: flex-start; gap: 8px; text-align: start; color: var(--text-2); font-weight: 600; font-size: .9375rem; }
.pricing-meta .pay .ic { color: var(--text-3); margin-top: .3em; }
.free-week { margin-top: 16px; }

/* ---------- CTA panel ---------- */
.cta-panel {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(36px, 6vw, 64px) clamp(20px, 5vw, 56px);
  text-align: center; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.cta-panel::before {
  content: ""; position: absolute; z-index: -1; inset: -40% -10% auto; height: 120%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 12%, transparent), transparent);
}
.cta-panel .lead { margin: 12px auto 0; max-width: 52ch; font-size: 1.0625rem; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.cta-panel .checklist { max-width: 560px; margin: 24px auto 0; text-align: start; }
.mail-line { display: flex; align-items: flex-start; justify-content: center; gap: 8px; margin-top: 24px; color: var(--text-2); font-size: .9375rem; text-align: start; }
.mail-line .ic { margin-top: .3em; }
.mail-line .ic { color: var(--text-3); }
.cta-sub { margin-top: 8px; color: var(--text-3); font-size: .875rem; }

/* ---------- Demo page extras ---------- */
.info-card { margin-top: 20px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.info-card .h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.info-card p { margin-top: 8px; color: var(--text-2); font-size: .9375rem; }
.info-card .btn { margin-top: 16px; }
.info-card .muted { font-size: .8125rem; }
.disclosure { margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-xs); }
.disclosure summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; cursor: pointer; list-style: none; font-weight: 600; font-size: .9375rem;
  border-radius: var(--r-md); transition: background-color var(--t) var(--ease);
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary:hover { background: var(--surface-2); }
.disclosure summary .ic { color: var(--text-3); transition: transform var(--t) var(--ease); }
.disclosure[open] summary .ic { transform: rotate(180deg); }
.disclosure ul { margin: 0; padding: 4px 18px 8px; padding-inline-start: 36px; color: var(--text-2); font-size: .9375rem; }
.disclosure ul li { margin-block: 6px; }
.demo-extras .note { margin-top: 16px; }
.disclosure .src { padding: 0 18px 16px; color: var(--text-3); font-size: .8125rem; }
.dz-missing { padding: 48px 20px; text-align: center; }
.dz-missing .h2 { margin-bottom: 8px; }
.dz-missing a { color: var(--primary-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); }
.footer-grid { display: grid; gap: 28px; padding-block: 48px 32px; }
.footer-grid .about { max-width: 340px; color: var(--text-3); font-size: .9375rem; margin-top: 12px; }
.footer-col h4 { margin: 0 0 12px; font-size: .8125rem; font-weight: 700; color: var(--text); }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.footer-col a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .9375rem; transition: color var(--t) var(--ease); }
.footer-col a:hover { color: var(--primary-text); }
.footer-col .ic { color: var(--text-3); width: 18px; height: 18px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: .8125rem; }

/* ---------- Utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- Responsive (mobile-first) ---------- */
@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .header-actions .hide-sm { display: inline-flex; }
}
@media (min-width: 900px) {
  .nav { display: flex; }
  .menu-toggle, .mobile-menu { display: none !important; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .demo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 64px; align-items: center; }
  .chat { margin-inline: 0; }
  .demo-grid.has-extras { grid-template-areas: "intro chat" "extras chat"; grid-template-rows: auto 1fr; row-gap: 0; align-items: start; }
  .demo-grid.has-extras .demo-intro { grid-area: intro; }
  .demo-grid.has-extras .chat { grid-area: chat; }
  .demo-grid.has-extras .demo-extras { grid-area: extras; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .plan.featured { transform: translateY(-8px); }
  .plan.featured:hover { transform: translateY(-10px); }
}
@media (max-width: 899.98px) {
  .demo-intro { text-align: center; }
  .demo-extras { max-width: 460px; margin-inline: auto; width: 100%; }
  .demo-intro .lead, .demo-intro .note { margin-inline: auto; max-width: 60ch; }
}
@media (max-width: 420px) {
  .container { padding-inline: 16px; }
  .hero-cta .btn, .hero-secondary .btn, .cta-actions .btn { width: 100%; }
  .brand-sub { display: none; }
  .chat { min-height: 480px; height: min(560px, 70svh); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
