/* Cosmogid demo: in the client's own idiom (Montserrat, violet #4c1d95, white),
   with the logo's butterfly gradient as the single accent on the chat. */
:root {
  color-scheme: light;
  --violet: #4c1d95;
  --violet-deep: #2e1065;
  --ink: #160f26;
  --muted: #6b6480;
  --lilac: #f5f2fb;
  --line: #e7e1f2;
  --white: #ffffff;
  --butterfly: linear-gradient(90deg, #c02ba8 0%, #7c3aed 50%, #5284d4 100%);
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font: 400 15px/1.6 Montserrat, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 0.2em; }
img { max-width: 100%; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--violet);
  color: var(--white);
  border-radius: 10px;
}
.skip-link:focus { top: 12px; }

/* Header */
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}
.logo { display: block; line-height: 0; }
.logo img { width: 90px; height: 60px; }
.demo-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--violet);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--lilac);
}

/* Hero: the chat is the page */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(32px, 5vw, 64px);
}
.eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
}
h1 {
  margin: 0 0 22px;
  font-weight: 300;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
h1 strong {
  display: block;
  font-weight: 700;
  color: var(--violet);
}
.lead {
  margin: 0 0 32px;
  max-width: 40ch;
  color: var(--muted);
  font-size: 16px;
}
.chips-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--violet);
  background: var(--white);
  border: 1px solid #d8cdef;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover {
  background: var(--violet);
  border-color: var(--violet);
  color: var(--white);
}
.chip:disabled { opacity: 0.5; cursor: progress; }

.chat-panel {
  position: relative;
  min-width: 0;
  height: min(680px, calc(100dvh - 140px));
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 24px 60px -24px rgba(76, 29, 149, 0.28);
  overflow: hidden;
}
/* Signature: the logo's butterfly gradient as the top edge of the consultant */
.chat-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--butterfly);
  z-index: 1;
}
.chat-panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.chat-status,
.chat-fallback,
.reopen-chat {
  position: absolute;
  inset: 0;
  margin: auto;
  height: fit-content;
  width: fit-content;
  max-width: 80%;
  text-align: center;
  color: var(--muted);
}
.chat-fallback p { margin: 0 0 12px; }
.chat-fallback button,
.reopen-chat,
.show-all {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--violet);
  background: var(--violet);
  color: var(--white);
}
.chat-fallback button:hover,
.reopen-chat:hover { background: var(--violet-deep); }

/* Expanded widget: chat takes the whole row */
.hero.expanded { grid-template-columns: minmax(0, 1fr); }
.hero.expanded .hero-copy { display: none; }
.hero.expanded .chat-panel { height: calc(100dvh - 120px); }

/* What the consultant knows */
.knowledge { padding-block: clamp(8px, 2vw, 24px) 24px; }
.knowledge-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  margin-bottom: 32px;
}
h2 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.knowledge-head p { margin: 0; color: var(--muted); font-size: 14px; }
.subhead {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.pages {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pages a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  text-decoration: none;
}
.pages a:hover { border-color: var(--violet); color: var(--violet); }

.products {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.products:not(.show-all-open) .is-extra { display: none; }
.product a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.2s;
}
.product a:hover {
  border-color: #d8cdef;
  box-shadow: 0 10px 24px -14px rgba(76, 29, 149, 0.35);
}
.product-photo {
  position: relative;
  display: block;
  aspect-ratio: 1;
  margin-bottom: 8px;
}
.product-photo img {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
}
.product-brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
}
.product-name {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price {
  margin-top: auto;
  padding-top: 8px;
  font-size: 16px;
  font-weight: 600;
}
.show-all {
  display: block;
  margin: 24px auto 0;
  background: var(--white);
  color: var(--violet);
}
.show-all:hover { background: var(--violet); color: var(--white); }

.note {
  margin-block: 24px 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.note a { color: var(--violet); }

@media (max-width: 1080px) {
  .products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .chat-panel { height: min(640px, calc(100dvh - 96px)); }
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-inner { min-height: 64px; }
  .logo img { width: 66px; height: 44px; }
  .demo-badge { font-size: 11px; padding: 5px 10px; }
  .lead { margin-bottom: 24px; font-size: 15px; }
  .chat-panel { min-height: 480px; border-radius: 14px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product a { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
