/* Source to Sea: The Nile — brand site. Palette lifted verbatim from the app's Theme.swift so
   web and app read as one identity. */
:root {
  --navy: #121a3d;
  --navy-deep: #0a0f26;
  --teal: #1a8094;
  --teal-bright: #29adb8;
  --gold: #f5b854;
  --gold-bright: #ffd173;
  --cream: #f7f2e0;
  --logo-blue: #4075b8;
  --ink: #f7f2e0;
  --muted: rgba(247, 242, 224, 0.62);
  --line: rgba(247, 242, 224, 0.12);
  --card: rgba(255, 255, 255, 0.04);
  --maxw: 1080px;
  --radius: 18px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(41, 173, 184, 0.16), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  overscroll-behavior-y: none; /* iOS rubber-band past footer */
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(10, 15, 38, 0.72);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 600;
  margin-left: 22px; transition: color 0.18s ease;
}
.nav a:hover { color: var(--ink); }

/* ---- hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(10, 15, 38, 0.85) 0%, rgba(10, 15, 38, 0.38) 48%, rgba(10, 15, 38, 0.92) 100%),
    url("assets/nile-hero.jpg") center 62% / cover no-repeat;
}
.hero::after {
  /* blend photo into the page gradient below */
  content: ""; position: absolute; inset: auto 0 0 0; height: 120px;
  background: linear-gradient(180deg, transparent, var(--navy-deep));
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.7fr);
  align-items: center; gap: clamp(28px, 5vw, 64px);
  padding-top: 84px; padding-bottom: 96px;
}
.hero-brandline {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em;
  color: var(--cream); margin-bottom: 22px;
}
.hero-brandline img { width: 44px; height: 44px; border-radius: 11px; }
.hero-kicker {
  font-size: 1.02rem; font-weight: 700; color: var(--gold-bright);
  margin-bottom: 12px;
  text-shadow: 0 1px 14px rgba(10, 15, 38, 0.7);
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04;
  text-wrap: balance; margin-bottom: 18px;
  text-shadow: 0 2px 24px rgba(10, 15, 38, 0.6);
}
.hero h1 .accent { color: var(--gold-bright); }
.hero p.lead {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: rgba(247, 242, 224, 0.78); max-width: 54ch;
  margin-bottom: 34px; text-wrap: pretty;
  text-shadow: 0 1px 16px rgba(10, 15, 38, 0.6);
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.platform-note { margin-top: 12px; font-size: 0.85rem; color: var(--muted); }

/* ---- phone frame ---- */
.phone {
  border-radius: clamp(26px, 5.5cqw, 38px);
  border: 5px solid rgba(247, 242, 224, 0.14);
  background: var(--navy-deep);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.35);
}
.phone img { display: block; width: 100%; height: auto; }

.hero-phone { container-type: inline-size; width: min(320px, 100%); justify-self: center; }
.hero-phone .phone {
  transform: rotate(2.5deg);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.55), 0 0 60px rgba(245, 184, 84, 0.12);
}

.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-weight: 700; font-size: 1rem; padding: 14px 26px; border-radius: 14px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn-gold { background: linear-gradient(160deg, var(--gold-bright), var(--gold)); color: #3a2a08; box-shadow: 0 10px 30px rgba(245, 184, 84, 0.28); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(245, 184, 84, 0.36); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.07); }

.appstore-badge {
  display: inline-flex; align-items: center;
  border-radius: 10px;
  transition: transform 0.16s ease, filter 0.16s ease;
}
.appstore-badge img { display: block; width: 160px; height: auto; border-radius: 10px; }
.appstore-badge:hover { transform: translateY(-2px); filter: brightness(1.08); }
.appstore-badge:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }

/* ---- manifesto ---- */
.manifesto { text-align: center; padding: 84px 0 20px; }
.manifesto-line {
  font-size: clamp(1.6rem, 4.2vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.18; text-wrap: balance; margin-bottom: 20px;
}
.manifesto-line .accent { color: var(--gold-bright); }
.manifesto-sub {
  max-width: 62ch; margin: 0 auto; color: var(--muted);
  font-size: 1.08rem; text-wrap: pretty;
}

/* ---- section scaffolding ---- */
section.block { padding: 64px 0; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; text-wrap: balance; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* ---- steps ---- */
.steps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { padding: 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.step .num {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; color: var(--navy-deep); margin-bottom: 16px;
  background: linear-gradient(160deg, var(--teal-bright), var(--teal));
}
.step h3 { font-size: 1.18rem; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.98rem; }

/* ---- screenshot showcase ---- */
#screens .screens-row {
  display: flex; gap: clamp(16px, 2.5vw, 28px);
  overflow-x: auto; padding: 4px 4px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* hide the native scrollbar; scroll still works via trackpad/drag/swipe */
  scrollbar-width: none;
  /* soft fade at both ends so cut-off cards read as "scroll for more" */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}
#screens .screens-row::-webkit-scrollbar { display: none; }
.screen {
  flex: 0 0 auto; width: clamp(200px, 22vw, 244px);
  container-type: inline-size;
  scroll-snap-align: center;
  text-align: center;
}
.screen figcaption {
  margin-top: 14px; font-weight: 700; font-size: 0.98rem; color: var(--cream);
}
#screens { position: relative; }

/* ---- feature grid ---- */
/* Full-width banner on top (the 5,500 km card), then a clean 3-up row.
   No 2-column stage, so we never get an orphaned card. */
.features { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.feature { padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.feature .stat { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; color: var(--gold-bright); line-height: 1; margin-bottom: 10px; }
.feature .stat-unit { font-size: 1.1rem; }
.feature h3 { font-size: 1.14rem; font-weight: 700; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.97rem; }

.feature-wide {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: auto 1fr; align-items: center;
  gap: 12px 40px;
  background: linear-gradient(135deg, rgba(41, 173, 184, 0.14), rgba(245, 184, 84, 0.08)), var(--card);
  border-color: rgba(245, 184, 84, 0.28);
}
.feature-wide .stat { font-size: clamp(3rem, 7vw, 4.6rem); margin-bottom: 0; grid-row: 1 / span 2; }
.feature-wide .stat-unit { font-size: 1.6rem; }
.feature-wide h3 { font-size: 1.35rem; margin-bottom: 6px; align-self: end; }
.feature-wide p { max-width: 62ch; font-size: 1.02rem; align-self: start; }

@media (max-width: 820px) {
  .features { grid-template-columns: 1fr; }
  .feature-wide { grid-column: auto; grid-template-columns: 1fr; gap: 8px; text-align: center; }
  .feature-wide .stat { grid-row: auto; }
}

/* ---- privacy strip ---- */
/* 3-up on desktop, straight to 1-up on small screens — no 2+1 orphan stage. */
.assurance { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .assurance { grid-template-columns: 1fr; } }
.assurance .item { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.assurance .dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; background: var(--teal-bright); box-shadow: 0 0 12px rgba(41, 173, 184, 0.6); }
.assurance h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 4px; }
.assurance p { color: var(--muted); font-size: 0.92rem; }

/* ---- final cta ---- */
.final-cta { text-align: center; padding: 72px 0; }
.final-cta h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; text-wrap: balance; }
.final-cta p { color: var(--muted); font-size: 1.1rem; margin-bottom: 30px; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.site-footer .brand b { font-size: 0.95rem; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; font-weight: 600; margin-left: 20px; }
.site-footer nav a:hover { color: var(--ink); }
.site-footer .copyright { color: var(--muted); font-size: 0.85rem; width: 100%; }

/* ---- legal / doc pages ---- */
.doc { max-width: 760px; margin: 0 auto; padding: 56px 0 72px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.doc .updated { color: var(--muted); font-size: 0.92rem; margin-bottom: 32px; }
.doc h2 { font-size: 1.35rem; font-weight: 700; margin: 32px 0 10px; }
.doc p, .doc li { color: rgba(247, 242, 224, 0.82); margin-bottom: 12px; }
.doc ul { padding-left: 22px; margin-bottom: 12px; }
.doc li { margin-bottom: 8px; }
.doc a { color: var(--gold-bright); }
.doc strong { color: var(--ink); }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.back-link:hover { color: var(--ink); }

@media (max-width: 840px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 64px; }
  .hero-copy { text-align: center; }
  .hero-brandline { justify-content: center; }
  .hero p.lead { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .hero-phone { max-width: 240px; margin-top: 8px; }
  .hero-phone .phone { transform: none; }
  .screen { width: 210px; }
}

@media (max-width: 640px) {
  .nav a:not(.nav-cta) { display: none; }
  section.block { padding: 48px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}
