:root {
  --paper: #f5efe3;
  --paper-dark: #ebe0c9;
  --ink: #2a2520;
  --ink-light: #5a5044;
  --gold: #c9a15b;
  --gold-bright: #e8c07d;
  --gold-dark: #7a5420;
  --border: #d4c5a5;
  --night: #0a0f2c;
  --night-deep: #05081a;
  --night-blue: #1a2050;
  --max-width: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container.center { text-align: center; }

/* ─── Starfield animated background for dark sections ─── */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 60% 70%, #fff 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 10%, var(--gold-bright) 50%, transparent 100%),
    radial-gradient(1px 1px at 30% 80%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 90% 40%, #fff 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 10% 60%, var(--gold-bright) 50%, transparent 100%),
    radial-gradient(1px 1px at 50% 50%, #fff 50%, transparent 100%);
  background-size: 400px 400px;
  opacity: 0;
  pointer-events: none;
  animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ─── Header ─── */
.header-dark {
  background: rgba(5, 8, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 161, 91, 0.15);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 1rem;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-bright);
  text-decoration: none;
  letter-spacing: 0.1em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--gold-bright); }

/* ─── Hero (dark) ─── */
.hero-dark {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(201, 161, 91, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(26, 32, 80, 0.8) 0%, transparent 60%),
    linear-gradient(180deg, var(--night-deep) 0%, var(--night) 50%, var(--night-blue) 100%);
  padding: 5rem 0 6rem;
  overflow: hidden;
}

.hero-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.8), transparent 50%),
    radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,0.6), transparent 50%),
    radial-gradient(1px 1px at 50% 40%, rgba(255,255,255,0.9), transparent 50%),
    radial-gradient(2px 2px at 70% 70%, rgba(232,192,125,0.8), transparent 50%),
    radial-gradient(1px 1px at 90% 30%, rgba(255,255,255,0.7), transparent 50%),
    radial-gradient(1px 1px at 15% 60%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 50%, rgba(232,192,125,0.6), transparent 50%),
    radial-gradient(1px 1px at 40% 10%, rgba(255,255,255,0.8), transparent 50%),
    radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,0.7), transparent 50%),
    radial-gradient(1px 1px at 25% 45%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(1px 1px at 75% 25%, rgba(255,255,255,0.6), transparent 50%);
  background-size: 100% 100%;
  pointer-events: none;
  animation: slow-twinkle 6s ease-in-out infinite;
}

@keyframes slow-twinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.hero-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-copy {
  color: #fff;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(201, 161, 91, 0.1);
  border: 1px solid rgba(201, 161, 91, 0.3);
  border-radius: 20px;
}

.eyebrow.dark {
  color: var(--gold-dark);
  background: rgba(122, 84, 32, 0.08);
  border-color: rgba(122, 84, 32, 0.25);
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--gold-bright) 0%, #fff 50%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.hero-tagline {
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.hero-sub {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2rem;
  max-width: 500px;
}

.cta-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cta-row.center { justify-content: center; margin: 2rem auto; }

.app-store-badge {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s;
}

.app-store-badge:hover { transform: translateY(-2px); }

.app-store-badge svg {
  width: 180px;
  height: 60px;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.btn-secondary {
  padding: 0.85rem 1.75rem;
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid rgba(201, 161, 91, 0.5);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn-secondary:hover {
  background: rgba(201, 161, 91, 0.1);
  border-color: var(--gold-bright);
}

.hero-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
}

/* ─── Phone frame (hero visual) ─── */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-frame {
  position: relative;
  width: 280px;
  border-radius: 36px;
  overflow: hidden;
  box-shadow:
    0 0 0 8px #1a1a1a,
    0 0 0 9px #333,
    0 20px 60px rgba(201, 161, 91, 0.2),
    0 30px 80px rgba(0, 0, 0, 0.5);
  z-index: 2;
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
  transition: transform 0.5s;
}

.phone-frame:hover {
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
}

.phone-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.phone-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201, 161, 91, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

/* ─── Sections ─── */
.section-paper {
  background: var(--paper);
  padding: 6rem 0;
  position: relative;
}

.section-dark {
  background:
    radial-gradient(ellipse at center, rgba(26, 32, 80, 0.5) 0%, transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-deep) 100%);
  padding: 6rem 0;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.section-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.6), transparent 50%),
    radial-gradient(1px 1px at 75% 40%, rgba(232,192,125,0.5), transparent 50%),
    radial-gradient(1.5px 1.5px at 50% 60%, rgba(255,255,255,0.8), transparent 50%),
    radial-gradient(1px 1px at 85% 75%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(1px 1px at 25% 85%, rgba(232,192,125,0.6), transparent 50%);
  pointer-events: none;
}

.section-header {
  text-align: left;
  margin-bottom: 3.5rem;
}

.section-header.center { text-align: center; }

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.05em;
  margin: 0.75rem 0 1rem;
  line-height: 1.3;
}

.section-title.light {
  background: linear-gradient(135deg, var(--gold-bright), #fff, var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--ink-light);
  max-width: 620px;
  line-height: 1.8;
}

.section-header.center .section-lead {
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.7);
}

/* ─── Features grid ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem 1.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(122, 84, 32, 0.12);
  border-color: var(--gold);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--gold-dark);
  background: var(--paper-dark);
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.feature-card p {
  color: var(--ink-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ─── Stats ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 700px;
  margin: 3rem auto 0;
  position: relative;
  z-index: 1;
}

.stat { text-align: center; }

.stat-value {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-bright), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  letter-spacing: 0.05em;
}

.stat-label {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
}

/* ─── Finale CTA (dark dramatic) ─── */
.cta-finale {
  position: relative;
  padding: 6rem 1.5rem;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(201, 161, 91, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 100%, rgba(26, 32, 80, 0.6) 0%, transparent 60%),
    linear-gradient(180deg, var(--night-deep) 0%, var(--night) 50%, var(--night-deep) 100%);
  color: #fff;
  overflow: hidden;
}

.cta-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 161, 91, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 161, 91, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.cta-icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}

.cta-icon {
  position: relative;
  z-index: 2;
  width: 120px;
  height: 120px;
  border-radius: 26px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(201, 161, 91, 0.3);
  animation: icon-float 4s ease-in-out infinite;
}

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

.cta-icon-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle, rgba(201, 161, 91, 0.4) 0%, transparent 60%);
  border-radius: 50%;
  z-index: 1;
  animation: glow-pulse 3s ease-in-out infinite;
}

.cta-finale-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 0%, var(--gold-bright) 50%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cta-finale-lead {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 3rem;
  letter-spacing: 0.05em;
}

/* ─── Pricing tiers ─── */
.cta-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.tier-card {
  padding: 2rem 1.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 161, 91, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  text-align: left;
  transition: all 0.3s;
}

.tier-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 161, 91, 0.5);
}

.tier-card.featured {
  background:
    linear-gradient(135deg, rgba(201, 161, 91, 0.12) 0%, rgba(201, 161, 91, 0.04) 100%);
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(201, 161, 91, 0.15);
  position: relative;
}

.tier-card.featured::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, var(--gold-bright), transparent, var(--gold-bright));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.tier-badge {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.tier-badge.featured-badge {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--night-deep);
  font-weight: 700;
}

.tier-price {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.price-currency {
  font-size: 1.1rem;
  color: var(--gold-bright);
  margin-right: 0.15rem;
  vertical-align: super;
}

.price-amount {
  background: linear-gradient(135deg, var(--gold-bright), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.price-period {
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 0.25rem;
}

.tier-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tier-list li {
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  padding-left: 1.5rem;
}

.tier-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold-bright);
}

.app-store-badge.large svg {
  width: 220px;
  height: 74px;
}

.cta-fine-print {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 1.5rem;
  letter-spacing: 0.05em;
}

/* ─── Footer ─── */
footer {
  background: var(--night-deep);
  color: rgba(255, 255, 255, 0.6);
  padding: 3rem 1.5rem;
  border-top: 1px solid rgba(201, 161, 91, 0.2);
}

footer .footer-links {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

footer a {
  color: var(--gold-bright);
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s;
}

footer a:hover { color: #fff; }

footer span { color: rgba(255, 255, 255, 0.3); }

.copyright {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.5rem;
}

/* ─── Legal pages (privacy / terms / support) ─── */
main.container { padding-top: 3rem; padding-bottom: 3rem; max-width: 800px; }

main h1 {
  font-size: 2.25rem;
  margin: 0 0 0.5rem;
  color: var(--gold-dark);
  letter-spacing: 0.05em;
}

main h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 1rem;
  color: var(--ink);
  border-left: 3px solid var(--gold);
  padding-left: 0.75rem;
}

main h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--ink);
}

main p { margin: 0.75rem 0; }
main ul, main ol { margin: 0.75rem 0 0.75rem 1.5rem; }
main li { margin: 0.35rem 0; }
main a { color: var(--gold-dark); }

.subtitle {
  color: var(--ink-light);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.meta {
  color: var(--ink-light);
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--paper-dark);
  border-left: 3px solid var(--gold);
  margin: 1.5rem 0;
  border-radius: 4px;
}

.lang-en { color: var(--ink-light); font-style: italic; font-size: 0.95em; }

/* Legal pages use the regular paper background, not the dark hero */
body:has(main.container) .starfield { display: none; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .hero-wrap {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-copy { text-align: center; }
  .hero-sub { margin: 0 auto 2rem; }
  .cta-row { justify-content: center; }
  .phone-frame {
    width: 240px;
    transform: perspective(1200px) rotateY(0) rotateX(0);
  }
}

@media (max-width: 640px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }
  .hero-dark { padding: 3rem 0 4rem; }
  .section-paper, .section-dark { padding: 4rem 0; }
  .stats-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-title { font-size: 3rem; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn-secondary { text-align: center; }
  main h1 { font-size: 1.75rem; }
}
