/* ===== أوتو — marketing site ===== */
/* palette mirrors 5001 (public/mobile/styles.css) */
@font-face {
  font-family: "Lateef";
  src: url("/fonts/Lateef-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lateef";
  src: url("/fonts/Lateef-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lateef";
  src: url("/fonts/Lateef-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3faf8;
  --surface: #FAFAFA;
  --surface-soft: #116266;
  --text: #0B4548;
  --text2: #FAFAFA;
  --muted: #5e7470;
  --line: #d8e8e3;
  --accent: #116266;
  --accent-dark: #0D4E52;
  --brand-green: #46CF91;

  --radius-card: 20px;
  --radius-sm: 12px;
  --shadow-card: 0 4px 20px rgba(17, 98, 102, 0.07);
  --shadow-soft: 0 2px 10px rgba(17, 98, 102, 0.05);

  --maxw: 1080px;
  --pad: clamp(20px, 5vw, 48px);
  --gap-section: clamp(72px, 12vw, 140px);

  --font: "Lateef", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  font-size: 200%;
  scroll-behavior: auto;
}   /* in-page scrolling is JS-driven (app.js, 500ms) */
:where([id]) { scroll-margin-top: 72px; }

html, body { overflow-x: clip; max-width: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* home: white ground for the animated wave background to sit on */
body[data-path="/"] { background: #FAFAFA; }
body[data-path="/"] #main { position: relative; z-index: 0; isolation: isolate; }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: normal;      /* Arabic is connected script - no Latin-style tracking */
  overflow-wrap: normal;       /* headings never break mid-word */
  word-break: keep-all;
}

h1 { font-size: clamp(2rem, 5.2vw, 3.35rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { margin: 0; }

.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: var(--muted);
  font-weight: 400;
}

/* ===== buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }

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

.btn-block { width: 100%; }

/* ===== nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--surface);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-soft);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 6px var(--pad);
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-logo {
  display: flex;
  align-items: center;
}
.nav-logo img { display: block; height: 28px; width: auto; object-fit: contain; }

.nav-actions .btn {
  padding-block: 5px;
  font-size: 0.9rem;
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-inline-start: 8px;
  margin-inline-end: auto;
}
.nav-links a {
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--text);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a[aria-current="page"] { border-bottom-color: var(--accent); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-login {
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--muted);
}
.nav-login:hover { color: var(--text); }
.nav-user {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-drawer .nav-user {
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  max-width: none;
}

/* ===== inline login modal ===== */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-modal[hidden] { display: none; }
.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 40, 42, 0.45);
  backdrop-filter: blur(2px);
}
.login-card {
  position: relative;
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: 0 30px 70px -20px rgba(0, 30, 32, 0.4);
  padding: clamp(24px, 5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h3 { margin-bottom: 4px; }
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.login-card input {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}
.login-card input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.login-close {
  position: absolute;
  inset-inline-end: 12px;
  inset-block-start: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.login-close:hover { color: var(--text); }
.login-error {
  margin: 0;
  font-size: 0.86rem;
  color: var(--danger, #b42318);
}
.login-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  margin-inline-start: auto;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px var(--pad) 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav-drawer[hidden] { display: none; }
.nav-drawer a {
  padding: 12px 6px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.nav-drawer a:last-child { border-bottom: 0; margin-top: 10px; }
.nav-drawer .btn { padding: 9px 18px; }

/* ===== layout ===== */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--gap-section) var(--pad);
}
.section-narrow { max-width: 760px; }
.section-tight { padding-top: clamp(40px, 7vw, 72px); padding-bottom: clamp(40px, 7vw, 72px); }

.section-head {
  max-width: 620px;
  margin-bottom: clamp(36px, 6vw, 60px);
}
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-head p { margin-top: 14px; }

/* ===== animated wave background (from 5005/server.js) ===== */
.app-header-waves {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100vh;
  height: 100vw;
  z-index: -1;
  overflow: hidden;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  pointer-events: none;
}
.app-header-waves > div {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.app-header-waves svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  display: block;
  animation: wave-scroll 4s linear infinite;
}
.app-header-waves .overlay-bottom path { fill: #46CF91; opacity: 0.2; }
.app-header-waves .overlay-bottom-2 svg { animation-duration: 6s; }
.app-header-waves .overlay-bottom-2 path { fill: #46CF91; opacity: 0.5; }
.app-header-waves .overlay-bottom-3 svg { animation-duration: 5s; }
.app-header-waves .overlay-bottom-3 path { fill: #46CF91; opacity: 0.7; }

@keyframes wave-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .app-header-waves svg { animation: none; }
}

/* ===== hero ===== */
.hero {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: min(58vh, 520px);
  padding: clamp(36px, 6vw, 72px) var(--pad) clamp(20px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* content wrapper — transparent so the fixed wave background shows through
   as the page scrolls */
.content-sheet {
  position: relative;
  z-index: 1;
  padding-top: 0;
}
#how-it-works { padding-top: clamp(16px, 3vw, 28px); }
.hero-text { color: var(--text); }
.hero-text h1 {
  max-width: none;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1.18;
  font-weight: 700;
  text-wrap: balance;
}
.hero-text .lead {
  max-width: none;
  margin-top: 22px;
  color: var(--muted);
}
.hero-cta {
  margin-top: 30px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-note {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* device mock — floats over the angled cut with Stripe's deep soft shadow */
.hero-mock {
  position: relative;
  z-index: 2;
  margin-bottom: calc(-1 * clamp(48px, 9vw, 120px));
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-card);
  box-shadow: 0 40px 80px -24px rgba(0, 30, 32, 0.45), 0 12px 28px -12px rgba(0, 30, 32, 0.3);
  overflow: hidden;
}
.hero-mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.hero-mock-bar i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line);
}
.hero-mock-bar span {
  margin-inline-start: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}
.hero-mock-body { padding: clamp(18px, 4vw, 30px); }
.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: #fff;
}
.mock-row:last-child { margin-bottom: 0; }
.mock-row .mr-main { display: flex; flex-direction: column; gap: 4px; text-align: start; }
.mock-row .mr-title { font-weight: 600; font-size: 0.95rem; }
.mock-row .mr-sub { font-size: 0.82rem; color: var(--muted); }
.mock-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent);
  white-space: nowrap;
}
.mock-pill.green { background: rgba(102, 198, 155, 0.22); color: #1c6b4a; }

/* ===== steps ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 4vw, 36px);
  counter-reset: step;
}
.step { counter-increment: step; }
.step-num {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}
.step-num::before { content: counter(step); }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.98rem; }

/* ===== feature cards ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 3vw, 26px);
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: clamp(24px, 3.5vw, 34px);
  box-shadow: var(--shadow-soft);
}
.feature-card .fc-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--accent);
  margin-bottom: 18px;
}
.feature-card .fc-icon svg { width: 24px; height: 24px; }
.feature-card h3 { margin-bottom: 10px; }
.feature-card p { color: var(--muted); font-size: 0.97rem; }
.feature-card ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.feature-card li {
  position: relative;
  padding-inline-start: 22px;
  font-size: 0.93rem;
  color: var(--text);
}
.feature-card li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.62em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
}
.fc-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 4px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: gap .18s;
}
.fc-cta svg { width: 16px; height: 16px; transition: transform .18s; }
.fc-cta:hover { gap: 10px; }
.fc-cta:hover svg { transform: translateX(-3px); }

.inline-demo { margin-top: 22px; scroll-margin-top: 90px; max-height: 90vh; overflow-y: auto; overscroll-behavior: contain; }
.inline-demo[hidden] { display: none; }
.demo-phone-panel { margin-top: 22px; }
.demo-phone-panel[hidden] { display: none; }
/* the card keeps its normal grid width when expanded - the demo widget
   inside it always renders at its narrow/mobile layout (same rules as the
   real <760px breakpoint below) so it reads like a phone preview docked in
   the card, not a desktop-width panel. */
.feature-card .demo-categories { grid-template-columns: repeat(2, 1fr); }
.feature-card .demo-colors { grid-template-columns: 1fr; }
.feature-card .demo-backgrounds { grid-template-columns: repeat(4, 1fr); }
.feature-card .demo-product-card { width: 38%; }
.feature-card .demo-step {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 20px 0 0;
}

/* ===== AI split ===== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 6vw, 64px);
  align-items: center;
}
.split .split-text p { color: var(--muted); margin-top: 14px; }

.chat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: grid;
  gap: 12px;
}
.bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.bubble.in {
  background: var(--surface-soft);
  border-bottom-right-radius: 5px;
  justify-self: start;
}
.bubble.out {
  background: var(--accent);
  color: #fff;
  border-bottom-left-radius: 5px;
  justify-self: end;
}
.chat-tag {
  font-size: 0.76rem;
  color: var(--muted);
  justify-self: end;
}

/* ===== generic prose (legal / about) ===== */
.prose { max-width: 760px; }
.prose .lead { margin-top: 14px; }
.prose h2 { margin-top: 44px; margin-bottom: 12px; font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.prose h3 { margin-top: 28px; margin-bottom: 8px; }
.prose p { margin-top: 12px; color: var(--text); }
.prose ul { margin-top: 12px; padding-inline-start: 22px; color: var(--text); }
.prose li { margin-top: 6px; }
.prose a { color: var(--accent); text-decoration: underline; }

.draft-note {
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px dashed var(--brand-green);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  font-size: 0.9rem;
  color: var(--muted);
}

.placeholder {
  background: rgba(102, 198, 155, 0.16);
  border-radius: 4px;
  padding: 0 4px;
}

/* contact rows */
.contact-list { display: grid; gap: 14px; margin-top: 24px; }
.contact-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.contact-item .ci-label { font-size: 0.85rem; color: var(--muted); }
.contact-item .ci-value { font-weight: 600; }

/* pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}
@media (min-width: 860px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    gap: 0;
  }
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(24px, 4vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-align: start;
  position: relative;
}

@media (min-width: 860px) {
  .plan-card.plan-card-side {
    margin-block: 16px;
  }
  .plan-card.plan-card-start {
    border-inline-end: 0;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
  }
  .plan-card.plan-card-end {
    border-inline-start: 0;
    border-start-start-radius: 0;
    border-end-start-radius: 0;
  }
  .plan-card.plan-card-active {
    padding-block: clamp(32px, 5vw, 44px);
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 1;
  }
}

.plan-card-active { border-color: var(--accent); }

.plan-badge {
  position: absolute;
  top: -12px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
}

.plan-card-header h3 { margin: 0 0 8px; font-size: 1.1rem; }
.plan-price-row { margin: 0 0 6px; }
.plan-price { font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.plan-desc { margin: 0; font-size: 0.88rem; color: var(--muted); }

.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.plan-features li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.88rem;
  color: var(--text);
}
.plan-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  background: rgba(17, 98, 102, 0.12);
  color: var(--accent);
}
.plan-check svg { width: 11px; height: 11px; }

.plan-cta { margin-top: auto; }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-ghost:disabled:hover { background: transparent; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 18px 4px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 12px; color: var(--muted); }

/* footer */
.footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--accent-dark);
  color: var(--text2);
  border-top: 0;
  /* angled edge that closes off the end of the page */
  clip-path: polygon(0 clamp(24px, 4vw, 56px), 100% 0, 100% 100%, 0 100%);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(44px, 7vw, 72px) var(--pad) 36px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-logo { display: flex; align-items: center; }
.footer-brand p { color: var(--text2); font-size: 0.92rem; margin-top: 14px; max-width: 30ch; }
.footer-wordmark { display: block; height: 42px; width: auto; object-fit: contain; }
.footer-col h4 { font-size: 0.9rem; margin-bottom: 14px; color: var(--text2); }
.footer-col a {
  display: block;
  color: var(--text2);
  font-size: 0.92rem;
  padding: 5px 0;
}
.footer-col a:hover { color: var(--text2); opacity: 0.7; }
.footer-base {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--pad) 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.85rem;
  color: var(--text2);
}

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== responsive ===== */
@media (max-width: 860px) {
  html { font-size: 140%; }
  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: flex; }
  .steps { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  /* on mobile the example always sits under its explanation, whatever the DOM order */
  .split > .split-text { order: 1; }
  .split > .chat { order: 2; }
  .footer-inner { grid-template-columns: 1fr 1fr; }

  .hero { text-align: center; }
  .hero-text .lead { max-width: 52ch; margin-inline: auto; }
  .hero-cta { justify-content: center; }
}
@media (max-width: 520px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
}

/* ===== AI chat widget (same template as 5003) ===== */
.ai-chat {
  --ai-chat-accent: var(--accent);
  --ai-chat-accent-text: #FAFAFA;
  position: fixed;
  inset-inline-start: max(14px, env(safe-area-inset-left));
  inset-block-end: max(14px, env(safe-area-inset-bottom));
  z-index: 150;
  font-family: var(--font);
}

.ai-chat-toggle {
  position: relative;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--ai-chat-accent);
  color: var(--ai-chat-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(17, 98, 102, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 98, 102, 0.34);
}

.ai-chat-toggle:active { transform: translateY(0); }

.ai-chat-glyph {
  position: absolute;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.ai-chat-glyph-close {
  opacity: 0;
  transform: scale(0.6) rotate(-45deg);
}

.ai-chat.open .ai-chat-glyph-open {
  opacity: 0;
  transform: scale(0.6) rotate(45deg);
}

.ai-chat.open .ai-chat-glyph-close {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.ai-chat-badge {
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #e0245e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.ai-chat-badge.hidden { display: none; }

.ai-chat-panel {
  position: absolute;
  inset-block-end: 70px;
  inset-inline-start: 0;
  width: min(360px, calc(100vw - 28px));
  height: min(70vh, 540px);
  background: #FAFAFA;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(17, 98, 102, 0.26);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom var(--ai-chat-origin-x, left);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.ai-chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--ai-chat-accent);
  color: var(--ai-chat-accent-text);
  flex-shrink: 0;
}

.ai-chat-title {
  font-weight: 700;
  font-size: 19px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-chat-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.85;
}

.ai-chat-close:hover { opacity: 1; }

.ai-chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f6f8;
}

.ai-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 82%;
}

.ai-chat-msg-user {
  align-self: flex-end;
  align-items: flex-end;
}

.ai-chat-msg-bot {
  align-self: flex-start;
  align-items: flex-start;
}

.ai-chat-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 20px;
  line-height: 1.8;
  white-space: pre-line;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.ai-chat-msg-bot .ai-chat-bubble {
  background: #FAFAFA;
  color: #16202a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.ai-chat-msg-user .ai-chat-bubble {
  background: var(--ai-chat-accent);
  color: var(--ai-chat-accent-text);
  border-bottom-right-radius: 4px;
}

.ai-chat-msg.error .ai-chat-bubble {
  background: #fdeeee;
  color: #b23b3b;
}

.ai-chat-typing {
  display: flex;
  gap: 4px;
  padding: 4px 18px 8px;
  background: #f5f6f8;
}

.ai-chat-typing.hidden { display: none; }

.ai-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b3bcc6;
  animation: ai-chat-bounce 1s infinite ease-in-out;
}

.ai-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ai-chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.ai-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e6e8ec;
  background: #FAFAFA;
  flex-shrink: 0;
}

.ai-chat-input {
  flex: 1;
  border: 1px solid #d7dbe0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 18px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: #16202a;
}

.ai-chat-input:focus { border-color: var(--ai-chat-accent); }
.ai-chat-input:disabled { opacity: 0.6; }

.ai-chat-send {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--ai-chat-accent);
  color: var(--ai-chat-accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ai-chat-send svg { transform: scaleX(-1); }

.ai-chat-form.is-sending .ai-chat-send {
  opacity: 0.5;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .ai-chat-panel { transition: opacity 0.16s ease, visibility 0.16s; transform: none; }
  .ai-chat-typing span { animation: none; opacity: 0.5; }
}

@media (max-width: 560px) {
  .ai-chat-panel {
    position: fixed;
    top: 0;
    inset-inline: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    transform: translateY(100%);
    transition: transform 0.24s ease, visibility 0.24s;
    opacity: 1;
  }

  .ai-chat-panel.open { transform: none; }

  .ai-chat.open .ai-chat-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .ai-chat-header {
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .ai-chat-close {
    font-size: 26px;
    padding: 4px 8px;
  }

  .ai-chat-msg { max-width: 86%; }

  .ai-chat-input {
    font-size: 18px;
    padding: 13px 24px;
  }

  .ai-chat-form {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .ai-chat-send {
    width: 42px;
    height: 42px;
  }

  .ai-chat-toggle {
    width: 52px;
    height: 52px;
    transition: opacity 0.18s ease, transform 0.15s ease;
  }
}
/* demo builder */
.demo-page{max-width:1120px;margin:auto;padding:64px 24px 100px}.demo-heading{text-align:center;max-width:720px;margin:0 auto 34px}.demo-heading h1{margin:7px 0 10px}.demo-heading p{color:var(--muted)}.demo-flow{display:grid;gap:20px}.demo-step{background:#fff;border:1px solid var(--line);border-radius:24px;padding:24px;box-shadow:0 16px 50px rgba(0,63,65,.07)}.demo-step-title{display:flex;gap:12px;align-items:start;margin-bottom:18px}.demo-step-title>span{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:var(--primary);color:#fff;font-weight:800}.demo-step-title h2{font-size:1.1rem;margin:0}.demo-step-title p{font-size:.8rem;color:var(--muted);margin:3px 0}.demo-categories{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.demo-categories button{min-height:84px;border:1.5px solid var(--line);border-radius:14px;background:#fbfcfa;font:inherit;font-size:1.35rem;cursor:pointer}.demo-categories b{display:block;font-size:.76rem;margin-top:5px}.demo-categories button:hover,.demo-categories button.selected{border-color:var(--primary);background:#e8f6f1;color:var(--primary)}.demo-identity-preview{width:100%;aspect-ratio:5/2;border-radius:20px;background-position:center;background-size:cover;display:flex;align-items:center;justify-content:center;gap:14px;padding:20px;overflow:hidden}.demo-product-card{width:min(29%,190px);border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff;box-shadow:0 8px 24px rgba(0,0,0,.14)}.demo-product-image{position:relative}.demo-product-image img{display:block;width:100%;aspect-ratio:1;object-fit:cover}.demo-product-image i{position:relative;display:inline-block;width:15px;height:15px;border-radius:50%;border:1px solid #fff;margin:6px 2px 0}.demo-product-image i:first-of-type{margin-inline-start:7px}.demo-product-copy{padding:7px 8px}.demo-product-copy b{display:block;font-size:.7rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.demo-product-copy span{font-size:.68rem;font-weight:800}.demo-colors{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}.demo-colors label{display:flex;align-items:center;gap:9px;padding:8px;border:1px solid var(--line);border-radius:12px;font-size:.75rem;font-weight:700}.demo-colors input{width:28px;height:28px;border:0;background:none}.demo-library-title{font-size:.9rem;margin:20px 0 10px}.demo-backgrounds{display:grid;grid-template-columns:repeat(7,1fr);gap:9px}.demo-backgrounds button{aspect-ratio:1;border:2px solid transparent;border-radius:12px;background-size:cover;background-position:center;cursor:pointer}.demo-backgrounds button.selected{border-color:var(--primary)}.demo-create{width:100%;margin-top:20px}.demo-result{text-align:center;color:var(--primary);font-weight:700}.demo-step[hidden]{display:none!important}@media(max-width:760px){.demo-categories{grid-template-columns:repeat(2,1fr)}.demo-colors{grid-template-columns:1fr}.demo-backgrounds{grid-template-columns:repeat(4,1fr)}.demo-product-card{width:38%}.demo-page{padding-inline:14px}}
.demo-destination-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}.demo-destination{display:flex;flex-direction:column;gap:2px;padding:11px 14px;border:1.5px solid var(--line);border-radius:12px;background:#fff;color:var(--text);text-decoration:none;transition:.18s}.demo-destination:hover{border-color:var(--accent);background:#e8f6f1;transform:translateY(-2px)}.demo-destination b{color:var(--accent)}.demo-destination small{color:var(--muted);font-weight:500}@media(max-width:560px){.demo-destination-actions{grid-template-columns:1fr}}
.demo-phone{position:relative;width:min(100%,360px);aspect-ratio:9/19.5;margin:14px auto 0;padding:16px 10px;background:#111;border-radius:42px;box-shadow:0 18px 40px rgba(0,0,0,.28)}
.demo-phone-notch{position:absolute;top:16px;left:50%;transform:translateX(-50%);width:44%;height:20px;background:#111;border-radius:0 0 16px 16px;z-index:1}
.demo-embed{display:block;width:100%;height:100%;border:0;border-radius:26px;background:#fff}
.demo-open-link{margin-top:14px}
/* the phone-frame preview is a desktop/laptop nicety - showing a phone
   mockup inside an actual phone screen is redundant, so real phones just
   get the plain "open in a new tab" button instead. */
@media (max-width: 640px) {
  .demo-phone { display: none; }
}
.demo-close-session{margin-top:14px;padding:10px 16px;border:1px solid #c94b4b;border-radius:11px;background:#fff;color:#a52f2f;font:inherit;font-size:.78rem;font-weight:800;cursor:pointer}.demo-close-session:hover{background:#fff1f1}.demo-close-session:disabled{opacity:.65;cursor:wait}
