:root {
  --paper: #F3F5F4;
  --surface: #FFFFFF;
  --ink: #1B2333;
  --slate: #5A6577;
  --line: #D9DEE3;
  --signal: #2B4FD8;
  --verified: #1E8A4C;
  --bezel: #0E1420;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --text: "Source Serif 4", ui-serif, Georgia, serif;
  --measure: 34rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --wide: 78rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.62 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, summary, .button, .wordmark, .site-header nav, .channel, .faq-group, dt, .river-caption, .path-label {
  font-family: var(--display);
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }

a { color: var(--signal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: var(--gutter); top: -3rem; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; border-radius: 8px; font-family: var(--display);
}
.skip:focus { top: 0.75rem; }

main > section { max-width: var(--wide); margin: 0 auto; padding-inline: var(--gutter); }
main > section + section { margin-top: clamp(5rem, 11vw, 9rem); }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.04; letter-spacing: -0.03em; max-width: 17ch; }

/* Header: solid, with a rule once you've scrolled */

.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); transition: box-shadow 0.3s; }
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: var(--wide); margin: 0 auto; padding: 0.9rem var(--gutter); }
.wordmark { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.mark { width: 1.75rem; height: 1.75rem; }
.mark rect { fill: var(--ink); }
.mark path, .mark circle { fill: var(--paper); }
.site-header nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.4vw, 1.9rem); font-size: 1rem; font-weight: 500; }
.site-header nav a { color: var(--ink); text-decoration: none; }
.site-header nav a:hover { color: var(--signal); }
.nav-github { border: 1.5px solid var(--line); border-radius: 999px; padding: 0.3rem 0.9rem; }
.nav-github:hover { border-color: var(--ink); }

/* Buttons */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3.1rem; padding: 0.7rem 1.35rem;
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: 12px;
  font-weight: 600; font-size: 1.05rem; text-decoration: none; transition: transform 0.2s var(--ease), background 0.2s;
}
.button:hover { background: var(--signal); border-color: var(--signal); }
.button:active { transform: scale(0.97); }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.button.quiet:hover { border-color: var(--ink); background: var(--surface); }

/* Waiting list */

.waitlist { margin-top: 2rem; max-width: 31rem; }
.waitlist label { display: block; font-family: var(--display); font-weight: 600; font-size: 1rem; margin-bottom: 0.6rem; }
.waitlist-row { display: flex; gap: 0.5rem; }
.waitlist input, .waitlist select {
  min-height: 3.1rem; padding: 0.6rem 0.9rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
}
.waitlist input { flex: 1; min-width: 0; }
.waitlist input:focus, .waitlist select:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: var(--signal); }
.waitlist .button { cursor: pointer; }
.waitlist .button:disabled { opacity: 0.6; cursor: default; }
.waitlist-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.waitlist-note { margin-top: 0.55rem; font-size: 0.92rem; color: var(--slate); }
.waitlist-note a { color: inherit; }
.waitlist.is-done .waitlist-row, .waitlist.is-done label { display: none; }
.waitlist.is-done .waitlist-note { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--verified); }
.waitlist + .actions { margin-top: 1.25rem; }

/* Phones: the real app, in a plain bezel */

.phone {
  position: relative; width: 100%; aspect-ratio: 607 / 1320;
  border-radius: 16% / 7.4%; background: var(--bezel); padding: 3.2%;
  box-shadow: 0 2px 0 rgba(255,255,255,0.08) inset, 0 40px 80px -40px rgba(14, 20, 32, 0.55), 0 12px 24px -12px rgba(14, 20, 32, 0.3);
}
.phone > img { width: 100%; height: 100%; object-fit: cover; border-radius: 13.4% / 6.2%; }

/* Hero: your iPhone on one side, your Telegram on the other, nothing in between */

.hero {
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(2rem, 4vw, 4rem); align-items: center;
  padding-top: clamp(1.5rem, 4vw, 3rem); min-height: min(calc(100svh - 5rem), 50rem);
}
.hero h1 { font-size: clamp(3rem, 5.2vw, 4.9rem); line-height: 0.96; font-weight: 800; letter-spacing: -0.04em; max-width: 8.4em; }
.lede { margin-top: 1.5rem; font-size: clamp(1.15rem, 1.5vw, 1.3rem); max-width: 31rem; }
.proof { list-style: none; margin: 1.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-family: var(--display); font-weight: 600; font-size: 0.98rem; }
.proof li { display: inline-flex; align-items: center; gap: 0.45rem; }
.proof svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--verified); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fine { margin-top: 1.25rem; font-size: 0.92rem; color: var(--slate); max-width: 31rem; }

.hero-stage {
  position: relative; display: grid; grid-template-columns: 35% 1fr 45%; align-items: start;
  padding: 0 0 2.4rem; isolation: isolate;
}
.hero-phone { grid-column: 1; grid-row: 1; width: 100%; }
.hero-phone > img { position: relative; }
.channel {
  grid-column: 3; grid-row: 1; margin: 22% 0 0; position: relative; z-index: 2;
  background: var(--surface); border-radius: 22px; padding: 1rem 1rem 0.45rem;
  box-shadow: 0 1px 0 var(--line), 0 40px 70px -36px rgba(14, 20, 32, 0.5);
}
.stage-label { position: absolute; bottom: 0; font-family: var(--display); font-weight: 600; font-size: 0.92rem; color: var(--slate); }
.stage-label.for-phone { left: 0; width: 35%; text-align: center; }
.stage-label.for-channel { right: 0; width: 45%; text-align: center; }
.path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.path path { fill: none; stroke: var(--signal); stroke-width: 1.6; stroke-dasharray: 2 7; stroke-linecap: round; opacity: 0.55; }
.path-label {
  position: absolute; z-index: 2; transform: translateX(-50%); width: 7.5rem; text-align: center;
  font-family: var(--display); font-size: 0.82rem; line-height: 1.3; font-weight: 600; color: var(--signal);
}
.path-label:empty, .path:not(.is-drawn), .path:not(.is-drawn) + .path-label { display: none; }

.channel-head { display: flex; align-items: center; gap: 0.7rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.channel-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ink); }
.channel-avatar svg { width: 1.4rem; height: 1.4rem; }
.channel-avatar rect { fill: var(--paper); }
.channel-avatar path, .channel-avatar circle { fill: var(--ink); }
.channel-name { font-weight: 700; font-size: 1rem; line-height: 1.2; display: flex; align-items: center; gap: 0.35rem; }
.channel-name svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: var(--slate); stroke-width: 2.2; stroke-linecap: round; }
.channel-sub { color: var(--slate); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.files { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.files li {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; grid-template-areas: "img name size" "img state state";
  column-gap: 0.7rem; align-items: center; padding: 0.55rem 0; overflow: hidden;
}
.files li + li { border-top: 1px solid var(--line); }
.thumb {
  grid-area: img; width: 2.5rem; height: 2.5rem; border-radius: 8px;
  background: url(img/timeline.webp) var(--x) var(--y) / 404.67% 880% no-repeat;
}
.files .name { grid-area: name; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files .size { grid-area: size; color: var(--slate); font-variant-numeric: tabular-nums; }
.files .state { grid-area: state; height: 1.15rem; display: flex; align-items: center; font-size: 0.8rem; font-weight: 600; color: var(--verified); }
.files .done { position: relative; padding-left: 1.1rem; }
.files .done::before {
  content: ""; position: absolute; left: 0.05rem; top: 50%; width: 0.7rem; height: 0.38rem; margin-top: -0.3rem;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
.files .progress { display: none; width: 100%; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.files .progress i { display: block; height: 100%; width: 0; background: var(--signal); border-radius: inherit; }
.files li.is-uploading .progress { display: block; }
.files li.is-uploading .done { display: none; }
.files li.is-uploading .thumb { visibility: hidden; }
.files li.is-sent .thumb { visibility: visible; }

/* The moving parts (app.js): a cell lifts out of the timeline and flies into the channel. */
.lift, .flyer { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
.lift { border-radius: 4px; box-shadow: 0 0 0 3px var(--signal); opacity: 0; }
.flyer {
  border-radius: 6px; background: url(img/timeline.webp) var(--x) var(--y) / 404.67% 880% no-repeat;
  box-shadow: 0 14px 30px -10px rgba(14, 20, 32, 0.45);
}

/* River: real photos, drifting with the scroll */

.river { max-width: none !important; padding: 0 !important; overflow: hidden; }
.river-row { display: flex; gap: 0.9rem; width: max-content; will-change: transform; }
.river-row + .river-row { margin-top: 0.9rem; margin-left: -6rem; }
.river-row img { width: clamp(9rem, 15vw, 13rem); aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; }
.river-caption { max-width: var(--wide); margin: 1.5rem auto 0; padding-inline: var(--gutter); font-size: 1.05rem; font-weight: 500; color: var(--slate); }

/* Why band: short statements drifting past in two directions */

.reasons { max-width: none !important; padding: 0 !important; overflow: hidden; }
.ticker-row { display: flex; width: max-content; }
.ticker-row + .ticker-row { margin-top: 0.4rem; }
.ticker-track { display: flex; flex: none; animation: ticker 60s linear infinite; }
.ticker-row[data-direction="right"] .ticker-track { animation-direction: reverse; animation-duration: 70s; }
.ticker-row:hover .ticker-track { animation-play-state: paused; }
.ticker-track span {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 3.2vw, 2.6rem); letter-spacing: -0.025em;
  white-space: nowrap; padding: 0.35rem 0; display: inline-flex; align-items: center;
}
.ticker-track span::after {
  content: ""; width: 0.42em; height: 0.42em; margin: 0 0.9em; border-radius: 50%; background: var(--signal); flex: none;
}
.ticker-row[data-direction="right"] span { color: var(--slate); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* Feature tour: the phone stays, the screen changes */

.features h2 { max-width: 15ch; }
.tour { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); margin-top: 3rem; }
.tour-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; max-width: 30rem; opacity: 0.32; transition: opacity 0.5s var(--ease); }
.tour-step.is-active { opacity: 1; }
.tour-step h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 0.9rem; }
.tour-step p + p { margin-top: 0.8rem; }
.tour-step .note { color: var(--slate); font-size: 1rem; }
.tour-inline { display: none; }
.tour-phone { position: sticky; top: calc(50vh - min(21rem, 38vh)); height: fit-content; align-self: start; display: flex; justify-content: center; margin-top: 8vh; }
.tour-phone .phone { width: min(19.5rem, 33vh); }
.tour-phone .phone > img { position: absolute; inset: 3.2%; width: 93.6%; height: 94.2%; opacity: 0; transform: scale(0.985); transition: opacity 0.45s var(--ease), transform 0.6s var(--ease); }
.tour-phone .phone > img.is-on { opacity: 1; transform: none; }

/* Details */

.details dl { margin: 3rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem clamp(1.5rem, 3vw, 2.5rem); }
.details svg { width: 2rem; height: 2rem; fill: none; stroke: var(--signal); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 0.9rem; }
.details dt { font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
.details dd { margin: 0.4rem 0 0; color: var(--slate); font-size: 1.02rem; }

/* How it works: a real sequence */

.steps { list-style: none; counter-reset: step; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem); }
.steps li { counter-increment: step; }
.steps img {
  width: min(14rem, 100%); aspect-ratio: 607 / 1320; object-fit: cover; border-radius: 1.9rem;
  border: 7px solid var(--bezel); box-shadow: 0 30px 50px -30px rgba(14, 20, 32, 0.5); margin-bottom: 1.6rem;
}
.steps h3 { font-size: 1.35rem; line-height: 1.2; display: flex; align-items: baseline; gap: 0.6rem; }
.steps h3::before { content: counter(step); color: var(--signal); font-weight: 800; font-variant-numeric: tabular-nums; }
.steps p { margin-top: 0.5rem; color: var(--slate); max-width: 22rem; }

/* Privacy band */

.privacy { max-width: none !important; padding: 0 !important; background: var(--ink); color: var(--paper); }
.privacy-inner { max-width: var(--wide); margin: 0 auto; padding: clamp(4.5rem, 10vw, 8rem) var(--gutter); }
.privacy h2 { font-size: clamp(2.6rem, 7vw, 5.4rem); max-width: 12ch; letter-spacing: -0.035em; }
.privacy p { margin-top: 1.6rem; max-width: 38rem; font-size: clamp(1.15rem, 1.6vw, 1.35rem); color: #C9D1DE; }
.privacy a { color: #A9BCFF; }

/* FAQ */

.faq { max-width: 54rem !important; }
.faq-intro { margin-top: 1.25rem; color: var(--slate); max-width: var(--measure); }
.faq-group { font-size: 1.05rem; font-weight: 700; color: var(--slate); margin: 3rem 0 0.4rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.1rem 0; font-weight: 600; font-size: 1.2rem; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 0.75rem; height: 0.75rem; border-right: 2px solid var(--signal); border-bottom: 2px solid var(--signal);
  transform: translateY(-25%) rotate(45deg); transition: transform 0.35s var(--ease);
}
.faq details[open] summary::after { transform: translateY(25%) rotate(-135deg); }
.faq summary:hover { color: var(--signal); }
.answer { overflow: hidden; }
.answer p { padding: 0 2.5rem 1.5rem 0; max-width: 44rem; }
.faq-more { margin-top: 2rem; color: var(--slate); }

/* Open source */

.open { padding-bottom: clamp(4rem, 9vw, 7rem); }
.open p { max-width: var(--measure); margin-top: 1.25rem; }

/* Footer */

.site-footer {
  max-width: var(--wide); margin: 0 auto; padding: 2rem var(--gutter) 3rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; font-size: 0.95rem; color: var(--slate);
}
.site-footer p { max-width: 36rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; font-family: var(--display); }

/* Long-form pages (privacy policy) */

.prose { max-width: 44rem; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(4rem, 8vw, 6rem); }
.prose h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; font-weight: 800; letter-spacing: -0.035em; margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.45rem; letter-spacing: -0.015em; margin: 2.4rem 0 0.6rem; max-width: none; }
.prose p, .prose ul { margin: 0.8rem 0 0; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.45rem; }
.prose h3 { font-size: 1.15rem; margin: 1.8rem 0 0.4rem; }
.prose code { font-size: 0.9em; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; }

/* Reveal on arrival (app.js adds .is-visible) */

.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-row { width: auto; flex-wrap: wrap; }
  .ticker-track[aria-hidden] { display: none; }
  .ticker-track { flex-wrap: wrap; padding-inline: var(--gutter); }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .tour-step { transition: none; }
  .tour-phone .phone > img { transition: none; }
  .button, .faq summary::after { transition: none; }
}

/* Smaller screens */

@media (max-width: 1200px) {
  .channel { padding: 0.8rem 0.8rem 0.3rem; border-radius: 18px; }
  .channel-avatar { width: 2.1rem; height: 2.1rem; }
  .channel-name { font-size: 0.92rem; }
  .channel-sub { font-size: 0.76rem; white-space: nowrap; }
  .files { font-size: 0.8rem; }
  .files li { grid-template-columns: 2.1rem minmax(0, 1fr) auto; column-gap: 0.55rem; padding: 0.45rem 0; }
  .thumb { width: 2.1rem; height: 2.1rem; }
  .files .state { font-size: 0.74rem; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .hero-stage { grid-template-columns: 58% 1fr; max-width: 34rem; margin-top: 0.5rem; padding-bottom: 0; }
  .channel { grid-column: 1 / -1; grid-row: 1; justify-self: end; width: 70%; margin: 64% 0 0; }
  .stage-label, .path, .path-label { display: none; }
  .details dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tour { grid-template-columns: 1fr; }
  .tour-phone { display: none; }
  .tour-step { min-height: 0; opacity: 1; margin-bottom: 4rem; }
  .tour-inline { display: block; width: min(17rem, 72%); aspect-ratio: 607 / 1320; object-fit: cover; border-radius: 2.2rem; border: 8px solid var(--bezel); margin-bottom: 1.6rem; box-shadow: 0 30px 50px -30px rgba(14,20,32,0.5); }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .site-header nav a[href="#how"], .site-header nav a[href="#features"] { display: none; }
  .button { width: 100%; }
  .waitlist-row { flex-wrap: wrap; }
  .waitlist input { flex-basis: 100%; }
  .waitlist select { flex: 0 0 auto; }
  .waitlist .button { width: auto; flex: 1; }
  .details dl { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps img { width: min(15rem, 70%); }
  .faq summary { font-size: 1.1rem; }
  .answer p { padding-right: 0; }
}
