/* Colours are the app's own (App/OpenConnctApp/Views/Theme.swift), so the page
   and the product read as one thing. System fonts only: nothing is fetched
   from another host. */

:root {
  color-scheme: dark light;
  --ink: #1b1b1f;
  --panel: #242429;
  --raised: #2e2e33;
  --text: #f2f2f4;
  --muted: #9c9ca6;
  --line: rgba(255, 255, 255, 0.1);
  --button: #d0342c;
  --button-hover: #b92c25;
  --button-text: #ffffff;
  --trace-a: #9c9ca6;
  --trace-drift: #ee5a4f;
  --trace-locked: #2ecc59;
  --link: #ff8a80;
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: light) {
  :root {
    --ink: #f5f5f7;
    --panel: #ffffff;
    --raised: #ececf0;
    --text: #1d1d1f;
    --muted: #5c5c66;
    --line: rgba(0, 0, 0, 0.12);
    --trace-a: #8a8a94;
    --trace-drift: #c9302a;
    --trace-locked: #14893a;
    --link: #b3261e;
    --shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2 {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 6.4vw, 4.5rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); }

p { margin: 0; }

/* Every section shares one measure so the left edge never wanders. */
.top, main > section, footer {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font: 700 1.125rem/1 ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  text-decoration: none;
}
.brand img { border-radius: 8px; }
.source { font-size: 0.9375rem; }

main > section { padding-block: clamp(2.75rem, 7vw, 5.5rem); }
main > section + section { border-top: 1px solid var(--line); }

/* Hero */
.hero {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  padding-top: clamp(1.5rem, 4vw, 3.5rem);
}
.lead {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--muted);
}
.lead strong { color: var(--text); font-weight: 650; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
}
.button {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border-radius: 12px;
  background: var(--button);
  color: var(--button-text);
  font: 650 1.0625rem/1.2 system-ui, -apple-system, sans-serif;
  text-decoration: none;
  transition: background-color 0.15s;
}
.button:hover { background: var(--button-hover); }
.quiet { color: var(--text); }

.status {
  margin-top: 1.1rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.shot { margin: 0; }
.shot img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
  outline: 1px solid var(--line);
}

/* Why */
.why {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
}
.why-text { max-width: 34rem; }
.why-text p { margin-top: 1.1rem; color: var(--muted); }
.why-text h2 + p { margin-top: 1.4rem; }

/* The figure: the one place the page moves.
   The wave has a period of exactly 80 units and the drifting trace slides by
   exactly one period, so the loop has no seam: it reads as a phase slipping
   continuously, which is what clock drift is. */
.drift {
  margin: 0;
  display: grid;
  gap: 1.5rem;
}
.drift > svg:first-child {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.lane svg {
  display: block;
  width: 100%;
  height: 5rem;
  overflow: hidden;
  background: var(--panel);
  border-radius: 10px;
}
.lane figcaption {
  margin-top: 0.55rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.mic-a { stroke: var(--trace-a); }
.mic-b.drifting { stroke: var(--trace-drift); animation: slip 14s linear infinite; }
.mic-b.locked { stroke: var(--trace-locked); }

@keyframes slip {
  from { transform: translateX(0); }
  to { transform: translateX(-80px); }
}

@media (prefers-reduced-motion: reduce) {
  .mic-b.drifting { animation: none; transform: translateX(-30px); }
}

/* What you get */
.features h2 { max-width: 30rem; }
.features dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem 3.5rem;
  margin: 2.5rem 0 0;
}
.features dt {
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
}
.features dd {
  margin: 0.45rem 0 0;
  max-width: 30rem;
  color: var(--muted);
}
.not { margin-top: 2.75rem; max-width: 40rem; color: var(--muted); }

/* Get it */
.get ol {
  margin: 1.75rem 0 0;
  padding: 0;
  max-width: 40rem;
  list-style: none;
  counter-reset: step;
}
.get li {
  position: relative;
  padding-left: 3rem;
  counter-increment: step;
}
.get li + li { margin-top: 1.1rem; }
.get li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--raised);
  font-weight: 700;
  font-size: 0.9375rem;
}
.get .actions { margin-top: 2rem; }
.fine { margin-top: 1.1rem; font-size: 0.9375rem; color: var(--muted); max-width: 40rem; }

/* Privacy */
.privacy p { margin-top: 1.2rem; max-width: 40rem; color: var(--muted); }

footer {
  padding-block: 2.5rem 3.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}
footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
footer p { margin-top: 1.25rem; }

@media (max-width: 52rem) {
  .hero, .why { grid-template-columns: minmax(0, 1fr); }
  .features dl { grid-template-columns: minmax(0, 1fr); }
  .shot { order: 2; }
}
