/*
 * Popmelon — popmelon.app
 *
 * Two decisions shape everything here.
 *
 * The palette is the fruit's actual anatomy, used structurally rather than as
 * an accent swapped into a dark theme: a green-black rind for the ground, pith
 * green for quiet structure, and flesh pink reserved almost entirely for the
 * playhead and the one button that matters. Pink appears rarely enough that
 * when it does, it means "this is the live thing".
 *
 * There are no webfonts. The privacy page promises nothing is handed to a third
 * party, and a Google Fonts stylesheet hands them every visitor's IP. So the
 * character has to come from treatment instead of typefaces: heavy tight
 * display sizes against a monospace utility face that carries timecodes and
 * room codes. That face is doing real work — this product is about time, so the
 * numbers are the structure, not decoration.
 */

:root {
  --rind-black: #0b1310;
  --rind: #1f7a4d;
  --pith: #b7e08a;
  --flesh: #f2496b;
  --seed: #1b2a20;

  --surface: #111b16;
  --surface-2: #16241d;
  --line: rgba(183, 224, 138, 0.14);
  --line-strong: rgba(183, 224, 138, 0.28);

  --ink: #eef5ef;
  --ink-dim: #93a89b;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --measure: 62ch;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--rind-black);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--flesh);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
}

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

/* ----------------------------------------------------------------- brand -- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18.5px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* The same SVG as the favicon, served from our own origin — one mark, and
   nothing fetched from anyone else. */
.melon {
  width: 26px;
  height: 13px;
  flex: none;
  display: block;
}

/* ------------------------------------------------------------------ nav -- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px var(--gutter);
  border-bottom: 1px solid var(--line);
}

.nav nav {
  display: flex;
  gap: clamp(14px, 3vw, 30px);
  font-size: 14.5px;
  color: var(--ink-dim);
}

.nav nav a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--pith);
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  padding: clamp(56px, 11vw, 120px) var(--gutter) clamp(40px, 7vw, 72px);
  max-width: 1080px;
}

.eyebrow {
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pith);
}

.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(46px, 9.5vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.lede {
  margin: 0 0 30px;
  max-width: var(--measure);
  font-size: clamp(17px, 2.1vw, 20px);
  color: var(--ink-dim);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
}

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.btn-primary {
  background: var(--flesh);
  color: #fff;
}
.btn-primary:hover { background: #ff5d7c; transform: translateY(-1px); }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--pith); transform: translateY(-1px); }

.fineprint {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-dim);
}

/* ------------------------------------------------------ the sync figure -- */
/*
 * The product, drawn. Three playheads drift apart and then GLIDE back rather
 * than snapping, because that is precisely what the correction ladder does:
 * under 400ms it leaves you alone, past that it nudges playback speed a few
 * percent so you slide back together, and only a real gap gets a hard seek.
 * A snap here would be a picture of the wrong product.
 */

.sync {
  margin: clamp(36px, 6vw, 56px) 0 clamp(34px, 5vw, 48px);
  padding: 20px 22px 30px;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sync-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 13px;
}

.tc {
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--pith);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}
.sync-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pith);
}

.track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
}

.buffered {
  position: absolute;
  inset: 0 22% 0 0;
  border-radius: 999px;
  background: rgba(183, 224, 138, 0.16);
}

/*
 * One dot per person, each in the colour the relay actually assigns members.
 * Labels sit in a legend below rather than under each dot: converged is the
 * healthy state, and in that state three labels on one point stack into an
 * unreadable smudge — the figure would be least legible exactly when it is
 * showing things working.
 */
.head {
  position: absolute;
  top: 50%;
  left: 58%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--who);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--who) 22%, transparent);
  animation: converge 9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Each drifts by a different amount, as real clients do. */
.head-a { --who: var(--flesh); --drift: -13%; animation-delay: 0s; }
.head-b { --who: var(--pith);  --drift: 9%;   animation-delay: -0.4s; }
.head-c { --who: #f5b50a;      --drift: 4%;   animation-delay: -0.8s; }

@keyframes converge {
  0%,  8%   { transform: translateX(0); }
  38%       { transform: translateX(var(--drift)); }
  86%, 100% { transform: translateX(0); }
}

.who {
  display: flex;
  gap: 18px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.who li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.who li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--who);
}

.who-a { --who: var(--flesh); }
.who-b { --who: var(--pith); }
.who-c { --who: #f5b50a; }

@media (prefers-reduced-motion: reduce) {
  .head { animation: none; }
  .btn { transition: none; }
}

/* ---------------------------------------------------------------- cards -- */

.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.card {
  padding: clamp(28px, 4vw, 40px) var(--gutter);
  background: var(--rind-black);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 19px;
  letter-spacing: -0.015em;
}

.card p {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink-dim);
}

/* -------------------------------------------------------------- sections -- */

.section-title {
  margin: 0 0 18px;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 750;
}

.how,
.private,
.install {
  padding: clamp(56px, 8vw, 96px) var(--gutter);
  max-width: 1080px;
}

.private {
  border-block: 1px solid var(--line);
  max-width: none;
}

.private p {
  max-width: var(--measure);
  color: var(--ink-dim);
}

.private .lede { color: var(--ink); }

.inline-link {
  color: var(--pith);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}
.inline-link:hover { border-bottom-color: var(--pith); }

/* Numbered because these genuinely are a sequence — you cannot send the link
 * before you have started the party. */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(22px, 3vw, 36px);
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.steps li { margin: 0; }

.step-n {
  display: block;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--flesh);
}

.steps h3 {
  margin: 0 0 7px;
  font-size: 17.5px;
  letter-spacing: -0.015em;
}

.steps p {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink-dim);
}

.steps-compact { margin-top: 26px; }
.steps-compact .step-n { margin-bottom: 10px; }

.install .fineprint { margin-top: 30px; }

/* --------------------------------------------------------------- footer -- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px clamp(30px, 8vw, 90px);
  padding: clamp(40px, 6vw, 64px) var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}

.foot-brand p {
  margin: 10px 0 0;
  color: var(--ink-dim);
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: var(--ink-dim);
}

.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--ink); }

.disclaimer {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--ink-dim);
  opacity: 0.75;
}

/* ------------------------------------------------------- privacy / terms -- */

.doc-head {
  padding: 22px var(--gutter);
  border-bottom: 1px solid var(--line);
}

.prose {
  padding: clamp(44px, 7vw, 76px) var(--gutter) clamp(56px, 8vw, 90px);
  max-width: 74ch;
}

.prose h1 {
  margin: 0 0 20px;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.prose h2 {
  margin: 46px 0 12px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.prose p,
.prose li { color: var(--ink-dim); }

.prose .lede {
  font-size: clamp(17px, 2vw, 19.5px);
  color: var(--ink);
}

.prose .meta {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--pith);
}

.prose ul { padding-left: 1.1em; }
.prose li { margin-bottom: 8px; }

.prose a { color: var(--pith); }

.doc-foot {
  display: flex;
  gap: 22px;
  padding: 30px var(--gutter) 56px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-dim);
}

.doc-foot a { text-decoration: none; }
.doc-foot a:hover { color: var(--ink); }

@media (max-width: 560px) {
  .nav { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sync { padding-inline: 16px; }
}
