/* ============================================================
   Typical! — Stylesheet
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cream:      #f7f4ef;
  --ink:        #1a1a1a;
  --ink-mid:    #4a4a4a;
  --ink-light:  #8a8a8a;
  --border:     #e0dbd2;
  --user-bg:    #2a2a2a;
  --user-text:  #f7f4ef;
  --ai-bg:      #ffffff;
  --ai-text:    #1a1a1a;
  --radius:     10px;
  --hero-bg:    #1a1208;
  --hero-text:  #f5e8c8;
  --hero-mid:   #a08858;
  --hero-dim:   #6a5838;
  --accent:     #c8902a;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

/* ── Donate float ─────────────────────────────────────────── */

.donate-float {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  background: #2a7a3b;
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
}
.donate-float:hover { opacity: 0.9; }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  background: var(--hero-bg);
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.hero-inner { max-width: 520px; }

.hero-portrait-wrap {
  width: 320px;
  height: 240px;
  margin: 0 auto 28px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--hero-dim);
}

.hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.wordmark {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 20px;
  color: var(--hero-text);
}

.tagline {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--hero-mid);
  font-weight: 300;
  margin-bottom: 10px;
  line-height: 1.5;
}

.sub {
  font-size: 0.95rem;
  color: var(--hero-dim);
  margin-bottom: 36px;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--hero-bg);
  text-decoration: none;
  padding: 14px 36px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: opacity 0.15s;
}
.cta-btn:hover { opacity: 0.88; }

/* ============================================================
   DEMO / CHAT
   ============================================================ */

.demo {
  padding: 0;
  display: flex;
  justify-content: center;
  background: var(--cream);
}

.demo-inner {
  width: 100%;
  max-width: 700px;
  padding: 40px 24px;
}

/* Chat card — fixed height, internal scroll */
.chat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100svh - 80px);
  max-height: 780px;
  min-height: 420px;
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar-header {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
}

.chat-header-text {
  display: flex;
  flex-direction: column;
}

.chat-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.chat-subtitle {
  font-size: 0.75rem;
  color: var(--ink-light);
  font-style: italic;
}

.reset-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-light);
  font-size: 0.78rem;
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.reset-btn:hover {
  color: var(--ink);
  border-color: var(--ink-mid);
}

/* Messages — scrollable, fills remaining height */
.chat-messages {
  flex: 1;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Message rows */
.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.assistant-row { align-items: flex-start; }
.user-row      { justify-content: flex-end; }

.bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
  margin-top: 2px;
}

.message {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.55;
}

.message.assistant {
  background: var(--ai-bg);
  color: var(--ai-text);
  border: 1px solid var(--border);
  border-radius: 4px 10px 10px 10px;
  font-style: italic;
}

.message.user {
  background: var(--user-bg);
  color: var(--user-text);
  border-radius: 10px 4px 10px 10px;
  font-style: normal;
}

.message.system-notice {
  background: none;
  border: none;
  color: var(--ink-light);
  font-size: 0.8rem;
  text-align: center;
  align-self: center;
  padding: 2px 0;
  max-width: 100%;
  font-style: normal;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 13px 15px;
  background: var(--ai-bg);
  border: 1px solid var(--border);
  border-radius: 4px 10px 10px 10px;
  align-self: flex-start;
}
.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-light);
  animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

/* Input area */
.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--cream);
  align-items: flex-end;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.15s;
  max-height: 120px;
  overflow-y: auto;
}
.chat-input:focus { border-color: var(--ink-mid); }

.send-btn {
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.send-btn:hover    { opacity: 0.85; }
.send-btn:disabled { opacity: 0.4; cursor: default; }

/* ============================================================
   SHARE STRIP
   ============================================================ */

.share-section {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}

.share-inner {
  max-width: 700px;
  margin: 0 auto;
}

.share-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--ink);
}

.share-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--cream);
  resize: vertical;
  outline: none;
  min-height: 70px;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.share-textarea:focus { border-color: var(--ink-mid); }

.share-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
}
.share-btn:hover { opacity: 0.8; }

.share-btn--fb { color: #1877F2; border-color: #1877F2; }
.share-btn--wa { color: #25D366; border-color: #25D366; }

.share-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================================
   FEEDBACK
   ============================================================ */

.feedback {
  padding: 60px 24px;
  background: var(--cream);
  border-top: 1px solid var(--border);
}

.feedback-inner {
  max-width: 560px;
  margin: 0 auto;
}

.feedback-heading {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feedback-sub {
  color: var(--ink-light);
  margin-bottom: 36px;
}

.field-group { margin-bottom: 26px; }

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-mid);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.optional {
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-light);
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-mid);
  padding: 8px 18px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
.radio-btn:hover { border-color: var(--ink-mid); color: var(--ink); }
.radio-btn.selected { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.comments-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}
.comments-input:focus { border-color: var(--ink-mid); }

.submit-btn {
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 4px;
  padding: 13px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.submit-btn:hover    { opacity: 0.85; }
.submit-btn:disabled { opacity: 0.4; cursor: default; }

.feedback-thanks {
  margin-top: 16px;
  color: var(--ink-mid);
  font-style: italic;
}

/* ============================================================
   UPGRADE STRIP
   ============================================================ */

.upgrade-strip {
  background: var(--hero-bg);
  padding: 32px 24px;
}

.upgrade-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.upgrade-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--hero-text);
  margin-bottom: 4px;
}

.upgrade-desc {
  font-size: 0.88rem;
  color: var(--hero-mid);
}

.upgrade-btn {
  background: var(--accent);
  color: var(--hero-bg);
  border: none;
  border-radius: 4px;
  padding: 11px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: not-allowed;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.7;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  padding: 36px 24px;
  text-align: center;
  border-top: 1px solid #2a2010;
  background: var(--hero-bg);
  font-size: 0.8rem;
  color: var(--hero-dim);
  line-height: 1.8;
}
.footer a { color: var(--hero-mid); }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */

@media (max-width: 600px) {

  /* Hero portrait smaller on phone */
  .hero-portrait-wrap {
    width: 120px;
    height: 120px;
  }

  /* Chat card fills the screen height more aggressively */
  .chat-card {
    height: calc(100svh - 40px);
    max-height: none;
    border-radius: 8px;
  }

  .demo-inner { padding: 20px 12px; }

  /* Input stacks on mobile */
  .chat-input-area {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 8px;
  }

  .send-btn {
    width: 100%;
    padding: 12px;
    text-align: center;
  }

  .message { max-width: 88%; }

  /* Share strip — textarea always visible, buttons wrap */
  .share-section { padding: 24px 16px; }

  .share-btns {
    gap: 8px;
  }

  .share-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    padding: 10px 8px;
    font-size: 0.82rem;
  }

  /* Upgrade strip stacks */
  .upgrade-inner {
    flex-direction: column;
    text-align: center;
  }

  .upgrade-btn { width: 100%; }

  /* Bubble avatar slightly smaller */
  .bubble-avatar { width: 26px; height: 26px; }
  .chat-avatar-header { width: 30px; height: 30px; }

  /* Feedback padding tighter */
  .feedback { padding: 40px 16px; }
}

@media (max-width: 380px) {
  .share-btn { flex: 1 1 100%; }
}

/* ============================================================
   REFERRAL — Send To A Friend
   ============================================================ */

.refer-section {
  margin-top: 28px;
  display: none; /* shown by JS after session complete or rate limit hit */
}

.refer-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 24px;
}

.refer-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.refer-sub {
  font-size: 0.88rem;
  color: var(--ink-light);
  margin-bottom: 18px;
  line-height: 1.5;
}

.refer-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.refer-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
}
.refer-btn:hover { opacity: 0.8; }

.refer-btn--wa    { color: #25D366; border-color: #25D366; }
.refer-btn--email { color: var(--accent); border-color: var(--accent); }

.refer-notice {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--ink-light);
  font-style: italic;
}

@media (max-width: 600px) {
  .refer-btns {
    gap: 8px;
  }
  .refer-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    padding: 10px 8px;
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  .refer-btn { flex: 1 1 100%; }
}

/* ============================================================
   WAITLIST PAGE
   ============================================================ */

.waitlist-page {
  background: var(--hero-bg);
}

.waitlist-hero {
  min-height: 100svh;
  padding: 48px 24px 80px;
  display: flex;
  justify-content: center;
}

.waitlist-inner {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.waitlist-back {
  align-self: flex-start;
  color: var(--hero-dim);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 36px;
  transition: color 0.15s;
}
.waitlist-back:hover { color: var(--hero-mid); }

.waitlist-portrait-wrap {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--hero-dim);
  margin-bottom: 20px;
}

.waitlist-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.waitlist-wordmark {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.waitlist-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  font-weight: 700;
  color: var(--hero-text);
  line-height: 1.2;
  margin-bottom: 16px;
}

.waitlist-sub {
  color: var(--hero-mid);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 40px;
}

/* Persona preview grid */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  width: 100%;
  margin-bottom: 44px;
}

.persona-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.persona-card--active {
  border-color: var(--accent);
  background: rgba(200,144,42,0.08);
}

.persona-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hero-dim);
  font-weight: 500;
}

.persona-card--active .persona-label {
  color: var(--accent);
}

.persona-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--hero-text);
  font-weight: 700;
}

.persona-desc {
  font-size: 0.78rem;
  color: var(--hero-mid);
  line-height: 1.4;
}

/* Waitlist form */
.waitlist-form {
  width: 100%;
  text-align: left;
}

.waitlist-field {
  margin-bottom: 20px;
}

.waitlist-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--hero-mid);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.waitlist-input,
.waitlist-select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--hero-text);
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}

.waitlist-input::placeholder { color: var(--hero-dim); }
.waitlist-input:focus,
.waitlist-select:focus { border-color: var(--accent); }

.waitlist-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a5838' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.waitlist-select option {
  background: #1a1208;
  color: var(--hero-text);
}

.waitlist-submit {
  width: 100%;
  background: var(--accent);
  color: var(--hero-bg);
  border: none;
  border-radius: 4px;
  padding: 14px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s;
}
.waitlist-submit:hover    { opacity: 0.88; }
.waitlist-submit:disabled { opacity: 0.5; cursor: default; }

.waitlist-thanks {
  margin-top: 20px;
  color: var(--hero-mid);
  font-style: italic;
  text-align: center;
  font-size: 1rem;
}

.waitlist-privacy {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--hero-dim);
  text-align: center;
}

/* Footer credit */
.footer-credit {
  margin-top: 8px;
  font-size: 0.75rem;
}
.footer-credit a { color: var(--hero-dim); }
.footer-credit a:hover { color: var(--hero-mid); }

/* Upgrade button — now an anchor link */
.upgrade-btn {
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  opacity: 1;
}
.upgrade-btn:hover { opacity: 0.88; }

@media (max-width: 600px) {
  .persona-grid {
    grid-template-columns: 1fr 1fr;
  }
  .waitlist-inner { text-align: left; }
  .waitlist-heading { text-align: left; }
  .waitlist-sub { text-align: left; }
}

@media (max-width: 380px) {
  .persona-grid { grid-template-columns: 1fr; }
}
