/* ═══════════════════════════════════════════════════════════════
   Hapu Landing Page — Styles (Redesign)
   Immersive, minimal, typography-driven, zero visual noise
═══════════════════════════════════════════════════════════════ */

:root {
  /* Colors */
  --bg-deep: #050814;
  --bg-sea:  #0a1128;
  --c-text:  #f8f9fa;
  --c-muted: rgba(248, 249, 250, 0.5);
  
  --brand-purple: #9b88ed;
  --brand-blue:   #64b5f6;

  /* Typography */
  --font-en: 'Inter', -apple-system, sans-serif;
  --font-zh: 'Alibaba PuHuiTi', sans-serif;
  
  /* Layout */
  --container-w: 1040px;
  --pad-x: 2rem;
  
  /* Animations */
  --ease-soft: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-breathe: cubic-bezier(0.45, 0, 0.55, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-deep);
  color: var(--c-text);
  font-family: var(--font-en);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── BILINGUAL TOGGLE BEHAVIOR ─── */
body[data-lang="en"] .lang-zh { display: none !important; }
body[data-lang="zh"] .lang-en { display: none !important; }

/* Chinese mode */
body[data-lang="zh"] {
  font-family: var(--font-zh);
  font-weight: 300;
}
body[data-lang="zh"] h1, 
body[data-lang="zh"] h2 {
  font-family: var(--font-zh);
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* ─── BACKGROUND LAYERS ─── */
.bg-layer {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
}

.bg-gradient {
  background: radial-gradient(circle at 50% 0%, var(--bg-sea) 0%, var(--bg-deep) 70%);
}

.bg-stars {
  width: 100%;
  height: 100%;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--dur) ease-in-out infinite var(--delay);
}

@keyframes twinkle {
  0%, 100% { opacity: var(--a); transform: scale(1); }
  50% { opacity: calc(var(--a) * 0.2); transform: scale(0.6); }
}

.bg-orbs {
  filter: blur(100px);
  opacity: 0.4;
}

.orb {
  position: absolute;
  border-radius: 50%;
  animation: drift 20s var(--ease-breathe) infinite alternate;
}

.orb-1 {
  width: 50vw; height: 50vw;
  background: var(--brand-purple);
  top: -10vw; right: -10vw;
}

.orb-2 {
  width: 40vw; height: 40vw;
  background: var(--brand-blue);
  bottom: -20vw; left: -10vw;
  animation-delay: -10s;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-5vw, 5vw) scale(1.1); }
}

/* ─── HEADER ─── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 1.5rem var(--pad-x);
  z-index: 100;
  transition: background 0.5s ease, backdrop-filter 0.5s ease, border 0.5s ease;
}

.site-header.scrolled {
  background: rgba(5, 8, 20, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: #fff;
}

.brand-logo {
  width: 24px;
  height: 24px;
  color: var(--brand-purple);
}

/* Center Navigation */
.header-nav {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  color: var(--c-muted);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #fff;
}

/* Language Selector */
.header-actions {
  display: flex;
  align-items: center;
}

.btn-lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--c-text);
  font-family: inherit;
  font-size: 0.8rem;
  border-radius: 20px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-lang:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-text {
  background: none;
  border: none;
  color: var(--c-muted);
  font-family: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.3s ease;
}

.btn-text:hover {
  color: #fff;
}

/* ─── TYPOGRAPHY & REVEALS ─── */
h1, h2 {
  line-height: 1.1;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.reveal-text, .reveal-fade, .reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s var(--ease-soft), transform 1.2s var(--ease-soft);
  will-change: opacity, transform;
}

.reveal-fade {
  transform: translateY(0);
}

.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* ─── HERO SECTION ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem var(--pad-x) 4rem;
  position: relative;
}

.hero-content {
  max-width: 800px;
  z-index: 10;
  margin-top: -5vh; /* Visual center adjustment */
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  color: var(--c-muted);
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.hero-stores {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.store-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-purple);
  opacity: 0.8;
}

.store-badges {
  display: flex;
  gap: 1.5rem;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--c-text);
  font-size: 0.875rem;
  font-weight: 400;
  opacity: 0.8;
}

/* Abstract Hero Visual */
.hero-abstract {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.glass-orb-container {
  position: relative;
  width: clamp(280px, 40vw, 400px);
  height: clamp(280px, 40vw, 400px);
  animation: float-slow 8s var(--ease-breathe) infinite alternate;
  opacity: 0.15; /* Subdued for text readability */
}

.glass-orb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 0 40px rgba(255,255,255,0.05), 0 20px 60px rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.orb-inner-content {
  text-align: center;
}

.orb-time {
  font-size: 3rem;
  font-weight: 200;
  letter-spacing: -0.05em;
  opacity: 0.8;
}

.orb-greeting {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 0.5rem;
}

@keyframes float-slow {
  0% { transform: translateY(-20px); }
  100% { transform: translateY(20px); }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.5;
}

.mouse {
  width: 24px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.wheel {
  width: 2px;
  height: 6px;
  background: #fff;
  border-radius: 1px;
  animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

/* ─── FEATURE SHOWCASES (The Pillars) ─── */
.feature-showcase {
  max-width: var(--container-w);
  margin: 0 auto;
  min-height: 80vh;
  display: flex;
  align-items: center;  /* Ensures vertical alignment */
  justify-content: space-between;
  gap: 6rem; /* Wider gap for high-end feel */
  padding: 8rem var(--pad-x);
}

.align-left { flex-direction: row; }
.align-right { flex-direction: row-reverse; }

.showcase-content {
  flex: 1;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.showcase-title {
  font-size: clamp(2.25rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.showcase-desc {
  font-size: 1.125rem;
  color: var(--c-muted);
  font-weight: 300;
  line-height: 1.8;
}

.showcase-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 440px;
}

/* Shared Visual Abstractions */
.minimal-tree, .audio-visual, .guide-visual {
  width: 300px;
  height: 300px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Audio Visual (Pillar 1) */
.wave {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(155, 136, 237, 0.3);
  animation: pulse-wave 6s cubic-bezier(0.21, 0.53, 0.56, 0.8) infinite;
}
.wave-1 { width: 100px; height: 100px; animation-delay: 0s; }
.wave-2 { width: 100px; height: 100px; animation-delay: 2s; }
.wave-3 { width: 100px; height: 100px; animation-delay: 4s; }

@keyframes pulse-wave {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

/* Tree Visual (Pillar 2) */
.m-trunk {
  position: absolute;
  bottom: 40px;
  width: 2px;
  height: 120px;
  background: linear-gradient(to top, rgba(255,255,255,0.1), rgba(255,255,255,0.4));
}
.m-leaf {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--brand-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--brand-blue);
  animation: float-leaf 4s ease-in-out infinite alternate;
}
.m-l-1 { bottom: 120px; left: calc(50% + 20px); animation-delay: 0s; }
.m-l-2 { bottom: 90px; left: calc(50% - 25px); background: var(--brand-purple); animation-delay: 1s; }
.m-l-3 { bottom: 150px; left: calc(50% - 5px); background: #fff; animation-delay: 2s; }
.glow-point {
  position: absolute;
  bottom: 30px;
  width: 60px; height: 10px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.2) 0%, transparent 70%);
}

@keyframes float-leaf {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

/* Guide Visual (Pillar 3) */
.focus-ring {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  animation: breathe 8s var(--ease-breathe) infinite alternate;
}
.r-2 { width: 160px; height: 160px; animation-delay: 0.5s; opacity: 0.5; }
.r-3 { width: 240px; height: 240px; animation-delay: 1s; opacity: 0.2; }

@keyframes breathe {
  0% { transform: scale(0.8); border-color: rgba(100, 181, 246, 0.1); }
  100% { transform: scale(1.1); border-color: rgba(155, 136, 237, 0.4); }
}

/* ─── SCIENCE SECTION (Expanded Content) ─── */
.science-section {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 8rem var(--pad-x);
  text-align: center;
}

.science-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 4rem;
  color: #fff;
  line-height: 1.2;
}

.science-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.science-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  transition: transform 0.4s var(--ease-soft), background 0.4s ease;
}

.science-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-10px);
}

.sc-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: rgba(155, 136, 237, 0.1);
  color: var(--brand-purple);
  display: flex;
  justify-content: center;
  align-items: center;
}

.science-card h3 {
  font-size: 1.25rem;
  font-weight: 300;
  color: #fff;
  margin-bottom: 1rem;
}

.science-card p {
  color: var(--c-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ─── CTA FORM (Early Access) ─── */
.cta-section {
  padding: 8rem var(--pad-x);
  display: flex;
  justify-content: center;
}

.cta-container {
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.cta-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-desc {
  color: var(--c-muted);
  font-weight: 300;
  margin-bottom: 3rem;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  position: relative;
}

.glass-input {
  width: 100%;
  padding: 1.2rem 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

body[data-lang="zh"] input::placeholder { color: transparent; } /* Hide EN placeholder in ZH */
body[data-lang="en"] .input-mask { display: none; } /* Hide mask in EN */

.input-mask {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.glass-input:focus + .input-mask,
.glass-input:not(:placeholder-shown) + .input-mask {
  opacity: 0;
}

.glass-input:focus {
  background: rgba(255,255,255,0.06);
  border-color: rgba(155, 136, 237, 0.5);
}

.glass-input::placeholder {
  color: var(--c-muted);
}

/* Radio Pills styling */
.platform-group {
  text-align: left;
  margin-top: 0.5rem;
}

.platform-label {
  font-size: 0.8rem;
  color: var(--c-muted);
  margin-bottom: 0.8rem;
  padding-left: 0.2rem;
}

.radio-pills {
  display: flex;
  gap: 1rem;
}

.radio-pill {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.pill-bg {
  width: 100%;
  padding: 1rem;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--c-muted);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.radio-pill:hover .pill-bg {
  background: rgba(255,255,255,0.06);
}

.radio-pill input:checked ~ .pill-bg {
  background: rgba(155, 136, 237, 0.15);
  border-color: rgba(155, 136, 237, 0.5);
  color: #fff;
  box-shadow: 0 0 20px rgba(155, 136, 237, 0.1); /* Subtle premium glow */
}

.btn-submit {
  background: #fff;
  color: var(--bg-deep);
  border: none;
  border-radius: 8px;
  padding: 1.2rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 56px;
}

.btn-submit:hover {
  background: #e9ecef;
  transform: translateY(-2px);
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(5,8,20,0.2);
  border-top-color: var(--bg-deep);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.form-success {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: fade-in 0.5s ease forwards;
}

.form-success svg {
  color: var(--brand-purple);
}

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

/* ─── FOOTER ─── */
.site-footer {
  padding: 4rem var(--pad-x) 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--c-muted);
  font-weight: 300;
  letter-spacing: 0.1em;
}

.footer-legal {
  text-align: right;
  color: rgba(255,255,255,0.3);
  font-size: 0.75rem;
}

.disclaimer {
  margin-top: 0.25rem;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .feature-showcase,
  .feature-showcase.align-right {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    padding: 4rem var(--pad-x);
  }
  
  .showcase-content {
    max-width: 100%;
  }

  .science-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  :root { --pad-x: 1.5rem; }
  
  .hero-title { font-size: 3rem; }
  .hero-abstract { display: none; } /* Hide orb on very small screens for pure text focus */
  .hero-content { margin-top: 0; }
  
  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
  }
  .footer-legal { text-align: center; }
}

/* Prevent layout shift when changing font family */
html {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}
