:root {
  --bg-base: #000004;
  --bg-surface: #111118;
  --bg-raised: #1a1a24;
  --border: #222233;
  --text-primary: #e4e2de;
  --text-secondary: #b0ada6;
  --text-muted: #6a6878;
  --accent: #5b87a8;
  --warm: #c4916a;
  --entity-person: #7a6faa;
  --entity-place: #4a8f6f;
  --constellation: #7ec8e3;
  --constellation-glow: rgba(126, 200, 227, 0.3);
}

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

html {
  font-size: 16px;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== Language toggle ===== */
#lang-toggle {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 100;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

#lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Constellation background ===== */
.constellation-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ===== Snap sections ===== */
.snap-section {
  scroll-snap-align: start;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1, h2, h3 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  line-height: 1.2;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 0;
  position: relative;
  scroll-snap-align: start;
}

.hero-content { max-width: 840px; }

.logo-mark {
  width: 80px; height: 80px;
  margin: 0 auto 32px;
}

.logo-mark svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 0 20px var(--constellation-glow));
}

.logo-mark img {
  width: 100%; height: 100%;
}

.logo-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 48px;
  animation: fadeIn 1s ease-out 0.3s both;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: #fff;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero h1 em {
  font-style: italic;
  color: var(--constellation);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 16px;
  animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero-free {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--constellation);
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.9s both;
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeIn 1s ease-out 1.5s both;
}

.scroll-hint span {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-arrow {
  width: 20px; height: 20px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.5; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 1; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-install {
  background: #fff;
  color: #111;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 10px;
}

.btn-install:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
}

.btn-install svg { width: 20px; height: 20px; }

.btn-store { display: inline-block; }
.badge-googleplay { height: 60px; width: auto; display: block; }

.btn-warm {
  background: var(--warm);
  color: #fff;
  height: 40px;
  padding: 0 16px;
}

.btn-warm:hover {
  background: #d4a17a;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(196, 145, 106, 0.3);
}

/* ===== BETA BUTTON ===== */
.btn-beta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--constellation), #5b87a8);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(126, 200, 227, 0.15);
  animation: pulseGlow 3s ease-in-out infinite;
}

.btn-beta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(126, 200, 227, 0.35);
}

.btn-beta-sub {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0.01em;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(126, 200, 227, 0.15); }
  50% { box-shadow: 0 4px 28px rgba(126, 200, 227, 0.3); }
}

/* ===== PREVIEW SECTION ===== */
.preview {
  padding: 40px 0 48px;
  position: relative;
}

/* Subtle ambient glow behind the phones */
.preview::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(126, 200, 227, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.preview-scroll {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.preview-phone {
  width: 195px;
  flex-shrink: 0;
  transition: transform 0.4s ease;
  position: relative;
}

.preview-phone:hover { transform: translateY(-8px); }

.preview-phone img {
  width: 100%;
  display: block;
  border-radius: 16px;
  /* Soft shadow to lift from bg without harsh borders */
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(126, 200, 227, 0.04);
}

/* Caption label below each phone */
.preview-label {
  text-align: center;
  margin-top: 14px;
}

.preview-label strong {
  display: block;
  font-family: 'DM Serif Display', serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--constellation);
  margin-bottom: 2px;
}

.preview-label span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== PROBLEM ===== */
.problem {
  padding: 32px 0 24px;
  background: var(--bg-surface);
  border-radius: 24px;
  margin: 0 16px;
}

.problem h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 28px;
  color: #fff;
}

.problem-text {
  max-width: 600px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.problem-text p + p { margin-top: 20px; }

.problem-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== FEATURES ===== */
.features h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 48px;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  padding: 24px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.feature:hover {
  border-color: var(--text-muted);
  transform: translateY(-4px);
}

.feature-icon { font-size: 1.5rem; margin-bottom: 12px; display: block; }
.feature h3 { font-size: 1rem; margin-bottom: 8px; color: var(--text-primary); }
.feature p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ===== BACKUP ===== */
.backup {
  padding: 64px 0 48px;
}

.backup h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 16px;
  color: #fff;
  text-align: center;
}

.backup-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto 40px;
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.backup-card {
  padding: 24px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.backup-card-cloud {
  border-color: rgba(0, 152, 255, 0.2);
}

.backup-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.backup-icon {
  float: left;
  font-size: 2.8rem;
  line-height: 1;
  margin: 0 14px 6px 0;
  color: var(--constellation);
}

.backup-card-cloud .backup-icon {
  color: #0098FF;
}

.backup-card p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.backup-card p strong {
  color: var(--text-primary);
  font-weight: 500;
}


/* kdrive CTA button */
.kdrive-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 20px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 152, 255, 0.25);
  text-decoration: none;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 152, 255, 0.1);
}

.kdrive-cta:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 152, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 152, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
}

.kdrive-cta:focus-visible {
  outline: 2px solid #0098FF;
  outline-offset: 2px;
}

.kdrive-logo {
  height: 36px;
  width: auto;
  display: block;
}

.kdrive-cta-text {
  color: #0098FF;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.kdrive-cta:hover .kdrive-cta-text {
  color: #33adff;
}

.kdrive-cta-tagline {
  color: #333333;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* ===== SCROLL HINT LINKS ===== */
.scroll-hint-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.scroll-hint-link,
.scroll-hint-link span {
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
}

.scroll-hint-link:hover .scroll-arrow {
  opacity: 1;
}

.scroll-hint-link:hover span {
  color: var(--accent);
}

/* ===== SCROLL HINT CENTER (non-absolute) ===== */
.scroll-hint-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 0 24px;
}

.scroll-hint-center span {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-hint-center .scroll-arrow {
  width: 20px; height: 20px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

/* ===== GLOW SEPARATOR ===== */
.glow-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--constellation-glow), var(--constellation), var(--constellation-glow), transparent);
  opacity: 0.4;
  margin: 0 auto;
  max-width: 260px;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  margin: 40px 0;
  padding: 20px 0;
  text-align: center;
  scroll-snap-align: end;
}

.footer-logo {
  width: 40px; height: 40px;
  margin: 0 auto 16px;
  display: block;
}

.footer-name {
  font-family: 'DM Serif Display', serif;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.footer-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-credit { font-size: 0.8rem; color: var(--text-muted); opacity: 0.6; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.preview-phone.reveal:nth-child(1) { transition-delay: 0s; }
.preview-phone.reveal:nth-child(2) { transition-delay: 0.1s; }
.preview-phone.reveal:nth-child(3) { transition-delay: 0.15s; }
.preview-phone.reveal:nth-child(4) { transition-delay: 0.2s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  html {
    scroll-snap-type: y proximity;
  }

  .preview-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 24px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
  }

  .preview-phone {
    scroll-snap-align: center;
    min-width: 170px;
    width: 170px;
  }

  .features-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero { min-height: 90vh; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .footer-buttons { flex-direction: column; align-items: center; }

  .backup-grid { grid-template-columns: 1fr; gap: 16px; }
  .backup { padding: 48px 0 32px; }

  .snap-section {
    min-height: auto;
    scroll-snap-align: start;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .preview-phone { width: 170px; }
}
