:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --accent: #d32f2f;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 32px;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #d1d5db 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 200%;
  z-index: -2;
  animation: gradient-shift 20s ease-in-out infinite alternate;
}

.chat-scroll {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.chat-scroll-track {
  position: absolute;
  left: 0;
  width: 100%;
  animation: chat-scroll-up 60s linear infinite;
}

@keyframes chat-scroll-up {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.chat-block {
  padding: 0 16px 24px;
  min-height: 100vh;
}

.chat-row {
  display: flex;
  margin-bottom: 12px;
  gap: 8px;
}

.chat-row--left { justify-content: flex-start; }
.chat-row--right { justify-content: flex-end; }

.chat-bubble {
  max-width: 75%;
  padding: 8px 14px;
  border-radius: 16px;
  font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.7rem;
  line-height: 1.4;
  opacity: 0.5;
}

.chat-row--left .chat-bubble {
  background: rgba(255, 255, 255, 0.6);
  color: #374151;
  border-bottom-left-radius: 4px;
}

.chat-row--right .chat-bubble {
  background: rgba(26, 26, 26, 0.15);
  color: #4b5563;
  border-bottom-right-radius: 4px;
}

.header,
.main,
.footer {
  position: relative;
  z-index: 1;
}

@keyframes gradient-shift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fade-in-up 0.6s var(--ease-out-expo) both;
}

.logo.animate-in { animation-delay: 0.05s; }
.title.animate-in { animation-delay: 0.12s; }
.tagline.animate-in { animation-delay: 0.2s; }
.description.animate-in { animation-delay: 0.28s; }
.store-badge.animate-in { animation-delay: 0.36s; }
.credits.animate-in { animation-delay: 0.44s; }
.privacy-expander.animate-in { animation-delay: 0.52s; }

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.logo {
  width: 180px;
  height: 180px;
  margin-bottom: 24px;
  transition: transform 0.4s var(--ease-out-expo);
}

.logo:hover {
  transform: scale(1.04);
}

.title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #8b0000;
}

.main {
  max-width: 480px;
  text-align: center;
  margin-bottom: 48px;
}

.tagline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
  color: #1a1a1a;
}

.description {
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 1.0625rem;
  margin: 0 0 24px;
  line-height: 1.5;
  color: #374151;
  font-weight: 500;
}

.store-badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  margin: 0;
  letter-spacing: 0.02em;
  transition: transform 0.3s var(--ease-out-expo), letter-spacing 0.3s var(--ease-out-expo);
}

.store-badge:hover {
  transform: scale(1.02);
  letter-spacing: 0.06em;
}

.footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
}

.credits {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.04em;
  position: relative;
  transition: color 0.3s var(--ease-out-expo);
}

.credits::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.35s var(--ease-out-expo);
}

.credits:hover,
.credits:focus-visible {
  color: var(--accent);
}

.credits:hover::after,
.credits:focus-visible::after {
  width: 100%;
}

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

/* Privacy Policy expander */
.privacy-expander {
  margin-top: 32px;
  max-width: 480px;
  width: 100%;
  border: 1px solid rgba(107, 114, 128, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.privacy-toggle {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  transition: color 0.3s var(--ease-out-expo);
}

.privacy-toggle::-webkit-details-marker {
  display: none;
}

.privacy-toggle::before {
  content: '▶';
  display: inline-block;
  margin-right: 8px;
  font-size: 0.7em;
  transition: transform 0.3s var(--ease-out-expo);
}

.privacy-expander[open] .privacy-toggle::before {
  transform: rotate(90deg);
}

.privacy-toggle:hover {
  color: var(--accent);
}

.privacy-content {
  padding: 0 16px 20px;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.privacy-content h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
}

.privacy-content h3:first-of-type {
  margin-top: 16px;
}

.privacy-content p,
.privacy-content ul {
  margin: 0 0 12px;
}

.privacy-content ul {
  padding-left: 20px;
}

.privacy-content a {
  color: var(--accent);
  text-decoration: underline;
}

.privacy-content a:hover {
  text-decoration: none;
}

.privacy-updated {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Mobile: solid background for text readability over chat scroll */
@media (max-width: 639px) {
  .main {
    background: rgba(255, 255, 255, 0.96);
    padding: 20px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  .privacy-expander {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  .credits {
    background: rgba(255, 255, 255, 0.96);
    padding: 12px 16px;
    border-radius: 8px;
  }
}

@media (min-width: 640px) {
  body {
    padding: 64px 32px 48px;
  }

  .logo {
    width: 220px;
    height: 220px;
    margin-bottom: 32px;
  }

  .title {
    font-size: 4.5rem;
  }

  .tagline {
    font-size: 2rem;
  }

  .store-badge {
    font-size: 2rem;
  }

  .description {
    font-size: 1.125rem;
  }
}
