:root {
  --bg: #12161d;
  --bg-raise: #181d26;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1f5;
  --muted: #9aa4b2;
  --blue: #1074ff;
  --green: #22c55e;
  --radius: 14px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.8rem;
}

.lede { color: var(--muted); font-size: 1.06rem; max-width: 34em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.93rem;
  padding: 0.65rem 1.25rem;
  border-radius: 9px;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2a82ff; }
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.25); }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1rem; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 22, 29, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1rem; }
.brand img { border-radius: 8px; }
.nav-links { display: flex; gap: 1.5rem; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3rem;
}

.hero-copy .lede { margin-top: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin-top: 2rem;
}
.hero-chips li {
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.28rem 0.7rem;
}

.hero-phone img {
  width: min(340px, 100%);
  margin: 0 auto;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.5));
}

/* ---------- Features ---------- */
.features {
  max-width: 1160px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}
.section-head { text-align: center; max-width: 640px; margin: 0 auto 1rem; }
.section-head .lede { margin: 1rem auto 0; }

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3.5rem;
  padding: 4rem 0;
}
.feature:nth-child(odd) .feature-copy { order: 2; }
.feature:nth-child(odd) .feature-shot { order: 1; }

.feature-copy p:not(.eyebrow) { color: var(--muted); margin-top: 0.9rem; max-width: 30em; }

.checks { list-style: none; margin-top: 1.4rem; display: grid; gap: 0.65rem; }
.checks li {
  position: relative;
  padding-left: 1.8rem;
  font-size: 0.96rem;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(16, 116, 255, 0.14) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%231074ff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') center / 10px no-repeat;
}
.checks .speed { color: var(--green); }

.feature-shot img {
  width: min(440px, 100%);
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* ---------- Trust ---------- */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-raise); }
.trust-grid {
  max-width: 1160px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}
.trust-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  background: var(--bg);
}
.trust-card h4 { font-size: 1.05rem; margin-bottom: 0.45rem; }
.trust-card p { color: var(--muted); font-size: 0.9rem; }

/* ---------- Final CTA ---------- */
.cta-final {
  max-width: 720px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 1.4rem;
}
.cta-final img { border-radius: 14px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-raise); }
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2.2rem 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.4rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-left: auto; }
.footer-links a { color: var(--muted); font-size: 0.88rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { width: 100%; color: var(--muted); font-size: 0.8rem; }

/* ---------- Policy page ---------- */
.policy {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4.5rem;
}
.policy h1 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); }
.policy-updated { color: var(--muted); font-size: 0.88rem; margin: 0.6rem 0 2rem; }
.policy h2 { font-size: 1.25rem; margin: 2.2rem 0 0.7rem; }
.policy p { color: var(--muted); margin-bottom: 0.9rem; }
.policy ul { color: var(--muted); padding-left: 1.3rem; margin-bottom: 0.9rem; display: grid; gap: 0.45rem; }
.policy strong { color: var(--text); font-weight: 600; }
.policy a { color: var(--blue); }
.policy a:hover { text-decoration: underline; }

/* ---------- Feature demos ---------- */
.demo {
  margin-top: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-raise);
  padding: 1.1rem 1.2rem 0.9rem;
  max-width: 380px;
}
.demo-caption {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Downloader: 8 thread bars filling at different speeds */
.dl-bars { display: grid; gap: 7px; }
.dl-bars span {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--blue) 0 100%) no-repeat rgba(255, 255, 255, 0.06);
  background-size: 0% 100%;
  animation: dlFill 2.8s var(--ease-out) infinite;
}
.dl-bars span:nth-child(1) { animation-duration: 2.2s; }
.dl-bars span:nth-child(2) { animation-duration: 3.1s; animation-delay: 0.2s; }
.dl-bars span:nth-child(3) { animation-duration: 2.6s; animation-delay: 0.5s; }
.dl-bars span:nth-child(4) { animation-duration: 3.4s; animation-delay: 0.1s; }
.dl-bars span:nth-child(5) { animation-duration: 2.4s; animation-delay: 0.7s; }
.dl-bars span:nth-child(6) { animation-duration: 3.0s; animation-delay: 0.35s; }
.dl-bars span:nth-child(7) { animation-duration: 2.9s; animation-delay: 0.6s; }
.dl-bars span:nth-child(8) { animation-duration: 2.3s; animation-delay: 0.45s; }
@keyframes dlFill {
  0% { background-size: 0% 100%; opacity: 1; }
  78% { background-size: 100% 100%; opacity: 1; }
  92% { opacity: 0.35; }
  100% { background-size: 100% 100%; opacity: 0.35; }
}
.dl-speed { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Proxy: packet travels phone → globe → lock, lock turns green */
.proxy-line { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; }
.px-icon { width: 26px; height: 26px; color: var(--muted); flex-shrink: 0; }
.px-track {
  position: relative;
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  overflow: visible;
}
.px-packet {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px rgba(16, 116, 255, 0.9);
  transform: translate(-50%, -50%);
  animation: pxHop 4s linear infinite;
}
.px-packet2 { animation-name: pxHop2; }
@keyframes pxHop {
  0% { left: 0%; opacity: 0; }
  5% { opacity: 1; }
  40% { left: 100%; opacity: 1; }
  45%, 100% { left: 100%; opacity: 0; }
}
@keyframes pxHop2 {
  0%, 42% { left: 0%; opacity: 0; }
  47% { opacity: 1; }
  82% { left: 100%; opacity: 1; }
  87%, 100% { left: 100%; opacity: 0; }
}
.px-lock { animation: pxLock 4s linear infinite; }
@keyframes pxLock {
  0%, 80% { color: var(--muted); }
  86%, 96% { color: var(--green); }
  100% { color: var(--muted); }
}
.px-status { animation: pxStatus 4s linear infinite; }
@keyframes pxStatus {
  0%, 80% { color: var(--muted); }
  86%, 96% { color: var(--green); }
  100% { color: var(--muted); }
}

/* Privacy: history rows get wiped one by one */
.priv-rows { display: grid; gap: 6px; }
.priv-row {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  animation: privWipe 5s var(--ease-out) infinite;
}
.priv-row:nth-child(1) { animation-delay: 1.2s; }
.priv-row:nth-child(2) { animation-delay: 1.7s; }
.priv-row:nth-child(3) { animation-delay: 2.2s; }
@keyframes privWipe {
  0%, 24% { opacity: 1; transform: none; text-decoration: none; }
  32% { opacity: 0.5; text-decoration: line-through; }
  44%, 78% { opacity: 0.12; transform: translateX(8px); text-decoration: line-through; }
  90%, 100% { opacity: 1; transform: none; text-decoration: none; }
}
.priv-status { animation: privStatus 5s linear infinite; }
@keyframes privStatus {
  0%, 45% { color: var(--muted); }
  52%, 78% { color: var(--green); }
  88%, 100% { color: var(--muted); }
}

/* Photo editor: before/after divider sweeps across a photo while filters change */
.edit-canvas {
  position: relative;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
}
.edit-photo {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 30%, #f6c66b 0 14%, transparent 15%),
    linear-gradient(180deg, #7fb2d9 0 58%, #4d7a4a 58% 100%);
  filter: saturate(0.4) brightness(0.85);
  animation: editFilter 6s var(--ease-out) infinite;
}
@keyframes editFilter {
  0%, 15% { filter: saturate(0.4) brightness(0.85); }
  35%, 60% { filter: saturate(1.25) brightness(1.05) contrast(1.08); }
  80% { filter: saturate(1) hue-rotate(-12deg) brightness(1); }
  100% { filter: saturate(0.4) brightness(0.85); }
}
.edit-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  animation: editSweep 6s var(--ease-out) infinite;
}
@keyframes editSweep {
  0%, 12% { left: 6%; }
  50% { left: 94%; }
  62%, 100% { left: 6%; }
}
.edit-status::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--blue);
  animation: editDot 1.5s ease-in-out infinite;
  vertical-align: 1px;
}
@keyframes editDot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* Media detector: beam scans a page, video hits light up */
.scan-page {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 0.4rem 0.2rem;
  overflow: hidden;
}
.scan-line {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
}
.scan-line.short { width: 62%; }
.scan-hit {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(16, 116, 255, 0.08);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  animation: scanHit 4.5s linear infinite;
}
.scan-hit b { float: right; font-weight: 600; }
.scan-hit.hit2 { animation-name: scanHit2; }
@keyframes scanHit {
  0%, 28% { color: var(--muted); border-color: transparent; }
  34%, 88% { color: var(--text); border-color: rgba(16, 116, 255, 0.55); background: rgba(16, 116, 255, 0.14); }
  96%, 100% { color: var(--muted); border-color: transparent; }
}
@keyframes scanHit2 {
  0%, 52% { color: var(--muted); border-color: transparent; }
  58%, 88% { color: var(--text); border-color: rgba(16, 116, 255, 0.55); background: rgba(16, 116, 255, 0.14); }
  96%, 100% { color: var(--muted); border-color: transparent; }
}
.scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 26px;
  background: linear-gradient(180deg, transparent, rgba(16, 116, 255, 0.16), transparent);
  border-bottom: 1px solid rgba(16, 116, 255, 0.5);
  animation: scanBeam 4.5s linear infinite;
  pointer-events: none;
}
@keyframes scanBeam {
  0% { top: -30px; opacity: 1; }
  60% { top: 105%; opacity: 1; }
  61%, 100% { top: 105%; opacity: 0; }
}
.scan-status { animation: scanStatus 4.5s linear infinite; }
@keyframes scanStatus {
  0%, 55% { color: var(--muted); }
  62%, 90% { color: var(--blue); }
  98%, 100% { color: var(--muted); }
}

@media (prefers-reduced-motion: reduce) {
  .dl-bars span { animation: none; background-size: 70% 100%; }
  .px-packet, .px-lock, .px-status, .priv-row, .priv-status,
  .edit-photo, .edit-divider, .edit-status::after,
  .scan-hit, .scan-beam, .scan-status { animation: none; }
  .edit-divider { left: 50%; }
  .scan-beam { display: none; }
}

/* ---------- Motion (apple.com-style) ---------- */
:root { --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1); }

/* Hero entrance sequence on page load */
.js .hero-copy > *,
.js .hero-phone {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.js .loaded .hero-copy > *,
.js .loaded .hero-phone { opacity: 1; transform: none; }
.js .loaded .hero-copy > *:nth-child(1) { transition-delay: 0.05s; }
.js .loaded .hero-copy > *:nth-child(2) { transition-delay: 0.15s; }
.js .loaded .hero-copy > *:nth-child(3) { transition-delay: 0.25s; }
.js .loaded .hero-copy > *:nth-child(4) { transition-delay: 0.35s; }
.js .loaded .hero-copy > *:nth-child(5) { transition-delay: 0.45s; }
.js .loaded .hero-phone { transition-delay: 0.3s; }

/* Scroll reveals: children of each group rise in with a stagger */
.js .reveal-group > * {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.js .reveal-group.in > * { opacity: 1; transform: none; }
.js .reveal-group.in > *:nth-child(1) { transition-delay: 0s; }
.js .reveal-group.in > *:nth-child(2) { transition-delay: 0.12s; }
.js .reveal-group.in > *:nth-child(3) { transition-delay: 0.24s; }
.js .reveal-group.in > *:nth-child(4) { transition-delay: 0.36s; }

/* Screenshot cards also ease from a slight scale, like Apple product shots */
.js .feature-shot { transform: translateY(34px) scale(1.03); }
.js .reveal-group.in .feature-shot { transform: none; }

/* Parallax drift (JS sets translateY on the images themselves) */
.feature-shot img, .hero-phone img { will-change: transform; }

/* Gentle hover on buttons */
.btn { transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out); }
.btn:hover { transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  .js .hero-copy > *,
  .js .hero-phone,
  .js .reveal-group > *,
  .js .feature-shot { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-top: 3rem; }
  .hero-copy .lede, .feature-copy p:not(.eyebrow) { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-chips { justify-content: center; }

  .feature { grid-template-columns: 1fr; gap: 2rem; padding: 2.8rem 0; text-align: center; }
  .feature:nth-child(odd) .feature-copy { order: 1; }
  .feature:nth-child(odd) .feature-shot { order: 2; }
  .checks { justify-items: center; }
  .checks li { text-align: left; }
  .demo { margin-left: auto; margin-right: auto; text-align: left; }

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

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .trust-grid { grid-template-columns: 1fr; }
  .footer-links { margin-left: 0; }
}
