:root {
  --primary: #6A3FD1;
  --primary-dark: #4a2c9a;
  --primary-light: #ede8fb;
  --text-on-primary: #ffffff;
  --surface: #ffffff;
  --background: #f5f3ff;
  --text: #1a1a2e;
  --text-muted: #6b6b8a;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(106, 63, 209, 0.12);
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  background: var(--primary);
  color: var(--text-on-primary);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: -1px;
  flex-shrink: 0;
  color: #fff;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

header nav {
  margin-left: auto;
}

header nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

header nav a:hover {
  color: #fff;
}

/* ── Main content ── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.25rem 3rem;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* ── Pep talk card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #a78bfa);
}

#pep-talk-text {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: var(--text);
  transition: opacity 0.2s ease;
}

#pep-talk-text.fade {
  opacity: 0;
}

/* ── Generate button ── */
.btn-generate {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 0.875rem 2.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-bottom: 3rem;
  letter-spacing: 0.01em;
}

.btn-generate:hover {
  background: var(--primary-dark);
}

.btn-generate:active {
  transform: scale(0.97);
}

/* ── Download nudge ── */
.download-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  width: 100%;
  text-align: center;
}

.download-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.download-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.download-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.play-badge {
  display: block;
  transition: opacity 0.15s;
}

.play-badge:hover {
  opacity: 0.85;
}

.play-badge img {
  height: 56px;
  width: auto;
}

#qrcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

#qrcode canvas, #qrcode img {
  border-radius: 8px;
  border: 3px solid var(--primary-light);
}

#qrcode span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

footer a:hover {
  text-decoration: underline;
}

/* ── Privacy page ── */
.prose {
  max-width: 680px;
  margin: 2.5rem auto;
  padding: 0 1.25rem 3rem;
}

.prose h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.prose .last-updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.prose h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
  color: var(--text);
}

.prose p, .prose ul {
  line-height: 1.7;
  color: #3a3a5c;
  font-size: 0.95rem;
}

.prose ul {
  padding-left: 1.25rem;
  margin-top: 0.25rem;
}

.prose ul li {
  margin-bottom: 0.25rem;
}

.prose a {
  color: var(--primary);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  header h1 {
    font-size: 1rem;
  }

  .card {
    padding: 2rem 1.25rem;
    min-height: 150px;
  }

  .download-actions {
    flex-direction: column;
    gap: 1.25rem;
  }
}
