/* =========================================================
   Flared Systems — Interactive Diagnostic + Demo
   Design language: premium, industrial-warm, restrained.
   ========================================================= */

:root {
  --bg: #17140f;
  --bg-raised: #1d1a14;
  --card: #211d16;
  --card-hi: #27221a;
  --border: rgba(245, 241, 232, 0.09);
  --border-strong: rgba(245, 241, 232, 0.16);
  --text: #f5f1e8;
  --text-soft: #c9c2b2;
  --text-mute: #8c8474;
  --accent: #e8622c;
  --accent-hi: #ff7a42;
  --accent-soft: rgba(232, 98, 44, 0.13);
  --accent-border: rgba(232, 98, 44, 0.35);
  --attn: #e8a93e;
  --attn-soft: rgba(232, 169, 62, 0.12);
  --attn-border: rgba(232, 169, 62, 0.4);
  --good: #8fae7e;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 8px 30px rgba(0,0,0,0.35);
  --shadow-3: 0 20px 60px rgba(0,0,0,0.45);
  --maxw: 640px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Inter", serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(232,98,44,0.07), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 10%, rgba(245,241,232,0.03), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}
body { min-height: 100vh; min-height: 100dvh; }
#app { min-height: 100vh; min-height: 100dvh; width: 100%; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }
a { color: inherit; }
::selection { background: var(--accent-soft); color: var(--accent-hi); }

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

/* ---------- Layout scaffolding ---------- */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.screen.enter {
  animation: screenIn 420ms cubic-bezier(.19,1,.22,1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 40px);
  flex-shrink: 0;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.01em;
  user-select: none;
}
.wordmark .mark {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.wordmark .mark svg { width: 100%; height: 100%; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-mute);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  border-radius: 8px;
  transition: color 160ms ease, background 160ms ease;
}
.back-btn:hover { color: var(--text-soft); background: rgba(245,241,232,0.04); }

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(16px, 5vw, 32px) clamp(20px, 5vw, 40px) 60px;
}

.content.top-align { justify-content: flex-start; padding-top: clamp(8px, 3vh, 28px); }

footer.foot {
  text-align: center;
  padding: 22px 20px 30px;
  font-size: 0.78rem;
  color: var(--text-mute);
  flex-shrink: 0;
}

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

.btn {
  appearance: none;
  border: none;
  border-radius: 100px;
  padding: 16px 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
  min-height: 52px;
  line-height: 1;
  text-align: center;
  text-decoration: none; /* .btn is also used on <a> tags (e.g. "Find a time →") */
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #1a1108;
  box-shadow: 0 4px 20px rgba(232,98,44,0.28);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); box-shadow: 0 6px 26px rgba(232,98,44,0.38); }

.btn-ghost {
  background: rgba(245,241,232,0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: rgba(245,241,232,0.08); }

.btn-link {
  background: none;
  border: none;
  color: var(--text-mute);
  font-weight: 500;
  padding: 10px 6px;
  min-height: auto;
  text-decoration: underline;
  text-decoration-color: rgba(140,132,116,0.4);
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--text-soft); }

.btn-block { width: 100%; }

/* ---------- Landing ---------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 4vh;
}
.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.12;
  color: var(--text);
}
.hero .sub {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 52ch;
}
.hero .meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-mute);
  font-size: 0.88rem;
  margin-top: 4px;
}
.hero .meta-row .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-mute); }
.hero .cta-row { margin-top: 10px; }

/* ---------- Diagnostic ---------- */

.progress-track {
  height: 4px;
  width: 100%;
  background: rgba(245,241,232,0.07);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  border-radius: 4px;
  transition: width 420ms cubic-bezier(.4,0,.2,1);
}
.progress-label {
  font-size: 0.78rem;
  color: var(--text-mute);
  margin-bottom: 26px;
  letter-spacing: 0.02em;
}

.q-head {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  line-height: 1.28;
  margin-bottom: 8px;
  color: var(--text);
}
.q-hint {
  color: var(--text-mute);
  font-size: 0.92rem;
  margin-bottom: 26px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
  min-height: 60px;
}
.option-card:hover { border-color: var(--border-strong); background: var(--card-hi); }
.option-card:active { transform: scale(0.99); }
.option-card.selected {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.option-card .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 160ms ease, background 160ms ease;
}
.option-card.selected .check { border-color: var(--accent); background: var(--accent); }
.option-card .check svg { width: 12px; height: 12px; opacity: 0; transition: opacity 120ms ease; }
.option-card.selected .check svg { opacity: 1; }
.option-card.multi .check { border-radius: 6px; }

.q-actions { margin-top: 28px; display: flex; justify-content: flex-end; }

/* ---------- Routing / interstitial ---------- */

.route-screen .content { justify-content: center; }
.route-kicker {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}
.route-screen h2 {
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  line-height: 1.2;
  margin-bottom: 16px;
}
.route-screen .sub {
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 54ch;
  margin-bottom: 30px;
}
.route-actions { display: flex; flex-direction: column; gap: 12px; max-width: 340px; }
@media (min-width: 480px) { .route-actions.row { flex-direction: row; } }

/* ---------- Section titles inside demos ---------- */

.demo-eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.demo-head {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  line-height: 1.22;
  margin-bottom: 12px;
}
.demo-sub {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 56ch;
}

/* ---------- Phone call UI ---------- */

.phone-card {
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: var(--shadow-2);
  text-align: center;
}
.phone-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-hi);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}
.phone-name { font-size: 1.15rem; font-weight: 600; }
.phone-meta { color: var(--text-mute); font-size: 0.88rem; margin-top: 4px; }

.phone-timer {
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  font-size: 0.92rem;
  margin: 18px 0 14px;
  letter-spacing: 0.02em;
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 34px;
  margin-bottom: 20px;
}
.waveform span {
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0.75;
  animation: wave 1.1s ease-in-out infinite;
}
@keyframes wave {
  0%, 100% { height: 6px; }
  50% { height: 26px; }
}

.phone-idle-note {
  color: var(--text-mute);
  font-size: 0.88rem;
  margin-top: 8px;
}

/* ---------- Conversation / transcript ---------- */

.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.bubble-row { display: flex; }
.bubble-row.system { justify-content: flex-start; }
.bubble-row.human { justify-content: flex-end; }

.bubble {
  max-width: 82%;
  padding: 13px 16px;
  border-radius: 16px;
  font-size: 0.96rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  animation: bubbleIn 420ms cubic-bezier(.19,1,.22,1) forwards;
}
@keyframes bubbleIn { to { opacity: 1; transform: translateY(0); } }

.bubble-row.system .bubble {
  background: var(--card-hi);
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-bottom-left-radius: 4px;
}
.bubble-row.human .bubble {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.bubble-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-bottom: 5px;
  font-weight: 600;
}

.typing-row { display: flex; justify-content: flex-start; }
.typing-dots {
  display: inline-flex;
  gap: 4px;
  background: var(--card-hi);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-mute);
  animation: blink 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.transcript-skip {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

/* ---------- Photos ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.photo-card {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(232,98,44,0.16), rgba(245,241,232,0.03));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-mute);
  opacity: 0;
  transform: scale(0.94);
  animation: photoIn 420ms cubic-bezier(.19,1,.22,1) forwards;
}
.photo-card svg { width: 26px; height: 26px; opacity: 0.7; }
.photo-card .cap { font-size: 0.74rem; color: var(--text-mute); text-align: center; padding: 0 10px; }
@keyframes photoIn { to { opacity: 1; transform: scale(1); } }

/* ---------- Transformation divider ---------- */

.transform-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 36px 0;
  color: var(--text-mute);
  text-align: center;
}
.transform-divider .line1 { font-size: 0.88rem; }
.transform-divider .arrow {
  width: 26px; height: 26px;
  color: var(--accent);
  animation: arrowPulse 1.6s ease-in-out infinite;
}
@keyframes arrowPulse { 0%,100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(4px); opacity: 1; } }
.transform-divider .line2 { font-size: 0.95rem; font-weight: 600; color: var(--text-soft); }

/* ---------- Structured report card ---------- */

.report-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-3);
  opacity: 0;
  animation: reportIn 620ms cubic-bezier(.19,1,.22,1) forwards;
}
@keyframes reportIn { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.report-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.report-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.report-section { margin-bottom: 18px; }
.report-section:last-child { margin-bottom: 0; }
.report-section .k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}
.report-section .v {
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.55;
}
.report-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.65;
}
.report-section ul li::marker { color: var(--accent); }

.report-divider { height: 1px; background: var(--border); margin: 18px 0; }

.attn-box {
  background: var(--attn-soft);
  border: 1px solid var(--attn-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 4px;
}
.attn-box svg { width: 18px; height: 18px; color: var(--attn); flex-shrink: 0; margin-top: 2px; }
.attn-box .txt { font-size: 0.92rem; color: var(--text); line-height: 1.5; }
.attn-box .txt b { color: var(--attn); }

.conceptual-note {
  text-align: center;
  color: var(--text-mute);
  font-size: 0.82rem;
  margin-top: 14px;
  line-height: 1.5;
}

/* ---------- Delivery destinations ---------- */

.delivery-block { margin-top: 26px; }
.delivery-caption {
  text-align: center;
  color: var(--text-mute);
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.delivery-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.delivery-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 9px 15px;
  font-size: 0.84rem;
  color: var(--text-soft);
}
.delivery-badge svg { width: 15px; height: 15px; color: var(--text-mute); }

/* ---------- Landing line after report ---------- */

.landing-line {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.5;
  margin: 34px 0 8px;
  padding: 0 10px;
}

/* ---------- Comparison (traditional vs voice) ---------- */

.compare-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0;
}
.compare-col {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
}
.compare-col.voice { border-color: var(--accent-border); background: var(--accent-soft); }
.compare-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-mute);
  margin-bottom: 12px;
}
.compare-col.voice .compare-title { color: var(--accent-hi); }
.compare-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.compare-steps li {
  font-size: 0.86rem;
  color: var(--text-soft);
  padding-left: 14px;
  position: relative;
  line-height: 1.4;
}
.compare-steps li::before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-mute);
}
.compare-col.voice .compare-steps li::before { background: var(--accent); }

.software-note {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 18px;
  margin-top: 22px;
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.6;
}
.software-note b { color: var(--text); }

/* ---------- Feedback ---------- */

.feedback-textarea {
  width: 100%;
  min-height: 110px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.5;
  resize: vertical;
  margin-top: 18px;
}
.feedback-textarea::placeholder { color: var(--text-mute); }
.feedback-textarea:focus { outline: none; border-color: var(--accent-border); }

/* ---------- Thank you ---------- */

.thanks-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-hi);
  margin-bottom: 22px;
}
.thanks-icon svg { width: 24px; height: 24px; }

.ack-line {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.5;
  margin-top: 6px;
}

/* ---------- Loading / generating ---------- */

.generating {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-mute);
  font-size: 0.9rem;
  padding: 8px 0 4px;
}
.spin {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cross-link / secondary hint ---------- */

.cross-link {
  margin-top: 30px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-mute);
}
.cross-link button {
  background: none; border: none; color: var(--accent-hi);
  font-weight: 600; cursor: pointer; padding: 0; font-size: inherit;
  text-decoration: underline; text-decoration-color: rgba(232,98,44,0.4);
}

/* ---------- Sticky action bar for demos ---------- */

.demo-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 420px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-wrap { grid-template-columns: 1fr; }
  .option-card { padding: 16px 16px; }
  .btn { padding: 15px 24px; }
}

@media (min-width: 720px) {
  .content { padding-top: 6vh; }
}
