:root {
  --bg: #0b0d10;
  --bg-elevated: #14171c;
  --bg-card: #1a1e24;
  --border: rgba(255,255,255,0.08);
  --text-primary: #f5f6f7;
  --text-secondary: #a7adb5;
  --text-tertiary: #6b7280;
  --accent: #3ea6ff;
  --accent-soft: rgba(62,166,255,0.12);
  --bad: #ff6b6b;
  --good: #4ade80;
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1100px;
  /* Critically-damped-style deceleration (no overshoot) -- these are hover
     states and scroll reveals, not momentum-driven gestures, so per Apple's
     own guidance (bounce only when a flick/drag preceded it) this should
     settle smoothly, not spring past the target. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
    'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }
@media (max-width: 700px) { section { padding: 64px 0; } }

/* --- Scroll reveal -- subtle fade + rise, skipped entirely (see the inline
   script) when the user has requested reduced motion. --- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Tracking and leading are size-specific, not one value for every heading --
   large display text wants tight leading and negative tracking (letters
   read too far apart as they grow); a small 20px h3 that often wraps to two
   lines in a card is closer to body-text territory and wants looser
   leading, with barely any negative tracking at all. */
h1, h2, h3 { margin: 0; font-weight: 700; }
h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: clamp(28px, 4vw, 42px); line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: 20px; line-height: 1.35; letter-spacing: -0.005em; }
p { color: var(--text-secondary); margin: 0; }
.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-secondary); max-width: 640px; }

/* --- Nav --- */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,13,16,0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text-primary); text-decoration: none; }
.brand svg { flex-shrink: 0; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text-primary); }
@media (max-width: 640px) { .nav-links a:not(.btn) { display: none; } }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #04101c; }
.btn-primary:hover { background: #5cb6ff; box-shadow: 0 4px 20px rgba(62,166,255,0.25); }
.btn-secondary { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-elevated); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.hero-ctas { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }

/* --- Hero --- */
.hero { padding-top: 120px; padding-bottom: 80px; text-align: center; }
.hero .wrap { display: flex; flex-direction: column; align-items: center; }
.hero .eyebrow { }
.hero h1 { max-width: 820px; }
.hero .lede { margin: 24px auto 0; text-align: center; }
.hero-badges {
  display: flex; gap: 10px; margin-top: 40px; flex-wrap: wrap; justify-content: center;
}
.badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 10px 16px 10px 14px; border-radius: 999px; font-size: 13px; color: var(--text-secondary);
}
.badge svg { flex-shrink: 0; color: var(--accent); }
.badge strong { color: var(--text-primary); }

/* --- Problem section --- */
.problem { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
@media (max-width: 800px) { .problem-grid { grid-template-columns: 1fr; } }
.problem-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
  transition: transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.problem-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.16); }
.mark {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; margin-bottom: 16px;
}
.mark-bad { background: rgba(255,107,107,0.12); color: var(--bad); }
.problem-card h3 { margin-bottom: 8px; }
.problem-card p { font-size: 15px; }

/* --- Alternatives comparison --- */
.compare-table-wrap { overflow-x: auto; margin-top: 48px; border-radius: var(--radius); border: 1px solid var(--border); }
table.compare { width: 100%; border-collapse: collapse; background: var(--bg-card); min-width: 640px; }
table.compare th, table.compare td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.compare th { color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
table.compare td { color: var(--text-secondary); }
table.compare tr:last-child td { border-bottom: none; }
table.compare td.product { color: var(--text-primary); font-weight: 600; }
table.compare tr.highlight td { background: var(--accent-soft); }
table.compare tr.highlight td.product { color: var(--accent); }
.cell-status { display: flex; align-items: center; gap: 8px; }
.cell-status::before {
  content: ''; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%;
  background-size: 10px 10px; background-position: center; background-repeat: no-repeat;
}
.cell-good::before {
  background-color: rgba(74,222,128,0.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 10.5l3 3 7-7' stroke='%234ade80' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.cell-bad::before {
  background-color: rgba(255,107,107,0.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 6l8 8M14 6l-8 8' stroke='%23ff6b6b' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* --- Solution section --- */
.solution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; margin-top: 48px; }
@media (max-width: 800px) { .solution-grid { grid-template-columns: 1fr; } }
.solution-list { display: flex; flex-direction: column; gap: 24px; }
.solution-item { display: flex; gap: 16px; }
/* Shared icon-badge base -- .icon-badge-lg/.icon-badge-warn below layer on
   top as size/color modifiers, used across solution items, howto cards,
   feature cards, and the security callout for one consistent icon system. */
.icon-badge {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.solution-item h3 { margin-bottom: 4px; font-size: 17px; }
.solution-item p { font-size: 14px; }
.solution-visual {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center;
}
.solution-visual .big-number { font-size: 56px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.solution-visual .big-label { color: var(--text-secondary); font-size: 15px; margin-top: 8px; }
.solution-visual hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* --- How it works --- */
.howto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px; }
@media (max-width: 800px) { .howto-grid { grid-template-columns: 1fr; } }
.howto-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; transition: transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.howto-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.16); }
.icon-badge-lg { width: 52px; height: 52px; border-radius: 14px; }
.howto-tag {
  display: inline-block; margin: 16px 0 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent);
}
.howto-card h3 { font-size: 21px; margin-bottom: 10px; }
.howto-card p { font-size: 15px; margin-bottom: 20px; }
.howto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.howto-list li {
  font-size: 14px; color: var(--text-secondary);
  padding-left: 24px; position: relative;
}
.howto-list li::before {
  content: ''; position: absolute; left: 0; top: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background-color: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 10.5l3 3 7-7' stroke='%233ea6ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 9px 9px; background-position: center; background-repeat: no-repeat;
}

/* --- Features grid --- */
.features { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
@media (max-width: 900px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  transition: transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.feature-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.16); }
.feature-card .icon-badge { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 16px; }
.feature-card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { font-size: 14px; }

/* --- Security callout --- */
.security-callout {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; margin-top: 48px; display: flex; gap: 20px; align-items: flex-start;
}
.icon-badge-warn {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,180,60,0.12); color: #ffb43c;
  display: flex; align-items: center; justify-content: center;
}
.security-callout h3 { margin-bottom: 8px; }
.security-callout p { font-size: 14.5px; }
.security-callout a { color: var(--accent); }

/* --- Screenshot placeholder --- */
.screenshot-frame {
  margin-top: 56px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-elevated));
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 14px; text-align: center;
  overflow: hidden;
}
.screenshot-frame img {
  display: block; width: 100%; height: 100%; min-width: 0; min-height: 0;
  object-fit: cover; object-position: top;
  border-radius: calc(var(--radius) - 1px);
}

/* --- Final CTA --- */
.final-cta { text-align: center; }
.final-cta h2 { max-width: 640px; margin: 0 auto; }
.final-cta .lede { margin: 16px auto 0; text-align: center; }
.final-cta .hero-ctas { justify-content: center; }

/* --- Footer --- */
footer { border-top: 1px solid var(--border); padding: 40px 0; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer p { font-size: 13px; color: var(--text-tertiary); }
footer .footer-links { display: flex; gap: 20px; }
footer .footer-links a { color: var(--text-tertiary); font-size: 13px; text-decoration: none; }
footer .footer-links a:hover { color: var(--text-secondary); }

/* --- Product-demo animations -----------------------------------------
   Three small looping widgets, each keyed to a single shared 0%-100%
   timeline per demo (no per-element animation-delay math needed) so every
   moving piece -- traveling dot, fill bar, node pulse, checkmark -- stays
   in sync purely from where its own keyframes sit on that timeline. */
.demo { margin-top: 26px; }
.hero .demo { width: 100%; max-width: 440px; margin-top: 48px; }
.demo-check {
  position: absolute; bottom: -3px; right: -3px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--good); border: 2px solid var(--bg-card);
  display: flex; align-items: center; justify-content: center;
}

/* Demo 1 -- drag & drop into a mock app window, then on to Telegram --- */
.demo-window {
  border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.demo-titlebar {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.1);
}
.demo-dot { width: 10px; height: 10px; border-radius: 50%; }
.demo-dot-red { background: #ff5f57; }
.demo-dot-yellow { background: #febc2e; }
.demo-dot-green { background: #28c840; }
.demo-titlebar-label { flex: 1; text-align: center; font-size: 12px; color: var(--text-tertiary); margin-right: 26px; }
.demo-dnd-body { position: relative; display: flex; align-items: center; gap: 14px; padding: 22px 18px; }
.demo-dropzone {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px; border-radius: 10px; color: var(--text-tertiary);
  border: 1.5px dashed rgba(255,255,255,0.22); background: rgba(255,255,255,0.02);
  animation: demo1-dz-glow 6.5s linear infinite;
}
.demo-dropzone-label { font-size: 11px; font-weight: 600; text-align: center; }
.demo-progress { width: 72%; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; margin-top: 2px; }
.demo-progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 2px; animation: demo1-progress 6.5s linear infinite; }
.demo-send-track { position: relative; width: 34px; height: 2px; flex-shrink: 0; background: rgba(255,255,255,0.12); border-radius: 2px; }
.demo-send-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: var(--accent); border-radius: 2px; animation: demo1-send-fill 6.5s linear infinite; }
.demo-plane {
  position: absolute; top: 50%; left: 0%; color: var(--accent); opacity: 0; transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px rgba(62,166,255,0.85)) drop-shadow(0 0 14px rgba(62,166,255,0.4));
  animation: demo1-plane 6.5s linear infinite;
}
.demo-telegram-node {
  position: relative; flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  animation: demo1-tg-pulse 6.5s linear infinite;
}
.demo-telegram-node .demo-check { animation: demo1-check-in 6.5s linear infinite; }
.demo-photo-chip {
  position: absolute; top: 14px; left: 44px; width: 26px; height: 26px; border-radius: 6px; z-index: 2;
  background: var(--bg-elevated); border: 1px solid rgba(255,255,255,0.16); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35), 0 0 16px rgba(62,166,255,0.55), 0 0 32px rgba(62,166,255,0.25);
  animation: demo1-chip 6.5s linear infinite;
}
@keyframes demo1-dz-glow {
  0%, 18%, 100% { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.02); }
  22% { border-color: var(--accent); background: rgba(62,166,255,0.07); }
  30% { border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.02); }
}
@keyframes demo1-chip {
  0% { opacity: 0; transform: translate(-52px, -30px) rotate(-12deg) scale(0.9); }
  4% { opacity: 1; }
  20% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1.14); }
  24% { transform: translate(0, 0) rotate(0deg) scale(1); }
  36% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.8); }
  100% { opacity: 0; }
}
@keyframes demo1-progress {
  0%, 20% { width: 0%; opacity: 1; }
  55% { width: 100%; opacity: 1; }
  90% { width: 100%; opacity: 1; }
  100% { width: 0%; opacity: 0; }
}
@keyframes demo1-send-fill {
  0%, 58% { width: 0%; opacity: 1; }
  80% { width: 100%; opacity: 1; }
  92% { width: 100%; opacity: 1; }
  100% { width: 0%; opacity: 0; }
}
@keyframes demo1-plane {
  0%, 58% { left: 0%; opacity: 0; }
  62% { opacity: 1; }
  80% { left: 100%; opacity: 1; }
  86%, 100% { opacity: 0; left: 100%; }
}
@keyframes demo1-tg-pulse {
  0%, 76%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
  82% { box-shadow: 0 0 0 9px rgba(74,222,128,0.18); }
  92% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
@keyframes demo1-check-in {
  0%, 78% { opacity: 0; transform: scale(0.5); }
  84% { opacity: 1; transform: scale(1); }
  95% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.6); }
}

/* Demo 2 -- iPhone -> Tailscale tunnel -> Mac -> Telegram ------------- */
.demo-tunnel { position: relative; }
.demo-tunnel-track { position: relative; height: 2px; margin: 0 12.5% 16px; }
.demo-tunnel-line { position: relative; width: 100%; height: 100%; background: var(--border); border-radius: 2px; overflow: hidden; }
.demo-tunnel-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: var(--accent); border-radius: 2px; animation: demo2-fill 8s linear infinite; }
.demo-tunnel-dot {
  position: absolute; top: 50%; left: 0%; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px var(--bg-card), 0 0 14px rgba(62,166,255,0.85), 0 0 28px rgba(62,166,255,0.4);
  animation: demo2-dot 8s linear infinite;
}
.demo-tunnel-nodes { display: flex; justify-content: space-between; }
.demo-tunnel-node { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 25%; }
.demo-tunnel-label { font-size: 11px; font-weight: 600; color: var(--text-tertiary); }
.demo-tunnel-node .icon-badge { position: relative; }
.demo2-n1 { animation: demo2-pulse-1 8s linear infinite; }
.demo2-n2 { animation: demo2-pulse-2 8s linear infinite; }
.demo2-n3 { animation: demo2-pulse-3 8s linear infinite; }
.demo2-n4 { animation: demo2-pulse-4 8s linear infinite; }
.demo-lock-open, .demo-lock-closed { position: absolute; inset: 0; margin: auto; }
.demo-lock-open { opacity: 1; animation: demo2-lock-open 8s linear infinite; }
.demo-lock-closed { opacity: 0; animation: demo2-lock-closed 8s linear infinite; }
.demo2-n4 .demo-check { animation: demo2-check-in 8s linear infinite; }
.demo-tunnel-caption {
  text-align: center; font-size: 11px; font-weight: 600; color: var(--accent);
  margin-top: 16px; opacity: 0; animation: demo2-caption 8s linear infinite;
}
@keyframes demo2-dot {
  0% { left: 0%; opacity: 0; }
  5% { opacity: 1; }
  24% { left: 33%; opacity: 1; }
  28% { opacity: 0; }
  32% { opacity: 1; left: 33%; }
  48% { left: 66%; opacity: 1; }
  50% { opacity: 0; }
  54% { opacity: 1; left: 66%; }
  72% { left: 100%; opacity: 1; }
  78%, 100% { opacity: 0; left: 100%; }
}
@keyframes demo2-fill {
  0% { width: 0%; opacity: 1; }
  24% { width: 33%; }
  32% { width: 33%; }
  48% { width: 66%; }
  54% { width: 66%; }
  72% { width: 100%; }
  92% { width: 100%; opacity: 1; }
  100% { width: 0%; opacity: 0; }
}
@keyframes demo2-pulse-1 {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62,166,255,0); }
  5% { box-shadow: 0 0 0 9px rgba(62,166,255,0.16); }
  12% { box-shadow: 0 0 0 0 rgba(62,166,255,0); }
}
@keyframes demo2-pulse-2 {
  0%, 20%, 100% { box-shadow: 0 0 0 0 rgba(62,166,255,0); }
  27% { box-shadow: 0 0 0 9px rgba(62,166,255,0.2); }
  34% { box-shadow: 0 0 0 0 rgba(62,166,255,0); }
}
@keyframes demo2-pulse-3 {
  0%, 44%, 100% { box-shadow: 0 0 0 0 rgba(62,166,255,0); }
  51% { box-shadow: 0 0 0 9px rgba(62,166,255,0.2); }
  58% { box-shadow: 0 0 0 0 rgba(62,166,255,0); }
}
@keyframes demo2-pulse-4 {
  0%, 68%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
  76% { box-shadow: 0 0 0 9px rgba(74,222,128,0.2); }
  86% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
@keyframes demo2-lock-open {
  0%, 22%, 100% { opacity: 1; }
  27%, 38% { opacity: 0; }
  44% { opacity: 1; }
}
@keyframes demo2-lock-closed {
  0%, 22%, 44%, 100% { opacity: 0; }
  27%, 38% { opacity: 1; }
}
@keyframes demo2-check-in {
  0%, 70% { opacity: 0; transform: scale(0.5); }
  78% { opacity: 1; transform: scale(1); }
  92% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.6); }
}
@keyframes demo2-caption {
  0%, 20%, 50%, 100% { opacity: 0; }
  26%, 42% { opacity: 1; }
}

/* Demo 3 -- typing an @username in and sharing the album -------------- */
.demo-share-row { display: flex; align-items: center; gap: 10px; }
.demo-share .icon-badge { margin-bottom: 0; flex-shrink: 0; position: relative; }
.demo3-album { animation: demo2-pulse-1 7s linear infinite; }
.demo-ghost-album {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--accent); opacity: 0; animation: demo3-ghost 7s linear infinite;
}
.demo-share-input {
  flex: 1; min-width: 0; height: 30px; padding: 0 10px; display: flex; align-items: center;
  border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
}
.demo-share-typed {
  display: inline-block; overflow: hidden; white-space: nowrap; width: 0;
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-primary);
  animation: demo3-type 7s steps(6, end) infinite;
}
.demo-share-caret {
  display: inline-block; width: 1px; height: 12px; background: var(--text-secondary);
  margin-left: 1px; opacity: 0; animation: demo3-caret 7s linear infinite;
}
.demo3-friend { animation: demo2-pulse-4 7s linear infinite; }
.demo3-friend .demo-check { animation: demo3-check-in 7s linear infinite; }
.demo-share-status {
  text-align: center; font-size: 11px; font-weight: 600; color: var(--good);
  margin-top: 12px; opacity: 0; animation: demo3-status 7s linear infinite;
}
@keyframes demo3-type {
  0%, 10% { width: 0; }
  34%, 100% { width: 6ch; }
}
@keyframes demo3-caret {
  0%, 8%, 100% { opacity: 0; }
  12%, 32% { opacity: 1; }
  38% { opacity: 0; }
}
@keyframes demo3-check-in {
  0%, 36% { opacity: 0; transform: scale(0.5); }
  44% { opacity: 1; transform: scale(1); }
  90% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.6); }
}
@keyframes demo3-status {
  0%, 38%, 96%, 100% { opacity: 0; }
  44%, 88% { opacity: 1; }
}
@keyframes demo3-ghost {
  0%, 44% { opacity: 0; transform: translate(0, 0) scale(1); }
  50% { opacity: 0.5; transform: translate(20px, 0) scale(0.9); }
  70% { opacity: 0.15; transform: translate(70px, 0) scale(0.7); }
  82%, 100% { opacity: 0; transform: translate(95px, 0) scale(0.6); }
}

/* --- Reduced motion: CSS-level backstop -- the scroll-reveal is already
   skipped in JS for these users, but this also removes the hover-lift
   transforms and anchor smooth-scrolling, in case JS is slow/blocked. --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .problem-card:hover, .howto-card:hover, .feature-card:hover {
    transform: none;
  }
  * { transition-duration: 0.01ms !important; }

  /* Freeze every demo on its finished frame instead of playing the loop. */
  .demo-dropzone, .demo-photo-chip, .demo-plane, .demo-telegram-node,
  .demo-tunnel-fill, .demo-tunnel-dot, .demo2-n1, .demo2-n2, .demo2-n3, .demo2-n4,
  .demo-lock-open, .demo-lock-closed, .demo-tunnel-caption,
  .demo3-album, .demo-ghost-album, .demo3-friend, .demo-share-typed,
  .demo-share-caret, .demo-share-status, .demo-check {
    animation: none !important;
  }
  .demo-progress-fill, .demo-send-fill, .demo-tunnel-fill { width: 100%; }
  .demo-photo-chip, .demo-plane, .demo-tunnel-dot, .demo-share-caret, .demo-ghost-album { display: none; }
  .demo-check { opacity: 1; transform: scale(1); }
  .demo-lock-open { opacity: 0; }
  .demo-lock-closed { opacity: 1; }
  .demo-tunnel-caption, .demo-share-status { opacity: 1; }
  .demo-share-typed { width: 6ch; }
}
