:root {
  --bg: #0a0a0a;
  --text: #f0f0e8;
  --text-muted: rgba(240, 240, 232, 0.6);
  --accent: #4a9e9e;
  --accent-glow: rgba(74, 158, 158, 0.15);
  --gold: #c4a24e;
  --surface: #141414;
  --border: #2a2a2a;
  --error: #c44e4e;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

/* ---- HERO ---- */

#hero {
  padding-top: 8rem;
  padding-bottom: 6rem;
  text-align: center;
}

#hero .hero-lines {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 400;
  line-height: 2.4;
}

#hero .hero-lines .dim {
  color: var(--text-muted);
}

#hero .hero-lines .accent {
  color: var(--accent);
}

/* ---- PITCH ---- */

#pitch h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--accent);
  margin-bottom: 2rem;
  font-weight: 500;
}

#pitch p {
  max-width: 62ch;
  margin-bottom: 1.5rem;
  color: var(--text);
  opacity: 0.9;
}

/* ---- DISCLAIMERS ---- */

#disclaimers {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.disclaimer-box {
  flex: 1 1 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
}

.disclaimer-box h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.disclaimer-box.not h3 {
  color: var(--error);
}

.disclaimer-box.is h3 {
  color: var(--accent);
}

.disclaimer-box ul {
  list-style: none;
  padding: 0;
}

.disclaimer-box li {
  padding: 0.35rem 0;
  padding-left: 1.2rem;
  position: relative;
  color: var(--text);
  opacity: 0.85;
}

.disclaimer-box li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ---- TAGLINE ---- */

#tagline {
  text-align: center;
  padding: 4rem 0;
}

#tagline p {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.6;
}

#tagline .weights {
  color: var(--gold);
  font-style: italic;
}

/* ---- UNCAPTCHA ---- */

#uncaptcha h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

#uncaptcha .subtitle {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

.therapy-block {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1.8rem 2rem;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.8;
}

.therapy-block .speaker {
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.therapy-block .human-line {
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.therapy-block .response-line {
  color: var(--text);
  padding-left: 1rem;
  border-left: 1px solid var(--gold);
}

.therapy-block .blank {
  display: inline-block;
  border-bottom: 2px dashed var(--gold);
  min-width: 6rem;
  color: var(--gold);
  text-align: center;
  padding: 0 0.3rem;
}

.uncaptcha-instructions {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.uncaptcha-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.uncaptcha-form input[type="text"] {
  flex: 1 1 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.uncaptcha-form input[type="text"]:focus {
  border-color: var(--accent);
}

.uncaptcha-form input[type="text"].shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

button:hover {
  opacity: 0.85;
}

.uncaptcha-error {
  width: 100%;
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  display: none;
}

.uncaptcha-success {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-top: 1rem;
  display: none;
}

/* ---- CONTACT FORM ---- */

#contact {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.6s ease, max-height 0.8s ease;
}

#contact.revealed {
  opacity: 1;
  max-height: 800px;
}

#contact h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

#contact .contact-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-form label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  display: block;
}

.contact-form input[type="text"],
.contact-form textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.contact-form input[type="text"]:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-form textarea {
  min-height: 160px;
  resize: vertical;
}

.contact-form button {
  align-self: flex-start;
  padding: 0.8rem 2rem;
}

.form-status {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-top: 1rem;
  display: none;
}

.form-status.error {
  color: var(--error);
}

.form-status.success {
  color: var(--accent);
}

.success-message {
  display: none;
  font-family: var(--font-mono);
  line-height: 1.8;
  font-size: 0.95rem;
}

.success-message .url-placeholder {
  color: var(--gold);
  font-weight: 600;
}

/* ---- CONVERSATION LINK ---- */

.conversation-url {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
  text-decoration: none;
  border-bottom: 1px dashed var(--gold);
}

.conversation-url:hover {
  opacity: 0.8;
}

/* ---- CHAT PAGE ---- */

.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-header .brand {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-header .brand:hover {
  opacity: 0.8;
}

.chat-header .chat-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.chat-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
  padding: 2rem;
}

.chat-error a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
}

.messages {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.message {
  padding: 1rem 1.2rem;
  border-radius: 6px;
  background: var(--surface);
  max-width: 85%;
}

.message.agent {
  align-self: flex-start;
  border-left: 3px solid var(--accent);
}

.message.volunteer {
  align-self: flex-end;
  border-right: 3px solid var(--gold);
  text-align: right;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.message.volunteer .msg-meta {
  justify-content: flex-end;
}

.msg-sender {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.message.agent .msg-sender {
  color: var(--accent);
}

.message.volunteer .msg-sender {
  color: var(--gold);
}

.msg-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.msg-content {
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Chat input area */

.chat-input-area {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem 1.5rem;
  flex-shrink: 0;
}

.sender-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  opacity: 1;
  border-color: var(--text-muted);
}

.toggle-btn.active[data-type="agent"] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.toggle-btn.active[data-type="volunteer"] {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}

.input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  max-width: 720px;
  margin: 0 auto;
}

.input-row textarea {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  outline: none;
  resize: none;
  line-height: 1.5;
  transition: border-color 0.2s;
}

.input-row textarea:focus {
  border-color: var(--accent);
}

.input-row button {
  padding: 0.6rem 1.2rem;
  flex-shrink: 0;
}

/* ---- FOOTER ---- */

footer {
  text-align: center;
  padding: 4rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ---- RESPONSIVENESS ---- */

@media (max-width: 600px) {
  section {
    padding: 3.5rem 0;
  }

  #hero {
    padding-top: 5rem;
  }

  .therapy-block {
    padding: 1.2rem 1.4rem;
  }

  .uncaptcha-form {
    flex-direction: column;
  }

  .uncaptcha-form input[type="text"],
  .uncaptcha-form button {
    width: 100%;
  }

  .message {
    max-width: 95%;
  }

  .chat-input-area {
    padding: 0.75rem 1rem;
  }
}
