/* ============================================================
   Welo — Design System & Landing Page Styles
   Tokens extracted from WeloTheme.swift (iOS)
   Fonts: Bricolage Grotesque (headings), Lexend (body)
   ============================================================ */

/* --- CSS Custom Properties (from WeloTheme.swift) --- */
:root {
  /* Backgrounds */
  --welo-bg: #FFFFFF;
  --welo-bg-alt: #FFFAF6;
  --welo-bg-dark: #F5F5F5;
  --welo-onboarding-gradient: #0068FF;

  /* Surfaces (WeloTheme: weloSurface, weloSurfaceAlt) */
  --welo-surface: #F0EDE6;
  --welo-surface-alt: #F5F0E8;
  --welo-surface-light: #F5F3ED;
  --welo-card-white: #FFFFFF;
  --welo-card-muted: #F5F2EC;
  --welo-card-selected: #F0EDE6;

  /* Text (WeloTheme: weloOnSurface, weloOnSurfaceDark, etc.) */
  --welo-text-primary: #000000;
  --welo-text-dark: #201E1B;
  --welo-text-muted: #615E58;
  --welo-text-muted-alt: #8A8680;
  --welo-text-tertiary: #656565;
  --welo-text-secondary: #4A4459;
  --welo-brown: #6B5430;

  /* Safety Status (WeloTheme: weloSafeGreen, weloWarnRed*, etc.) */
  --welo-safe-green: #EDF4EB;
  --welo-safe-green-text: #2D6A2E;
  --welo-warn-red-light: #FFB0A8;
  --welo-warn-red-badge: #FFBEBE;
  --welo-warn-red-bg: #FFD3CE;
  --welo-warn-red-chip: #FFE6E3;
  --welo-destructive: #D14637;
  --welo-red-pure: #F01314;

  /* Accents (WeloTheme: weloBlue, weloSkyBlue, etc.) */
  --welo-blue: #1070FF;
  --welo-sky-blue: #00A6FF;
  --welo-indigo: #518AED;
  --welo-orange: #FF6E2B;
  --welo-yellow: #FFD036;
  --welo-pink: #E73384;

  /* Utility */
  --welo-gray: #D9D9D9;
  --welo-dark: #1C1B1B;
  --welo-progress: #665527;

  /* Borders (WeloTheme: weloBorder, weloBorderActive, etc.) */
  --welo-border: #E5E2DC;
  --welo-border-active: #201E1B;
  --welo-border-muted: #EAEAEA;
  --welo-border-alt: #C4C0BA;

  /* Border Radii (WeloLayout) */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-card: 20px;
  --radius-lg: 24px;
  --radius-xl: 40px;
  --radius-full: 100px;

  /* Spacing (WeloLayout: gapTiny–gapXL) */
  --gap-tiny: 4px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-default: 16px;
  --gap-lg: 24px;
  --gap-xl: 40px;

  /* Typography scale */
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-body: 'Lexend', system-ui, -apple-system, sans-serif;

  /* Nav */
  --nav-height: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--welo-text-dark);
  background: var(--welo-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease, opacity 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--welo-text-dark);
  letter-spacing: -0.02em;
}

/* --- Container --- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gap-default);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--gap-lg);
  }
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--welo-border);
  height: var(--nav-height);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.logo-img {
  width: 100px;
  height: auto;
  object-fit: contain;
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--gap-lg);
}

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

.nav-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.938rem;
  color: var(--welo-text-muted);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--welo-text-dark);
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--welo-text-dark);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: var(--gap-lg);
  gap: var(--gap-default);
  background: var(--welo-bg);
  border-bottom: 1px solid var(--welo-border);
}

.mobile-menu.open {
  display: flex;
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
  }
}

.mobile-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--welo-text-dark);
  padding: var(--gap-sm) 0;
}

/* --- CTA Buttons --- */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.938rem;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.cta-btn--nav {
  background: var(--welo-text-dark);
  color: var(--welo-bg);
  padding: 10px 20px;
  font-size: 0.875rem;
}

.cta-btn--nav:hover {
  background: var(--welo-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 112, 255, 0.3);
}

.cta-btn--primary {
  background: var(--welo-text-dark);
  color: var(--welo-bg);
  font-size: 1rem;
  padding: 14px 32px;
}

.cta-btn--primary:hover {
  background: var(--welo-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(16, 112, 255, 0.3);
}

.cta-btn--large {
  font-size: 1.125rem;
  padding: 16px 40px;
}

.cta-btn--mobile {
  background: var(--welo-text-dark);
  color: var(--welo-bg);
  text-align: center;
  margin-top: var(--gap-sm);
}

.apple-icon {
  flex-shrink: 0;
}

/* --- Hero --- */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + 48px) 0 64px;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(16, 112, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(255, 110, 43, 0.04) 0%, transparent 50%),
    var(--welo-bg);
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xl);
  text-align: center;
}

@media (min-width: 900px) {
  .hero-grid {
    flex-direction: row;
    text-align: left;
    gap: 64px;
  }
}

.hero-content {
  flex: 1;
  max-width: 560px;
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: var(--gap-lg);
  color: var(--welo-text-dark);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.188rem);
  color: var(--welo-text-muted);
  line-height: 1.65;
  margin-bottom: 32px;
  max-width: 480px;
}

@media (max-width: 899px) {
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-default);
  margin-bottom: var(--gap-xl);
}

@media (max-width: 899px) {
  .hero-ctas {
    justify-content: center;
  }
}

.hero-stats {
  display: flex;
  gap: 32px;
}

@media (max-width: 899px) {
  .hero-stats {
    justify-content: center;
  }
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--welo-text-dark);
}

.stat-label {
  font-size: 0.813rem;
  color: var(--welo-text-muted-alt);
  letter-spacing: 0.02em;
}

/* Hero phone mockup */
.hero-visual {
  flex-shrink: 0;
}

.phone-mockup {
  position: relative;
  width: 260px;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 
    0 24px 80px rgba(0, 0, 0, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  background: var(--welo-bg);
}

@media (min-width: 900px) {
  .phone-mockup {
    width: 300px;
  }
}

.phone-mockup img {
  width: 100%;
  height: auto;
}

/* --- Section Shared --- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: var(--gap-md);
}

.section-subtitle {
  font-size: clamp(0.938rem, 1.5vw, 1.063rem);
  color: var(--welo-text-muted);
  line-height: 1.6;
}

/* --- Features --- */
.features {
  padding: 80px 0;
  background: var(--welo-bg);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-default);
}

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

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

.feature-card {
  padding: 28px 24px;
  border-radius: var(--radius-card);
  background: var(--welo-card-muted);
  border: 1px solid var(--welo-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gap-default);
}

.feature-icon--scan {
  background: rgba(16, 112, 255, 0.1);
  color: var(--welo-blue);
}

.feature-icon--safety {
  background: var(--welo-safe-green);
  color: var(--welo-safe-green-text);
}

.feature-icon--personal {
  background: rgba(255, 110, 43, 0.1);
  color: var(--welo-orange);
}

.feature-icon--swap {
  background: rgba(81, 138, 237, 0.1);
  color: var(--welo-indigo);
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--gap-sm);
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--welo-text-muted);
  line-height: 1.65;
}

/* --- How It Works --- */
.how-it-works {
  padding: 80px 0;
  background: var(--welo-surface);
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: 960px;
  margin: 0 auto;
}

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

.step {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.813rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--welo-text-dark);
  color: var(--welo-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gap-default);
}

.step-phone {
  width: 200px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  margin-bottom: var(--gap-lg);
  background: var(--welo-bg);
}

@media (min-width: 768px) {
  .step-phone {
    width: 220px;
  }
}

.step-phone img {
  width: 100%;
  height: auto;
}

.step-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--gap-sm);
}

.step-desc {
  font-size: 0.875rem;
  color: var(--welo-text-muted);
  line-height: 1.6;
  max-width: 260px;
}

/* --- Trust --- */
.trust {
  padding: 80px 0;
  background: var(--welo-bg);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-default);
}

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

.trust-card {
  text-align: center;
  padding: 32px 20px;
  background: var(--welo-bg-alt);
  border-radius: var(--radius-card);
  border: 1px solid var(--welo-border);
}

.trust-icon {
  font-size: 2rem;
  margin-bottom: var(--gap-md);
}

.trust-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--welo-text-dark);
  margin-bottom: var(--gap-sm);
}

.trust-label {
  font-size: 0.813rem;
  color: var(--welo-text-muted);
  line-height: 1.55;
}

/* --- Screenshots --- */
.screenshots {
  padding: 80px 0;
  background: var(--welo-surface);
}

.screenshots-track {
  display: flex;
  justify-content: center;
  gap: var(--gap-lg);
  flex-wrap: wrap;
}

.screenshot-card {
  position: relative;
  width: 220px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.06);
  background: var(--welo-bg);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.screenshot-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.screenshot-label {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  z-index: 2;
  white-space: nowrap;
}

.screenshot-label--safe {
  background: var(--welo-safe-green);
  color: var(--welo-safe-green-text);
}

.screenshot-label--warn {
  background: var(--welo-warn-red-chip);
  color: var(--welo-orange);
}

.screenshot-label--block {
  background: var(--welo-warn-red-bg);
  color: var(--welo-destructive);
}

.screenshot-card img {
  width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .screenshot-card {
    width: 180px;
  }
}

@media (max-width: 580px) {
  .screenshots-track {
    gap: var(--gap-md);
  }
  .screenshot-card {
    width: 150px;
    border-radius: 20px;
  }
}

/* --- FAQ --- */
.faq {
  padding: 80px 0;
  background: var(--welo-bg);
}

.faq-list {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq-item {
  border-bottom: 1px solid var(--welo-border);
}

.faq-item:first-child {
  border-top: 1px solid var(--welo-border);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-default);
  padding: 20px 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--welo-text-dark);
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::marker {
  display: none;
  content: '';
}

.faq-chevron {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--welo-text-muted-alt);
}

details[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 0 20px 0;
  font-size: 0.938rem;
  color: var(--welo-text-muted);
  line-height: 1.7;
}

/* --- Signup --- */
.signup {
  padding: 80px 0;
  background: var(--welo-surface);
}

.signup-card {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.signup-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: var(--gap-md);
}

.signup-subtitle {
  font-size: 1.063rem;
  color: var(--welo-text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

.signup-form {
  width: 100%;
}

.signup-input-wrap {
  display: flex;
  gap: var(--gap-sm);
  max-width: 480px;
  margin: 0 auto;
}

@media (max-width: 500px) {
  .signup-input-wrap {
    flex-direction: column;
  }
}

.signup-input-wrap input[type="email"] {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 20px;
  border: 1px solid var(--welo-border);
  border-radius: var(--radius-full);
  background: var(--welo-bg);
  color: var(--welo-text-dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.signup-input-wrap input[type="email"]:focus {
  border-color: var(--welo-blue);
  box-shadow: 0 0 0 3px rgba(16, 112, 255, 0.12);
}

.signup-input-wrap input[type="email"]::placeholder {
  color: var(--welo-text-muted-alt);
}

.signup-btn {
  flex-shrink: 0;
}

.signup-status {
  margin-top: var(--gap-md);
  font-size: 0.875rem;
  min-height: 1.4em;
}

.signup-status.success {
  color: var(--welo-safe-green-text);
}

.signup-status.error {
  color: var(--welo-destructive);
}

/* --- Download --- */
.download {
  padding: 80px 0;
  background: var(--welo-bg);
}

.download-card {
  text-align: center;
  padding: 64px 32px;
  background: var(--welo-surface);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.download-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 100%, rgba(16, 112, 255, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.download-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: var(--gap-md);
  position: relative;
}

.download-subtitle {
  font-size: 1.063rem;
  color: var(--welo-text-muted);
  margin-bottom: 32px;
  position: relative;
}

/* --- Footer --- */
.footer {
  padding: 48px 0 32px;
  background: var(--welo-bg);
  border-top: 1px solid var(--welo-border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-lg);
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
}

.footer-logo {
  width: 80px;
  height: auto;
  object-fit: contain;
  opacity: 0.7;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--welo-text-muted-alt);
}

.footer-links {
  display: flex;
  gap: var(--gap-lg);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--welo-text-muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--welo-text-dark);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--welo-text-muted-alt);
}

.footer-parent {
  font-size: 0.813rem;
  color: var(--welo-text-muted-alt);
}

.footer-parent a {
  color: var(--welo-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-parent a:hover {
  color: var(--welo-blue);
}

/* --- Animations --- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* --- Selection --- */
::selection {
  background: rgba(16, 112, 255, 0.15);
  color: var(--welo-text-dark);
}

/* --- Accessibility: Focus visible --- */
:focus-visible {
  outline: 2px solid var(--welo-blue);
  outline-offset: 3px;
}

/* --- Responsive: Extra small --- */
@media (max-width: 380px) {
  .hero {
    padding-top: calc(var(--nav-height) + 32px);
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-stats {
    gap: 20px;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .phone-mockup {
    width: 220px;
    border-radius: 28px;
  }

  .feature-card {
    padding: 20px 16px;
  }
}

/* --- Print --- */
@media print {
  .nav, .mobile-menu, .hero-bg, .cta-btn {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }
}
