/* ============ VARIABLES ============ */
:root {
  --bg: #0B0D10;
  --surface: #121621;
  --text: #EAF0FF;
  --text-secondary: #A9B2C7;
  --accent: #6EA8FF;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --max-width: 1080px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  font-feature-settings: "kern" 1, "liga" 1;
  position: relative;
}

/* Prevent any section from causing horizontal overflow */
section {
  max-width: 100%;
}

/* ============ ANIMATIONS ============ */
[data-animate] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ TOPBAR ============ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 13, 16, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.topbar-icon {
  width: 28px;
  height: 28px;
  filter: invert(1);
}

.topbar-logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lang-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.lang-toggle:hover {
  background: rgba(110, 168, 255, 0.1);
  border-color: var(--accent);
}

/* ============ HERO ============ */
.hero {
  padding: 130px 24px 100px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 60px;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  white-space: pre-line;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 460px;
  line-height: 1.7;
  text-wrap: balance;
}

/* App Store badge */
.appstore-link {
  display: inline-block;
  transition: opacity 0.2s, transform 0.2s;
}

.appstore-link:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.appstore-badge-img {
  height: 48px;
  display: block;
}

.appstore-badge-img--large {
  height: 56px;
}

/* CTA button (for contact) */
.cta-button {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 12px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.cta-button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.cta-secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.cta-secondary:hover {
  background: rgba(110, 168, 255, 0.08);
}

.microcopy {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 14px;
  white-space: pre-line;
}

.download .microcopy {
  color: rgba(255, 255, 255, 0.85);
}

/* Hero phone with parallax */
.hero-screenshots {
  flex: 0 0 340px;
  position: relative;
}

.hero-phone {
  width: 340px;
  transition: transform 0.3s ease-out;
}

/* ============ FEATURES ============ */
.features {
  padding: 100px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.feature-card {
  background: linear-gradient(135deg,
    rgba(18, 22, 33, 0.6) 0%,
    rgba(10, 14, 24, 0.8) 100%);
  border: 1px solid rgba(110, 168, 255, 0.15);
  border-radius: 28px;
  padding: 56px 44px 52px;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    #6EA8FF 50%,
    transparent 100%);
  opacity: 0.7;
}

.feature-icon {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  background: rgba(110, 168, 255, 0.1);
  border: 2px solid rgba(110, 168, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
  color: #6EA8FF;
}

.feature-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 2.5;
}

.feature-card h3 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 32px;
  letter-spacing: -0.045em;
  line-height: 1.1;
  color: #fff;
  text-transform: none;
}

.feature-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-card li {
  color: rgba(234, 240, 255, 0.9);
  font-size: 1.05rem;
  padding-left: 30px;
  position: relative;
  line-height: 1.35;
  letter-spacing: 0.015em;
  font-weight: 500;
}

.feature-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1.3rem;
  font-weight: 900;
  color: #6EA8FF;
}

.features-closing {
  text-align: center;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: transparent;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.35;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg,
    rgba(234, 240, 255, 0.15) 0%,
    rgba(234, 240, 255, 0.4) 50%,
    rgba(234, 240, 255, 0.15) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(110, 168, 255, 0.1);
  white-space: pre-line;
  perspective: 1000px;
  transform-origin: center center;
  will-change: transform;
}

/* ============ WHY FREE ============ */
.whyfree {
  padding: 0 24px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.whyfree-snippet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.whyfree-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(52, 199, 89, 0.12);
  color: #34C759;
  font-size: 1rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(52, 199, 89, 0.2);
}

.whyfree-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 4px;
  transition: opacity 0.2s;
}

.whyfree-toggle:hover {
  opacity: 0.75;
}

/* Why free popup overlay */
.whyfree-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.whyfree-popup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  max-width: 520px;
  width: 100%;
  padding: 36px 28px 40px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.whyfree-overlay.active .whyfree-popup {
  transform: translateY(0);
}

.whyfree-popup h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.whyfree-popup p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 14px;
}

.whyfree-future {
  font-size: 1rem !important;
  color: var(--text-secondary);
  opacity: 0.7;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 20px !important;
}

.whyfree-close {
  margin-top: 24px;
  width: 100%;
  text-align: center;
  padding: 14px;
}

/* Desktop: center the popup */
@media (min-width: 769px) {
  .whyfree-overlay {
    align-items: center;
  }

  .whyfree-popup {
    border-radius: 20px;
    transform: translateY(24px);
  }

  .whyfree-overlay.active .whyfree-popup {
    transform: translateY(0);
  }
}

/* ============ SCREENSHOTS ============ */
.screenshots {
  padding: 40px 0 100px;
  overflow: hidden;
}

.screenshots-track {
  display: flex;
  gap: 20px;
  padding: 0 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  justify-content: center;
}

.screenshots-track::-webkit-scrollbar {
  display: none;
}

.screenshots-track img {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: center;
  transition: transform 0.1s ease-out, opacity 0.3s ease-out;
  will-change: transform, opacity;
}

/* ============ DOWNLOAD ============ */
.download {
  padding: 100px 0;
  background: linear-gradient(180deg, #0B0D10 0%, #1a2840 50%, #038FFB 100%);
  text-align: center;
  transition: background-image 0.3s ease-out;
}

.download-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.download h2 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 56px;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #fff;
}

.download-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}

.download-mockup {
  flex: 0 0 auto;
}

.download-phone {
  width: 460px;
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.5));
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.download-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.qr-wrapper {
  text-align: center;
}

#qrcode {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
}

#qrcode canvas {
  display: block;
}

.download .microcopy {
  font-weight: 700;
  letter-spacing: 0.01em;
}


/* ============ CONTACT ============ */
.contact {
  padding: 100px 24px;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact h2 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.035em;
}

.contact > p:first-of-type {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1.05rem;
  line-height: 1.7;
}

#contactBtn {
  font-size: 1rem;
}

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-dev {
  font-size: 1rem;
  color: var(--text-secondary);
  white-space: pre-line;
  line-height: 1.1;
}

.footer-dev a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.footer-dev a:hover {
  color: var(--text);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text);
}

.footer-flag {
  display: inline-block;
  margin-top: 4px;
  height: 16px;
  width: 16px;
  opacity: 0;
  transform: translateY(4px) scale(0.9);
  transition: opacity 0.15s ease, transform 0.2s ease;
}

.footer-dev a:hover .footer-flag {
  opacity: 1;
  transform: translateY(0) scale(1);
}


/* ============ SCROLL TO TOP ============ */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s, border-color 0.2s;
  z-index: 90;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  background: rgba(110, 168, 255, 0.15);
  border-color: var(--accent);
}

/* ============ TABLET LAYOUT ============ */
@media (max-width: 1100px) {
  .hero {
    padding: 120px 24px 80px;
  }

  .hero-content {
    gap: 40px;
  }

  .features {
    padding: 80px 20px;
  }

  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .feature-card:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 640px;
  }

  .feature-card {
    padding: 40px 28px 36px;
  }

  .feature-card h3 {
    font-size: 1.7rem;
  }

  .feature-card li {
    font-size: 0.96rem;
    line-height: 1.4;
  }

  .download-content {
    gap: 36px;
  }

  .download-phone {
    width: 360px;
  }

  .screenshots-track {
    padding: 0 16px;
  }

  .screenshots-track img {
    width: 200px;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .hero {
    padding: 104px 24px 60px;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 48px;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
    line-height: 1.55;
    text-align: center;
  }

  .hero-screenshots {
    flex: 0 0 auto;
  }

  .hero-phone {
    width: 240px;
  }

  .features {
    padding: 60px 16px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .feature-card {
    padding: 28px 20px 24px;
    border-radius: 20px;
    max-width: 100%;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .feature-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
  }

  .feature-icon svg {
    width: 30px;
    height: 30px;
  }

  .feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .feature-card ul {
    gap: 14px;
  }

  .feature-card li {
    font-size: 1rem;
    padding-left: 26px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .feature-card li::before {
    font-size: 1.1rem;
  }

  .download-content {
    flex-direction: column;
    gap: 40px;
  }

  .download-phone {
    width: 320px;
  }

  .download-timeline {
    margin-top: 32px;
    padding: 28px 0 0;
  }

  .timeline-line {
    top: 30px;
  }

  .timeline-items {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 12px;
  }

  .timeline-item {
    padding-top: 30px;
  }

  .timeline-item::before {
    top: 32px;
    transform: translate(-50%, -6px) scale(0.92);
  }

  .timeline-date {
    font-size: 0.95rem;
    transform: translateX(-50%) rotate(-4deg);
  }

  .timeline-text {
    font-size: 0.9rem;
  }

  .screenshots-track {
    justify-content: flex-start;
  }

  .screenshots-track img {
    width: 180px;
  }

  .features-grid {
    margin-bottom: 36px;
  }

  .screenshots {
    padding: 20px 0 60px;
  }

  .download {
    padding: 60px 16px;
  }

  .download h2 {
    margin-bottom: 36px;
  }

  .contact {
    padding: 60px 16px;
  }

  .footer {
    padding: 28px 16px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .scroll-top {
    bottom: 20px;
    right: 20px;
  }
}
