:root {
  --bg: #050810;
  --bg-elevated: #0b1220;
  --bg-card: rgba(15, 23, 42, 0.72);
  --border: rgba(148, 163, 184, 0.14);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #22c55e;
  --primary-dim: rgba(34, 197, 94, 0.15);
  --accent: #eab308;
  --danger: #f87171;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-glow: 0 0 80px rgba(34, 197, 94, 0.12);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --max: 1120px;
  --carousel-interval: 4.2s;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34, 197, 94, 0.14), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(234, 179, 8, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(34, 197, 94, 0.05), transparent);
  pointer-events: none;
  z-index: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(5, 8, 16, 0.82);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.brand-name span {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-toggle {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.lang-btn.active {
  background: var(--primary-dim);
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
  box-shadow: 0 8px 28px rgba(34, 197, 94, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Store download buttons */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: stretch;
}

.store-buttons--hero {
  width: 100%;
}

.download-box .store-buttons {
  justify-content: center;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.35rem;
  border-radius: 14px;
  font-family: inherit;
  text-decoration: none;
  min-width: min(100%, 240px);
  flex: 1 1 200px;
  max-width: 280px;
  border: none;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.btn-store:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-store-android {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
  box-shadow: 0 8px 28px rgba(34, 197, 94, 0.35);
}

.btn-store-android:hover {
  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.45);
}

.btn-store-ios {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  color: #0f172a;
  box-shadow: 0 8px 28px rgba(148, 163, 184, 0.2);
}

.btn-store-soon {
  opacity: 0.72;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-store-soon:hover {
  transform: none;
}

.btn-store-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.store-buttons--hero .btn-store-icon {
  width: 28px;
  height: 28px;
}

.btn-store-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.btn-store-label {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.88;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-store-text strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.btn-store-soon-tag {
  font-size: 0.65rem;
  font-weight: 700;
  margin-top: 0.15rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-cta .store-buttons + .btn-ghost {
  width: 100%;
  max-width: 280px;
}

.nav-links {
  display: none;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
  .header-cta-mobile {
    display: none;
  }
}

/* Hero */
.hero {
  padding: 3rem 0 2rem;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
  }

  .carousel-section {
    padding-top: 0;
  }

}

/* Hero big logo */
.hero-logo {
  position: relative;
  width: fit-content;
  margin-top: 1.25rem;
  margin-bottom: 3.25rem;
  padding-top: 0.5rem;
  padding-bottom: 1.5rem;
}

@media (min-width: 900px) {
  .hero-logo {
    margin-top: 0.75rem;
    margin-bottom: 3.75rem;
    padding-top: 0.75rem;
    padding-bottom: 1.75rem;
  }
}

.hero-logo-glow {
  position: absolute;
  inset: -25%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.4) 0%, transparent 68%);
  animation: logo-glow-pulse 3.5s ease-in-out infinite;
  pointer-events: none;
}

.hero-logo-ring {
  position: absolute;
  inset: -10px;
  border-radius: 32px;
  border: 2px solid transparent;
  border-top-color: rgba(34, 197, 94, 0.75);
  border-right-color: rgba(234, 179, 8, 0.45);
  border-bottom-color: rgba(34, 197, 94, 0.2);
  animation: logo-ring-spin 10s linear infinite;
  pointer-events: none;
}

.hero-logo-img {
  position: relative;
  z-index: 1;
  width: clamp(128px, 20vw, 200px);
  height: clamp(128px, 20vw, 200px);
  border-radius: clamp(24px, 4vw, 36px);
  object-fit: cover;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(34, 197, 94, 0.25);
  animation: logo-float-tilt 5s ease-in-out infinite;
}

@keyframes logo-float-tilt {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-10px) rotate(4deg) scale(1.02);
  }
  50% {
    transform: translateY(-5px) rotate(-3deg) scale(1);
  }
  75% {
    transform: translateY(-12px) rotate(3deg) scale(1.01);
  }
}

@keyframes logo-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes logo-glow-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo-img,
  .hero-logo-ring,
  .hero-logo-glow {
    animation: none;
  }
}

.badge-row {
  display: block;
  margin-bottom: 2.25rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

html[lang='en'] [lang-only='en'].badge,
html[lang='es'] [lang-only='es'].badge {
  display: inline-block;
}

.hero-title,
.hero h1 {
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1rem;
  padding-top: 0.25rem;
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 34rem;
}

.hero-lead strong {
  color: var(--text);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-pill strong {
  color: var(--primary);
  display: block;
  font-size: 1.1rem;
}

/* Carousel */
.carousel-section {
  padding: 1rem 0 3rem;
}

.carousel-wrap {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .carousel-wrap {
    margin: 0;
    max-width: 300px;
  }
}

.phone-frame {
  position: relative;
  border-radius: 36px;
  padding: 10px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-glow), 0 24px 60px rgba(0, 0, 0, 0.55);
}

.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 22px;
  background: #0f172a;
  border-radius: 0 0 14px 14px;
  z-index: 3;
}

.carousel-viewport {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
  background: #000;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1.25rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.35);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s;
}

.carousel-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

.carousel-caption {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.4em;
}

/* Sections */
section {
  padding: 3.5rem 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 40rem;
  margin: 0 0 2rem;
}

/* Highlight scan */
.scan-highlight {
  background: linear-gradient(180deg, transparent, rgba(34, 197, 94, 0.04), transparent);
  border-block: 1px solid var(--border);
}

.live-scan-banner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.85));
  box-shadow: var(--shadow-glow);
}

.live-scan-banner h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.live-scan-banner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.live-scan-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--primary);
}

.scan-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .scan-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .scan-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.scan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(8px);
}

.scan-card--highlight {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.1), var(--bg-card));
}

.scan-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scan-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.scan-card .icon {
  font-size: 1.5rem;
}

.algo-box {
  margin-top: 2rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(34, 197, 94, 0.25);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(15, 23, 42, 0.6));
}

.algo-box h3 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.algo-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.algo-steps li {
  margin-bottom: 0.5rem;
}

.algo-steps strong {
  color: var(--text);
}

/* Features grid */
.features-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 600px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(34, 197, 94, 0.35);
  transform: translateY(-2px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Swap section */
.swap-section {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

.swap-flow {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .swap-flow {
    grid-template-columns: repeat(3, 1fr);
  }
}

.swap-step {
  text-align: center;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.swap-step-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #422006;
  font-weight: 800;
  border-radius: 50%;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.swap-step h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.swap-step p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Download */
.download-box {
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(34, 197, 94, 0.3);
  box-shadow: var(--shadow-glow);
}

.download-box h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.download-box p {
  color: var(--text-muted);
  margin: 0 0 1.75rem;
}

.download-box .store-buttons {
  margin: 0 auto;
  max-width: 580px;
}

.download-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer strong {
  color: var(--text);
}

/* i18n visibility */
[lang-only] {
  display: none;
}

html[lang='en'] [lang-only='en'],
html[lang='es'] [lang-only='es'] {
  display: revert;
}

html[lang='en'] [lang-only='en'].block,
html[lang='es'] [lang-only='es'].block {
  display: block;
}

html[lang='en'] [lang-only='en'].inline,
html[lang='es'] [lang-only='es'].inline {
  display: inline;
}

html[lang='en'] [lang-only='en'].flex,
html[lang='es'] [lang-only='es'].flex {
  display: flex;
}

/* Legal pages (privacy, etc.) */
.legal-page {
  padding: 2.5rem 0 4rem;
}

.legal-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.legal-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
}

.legal-updated {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.legal-card h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.legal-card p,
.legal-card li {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.legal-card ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.legal-card li {
  margin-bottom: 0.35rem;
}

.legal-card a {
  color: var(--primary);
}

.legal-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.site-footer .footer-legal {
  margin-top: 0.75rem;
}
