/* ============================================================
   Pop — marketing site shared stylesheet.

   Design tokens are lifted verbatim from the mobile app's
   `pop-app/src/theme/tokens.ts` and `FULL_REQUIREMENT.md` §4 so
   the website and the app feel like one product. When the app
   tokens change, mirror them here.

   Fonts (loaded via Google Fonts on every page):
     Fraunces  — display, italic for emotional emphasis
     Manrope   — body
   ============================================================ */

:root {
  /* fonts */
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body:    "Manrope", -apple-system, BlinkMacSystemFont,
                  "Segoe UI", "PingFang TC", "Noto Sans TC",
                  "Helvetica Neue", Arial, sans-serif;

  /* dark surface — primary marketing palette */
  --bg-deep:     #0b0c1f;
  --bg-mid:      #14152e;
  --text:        #f5f2ee;
  --text-dim:    rgba(245, 242, 238, 0.62);
  --text-mute:   rgba(245, 242, 238, 0.40);
  --surface:     rgba(255, 255, 255, 0.04);
  --surface-hi:  rgba(255, 255, 255, 0.09);
  --border:      rgba(255, 255, 255, 0.10);
  --border-hi:   rgba(255, 255, 255, 0.25);

  /* bubble palette — theme-independent */
  --close-a:  #ffcf6b;
  --close-b:  #ff8a5b;
  --close-c:  #d85a3c;
  --all-a:    #a7f3d0;
  --all-b:    #7dd3fc;
  --all-c:    #3f8acc;
  --custom-a: #f0abfc;
  --custom-b: #c4b5fd;
  --custom-c: #7c5cdf;

  /* spacing & radius (FULL_REQUIREMENT §4.3) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 100px;

  /* motion */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-emphasis: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 180ms;
  --dur-base: 280ms;
  --dur-slow: 480ms;
  --dur-breathe: 3500ms;
}

/* light-mode override — matches FULL_REQUIREMENT §4.1 light tokens */
@media (prefers-color-scheme: light) {
  :root {
    --bg-deep:    #fdf8f3;
    --bg-mid:     #f5ede3;
    --text:       #2a1f1a;
    --text-dim:   rgba(42, 31, 26, 0.60);
    --text-mute:  rgba(42, 31, 26, 0.40);
    --surface:    rgba(42, 31, 26, 0.04);
    --surface-hi: rgba(42, 31, 26, 0.08);
    --border:     rgba(42, 31, 26, 0.08);
    --border-hi:  rgba(42, 31, 26, 0.20);
  }
}

/* ============================================================
   Reset
   ============================================================ */

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

html { scroll-behavior: smooth; }

html, body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  /* match the app's home gradient: deep + mid + warm radial */
  background-image:
    radial-gradient(ellipse 70% 50% at 18% 8%, rgba(255, 138, 91, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 45% at 92% 92%, rgba(125, 211, 252, 0.07), transparent 70%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  background-attachment: fixed;
}

@media (prefers-color-scheme: light) {
  body {
    background-image:
      radial-gradient(ellipse 70% 50% at 18% 8%, rgba(255, 138, 91, 0.18), transparent 70%),
      radial-gradient(ellipse 60% 45% at 92% 92%, rgba(196, 181, 253, 0.16), transparent 70%),
      linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  }
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

/* ============================================================
   Typography
   ============================================================ */

.kicker {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.display-regular {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, var(--close-a) 50%, var(--custom-b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-color-scheme: light) {
  .gradient-text {
    background: linear-gradient(135deg, var(--text) 0%, var(--close-c) 50%, var(--custom-c) 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.7;
}

p.lead {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(42px, 6vw, 64px); line-height: 1.04; }
h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; }
h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.25; }
h4 { font-size: 17px; line-height: 1.35; }

ul, ol { padding-left: 22px; }
li { color: var(--text-dim); margin-bottom: 6px; }

code, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--surface-hi);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================================
   Layout
   ============================================================ */

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

section {
  padding: var(--space-20) 0;
}

@media (max-width: 640px) {
  section { padding: var(--space-16) 0; }
}

/* ============================================================
   Top bar
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg-deep) 70%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: var(--text);
}

.brand .dot {
  color: var(--close-b);
}

.nav {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.nav a {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  transition: color var(--dur-fast) var(--ease-standard);
}

.nav a:hover { color: var(--text); }

@media (max-width: 640px) {
  .nav { gap: var(--space-4); }
  .nav a:not(.nav-cta) { display: none; }
}

.nav-cta {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: var(--bg-deep) !important;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: transform var(--dur-fast) var(--ease-standard);
}

.nav-cta:hover { transform: translateY(-1px); }

/* Language switcher — native <select>, styled to match the nav */
.lang-switcher {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 28px 6px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.lang-switcher:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

.lang-switcher:focus {
  outline: none;
  color: var(--text);
  border-color: var(--border-hi);
}

.lang-switcher option {
  background: var(--bg-mid);
  color: var(--text);
}

@media (max-width: 640px) {
  .lang-switcher {
    padding: 5px 24px 5px 10px;
    font-size: 11px;
  }
}

/* Legal pages: when JS injects sections via data-i18n-sections,
   keep the spacing consistent with the static-default markup. */
.legal-section + .legal-section { margin-top: var(--space-8); }
.legal-section h2 { margin-top: 0; margin-bottom: var(--space-3); }
.legal-section p { margin-bottom: var(--space-4); }
.legal-section ul, .legal-section ol { margin-bottom: var(--space-4); }
.legal-section table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: 13px;
}
.legal-section th, .legal-section td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-dim);
}
.legal-section th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.legal-section a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-hi);
  text-underline-offset: 3px;
}
.legal-section a:hover { text-decoration-color: var(--text); }

/* Authoritative-version banner shown at the top of every legal page */
.authoritative-banner {
  margin: 0 0 var(--space-6);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}
.authoritative-banner strong { color: var(--text); }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  text-align: center;
  padding-top: var(--space-20);
  padding-bottom: var(--space-16);
  position: relative;
}

.hero-bubble-stage {
  height: 220px;
  position: relative;
  margin-bottom: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero h1 { margin-bottom: var(--space-4); }

.hero p {
  max-width: 540px;
  margin: 0 auto var(--space-8);
  font-size: 16px;
  line-height: 1.7;
}

.hero-cta-row {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Bubbles (decorative gradient circles, breathing)
   ============================================================ */

.bubble {
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.bubble--breathing { animation: breathe var(--dur-breathe) ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .bubble--breathing { animation: none; }
}

.bubble--close {
  background: radial-gradient(circle at 30% 28%, var(--close-a), var(--close-b) 65%, var(--close-c));
  box-shadow: 0 20px 80px rgba(255, 138, 91, 0.36);
}

.bubble--all {
  background: radial-gradient(circle at 30% 28%, var(--all-a), var(--all-b) 65%, var(--all-c));
  box-shadow: 0 20px 80px rgba(125, 211, 252, 0.32);
}

.bubble--custom {
  background: radial-gradient(circle at 30% 28%, var(--custom-a), var(--custom-b) 65%, var(--custom-c));
  box-shadow: 0 20px 80px rgba(196, 181, 253, 0.34);
}

.bubble--shine::after {
  content: "";
  position: absolute;
  inset: 6% 50% 50% 6%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  filter: blur(3px);
  opacity: 0.7;
}

.bubble--lg { width: 200px; height: 200px; }
.bubble--md { width: 140px; height: 140px; }
.bubble--sm { width: 64px; height: 64px; }

/* floating bubbles around the hero */
.float-bubble {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.float-bubble--a {
  top: -10px; left: 8%;
  width: 56px; height: 56px;
  background: radial-gradient(circle at 30% 28%, var(--all-a), var(--all-b) 65%, var(--all-c));
  opacity: 0.6;
  animation: float-y 7s ease-in-out infinite;
}

.float-bubble--b {
  top: 80px; right: 10%;
  width: 36px; height: 36px;
  background: radial-gradient(circle at 30% 28%, var(--custom-a), var(--custom-b) 65%, var(--custom-c));
  opacity: 0.55;
  animation: float-y 9s ease-in-out infinite reverse;
}

.float-bubble--c {
  bottom: 10px; left: 18%;
  width: 28px; height: 28px;
  background: radial-gradient(circle at 30% 28%, var(--close-a), var(--close-b) 65%, var(--close-c));
  opacity: 0.5;
  animation: float-y 11s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  .float-bubble { animation: none; }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: transform var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--text);
  color: var(--bg-deep);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-hi);
}

/* ============================================================
   Card grids
   ============================================================ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.feature {
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard);
}

.feature:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.feature-icon--close { background: radial-gradient(circle at 30% 28%, var(--close-a), var(--close-b) 65%, var(--close-c)); }
.feature-icon--all   { background: radial-gradient(circle at 30% 28%, var(--all-a),   var(--all-b)   65%, var(--all-c));   }
.feature-icon--custom{ background: radial-gradient(circle at 30% 28%, var(--custom-a),var(--custom-b)65%, var(--custom-c));}
.feature-icon--surface { background: var(--surface-hi); border: 1px solid var(--border); }

.feature h3 { margin-bottom: var(--space-2); }
.feature p  { font-size: 14px; line-height: 1.65; }

/* ============================================================
   Section heading
   ============================================================ */

.section-head {
  text-align: center;
  margin-bottom: var(--space-8);
}

.section-head .kicker { display: block; margin-bottom: var(--space-3); }
.section-head h2 { margin-bottom: var(--space-3); }
.section-head p {
  max-width: 540px;
  margin: 0 auto;
  font-size: 15px;
}

/* ============================================================
   Anti-feature list — "what Pop doesn't do"
   ============================================================ */

.anti {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}

.anti h3 { margin-bottom: var(--space-3); }

.anti-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.anti-list li {
  font-size: 14px;
  color: var(--text-dim);
  padding-left: 24px;
  position: relative;
  margin-bottom: 0;
}

.anti-list li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: var(--close-c);
  font-weight: 700;
}

/* ============================================================
   Audience strip — coloured info row
   ============================================================ */

.audience-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.audience-card {
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.audience-card .audience-bubble {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
}

.audience-card h4 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  margin-bottom: var(--space-2);
}

.audience-card p { font-size: 13px; }

/* ============================================================
   Steps — numbered timeline
   ============================================================ */

.steps {
  margin-top: var(--space-10);
  display: grid;
  gap: var(--space-5);
}

.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
}

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--close-a), var(--close-b));
  color: #3d1a0b;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h4 { margin-bottom: 4px; }
.step p { font-size: 14px; }

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-10) 0 var(--space-12);
  margin-top: var(--space-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

.footer h5 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: var(--space-3);
}

.footer ul { list-style: none; padding: 0; }
.footer li { margin-bottom: var(--space-2); }
.footer a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color var(--dur-fast) var(--ease-standard);
}
.footer a:hover { color: var(--text); }

.footer-meta {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ============================================================
   Long-form prose pages (legal, account-delete)
   ============================================================ */

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6) var(--space-16);
}

.prose h1 { margin-bottom: var(--space-2); }
.prose h2 { margin-top: var(--space-10); margin-bottom: var(--space-3); }
.prose h3 { margin-top: var(--space-6); margin-bottom: var(--space-2); font-size: 17px; }

.prose .lede {
  font-size: 15px;
  color: var(--text-dim);
  margin: 0 0 var(--space-8);
  line-height: 1.7;
}

.prose p { margin-bottom: var(--space-4); }

.prose ul, .prose ol { margin-bottom: var(--space-4); }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: 13px;
}

.prose th, .prose td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-dim);
}

.prose th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.prose .updated {
  margin-top: var(--space-12);
  font-size: 12px;
  color: var(--text-mute);
}

.prose .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: var(--space-6);
  transition: color var(--dur-fast) var(--ease-standard);
}

.prose .back:hover { color: var(--text); }

/* "callout" boxes for important callouts inside prose */
.callout {
  padding: var(--space-5) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  margin: var(--space-5) 0;
}

.callout--warn { border-color: rgba(216, 90, 60, 0.4); }
.callout p:last-child { margin-bottom: 0; }
