/* The home page. Everything else on the site reads as a note in one column, and this is
   that column with room for the pictures to step outside it. Pictures do the talking here:
   each part is a headline, a picture, and at most a line. */

:root {
  --wide: 1040px;
  --pop: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.05), 0 22px 56px rgba(0, 0, 0, 0.16);
  --win: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04), 0 14px 34px rgba(0, 0, 0, 0.1);
  --bar: rgba(252, 252, 252, 0.82);
  --glass: #f8f8f8;
  --press: rgba(0, 0, 0, 0.09);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pop: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 22px 56px rgba(0, 0, 0, 0.6);
    --win: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 34px rgba(0, 0, 0, 0.45);
    --bar: rgba(17, 17, 17, 0.82);
    --glass: #262626;
    --press: rgba(255, 255, 255, 0.14);
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 68px;
}

::selection {
  color: var(--bg);
  background: var(--ink);
}

.home main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--column)) minmax(0, 1fr);
  max-width: calc(var(--wide) + var(--gutter) * 2);
  padding-top: 28px;
}

.home main > * {
  grid-column: 2;
}

.home main > .wide {
  grid-column: 1 / -1;
}

.home section {
  margin-top: 128px;
}

.home h2 {
  color: var(--ink);
  font-size: 30px;
  font-weight: 560;
  line-height: 36px;
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.home h2 span,
.nb {
  display: inline-block;
}

.nb {
  white-space: nowrap;
}

.home section h2 + * {
  margin-top: 14px;
}

.home section h2 + figure,
.home section h2 + ul,
.home section h2 + div {
  margin-top: 28px;
}

.home p,
.home li {
  text-wrap: pretty;
}

/* What keeps a claim honest, said small. */
.fine,
.home figcaption {
  margin-top: 14px;
  padding: 0;
  color: var(--quiet);
  font-size: 13px;
  line-height: 20px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

/* One set of icons, one weight of line, drawn to sit beside the mark and the dots. */
.i {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Who, with the way to the other pages. */
.who .name {
  color: var(--ink);
  font-weight: 500;
}

.home .who p + p {
  margin-top: 0;
}

.who nav {
  margin-left: auto;
  font-size: 15px;
}

.who nav a {
  display: inline;
  color: var(--quiet);
  font-weight: 400;
  line-height: inherit;
}

.who nav a + a {
  margin-left: 20px;
}

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

/* The first screen is a desktop: a menu bar across the top, the panel hanging from our
   mark in it, and what we have to say sitting where the windows would be. */
.home .hero {
  position: relative;
  margin-top: 28px;
  overflow: hidden;
  background: var(--wash);
  border-radius: 20px;
}

.scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The dots keep clear of the words. */
.hero .field {
  -webkit-mask-image: linear-gradient(90deg, transparent 50%, #000 68%);
  mask-image: linear-gradient(90deg, transparent 50%, #000 68%);
}

.menubar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 14px 0 20px;
  color: var(--ink);
  background: var(--glass);
  box-shadow: 0 1px 0 var(--line);
  font-size: 13px;
  line-height: 1;
}

.mb-apps {
  display: flex;
  gap: 18px;
  opacity: 0.72;
}

.mb-apps b {
  font-weight: 620;
}

.mb-status {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

.mb-on {
  display: grid;
  place-items: center;
  width: 32px;
  height: 22px;
  margin-right: -4px;
  background: var(--press);
  border-radius: 6px;
}

.mb-on svg {
  width: 17px;
  height: 17px;
}

.mb-wifi {
  width: 17px;
  height: 12px;
}

.mb-battery {
  width: 26px;
  height: 12px;
}

.mb-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 450;
}

/* Centred under the mark in the menu bar, which sits 238px in from the right. */
.panel {
  position: absolute;
  top: 40px;
  right: 78px;
  display: block;
}

/* It opens the way a menu bar panel does, once, from under the mark. */
.panel img {
  display: block;
  width: 320px;
  height: auto;
  border-radius: 13px;
  box-shadow: var(--pop);
  transform-origin: 50% 0;
  animation: open 360ms cubic-bezier(0.2, 0.9, 0.25, 1) 240ms both;
}

@keyframes open {
  from { transform: scale(0.94) translateY(-6px); opacity: 0; }
}

.pitch {
  position: relative;
  z-index: 1;
  max-width: 632px;
  padding: 108px 0 76px 56px;
}

.home h1 {
  color: var(--ink);
  font-size: clamp(38px, 4.4vw, 50px);
  font-weight: 580;
  line-height: 1.08;
  letter-spacing: -0.036em;
}

.home h1 span {
  display: block;
  color: var(--quiet);
  text-wrap: balance;
}

.lede {
  margin-top: 20px;
  font-size: 19px;
  line-height: 28px;
}

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 30px;
  font-size: 15px;
}

/* Buttons are pills, here and on every page. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 50px;
  padding: 0 28px 0 22px;
  color: var(--bg);
  background: var(--ink);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 560;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1), opacity 160ms;
  -webkit-tap-highlight-color: transparent;
}

.button .i {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.button:hover,
.bar-get:hover {
  opacity: 0.84;
  text-decoration: none;
}

.button:active,
.bar-get:active {
  transform: scale(0.97);
}

.button:focus-visible,
.bar-get:focus-visible,
.home button:focus-visible {
  outline-offset: 3px;
  border-radius: 999px;
}

.needs {
  margin-top: 14px;
  font-size: 14px;
  line-height: 22px;
}

.home .get + .needs {
  margin-top: 14px;
}

/* What we measured, right under the first screen. */
.proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 30px 0 0 56px;
}

.proof div {
  padding: 2px 16px 2px 22px;
  border-left: 1px solid var(--line);
}

.proof div:first-child {
  padding-left: 0;
  border-left: 0;
}

.proof dt {
  color: var(--ink);
  font-size: 23px;
  font-weight: 560;
  line-height: 28px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.proof dd {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 6px;
  font-size: 14px;
  line-height: 20px;
}

.proof .i {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.proof-note {
  margin-top: 18px;
  margin-left: 56px;
}

/* Drawn to scale. Every dot on the page is worth the same as the one beside it. */
.home .scale {
  margin-top: 32px;
}

.home main > .scale {
  margin-top: 44px;
}

.home .scale figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 22px;
}

.scale figcaption .ink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.scale figcaption .i {
  width: 18px;
  height: 18px;
}

.series {
  margin-top: 14px;
}

.series + .series {
  margin-top: 18px;
}

.series p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  line-height: 22px;
}

.series p .ink {
  margin-right: 6px;
}

.series p > :last-child {
  flex: none;
  margin-right: 0;
  font-weight: 560;
}

.dots {
  margin-top: 8px;
  line-height: 0;
}

.dots canvas,
.noise canvas {
  display: block;
  max-width: 100%;
}

.after-scale {
  margin-top: 18px;
}

/* The app's own windows. Two of them share a desk the way they would on a screen. */
.home figure {
  margin: 28px 0 0;
}

.home main > figure.wide {
  margin-top: 28px;
}

.home main > figure.wide:not(.scale) > figcaption {
  max-width: var(--column);
  margin-right: auto;
  margin-left: auto;
}

.home figure:not(.scale) > figcaption .i {
  width: 18px;
  height: 18px;
  margin: -3px 8px 0 0;
  color: var(--ink);
  vertical-align: middle;
}

.home .stage {
  overflow: hidden;
  border-radius: 16px;
}

.stage picture {
  display: block;
  min-width: 0;
}

.stage img {
  box-shadow: var(--win);
}

.stage.pair {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  padding: 48px 32px;
}

/* Pause. The mark does what the app's does while it works, and holds still when told. */
.home .demo {
  gap: 18px;
  padding: 18px 18px 18px 24px;
  border-radius: 20px;
}

.pulse {
  flex: none;
  width: 52px;
  height: 52px;
  fill: var(--ink);
}

.pulse circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: swell 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.pulse .d1 { animation-delay: 0.1s; }
.pulse .d2 { animation-delay: 0.16s; }
.pulse .d3 { animation-delay: 0.24s; }
.pulse .d4 { animation-delay: 0.29s; }
.pulse .d5 { animation-delay: 0.38s; }

@keyframes swell {
  0%, 55%, 100% { transform: scale(1); }
  18% { transform: scale(1.36); }
  36% { transform: scale(0.8); }
}

.demo.paused .pulse circle,
.demo.away .pulse circle {
  animation-play-state: paused;
}

.home .meter {
  flex: 1;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
}

.home #state {
  font-size: 17px;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.sent {
  color: var(--quiet);
}

.home .demo button {
  min-width: 112px;
  height: 46px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 560;
  transition: transform 120ms cubic-bezier(0.2, 0, 0, 1), opacity 160ms;
}

.home .demo button:hover {
  opacity: 0.84;
}

.home .demo button:active {
  transform: scale(0.97);
  opacity: 1;
}

/* What it skips, as the kinds of thing they are. */
.kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kinds li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px 0 10px;
  color: var(--ink);
  background: var(--wash);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 450;
}

.kinds .i {
  width: 19px;
  height: 19px;
}

.kinds code {
  font-size: 13px;
}

/* The rule, as three folders: the same name is skipped in one place and kept in another. */
.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
  background: var(--wash);
  border-radius: 16px;
}

.rules div {
  padding: 16px 18px 18px;
}

.rules div + div {
  box-shadow: -1px 0 0 var(--line);
}

.rules p {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  color: var(--ink);
  font: 450 13.5px/1 ui-monospace, "SF Mono", Menlo, monospace;
}

.rules p + p {
  margin-top: 0;
}

.rules .in {
  padding-left: 22px;
}

.rules .i {
  width: 18px;
  height: 18px;
  color: var(--quiet);
}

.rules .out {
  color: var(--faint);
}

.rules .out .i {
  color: var(--faint);
}

.tag {
  margin-left: auto;
  padding: 4px 9px;
  color: var(--quiet);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--faint);
  font: 500 12px/1 "Inter", system-ui, sans-serif;
}

.tag.kept {
  color: var(--bg);
  background: var(--ink);
  box-shadow: none;
}

/* Encryption, as what each end holds: files and key at yours, noise at ours. */
.wire {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  background: var(--wash);
  border-radius: 16px;
}

.end {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 84px;
  color: var(--quiet);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.end .i {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  color: var(--ink);
  stroke-width: 1.3;
}

.end b {
  color: var(--ink);
  font-size: 15px;
  font-weight: 560;
}

.noise {
  position: relative;
  min-width: 0;
  height: 52px;
}

.noise::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 42%;
  width: 34px;
  height: 34px;
  margin: -22px 0 0 -22px;
  background: var(--ink);
  border: 5px solid var(--wash);
  border-radius: 999px;
  box-sizing: content-box;
}

.noise .i {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 42%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  color: var(--bg);
  stroke-width: 1.8;
}

.facts3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.facts3 li,
.rows li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
}

/* Lists the way the app writes them: an icon, then the thing. */
.rows {
  display: grid;
  gap: 14px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rows.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.know .rows li {
  color: var(--quiet);
}

.know .rows .i {
  color: var(--ink);
}

/* Price is three words, so it gets to be the biggest thing after the headline. */
.price h2 {
  font-size: 50px;
  line-height: 54px;
  letter-spacing: -0.036em;
}

.home .price h2 + ul {
  margin-top: 26px;
}

.know h2 {
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  letter-spacing: 0;
}

.home .know {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.home .know h2 + ul {
  margin-top: 16px;
}

/* The last screen is the first one again, with the mark at full size. */
.home .last {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  min-height: 456px;
  overflow: hidden;
  background: var(--wash);
  border-radius: 20px;
}

.last .pitch {
  max-width: 520px;
  padding: 72px 0 72px 56px;
}

.last .get {
  margin-top: 22px;
}

.last .get + .needs {
  margin-top: 22px;
}

.last .needs + .needs {
  margin-top: 8px;
}

/* Nothing to see by itself. It's where the big mark is hung from. */
.mark {
  flex: none;
  width: 1px;
  height: 1px;
  margin-right: 250px;
}

.home footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 40px;
  padding-left: 56px;
}

.home footer a + a {
  margin-left: 0;
}

/* A way to get it from anywhere down the page, once the first button has scrolled off.
   It steps aside again when the last one comes into view. */
.bar {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
  visibility: hidden;
  background: var(--bar);
  box-shadow: 0 1px 0 var(--line);
  transform: translateY(-100%);
  transition: transform 260ms cubic-bezier(0.2, 0, 0, 1), visibility 0s 260ms;
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.scrolled:not(.ending) .bar {
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.bar > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: calc(var(--wide) + var(--gutter) * 2);
  height: 56px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.bar-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
}

.bar-name:hover {
  text-decoration: none;
}

.bar .spark {
  width: 22px;
  height: 22px;
}

.bar-get {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  color: var(--bg);
  background: var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 560;
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1), opacity 160ms;
}

@media (max-width: 1100px) {
  .mb-apps span:nth-child(n + 5) {
    display: none;
  }

  .hero .pitch {
    padding-left: 40px;
  }

  .proof {
    padding-left: 40px;
  }

  .proof-note {
    margin-left: 40px;
  }

  .proof div {
    padding-right: 12px;
    padding-left: 16px;
  }

  .proof dt {
    font-size: 20px;
  }

  .stage.pair {
    gap: 16px;
    padding: 32px 20px;
  }

  .last .pitch {
    max-width: 440px;
    padding-left: 40px;
  }

  .mark {
    margin-right: 216px;
  }

  .home footer {
    padding-left: 40px;
  }
}

/* Narrower than this and the words come first, with the desktop as a picture under them. */
@media (max-width: 1000px) {
  .home .hero {
    display: flex;
    flex-direction: column;
    margin-top: 44px;
    overflow: visible;
    background: none;
    border-radius: 0;
  }

  .hero .pitch {
    display: contents;
  }

  .hero .field {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .scene {
    position: relative;
    inset: auto;
    order: 1;
    margin-top: 28px;
    padding: 44px 0 20px;
    overflow: hidden;
    background: var(--wash);
    border-radius: 20px;
  }

  .panel {
    position: relative;
    top: auto;
    right: auto;
    width: 320px;
    margin: 0 78px 0 auto;
  }

  .panel img {
    width: 100%;
  }

  .proof,
  .home footer {
    padding-left: 0;
  }

  .proof-note {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .stage.pair {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 32px 20px;
  }
}

@media (max-width: 760px) {
  .home section {
    margin-top: 96px;
  }

  .home .hero {
    margin-top: 36px;
  }

  .mb-apps {
    display: none;
  }

  .proof {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 22px;
  }

  .proof div,
  .proof div:first-child {
    padding: 0 12px 0 0;
    border-left: 0;
  }

  .stage.pair {
    gap: 16px;
    padding: 16px;
  }

  .home .last {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0;
    min-height: 0;
  }

  .last .pitch {
    padding: 0 24px 40px;
  }

  .mark {
    align-self: center;
    margin: 150px 0 140px;
  }
}

@media (max-width: 520px) {
  .home main {
    padding-top: 20px;
  }

  .who nav {
    display: none;
  }

  .home footer {
    gap: 6px 14px;
    font-size: 15px;
  }

  .home .hero {
    margin-top: 28px;
  }

  .home h1 {
    font-size: 31px;
    letter-spacing: -0.032em;
  }

  .lede {
    margin-top: 12px;
    font-size: 17px;
    line-height: 26px;
  }

  .get {
    margin-top: 20px;
  }

  .scene {
    margin-top: 24px;
  }

  .home h2 {
    font-size: 26px;
    line-height: 32px;
  }

  .price h2 {
    font-size: 40px;
    line-height: 44px;
  }

  .know h2 {
    font-size: 16px;
    line-height: 26px;
  }

  .proof dt {
    font-size: 20px;
  }

  .series p {
    font-size: 14px;
  }

  /* The date goes, which brings the mark over the middle of the panel. */
  .mb-date {
    display: none;
  }

  .panel {
    width: min(320px, 100% - 24px);
    margin: 0 auto;
  }

  /* On a phone the windows become a strip to swipe along, so their words stay big
     enough to read. The page itself never moves sideways. */
  .home .stage,
  .home .stage.pair {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    margin-right: calc(var(--gutter) * -1);
    margin-left: calc(var(--gutter) * -1);
    padding: 16px var(--gutter) 20px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 0;
    scroll-snap-type: x proximity;
    scroll-padding: 0 var(--gutter);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .home .stage::-webkit-scrollbar {
    display: none;
  }

  .home .stage picture {
    flex: none;
    scroll-snap-align: start;
  }

  .home .stage img {
    width: 470px;
    max-width: none;
  }

  .home .stage img[width="460"] {
    width: 386px;
  }

  .rules,
  .facts3,
  .rows.two {
    grid-template-columns: minmax(0, 1fr);
  }

  .rules div + div {
    box-shadow: 0 -1px 0 var(--line);
  }

  .wire {
    gap: 12px;
    padding: 20px 14px;
  }

  .end {
    min-width: 58px;
  }

  .noise::after {
    width: 26px;
    height: 26px;
    margin: -17px 0 0 -17px;
    border-width: 4px;
  }

  .noise .i {
    width: 15px;
    height: 15px;
    margin: -7.5px 0 0 -7.5px;
  }

  .home .demo {
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px;
  }

  .home .demo button {
    flex: 1 0 100%;
  }

  .pulse {
    width: 44px;
    height: 44px;
  }

  .last .pitch {
    padding: 0 20px 32px;
  }
}

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

  .pulse circle,
  .panel img {
    animation: none;
  }

  .bar,
  .bar-get,
  .button,
  .home .demo button {
    transition: none;
  }
}
