/* === Design System — "Ethereal Glass" Vibe (high-end-visual-design) === */
/* Aesthetic: OLED deep black + radial mesh glow + premium glass depth */
/* Layout: Asymmetric spacing + Double-Bezel nested cards */
/* Motion: Custom cubic-bezier spring physics */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;700;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #00D4FF;
  --primary-dark: #0088FF;
  --accent: #7C3AED;
  --accent-light: #A78BFA;
  --bg-deep: #050508;
  --bg-card: #0c1017;
  --bg-card-inner: #0f141c;
  --bg-alt: #080b12;
  --text-primary: #F1F5F9;
  --text-secondary: #8B99AE;
  --text-muted: #556171;
  --border: rgba(255,255,255,0.04);
  --border-glow: rgba(0,212,255,0.12);
  --border-card: rgba(255,255,255,0.06);
  --glass: rgba(255,255,255,0.02);
  --glass-hover: rgba(255,255,255,0.05);
  --radius-xl: 24px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-ambient: 0 8px 40px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 60px rgba(0,212,255,0.06);
  --nav-h: 64px;
  --gradient: linear-gradient(135deg, var(--primary), var(--primary-dark));
  --gradient-accent: linear-gradient(135deg, var(--primary), var(--accent));
  /* Spring-physics easing (high-end-visual-design §5) */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: color .3s var(--ease-spring); }
a:hover { color: var(--accent-light); }

/* === prefers-reduced-motion (scroll-experience §Accessible) === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === Utilities === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === Floating Island Nav (high-end-visual-design §5A) === */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: center;
  padding: 16px 24px 0;
  pointer-events: none;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 900px; width: 100%;
  background: rgba(12,16,23,0.7);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-card);
  border-radius: 100px;
  padding: 8px 8px 8px 20px;
  pointer-events: auto;
  transition: all .5s var(--ease-spring);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.nav.scrolled .nav-inner {
  background: rgba(8,11,18,0.9);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
}
.nav-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.95rem; color: var(--text-primary); white-space: nowrap; }
.logo-icon { border-radius: 6px; object-fit: cover; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
  padding: 6px 14px; border-radius: 100px;
  transition: all .4s var(--ease-spring);
}
.nav-links a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.lang-btn {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary); padding: 6px 14px; border-radius: 100px;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: all .4s var(--ease-spring); font-family: inherit;
}
.lang-btn:hover { background: rgba(0,212,255,0.08); color: var(--primary); border-color: var(--border-glow); }
.gh-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--text-primary); color: var(--bg-deep);
  padding: 8px 18px; border-radius: 100px;
  font-size: 0.82rem; font-weight: 600;
  transition: all .4s var(--ease-spring);
}
.gh-btn:hover { transform: scale(0.97); color: var(--bg-deep); box-shadow: 0 0 20px rgba(255,255,255,0.1); }
.gh-btn:active { transform: scale(0.95); }
.menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.menu-btn span { display: block; width: 18px; height: 1.5px; background: var(--text-secondary); margin: 4px 0; border-radius: 2px; transition: all .4s var(--ease-spring); transform-origin: center; }
.menu-btn.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-btn.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.nav-links a.active { color: var(--primary); background: rgba(0,212,255,0.06); }

/* === Hero === */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 140px 24px 100px;
}
/* Radial mesh glow (Ethereal Glass vibe) */
.hero::before {
  content: ''; position: absolute;
  top: -20%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(0,212,255,0.08) 0%, rgba(124,58,237,0.04) 40%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 820px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,212,255,0.06); border: 1px solid rgba(0,212,255,0.15);
  padding: 6px 18px; border-radius: 100px;
  font-size: 0.78rem; color: var(--primary); font-weight: 500;
  margin-bottom: 32px; letter-spacing: 0.02em;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: pulse-dot 2s ease infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,212,255,0.4); } 50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(0,212,255,0); } }

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 800;
  line-height: 1.1; margin-bottom: 24px;
  letter-spacing: -0.03em;
}
.hero-line { display: block; }
.hero-desc {
  font-size: 1.05rem; color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 40px;
  line-height: 1.8; font-weight: 400;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 64px; flex-wrap: wrap; }

/* Button-in-Button architecture (high-end-visual-design §4B) */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 100px; font-weight: 600;
  font-size: 0.9rem; cursor: pointer; border: none;
  font-family: inherit;
  transition: all .5s var(--ease-spring);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 4px 24px rgba(0,212,255,0.2), inset 0 1px 1px rgba(255,255,255,0.15);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 32px rgba(0,212,255,0.3); color: #fff; }
.btn-outline {
  background: rgba(255,255,255,0.03); color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
}
.btn-outline:hover { border-color: rgba(0,212,255,0.25); color: var(--primary); background: rgba(0,212,255,0.04); }

.hero-stats { display: flex; gap: 56px; justify-content: center; }
.stat { text-align: center; }
.stat-num {
  display: block; font-size: 1.6rem; font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -0.02em;
}
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }

/* === Sections (generous py-28 to py-32 per high-end-visual-design §4C) === */
.section { padding: 112px 0; }
.section-alt { background: var(--bg-alt); }
.section-header { text-align: center; margin-bottom: 64px; }
.section-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 600; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 14px;
  background: rgba(0,212,255,0.06); padding: 5px 16px; border-radius: 100px;
  border: 1px solid rgba(0,212,255,0.1);
}
.section-header h2 {
  font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 800;
  margin-bottom: 14px; letter-spacing: -0.025em;
}
.section-desc { color: var(--text-secondary); font-size: 1rem; max-width: 520px; margin: 0 auto; }

/* === Double-Bezel Cards (high-end-visual-design §4A) === */
/* Outer shell + inner core for machined hardware feel */
.highlights-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.highlight-card {
  /* Outer Shell */
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 3px;
  transition: all .6s var(--ease-spring);
  will-change: transform;
}
.highlight-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-6px);
  box-shadow: var(--shadow-ambient), var(--shadow-glow);
}
.highlight-card-inner {
  /* Inner Core */
  background: var(--bg-card-inner);
  border-radius: calc(var(--radius-xl) - 3px);
  padding: 36px 28px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
  height: 100%;
}
.hc-icon { font-size: 2rem; margin-bottom: 18px; }
.highlight-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.highlight-card p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.75; }

/* === Showcase (alternating text + screenshots) === */
.showcase {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: center;
}
.showcase-reverse { direction: rtl; }
.showcase-reverse > * { direction: ltr; }
.showcase-text .section-tag { margin-bottom: 16px; }
.showcase-text h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800;
  margin-bottom: 16px; letter-spacing: -0.02em;
}
.showcase-text p {
  color: var(--text-secondary); font-size: 0.92rem;
  line-height: 1.8; margin-bottom: 24px;
}
.showcase-features {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.showcase-features span {
  background: rgba(0,212,255,0.06); border: 1px solid rgba(0,212,255,0.1);
  padding: 6px 14px; border-radius: 100px;
  font-size: 0.78rem; color: var(--text-secondary); font-weight: 500;
}
.showcase-images {
  display: flex; gap: 16px; justify-content: center;
  position: relative;
}
/* Phone frame with device bezel */
.phone-frame {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-card);
  border-radius: 28px; padding: 4px;
  overflow: hidden; max-width: 220px;
  box-shadow: var(--shadow-ambient);
  transition: all .6s var(--ease-spring);
}
.phone-frame:hover {
  border-color: var(--border-glow);
  transform: translateY(-6px);
  box-shadow: var(--shadow-ambient), var(--shadow-glow);
}
.phone-frame img {
  width: 100%; height: auto; display: block;
  border-radius: 24px;
}
.phone-overlap {
  margin-left: -40px; margin-top: 60px;
  position: relative; z-index: 1;
}

/* === Architecture === */
.arch-flow { max-width: 580px; margin: 0 auto 48px; }
.arch-layer {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius); padding: 3px;
}
.arch-layer-inner {
  background: var(--bg-card-inner);
  border-radius: calc(var(--radius) - 3px);
  padding: 22px; text-align: center;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
}
.arch-layer h4 { font-size: 0.78rem; color: var(--primary); margin-bottom: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.arch-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.arch-tags span {
  background: rgba(0,212,255,0.05); border: 1px solid rgba(0,212,255,0.1);
  padding: 4px 12px; border-radius: 100px; font-size: 0.75rem; color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}
.arch-arrow { text-align: center; padding: 6px 0; color: var(--text-muted); font-size: 1rem; opacity: 0.4; }
.arch-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tech-badge {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border-card);
  padding: 8px 16px; border-radius: 100px;
  font-size: 0.8rem; color: var(--text-secondary); font-weight: 500;
  transition: all .4s var(--ease-spring);
}
.tech-badge:hover { border-color: var(--border-glow); color: var(--primary); background: rgba(0,212,255,0.04); }

/* === Models === */
.models-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.model-group {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl); padding: 3px;
}
.model-group-inner {
  background: var(--bg-card-inner);
  border-radius: calc(var(--radius-xl) - 3px);
  padding: 26px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
}
.model-group h4 { font-size: 0.95rem; margin-bottom: 16px; font-weight: 600; }
.model-list { display: flex; flex-wrap: wrap; gap: 6px; }
.model-tag {
  background: rgba(0,212,255,0.04); border: 1px solid rgba(0,212,255,0.08);
  padding: 3px 10px; border-radius: 100px; font-size: 0.72rem; color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  transition: all .3s var(--ease-spring);
}
.model-tag:hover { background: rgba(0,212,255,0.1); color: var(--primary); }

/* === Soul Engine === */
.soul-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.soul-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl); padding: 3px;
  transition: all .6s var(--ease-spring);
  will-change: transform; position: relative; overflow: hidden;
}
.soul-card::after {
  content: ''; position: absolute; bottom: 0; left: 3px; right: 3px; height: 2px;
  background: var(--gradient-accent); opacity: 0;
  transition: opacity .5s var(--ease-spring);
  border-radius: 0 0 calc(var(--radius-xl) - 3px) calc(var(--radius-xl) - 3px);
}
.soul-card:hover { border-color: var(--border-glow); transform: translateY(-5px); }
.soul-card:hover::after { opacity: 1; }
.soul-card-inner {
  background: var(--bg-card-inner);
  border-radius: calc(var(--radius-xl) - 3px);
  padding: 30px 22px; text-align: center;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
}
.soul-icon { font-size: 1.8rem; margin-bottom: 14px; }
.soul-card h3 {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 8px;
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.soul-card p { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.7; }

/* === Download (Double-Bezel) === */
.download-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; max-width: 680px; margin: 0 auto 36px; }
.download-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl); padding: 3px;
  transition: all .6s var(--ease-spring); will-change: transform;
}
.download-card:hover { border-color: var(--border-glow); transform: translateY(-4px); box-shadow: var(--shadow-ambient); }
.download-card-inner {
  background: var(--bg-card-inner);
  border-radius: calc(var(--radius-xl) - 3px);
  padding: 36px 26px; text-align: center;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
}
.dl-icon { font-size: 2.2rem; margin-bottom: 16px; }
.download-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.download-card p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 22px; }
.dl-info { text-align: center; color: var(--text-muted); font-size: 0.82rem; }
.dl-info a { display: inline-block; margin-top: 8px; }

/* === Footer === */
.footer { border-top: 1px solid var(--border); padding: 56px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.footer-logo { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.footer-brand p { color: var(--text-muted); font-size: 0.82rem; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-secondary); font-size: 0.85rem; transition: color .3s var(--ease-spring); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 28px; border-top: 1px solid var(--border); }
.footer-bottom p { color: var(--text-muted); font-size: 0.75rem; }

/* === Scroll Reveal Animation ===
 * IMPORTANT: !important is intentional here — it prevents
 * .highlight-card, .soul-card etc.'s "transition: all" from
 * overriding the reveal animation's transition property.
 * Stagger delays are injected by JS for reliability.
 */
.reveal {
  opacity: 0 !important;
  transform: translateY(40px) !important;
  transition: opacity .6s var(--ease-out-expo),
              transform .6s var(--ease-out-expo) !important;
  will-change: transform, opacity;
}
.reveal.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* === Frame Labels === */
.frame-label {
  display: block; text-align: center;
  font-size: 0.72rem; font-weight: 500;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: 0.02em;
}

/* === Hero Badge (GitHub Stars) === */
.hero-badge-img {
  margin-top: 20px;
  height: 22px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity .3s;
}
.hero-badge-img:hover { opacity: 1; }

/* === Back to Top Button === */
.back-to-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 90;
  width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--border-card);
  background: rgba(12,16,23,0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: all .4s var(--ease-spring);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.back-to-top.visible {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--border-glow);
  color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* === Responsive === */
@media (max-width: 1024px) {
  .models-grid { grid-template-columns: repeat(2,1fr); }
  .soul-grid { grid-template-columns: repeat(2,1fr); }
  .showcase { gap: 40px; }
  .phone-frame { max-width: 180px; }
}
@media (max-width: 768px) {
  .nav { padding: 12px 16px 0; }
  .nav-inner { padding: 6px 6px 6px 16px; border-radius: var(--radius); }
  .nav-links {
    display: none; position: fixed;
    top: calc(var(--nav-h) + 12px); left: 16px; right: 16px;
    background: rgba(8,11,18,0.95);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    flex-direction: column; padding: 20px;
    gap: 4px; border: 1px solid var(--border-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-ambient);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 16px; border-radius: var(--radius-sm); }
  .menu-btn { display: block; }
  .gh-btn span { display: none; }
  .highlights-grid, .models-grid { grid-template-columns: 1fr; }
  .soul-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: 1fr; gap: 40px; }
  .showcase-reverse { direction: ltr; }
  .showcase-images { justify-content: center; }
  .phone-frame { max-width: 200px; }
  .phone-overlap { margin-left: -30px; margin-top: 40px; }
  .hero-stats { gap: 28px; flex-wrap: wrap; }
  .hero h1 { font-size: 2.4rem; }
  .hero-desc { font-size: 0.95rem; }
  .section { padding: 72px 0; }
  .footer-inner { flex-direction: column; gap: 20px; text-align: center; }
  .footer-links { justify-content: center; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .phone-frame { max-width: 160px; }
}
