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

/* ── Tokens ── */
:root {
  --bg: #141217;
  --surface: #1f1c24;
  --surface-light: #2e2b33;
  --amber: #ffbf4d;
  --warm-orange: #ff9933;
  --sent-bubble: #2b241f;
  --received-bubble: #1a1a1f;
  --text-primary: #ffffff;
  --text-secondary: #a6a6a6;
  --sent-border: rgba(255, 191, 77, 0.14);
  --received-border: rgba(255, 255, 255, 0.06);
  --sent-playback-accent: var(--warm-orange);
  --received-playback-accent: var(--amber);
  --card-fill: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.08);
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 128px 24px 56px;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-glow::before,
.hero-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hero-glow::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 191, 77, 0.06) 0%, transparent 70%);
  animation: glow-1 25s ease-in-out infinite;
}

.hero-glow::after {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(112, 189, 255, 0.035) 0%, transparent 70%);
  animation: glow-2 30s ease-in-out infinite;
}

@keyframes glow-1 {
  0%, 100% { transform: translate(-50%, -50%); }
  25%      { transform: translate(-46%, -55%); }
  50%      { transform: translate(-54%, -48%); }
  75%      { transform: translate(-47%, -52%); }
}

@keyframes glow-2 {
  0%, 100% { transform: translate(-50%, -50%); }
  33%      { transform: translate(-54%, -46%); }
  66%      { transform: translate(-46%, -54%); }
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22%;
  display: inline-block;
  object-fit: cover;
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 100;
  letter-spacing: 0;
  margin-top: 28px;
  position: relative;
  z-index: 1;
}

.hero-tagline {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 16px auto 0;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

.app-store-badge {
  display: inline-block;
  margin-top: 36px;
  position: relative;
  z-index: 1;
  transition: opacity 0.2s;
}

.app-store-badge:hover {
  opacity: 0.8;
  text-decoration: none;
}

.app-store-badge svg {
  width: 150px;
  height: 50px;
}

/* ── Conversation Demo ── */
.conversation {
  padding: 0 24px 96px;
  display: flex;
  justify-content: center;
  overflow: visible;
}

.conversation-container {
  max-width: 400px;
  width: 100%;
  position: relative;
}

.conversation-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-left: 2px;
}

.conversation-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--warm-orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #000;
  flex-shrink: 0;
}

.conversation-name {
  font-size: 1.0625rem;
  font-weight: 600;
}

.conversation-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conversation-playback-bar {
  position: absolute;
  top: 0;
  right: 0;
  transform: translateY(-128%);
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.conversation-playback-bar[hidden] {
  display: none;
}

.playback-stop-button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(31, 28, 36, 0.92);
  color: var(--text-primary);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.playback-stop-button:hover {
  border-color: rgba(255, 191, 77, 0.22);
  background: rgba(46, 43, 51, 0.96);
}

.playback-stop-button:focus-visible {
  outline: 2px solid rgba(255, 191, 77, 0.68);
  outline-offset: 3px;
}

.stop-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 191, 77, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stop-icon::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--amber);
}

/* ── Message Bubbles ── */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.message.sent {
  align-self: flex-end;
  align-items: flex-end;
}

.message.received {
  align-self: flex-start;
  align-items: flex-start;
}

.message-bubble {
  appearance: none;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  border: 1px solid transparent;
  display: inline-block;
  width: auto;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.message-bubble:hover {
  transform: translateY(-1px);
}

.message-bubble:focus-visible {
  outline: 2px solid rgba(255, 191, 77, 0.68);
  outline-offset: 3px;
}

.message.sent .message-bubble {
  background: var(--sent-bubble);
  border: 1px solid var(--sent-border);
  box-shadow: 0 6px 14px rgba(255, 191, 77, 0.08);
}

.message.received .message-bubble {
  background: var(--received-bubble);
  border: 1px solid var(--received-border);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.20);
}

.message.is-playing .message-bubble {
  transform: translateY(-1px);
}

.message.sent.is-playing .message-bubble {
  border-color: rgba(255, 153, 51, 0.52);
  box-shadow: 0 8px 22px rgba(255, 153, 51, 0.12);
}

.message.received.is-playing .message-bubble {
  border-color: rgba(255, 191, 77, 0.46);
  box-shadow: 0 8px 22px rgba(255, 191, 77, 0.10);
}

.message-text {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.play-icon {
  width: 12px;
  height: 12px;
  opacity: 0.92;
  flex-shrink: 0;
}

.message.sent .play-icon,
.message.sent .playing-bars {
  color: var(--sent-playback-accent);
}

.message.received .play-icon,
.message.received .playing-bars {
  color: var(--received-playback-accent);
}

.playing-bars {
  width: 18px;
  height: 13px;
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.playing-bars span {
  width: 3px;
  border-radius: 999px;
  background: currentColor;
  animation: waveform 0.82s ease-in-out infinite;
}

.playing-bars span:nth-child(1) {
  height: 7px;
  animation-delay: -0.16s;
}

.playing-bars span:nth-child(2) {
  height: 13px;
}

.playing-bars span:nth-child(3) {
  height: 9px;
  animation-delay: -0.32s;
}

.message.is-playing .play-icon {
  display: none;
}

.message.is-playing .playing-bars {
  display: flex;
}

@keyframes waveform {
  0%, 100% { transform: scaleY(0.48); opacity: 0.62; }
  50%      { transform: scaleY(1); opacity: 1; }
}

.message-source {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  opacity: 0.6;
}

.message-time {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  opacity: 0.4;
  margin-left: auto;
}

/* ── Features ── */
.features {
  padding: 0 24px 48px;
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.feature-card {
  background: var(--card-fill);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
}

.feature-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 191, 77, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--amber);
}

.feature-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Privacy ── */
.privacy-section {
  padding: 24px 24px 64px;
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}

.privacy-section h2 {
  font-size: 1.1875rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.privacy-section p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Footer ── */
.site-footer {
  padding: 36px 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-footer .made-by {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.footer-support {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-support a {
  color: var(--amber);
}

.site-footer .copyright {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  opacity: 0.4;
}

/* ── Legal Pages ── */
.legal-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  margin-bottom: 48px;
}

.legal-back svg {
  width: 14px;
  height: 14px;
}

.legal-page h1 {
  font-size: 2.375rem;
  font-weight: 100;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.legal-page h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 28px;
  color: var(--text-primary);
}

.legal-page .legal-body {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.legal-page .legal-body h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 40px 0 12px;
}

.legal-page .legal-body h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 28px 0 8px;
}

.legal-page .legal-body p {
  margin: 0 0 12px;
}

.legal-page .legal-body ul,
.legal-page .legal-body ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.legal-page .legal-body li {
  margin-bottom: 6px;
}

.legal-page .legal-body strong {
  color: var(--text-primary);
}

.legal-page .legal-body a {
  color: var(--amber);
}

.legal-page .legal-body hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 32px 0;
}

.legal-page .legal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 0.8125rem;
}

.legal-page .legal-body th,
.legal-page .legal-body td {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.legal-page .legal-body th {
  color: var(--text-primary);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero {
    padding: 88px 24px 44px;
  }

  .hero-icon {
    width: 80px;
    height: 80px;
  }

  .hero-title {
    font-size: 2.75rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .conversation {
    padding-inline: 18px;
  }

  .conversation-playback-bar {
    right: 2px;
  }

  .features {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .feature-card {
    padding: 22px 20px;
    text-align: left;
    display: flex;
    gap: 16px;
    align-items: flex-start;
  }

  .feature-icon-wrap {
    margin: 0;
    flex-shrink: 0;
  }

  .feature-card h3 {
    margin-bottom: 4px;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .hero-glow::before,
  .hero-glow::after {
    animation: none;
    transform: translate(-50%, -50%);
  }

  .playing-bars span {
    animation: none;
    transform: none;
  }
}
