:root {
  --surface: #ffffff;
  --surface-soft: #f3f6ff;
  --text: #172033;
  --muted: #657089;
  --brand: #1f6fdb;
  --brand-2: #0f8a5f;
  --line: rgba(24, 32, 51, 0.08);
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  overflow-x: hidden;
  background: #e9eef9;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
button { font: inherit; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

.page-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #fff9f2 0%, #f7f1e8 100%);
}
.compact-page { padding-bottom: 20px; }
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.35;
  overflow: hidden;
  border-radius: 0 0 26px 26px;
  background: #e7dcc8;
}
.language-control {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  padding: 5px 7px 5px 9px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: rgba(9, 25, 30, .48);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  color: #fff;
  backdrop-filter: blur(12px);
}
.language-control label { font-size: 10px; font-weight: 800; white-space: nowrap; }
.language-control select {
  min-width: 0;
  max-width: 180px;
  padding: 3px 22px 3px 7px;
  border: 0;
  border-radius: 999px;
  outline: 0;
  color: #172033;
  background: rgba(255, 255, 255, .94);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
}
.hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: opacity 0.22s ease, transform 0.35s ease;
}
.hero.is-changing > img { opacity: 0.3; transform: scale(1.02); }
.hero-gradient {
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  background: linear-gradient(to top, rgba(8, 46, 34, 0.88), rgba(8, 46, 34, 0.42) 55%, transparent);
}
.hero-copy { position: absolute; left: 16px; right: 16px; bottom: 16px; color: #fff; }
.nearby-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 10px; padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 999px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(8px);
  font-size: 10px; font-weight: 900;
}
.nearby-badge span { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.hero h1 { max-width: 330px; font-size: clamp(20px, 5.6vw, 24px); line-height: 1.12; letter-spacing: -.03em; font-weight: 950; overflow-wrap: anywhere; }
.hero p { max-width: 310px; margin-top: 8px; color: rgba(255,255,255,.84); font-size: 12px; line-height: 1.45; }
.hero-meta { margin-top: 10px; color: rgba(255,255,255,.86); font-size: 11px; font-weight: 800; }

.thumb-viewport { position: relative; z-index: 3; margin-top: -8px; padding: 0 10px; overflow: hidden; }
.thumb-track {
  display: flex; gap: 6px; width: 100%; padding: 6px 4px 8px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
}
.thumb-track::-webkit-scrollbar { display: none; }
.thumb-card {
  flex: 0 0 calc((100% - 18px) / 4); min-width: 70px; padding: 3px;
  border: 1px solid rgba(255,255,255,.92); border-radius: 14px;
  background: #fff; box-shadow: 0 8px 18px rgba(18,28,56,.10);
  opacity: .9; scroll-snap-align: center; transition: .18s ease;
}
.thumb-card.active { outline: 2px solid var(--brand); transform: translateY(-2px); box-shadow: 0 14px 28px rgba(31,111,219,.18); opacity: 1; }
.thumb-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }

.content-stack { display: grid; gap: 8px; padding: 8px 12px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.story-card { padding: 14px; }
.eyebrow { color: #8b95ab; font-size: 10px; font-weight: 900; letter-spacing: .08em; overflow-wrap: anywhere; }
.story-card h2 { margin-top: 6px; font-size: 16px; line-height: 1.2; font-weight: 950; }
.story-card p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.stats-card { display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 6px; }
.stats-card article { padding: 4px 2px; text-align: center; }
.stats-card strong { display: block; color: #1f3563; font-size: 18px; font-weight: 950; }
.stats-card span { display: block; margin-top: 3px; color: #8590a9; font-size: 10px; line-height: 1.35; font-weight: 800; overflow-wrap: anywhere; }
.trust-card { padding: 12px; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.trust-grid > div { padding: 10px 8px; border: 1px solid rgba(31,111,219,.08); border-radius: 12px; background: var(--surface-soft); text-align: center; }
.trust-grid strong { display: block; color: #1c2a4f; font-size: 12px; font-weight: 900; }
.trust-grid span { display: block; margin-top: 3px; color: #7a86a1; font-size: 10px; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; }

.cta-wrap { position: relative; margin-top: 10px; padding: 0 12px; }
#ctaButton {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px;
  border-radius: 16px; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 26px rgba(31,111,219,.28); color: #fff; font-size: 16px; font-weight: 900;
}
#ctaButton:active { transform: translateY(1px); }
.cta-finger {
  position: absolute; right: 18px; top: 22px; z-index: 4; width: 40px; height: 44px;
  pointer-events: none; filter: drop-shadow(0 4px 10px rgba(12,27,58,.18)); animation: finger 1s ease-in-out infinite;
}
.cta-note { margin-top: 7px; color: #8591aa; font-size: 11px; line-height: 1.4; font-weight: 700; text-align: center; }
.privacy { padding: 10px 16px 0; color: #a8afbf; font-size: 10px; line-height: 1.6; text-align: center; }
@keyframes finger { 50% { transform: translateY(6px); } }

.modal {
  position: fixed; inset: 0; z-index: 30; display: none; align-items: flex-end; justify-content: center;
  padding: 14px; background: rgba(8,13,24,.58); backdrop-filter: blur(6px);
}
.modal.open { display: flex; }
.modal-panel {
  position: relative; width: min(100%, 430px); padding: 14px 16px 18px; border-radius: 26px;
  background: rgba(255,255,255,.98); box-shadow: 0 28px 70px rgba(0,0,0,.28); animation: rise .24s ease;
}
.modal-handle { width: 42px; height: 4px; margin: 0 auto 16px; border-radius: 99px; background: #dfe3ec; }
.modal-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 50%; color: #657089; background: #f1f4fa; font-size: 22px; }
.modal-profile { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.modal-profile img { width: 58px; height: 58px; border-radius: 17px; object-fit: cover; }
.modal-title { font-size: 17px; font-weight: 950; }
.modal-status { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: #7a8498; font-size: 11px; font-weight: 800; }
.modal-status span { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.modal-panel h3 { font-size: 20px; font-weight: 950; }
.modal-panel > p { margin-top: 8px; color: #657089; font-size: 13px; line-height: 1.55; }
.modal-primary { width: 100%; min-height: 50px; margin-top: 16px; border-radius: 15px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 15px; font-weight: 900; }
@keyframes rise { from { transform: translateY(28px); opacity: 0; } }

html[dir="rtl"] .language-control { right: auto; left: 12px; padding: 5px 9px 5px 7px; }
html[dir="rtl"] .hero-copy,
html[dir="rtl"] .story-card,
html[dir="rtl"] .trust-card,
html[dir="rtl"] .modal-panel { text-align: right; }
html[dir="rtl"] .modal-close { right: auto; left: 14px; }
html[dir="rtl"] .cta-finger { right: auto; left: 18px; transform: scaleX(-1); }
html[dir="rtl"] .modal-profile,
html[dir="rtl"] .modal-status { flex-direction: row; }
html[dir="rtl"] .thumb-track { direction: rtl; }

@media (max-width: 350px) {
  .language-control label { display: none; }
  .language-control select { max-width: 168px; }
  .hero h1 { font-size: 20px; }
}

@media (min-width: 600px) { .page-shell { box-shadow: 0 0 60px rgba(33,48,84,.12); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; } }
