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

:root {
  --moon:   #9baacf;
  --mist:   #6b7fa8;
  --deep:   #1a1830;
  --panel:  rgba(10, 9, 28, 0.55);
  --border: rgba(155, 170, 207, 0.10);
  --text:   #d4d8ea;
  --dim:    rgba(212, 216, 234, 0.55);
  --accent: #7b8db0;
  --fav:    #c47e8a;
  --green:  #7fc47e;
  /* Safe areas */
  --safe-t: env(safe-area-inset-top,    0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left,   0px);
  --safe-r: env(safe-area-inset-right,  0px);
}

/* ─── Base ───────────────────────────────────────────────────── */
html { height: -webkit-fill-available; scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding:
    calc(2rem + var(--safe-t))
    calc(1rem  + var(--safe-r))
    calc(3rem + var(--safe-b))
    calc(1rem  + var(--safe-l));
  background: linear-gradient(135deg, #080617 0%, #1b1640 45%, #0e1228 100%);
  background-size: 400% 400%;
  animation: nightFlow 24s ease-in-out infinite;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-size: 1rem;
}

/* Starfield */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 25%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 72% 18%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 60%, rgba(255,255,255,0.30) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 40%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 30% 85%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 63% 90%, rgba(255,255,255,0.15) 0%, transparent 100%);
  pointer-events: none; z-index: 0;
}

@keyframes nightFlow {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* ─── Layout ─────────────────────────────────────────────────── */
.page-wrapper {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; align-items: center;
}

.glass-panel {
  width: 100%;
  background: var(--panel);
  backdrop-filter: blur(32px) saturate(1.3);
  -webkit-backdrop-filter: blur(32px) saturate(1.3);
  border-radius: 28px;
  border: 1px solid var(--border);
  padding: 2.2rem 1.6rem 2rem;
  text-align: center; color: var(--text);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.6),
    0 4px 16px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ─── Breathing circle ───────────────────────────────────────── */
.circle-container {
  position: relative; width: 140px; height: 140px;
  margin: 0 auto 1.4rem;
  display: flex; justify-content: center; align-items: center;
}
.orbit-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(155,170,207,0.11);
}
.ring-1 { width: 128px; height: 128px; animation: orbit 15s linear infinite; }
.ring-2 { width: 104px; height: 104px; animation: orbit 11s linear infinite reverse; }

@keyframes orbit { to { transform: rotate(360deg); } }

.breathing-circle {
  width: 76px; height: 76px;
  background: radial-gradient(circle at 38% 35%, #b0beda 0%, #4a5d8a 55%, #1e2a4a 100%);
  border-radius: 50%;
  filter: blur(1.5px);
  box-shadow: 0 0 36px rgba(123,141,176,0.42), 0 0 72px rgba(100,120,170,0.16);
  animation: breathe 10s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.88); opacity: 0.45; }
  50%       { transform: scale(1.35); opacity: 0.85; }
}

/* ─── Tagline ────────────────────────────────────────────────── */
.tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem; font-weight: 300; line-height: 1.8;
  color: var(--dim); margin-bottom: 1.6rem; letter-spacing: 0.02em;
}
.tagline em { font-style: italic; opacity: 0.72; }

/* ─── Paywall: brand ─────────────────────────────────────────── */
.brand-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.9rem; font-weight: 300;
  letter-spacing: 7px; text-transform: uppercase;
  color: var(--text); margin-bottom: 0.4rem;
}
.brand-sub {
  font-size: 0.84rem; color: var(--dim);
  line-height: 1.75; margin-bottom: 1.1rem;
}

/* Preview chips */
.preview-chips {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.32rem; margin-bottom: 1rem;
}
.preview-chips span {
  font-size: 0.68rem; padding: 0.26rem 0.58rem; border-radius: 20px;
  background: rgba(155,170,207,0.07); border: 1px solid rgba(155,170,207,0.11);
  color: var(--mist);
}

/* Perks row */
.perks-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.4rem; margin-bottom: 1.4rem;
}
.perk-pill {
  display: inline-flex; align-items: center; gap: 0.28rem;
  font-size: 0.67rem;
  color: var(--green); background: rgba(127,196,126,0.07);
  border: 1px solid rgba(127,196,126,0.16); border-radius: 20px;
  padding: 0.26rem 0.62rem;
}
.perk-pill.muted {
  color: var(--mist); background: rgba(155,170,207,0.06);
  border-color: rgba(155,170,207,0.12);
}

/* ─── Auth gate & success ────────────────────────────────────── */
.gate-panel, .success-panel { max-width: 340px; margin: 0 auto; }
.gate-msg { font-size: 0.87rem; color: var(--dim); margin-bottom: 1.2rem; line-height: 1.65; }
.gate-back { font-size: 0.76rem; color: var(--mist); text-decoration: none; }
.gate-back:hover { text-decoration: underline; }

.success-icon {
  font-size: 2.4rem; margin-bottom: 1rem;
  animation: spin 1s linear infinite;
  display: inline-block; color: var(--moon);
}
.success-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.55rem; font-weight: 300; color: var(--text); margin-bottom: 0.45rem;
}
.success-msg { font-size: 0.83rem; color: var(--dim); margin-bottom: 1.5rem; line-height: 1.65; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── App selector label ─────────────────────────────────────── */
.selector-label {
  font-size: 0.59rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--mist); margin-bottom: 0.62rem; opacity: 0.75; text-align: left;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  padding: 1.6rem 1rem 0.5rem;
  text-align: center;
}
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; gap: 0.3rem 0.5rem;
  margin-bottom: 0.6rem;
}
.footer-links a {
  font-size: 0.68rem; color: var(--mist); text-decoration: none;
  opacity: 0.6; transition: opacity 0.18s;
}
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.footer-dot { font-size: 0.55rem; color: var(--mist); opacity: 0.3; }
.footer-copy {
  font-size: 0.62rem; color: var(--mist); opacity: 0.38; line-height: 1.6;
}
.footer-copy a { color: var(--mist); text-decoration: none; opacity: 0.7; }
.footer-copy a:hover { text-decoration: underline; opacity: 1; }

/* ─── Responsive ─────────────────────────────────────────────── */

/* Extra-small phones (iPhone SE, Galaxy A01, etc.) */
@media (max-width: 359px) {
  body { padding: 1.2rem 0.75rem 2.5rem; }
  .glass-panel { padding: 1.6rem 1rem 1.5rem; border-radius: 22px; }
  .brand-title  { font-size: 1.6rem; letter-spacing: 5px; }
  .circle-container { width: 110px; height: 110px; }
  .ring-1 { width: 100px; height: 100px; }
  .ring-2 { width: 80px;  height: 80px; }
  .breathing-circle { width: 58px; height: 58px; }
  .preview-chips span { font-size: 0.63rem; }
}

/* Small phones (≤ 390px) */
@media (max-width: 390px) {
  .glass-panel { padding: 1.8rem 1.1rem 1.6rem; border-radius: 24px; }
  .brand-title  { font-size: 1.7rem; letter-spacing: 5px; }
  .circle-container { width: 120px; height: 120px; }
  .ring-1 { width: 110px; height: 110px; }
  .ring-2 { width: 90px;  height: 90px; }
  .breathing-circle { width: 64px; height: 64px; }
}

/* Tablets and up */
@media (min-width: 520px) {
  body { padding: 3rem 2rem 4rem; }
  .glass-panel { padding: 2.8rem 2.4rem 2.4rem; border-radius: 34px; }
  .brand-title  { font-size: 2.1rem; letter-spacing: 8px; }
  .circle-container { width: 160px; height: 160px; }
  .ring-1 { width: 148px; height: 148px; }
  .ring-2 { width: 120px; height: 120px; }
  .breathing-circle { width: 84px; height: 84px; }
}

/* Desktop */
@media (min-width: 768px) {
  body { padding: 4rem 2rem 5rem; }
  .glass-panel  { padding: 3.2rem 3rem 2.8rem; }
  .brand-title  { font-size: 2.4rem; letter-spacing: 9px; }
  .tagline      { font-size: 1.08rem; }
}

/* Large desktop */
@media (min-width: 1024px) {
  .page-wrapper { max-width: 520px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .breathing-circle, .ring-1, .ring-2, body { animation: none; }
  .cta-btn:hover:not(:disabled) { transform: none; }
}
