/* ==========================================================================
   FLOWVIA APK LANDING PAGE — DESIGN SYSTEM & TOKENS
   Inspired by UI&UX.html (Warm Parchment & Dark Espresso Theme)
   ========================================================================== */

:root {
  /* Default Theme: Warm Parchment (Light) */
  --bg-canvas: #F7F4EE;
  --bg-elevated: #FFFFFF;
  --bg-sunken: #EFEAE0;
  --ink-900: #15140F;
  --ink-700: #3D3A33;
  --ink-500: #6E6A60;
  --ink-300: #A8A398;
  --line: rgba(21, 20, 15, 0.08);
  --line-strong: rgba(21, 20, 15, 0.16);
  --accent: #C8553D;
  --accent-hover: #B2462F;
  --accent-soft: #E8B4A8;
  --mood-peach: #F2A88A;
  --mood-lavender: #B8A4D4;
  --mood-sage: #9DB89C;
  --mood-sky: #9CB8D4;
  --mood-butter: #E8C97A;
  --success: #5C8A6F;
  --warning: #D89B47;
  --danger: #C8553D;
  --shadow-sm: 0 2px 8px rgba(21, 20, 15, 0.04);
  --shadow-md: 0 12px 32px -4px rgba(21, 20, 15, 0.08);
  --shadow-lg: 0 24px 64px -12px rgba(21, 20, 15, 0.14);
  --shadow-glow: 0 8px 32px -4px rgba(200, 85, 61, 0.35);
  --transition: 280ms cubic-bezier(0.32, 0.72, 0, 1);
}

[data-theme="dark"] {
  /* Dark Theme: Dark Espresso */
  --bg-canvas: #0F0E0C;
  --bg-elevated: #1A1916;
  --bg-sunken: #08070A;
  --ink-900: #F5F2EA;
  --ink-700: #D4CFC2;
  --ink-500: #8E887B;
  --ink-300: #5A554B;
  --line: rgba(245, 242, 234, 0.08);
  --line-strong: rgba(245, 242, 234, 0.16);
  --accent: #E27B5F;
  --accent-hover: #F08E74;
  --accent-soft: #5A2E26;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 8px 32px -4px rgba(226, 123, 95, 0.3);
}

/* ==========================================================================
   GLOBAL RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--bg-canvas);
  color: var(--ink-900);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.serif {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
}

.serif em {
  font-style: italic;
  color: var(--accent);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 238, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 16px 32px;
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 14, 12, 0.85);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.brand-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-sunken);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-500);
  transition: color 200ms;
}

.nav-link:hover {
  color: var(--ink-900);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-sunken);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.theme-btn {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-500);
  transition: all 200ms ease;
}

.theme-btn.active {
  background: var(--bg-elevated);
  color: var(--ink-900);
  box-shadow: var(--shadow-sm);
}

.btn-nav-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-900);
  color: var(--bg-canvas);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  transition: transform 200ms, box-shadow 200ms, background 200ms;
}

[data-theme="dark"] .btn-nav-download {
  background: var(--bg-elevated);
  color: var(--ink-900);
  border: 1px solid var(--line-strong);
}

.btn-nav-download:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: var(--accent);
  color: #FFFFFF;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  position: relative;
  padding: 80px 32px 64px;
  overflow: hidden;
}

.aurora-blob {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}

.aurora-1 {
  width: 480px;
  height: 480px;
  top: -80px;
  right: -100px;
  background: radial-gradient(circle, var(--mood-peach) 0%, var(--accent-soft) 40%, transparent 80%);
  opacity: 0.6;
  animation: breathe 8s ease-in-out infinite;
}

.aurora-2 {
  width: 420px;
  height: 420px;
  bottom: -40px;
  left: -80px;
  background: radial-gradient(circle, var(--mood-lavender) 0%, var(--mood-sky) 50%, transparent 80%);
  opacity: 0.5;
  animation: breathe 10s ease-in-out infinite reverse;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.1) translate(20px, -15px);
  }
}

.hero-container {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  padding: 6px 14px;
  border-radius: 100px;
  width: fit-content;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
}

.hero-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: 64px;
  line-height: 1.05;
  color: var(--ink-900);
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--ink-500);
  max-width: 540px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-download-hero {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--accent);
  color: #FFFFFF;
  padding: 16px 32px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
  transition: transform 200ms, background 200ms, box-shadow 200ms;
}

.btn-download-hero:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px -4px rgba(200, 85, 61, 0.5);
}

.btn-download-hero svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  color: var(--ink-700);
  padding: 16px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  transition: all 200ms;
}

.btn-secondary:hover {
  background: var(--bg-sunken);
  color: var(--ink-900);
  border-color: var(--ink-500);
}

.apk-specs {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--ink-500);
  flex-wrap: wrap;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spec-item svg {
  width: 16px;
  height: 16px;
  color: var(--ink-300);
}

/* ==========================================================================
   PHONE FRAME MOCKUP (INTERACTIVE)
   ========================================================================== */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.phone-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-frame {
  width: 320px;
  height: 670px;
  border-radius: 46px;
  background: #15140F;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg), 0 0 0 10px #1E1D19, 0 0 0 12px #2A2823;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: #000000;
  border-radius: 20px;
  z-index: 20;
}

.phone-screen {
  flex: 1;
  position: relative;
  background: #000000;
  overflow: hidden;
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 350ms ease;
}

.phone-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  padding: 4px;
  border-radius: 999px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.phone-toggle-btn {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-500);
  transition: all 200ms;
}

.phone-toggle-btn.active {
  background: var(--ink-900);
  color: var(--bg-canvas);
}

[data-theme="dark"] .phone-toggle-btn.active {
  background: var(--bg-canvas);
  color: var(--ink-900);
}

/* ==========================================================================
   FEATURES SECTION ("6-in-1 Powerhouse")
   ========================================================================== */
.features {
  padding: 80px 32px;
  background: var(--bg-canvas);
  position: relative;
}

.section-header {
  max-width: 640px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-family: 'Instrument Serif', serif;
  font-size: 48px;
  line-height: 1.1;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 16px;
  color: var(--ink-500);
}

.features-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  font-size: 24px;
}

.feature-card.routine .feature-icon {
  background: rgba(157, 184, 156, 0.2);
  color: var(--mood-sage);
}

.feature-card.habit .feature-icon {
  background: rgba(242, 168, 138, 0.25);
  color: var(--accent);
}

.feature-card.focus .feature-icon {
  background: rgba(156, 184, 212, 0.25);
  color: var(--mood-sky);
}

.feature-card.mood .feature-icon {
  background: rgba(232, 201, 122, 0.25);
  color: var(--warning);
}

.feature-card.finance .feature-icon {
  background: rgba(200, 85, 61, 0.14);
  color: var(--accent);
}

.feature-card.offline .feature-icon {
  background: rgba(184, 164, 212, 0.25);
  color: var(--mood-lavender);
}

.feature-card h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  color: var(--ink-900);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 15px;
  color: var(--ink-500);
  line-height: 1.6;
}

.feature-badge {
  display: inline-block;
  margin-top: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-500);
  background: var(--bg-sunken);
  padding: 4px 10px;
  border-radius: 6px;
  width: fit-content;
}

/* ==========================================================================
   INTERACTIVE LIFE SCORE SHOWCASE SECTION
   ========================================================================== */
.showcase {
  padding: 64px 32px;
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.showcase-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.showcase-text h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 44px;
  color: var(--ink-900);
  line-height: 1.15;
  margin-bottom: 16px;
}

.showcase-text p {
  font-size: 16px;
  color: var(--ink-500);
  margin-bottom: 24px;
}

.interactive-demo-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 32px;
  padding: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition);
}

.interactive-demo-card:hover {
  transform: scale(1.02);
}

.interactive-demo-card .demo-hint {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  background: var(--bg-sunken);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.life-score-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.score-left .label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.score-left .number {
  font-family: 'Instrument Serif', serif;
  font-size: 80px;
  line-height: 0.95;
  color: var(--ink-900);
  margin-top: 8px;
}

.score-left .denom {
  font-size: 28px;
  color: var(--ink-500);
}

.score-left .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}

.score-left .status-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.score-ring {
  width: 130px;
  height: 130px;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 10;
}

.score-ring .track {
  stroke: var(--bg-sunken);
}

.score-ring .fill {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   INSTALLATION GUIDE SECTION
   ========================================================================== */
.install-guide {
  padding: 80px 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 24px;
  margin-top: 48px;
}

.step-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  position: relative;
}

.step-num {
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
}

.step-card h4 {
  font-size: 18px;
  color: var(--ink-900);
  margin-bottom: 8px;
  font-weight: 600;
}

.step-card p {
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.5;
}

/* ==========================================================================
   FAQ SECTION (ACCORDION)
   ========================================================================== */
.faq {
  padding: 80px 32px 100px;
  max-width: 800px;
  margin: 0 auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 48px;
}

.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 200ms;
}

.faq-question {
  width: 100%;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  text-align: left;
  cursor: pointer;
}

.faq-question svg {
  width: 20px;
  height: 20px;
  transition: transform 250ms ease;
  color: var(--ink-500);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease, padding 300ms ease;
  padding: 0 24px;
  font-size: 15px;
  color: var(--ink-500);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 24px 22px;
}

/* ==========================================================================
   MODAL / APK DOWNLOAD INSTRUCTIONS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 20, 15, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 32px;
  max-width: 520px;
  width: 100%;
  padding: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: scale(0.95);
  transition: transform 250ms ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--ink-700);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 200ms;
}

.modal-close:hover {
  background: var(--line-strong);
}

.modal-title {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  color: var(--ink-900);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 15px;
  color: var(--ink-500);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  padding: 48px 32px;
  text-align: center;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-text {
  font-size: 14px;
  color: var(--ink-500);
}

.footer-links {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--ink-700);
  font-weight: 500;
}

/* ==========================================================================
   RESPONSIVE LAYOUT
   ========================================================================== */
@media (max-width: 960px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-content {
    align-items: center;
  }

  .hero-subtitle {
    margin: 0 auto;
  }

  .btn-group {
    justify-content: center;
  }

  .apk-specs {
    justify-content: center;
  }

  .showcase-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 16px;
  }
  
  .brand-badge {
    display: none;
  }

  .btn-nav-download span {
    display: none;
  }
  
  .btn-nav-download {
    padding: 8px 12px;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero-title {
    font-size: 42px;
  }

  .hero-subtitle {
    font-size: 16px;
    line-height: 1.5;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .btn-download-hero,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .features,
  .install-guide,
  .showcase,
  .faq {
    padding: 50px 20px;
  }

  .section-title {
    font-size: 34px;
  }

  .interactive-demo-card {
    padding: 24px 20px;
  }

  .life-score-display {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .score-left .number {
    font-size: 64px;
  }

  .phone-frame {
    width: 275px;
    height: 580px;
  }

  .modal-content {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 36px;
  }

  .section-title {
    font-size: 28px;
  }

  .phone-frame {
    width: 260px;
    height: 550px;
  }

  .feature-card {
    padding: 24px 20px;
    min-height: auto;
  }

  .theme-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .faq-question {
    font-size: 15px;
    padding: 16px 18px;
  }
}
