/* GuestAI public landing page (BLUEPRINT §2c, T12).
   Mobile-first, one file, system fonts only, no build step. Section order mirrors
   guestai.chat's own simplicity (hero-with-live-demo, benefits, escalation, live-in-
   minutes, pricing placeholder, fine print, FAQ) - never its copy or branding. */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  --bg: #ffffff;
  --bg-alt: #f6f8f7;
  --bg-dark: #0b1220;
  --bg-dark-2: #121b2e;
  --text: #10161f;
  --text-muted: #4b5768;
  --text-on-dark: #eef2f6;
  --text-on-dark-muted: #a7b3c4;
  --accent: #0f9d8d;
  --accent-strong: #0c7d71;
  --accent-soft: #e3f5f2;
  --border: #e3e8ec;
  --border-dark: #24314a;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(16, 22, 31, 0.06), 0 8px 24px rgba(16, 22, 31, 0.06);
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
  /* Defensive backstop (task instruction: the page must never scroll
     horizontally) - every child is meant to wrap/shrink on its own already,
     this just guarantees a stray intrinsic width can never widen the page. */
  overflow-x: hidden;
}

h1,
h2,
h3 {
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 0.5em;
}

h2 {
  font-size: clamp(1.6rem, 4.4vw, 2.15rem);
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
}

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

.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;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6em 1em;
  z-index: 100;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-narrow {
  max-width: 760px;
}

/* ---- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.75em 1.4em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--accent);
}

.btn-outline-light {
  background: transparent;
  color: var(--text-on-dark);
  border-color: var(--border-dark);
}

.btn-outline-light:hover {
  border-color: var(--accent);
}

.btn-small {
  padding: 0.5em 1.1em;
  font-size: 0.9rem;
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dark);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.site-header-inner .brand,
.site-header-inner .btn {
  /* Flex items default to min-width:auto, which refuses to shrink below its
     own text's intrinsic width - the one thing that was pushing this row
     (and so the whole page) wider than a narrow viewport before `flex-wrap`
     alone could kick in. */
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  text-decoration: none;
  color: var(--text-on-dark);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

/* ---- Sections ----------------------------------------------------------- */

.section {
  padding: 56px 0;
}

.section-light {
  background: var(--bg);
}

.section-light:nth-of-type(even) {
  background: var(--bg-alt);
}

.section-dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.section-accent {
  background: var(--accent-soft);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 0.3em 0.8em;
  border-radius: 999px;
  margin-bottom: 1em;
}

.eyebrow-light {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
}

.section-sub {
  color: var(--text-muted);
  max-width: 640px;
}

.section-sub-light {
  color: var(--text-on-dark-muted);
}

/* ---- Hero ---------------------------------------------------------------- */

.hero {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding-top: 48px;
  padding-bottom: 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

.hero-grid > * {
  /* Grid items default to min-width:auto, so the track can never shrink
     below a child's own min-content size - `.phone`'s `width: min(340px,
     100%)` resolves its intrinsic contribution to the definite 340px
     operand, which was forcing this single `1fr` column (and so the whole
     page) wider than a narrow viewport. Overriding it here is what actually
     lets the phone mockup shrink to fit instead of overflowing. */
  min-width: 0;
}

.hero-headline {
  font-size: clamp(1.9rem, 6vw, 2.7rem);
  margin-bottom: 0.4em;
}

.hero-sub {
  color: var(--text-on-dark-muted);
  font-size: 1.05rem;
  max-width: 46ch;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.4em 0 1em;
}

.hero-meta {
  color: var(--text-on-dark-muted);
  font-size: 0.9rem;
}

.hero-phone-wrap {
  display: flex;
  justify-content: center;
}

/* ---- Phone mockup + live chat demo --------------------------------------- */

.phone {
  width: min(340px, 100%);
  background: #05070c;
  border-radius: 40px;
  padding: 14px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.phone-notch {
  width: 90px;
  height: 18px;
  background: #05070c;
  border-radius: 0 0 14px 14px;
  margin: 0 auto 6px;
  position: relative;
}

.phone-notch::after {
  content: "";
  position: absolute;
  inset: 6px 34px;
  background: #1a2233;
  border-radius: 6px;
}

.phone-screen {
  background: #f3f5f7;
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 480px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex: none;
}

.chat-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}

.chat-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.chat-subtitle::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 5px;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #eef1f3;
}

.bubble {
  max-width: 86%;
  padding: 0.6em 0.85em;
  border-radius: 16px;
  font-size: 0.86rem;
  line-height: 1.4;
  white-space: pre-line;
}

.bubble-assistant {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 1px rgba(16, 22, 31, 0.06);
}

.bubble-guest {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble-error {
  align-self: center;
  background: #fdeceb;
  color: #9c2a1e;
  font-size: 0.78rem;
}

.bubble-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 0.25em 0.6em;
  border-radius: 999px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid var(--border);
}

.chat-input-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6em 1em;
  font-size: 0.86rem;
  font-family: inherit;
  min-width: 0;
}

.chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
}

.chat-send:hover {
  background: var(--accent-strong);
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.chat-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-on-dark-muted);
  max-width: 320px;
  margin: 10px auto 0;
}

/* ---- Grids / feature cards ------------------------------------------------ */

.grid {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.grid-4,
.grid-3 {
  grid-template-columns: 1fr;
}

/* A quiet aside under a section's cards - used for the "stays yours" note. */
.section-note {
  margin-top: 22px;
  font-size: 0.92rem;
  color: var(--muted, #6b6b66);
}

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 0.4em;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ---- Numbered steps -------------------------------------------------------- */

.steps {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 0.6em;
}

.steps-light p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.steps-dark p {
  color: var(--text-on-dark-muted);
  font-size: 0.95rem;
}

/* ---- Pricing (T57b, backlog item 16) -------------------------------------- */

.plans-slider {
  margin-top: 24px;
  text-align: center;
}

.plans-slider label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.6em;
}

.plans-slider input[type="range"] {
  width: 100%;
  max-width: 420px;
}

.plans-count-value {
  margin-top: 0.5em;
  font-weight: 700;
  color: var(--accent-strong);
}

.plan-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px 20px;
  text-align: center;
}

.plan-price {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.4em 0 0;
}

.plan-price span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-cap,
.plan-best-for {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5em;
}

.plan-total {
  margin-top: 1em;
  font-weight: 700;
  border-top: 1px solid var(--border);
  padding-top: 0.8em;
}

.plans-note {
  margin-top: 24px;
  text-align: center;
  color: var(--text-muted);
}

.pricing-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 28px;
  text-align: center;
  margin-top: 24px;
}

.pricing-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 0.3em 0.9em;
  border-radius: 999px;
  margin-bottom: 0.8em;
}

.pricing-line {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.3em;
}

.pricing-sub {
  color: var(--text-muted);
  max-width: 44ch;
  margin: 0 auto 1.4em;
}

/* ---- Fine print --------------------------------------------------------- */

.fine-print-grid {
  text-align: center;
}

.fine-print-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.fine-print-label {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.2em;
}

/* ---- FAQ ------------------------------------------------------------------ */

.faq-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 18px;
}

.faq-item summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 26px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 12px;
  font-size: 1.2rem;
  color: var(--accent-strong);
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  color: var(--text-muted);
  padding-bottom: 16px;
  margin: 0;
}

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-muted);
  padding: 26px 0;
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.footer-link {
  color: var(--text-on-dark);
  text-decoration: underline;
}

/* ---- Responsive: tablet/desktop ------------------------------------------ */

@media (min-width: 640px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .fine-print-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 920px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .hero-phone-wrap {
    justify-content: flex-end;
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
