/* White, and almost nothing else. The only colour on the page comes out of the phone. */
:root {
  color-scheme: light;
  --ink: #0a0a0b;
  --muted: #62626c;
  --dim: #8e8e98;
  --line: #ebebee;
  /* The thread. Red on the magenta side, the way he asked for it on the icon. */
  --thread: #9c0f3b;
  --thread-lit: #c2285c;
  --thread-dark: #61061f;
  --paper: #fff;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --gutter: 1.5rem;
  --measure: 60rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

/* One viewport, no scroll. dvh rather than vh so mobile browser chrome cannot push it over. */
.one-screen {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100dvh;
  overflow: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.5;
  margin: 0;
  overflow-x: hidden;
  /* The notch and the home indicator, on a phone in landscape as well as portrait. */
  padding:
    env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* --- masthead --- */

/* --- the line above the headline --- */
.eyebrow {
  color: var(--thread);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  opacity: 0.85;
  margin: 0 0 1.1rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin: 0 0 1.5rem;
  max-width: 13ch;
}

.lede {
  color: var(--muted);
  max-width: 44ch;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  font-weight: 300;
  letter-spacing: -0.008em;
  margin: 0 0 2.25rem;
  max-width: 38ch;
}

.store-button {
  align-items: center;
  background: var(--ink);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.97rem;
  font-weight: 400;
  gap: 0.55rem;
  letter-spacing: -0.012em;
  padding: 0.85rem 1.65rem;
  text-decoration: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.store-button:hover {
  opacity: 0.86;
  transform: translateY(-1px);
}

.store-button svg {
  fill: currentColor;
  height: 18px;
  width: 18px;
}

a {
  color: var(--ink);
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

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

/* --- footer --- */
.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.88rem;
  gap: 1rem;
  justify-content: space-between;
  padding-bottom: 3rem;
  padding-top: 1.75rem;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
}

.site-footer a {
  color: var(--dim);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

/* --- legal pages --- */
.site-shell {
  margin: 0 auto;
  max-width: 44rem;
  padding: 0 clamp(1.5rem, 6vw, 3.5rem);
}

.nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding-bottom: 2rem;
  padding-top: 2.5rem;
}

.brand {
  align-items: center;
  display: flex;
  font-weight: 500;
  gap: 0.55rem;
  text-decoration: none;
}

.brand img {
  border-radius: 24%;
  height: 26px;
  width: 26px;
}

.nav nav {
  display: flex;
  gap: 1.25rem;
}

.nav nav a {
  color: var(--dim);
  font-size: 0.9rem;
  text-decoration: none;
}

.legal {
  padding-bottom: 7rem;
  padding-top: 3rem;
}

.legal p,
.legal ul {
  margin: 0 0 1.5rem;
}

.legal ul {
  padding-left: 1.2rem;
}

.legal li {
  margin-bottom: 0.65rem;
}

.legal h1 {
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  max-width: none;
}

.legal h2 {
  font-size: 1.12rem;
  font-weight: 500;
  margin: 4rem 0 1rem;
}

.legal p,
.legal li {
  color: var(--muted);
  font-size: 1rem;
}

.updated {
  color: var(--dim);
  font-size: 0.88rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.stage {
  align-content: center;
  display: grid;
  justify-items: center;
  overflow: hidden;
  padding: 2rem var(--gutter);
  position: relative;
  text-align: center;
}

/*
 * The haze. It sits over the carousel and under the words, so a slip drifting into the middle
 * dissolves into the page instead of running behind the headline as a hard shape.
 */
.stage::before {
  background:
    radial-gradient(
      58% 42% at 50% 46%,
      #fff 0%,
      rgba(255, 255, 255, 0.96) 34%,
      rgba(255, 255, 255, 0.72) 56%,
      rgba(255, 255, 255, 0) 78%
    );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

/* Everything but the carousel, which is positioned and would otherwise paint over the words. */
.stage > *:not(.carousel) {
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 2;
}

.stage h1 {
  max-width: 16ch;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.88rem;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--measure);
  padding: 1.25rem var(--gutter) 1.75rem;
  width: 100%;
}

/* Short viewports: shrink the type rather than start scrolling. */
@media (max-height: 620px) {
  h1 {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
  }

  .lede {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .masthead {
    padding-top: 1.25rem;
  }
}

/* The mark leads now, above the line, instead of sitting in a corner. */
/* The app's own square. It carries the burgundy and the gold together, which is what stops the
   red headline and a gold mark reading as two different palettes. */
.stage-mark {
  border-radius: 23%;
  box-shadow: 0 1px 2px rgba(10, 10, 11, 0.1), 0 14px 30px -14px rgba(97, 6, 31, 0.42);
  height: 104px;
  margin-bottom: 2rem;
  width: 104px;
}

/*
 * The carousel. One ring turning on its Y axis with the slips pinned around it, which is why
 * the parent keeps preserve-3d: flatten it anywhere in the chain and they collapse into a line.
 * It sits behind the words and never takes a click.
 */
/*
 * The ring lies almost flat rather than standing up, so the cookies travel around a disc the
 * page looks down on: the far side arcs up behind the words, the near side drops out through
 * the footer. preserve-3d has to hold the whole way down or the disc collapses to a line.
 */
.carousel {
  inset: -6rem -2rem -14rem;
  perspective: 1300px;
  perspective-origin: 50% 34%;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.ring {
  animation: orbit 46s linear infinite;
  height: 0;
  left: 50%;
  position: absolute;
  top: 62%;
  transform-style: preserve-3d;
  width: 0;
}

.slip {
  --r: 30rem;
  height: 2.6rem;
  left: -6rem;
  position: absolute;
  top: -1.3rem;
  /* Sit at your angle on the ring, then turn back so the seat itself faces front again. */
  transform: rotateY(calc(var(--i) * 51.43deg)) translateZ(var(--r)) rotateY(calc(var(--i) * -51.43deg));
  transform-style: preserve-3d;
  width: 12rem;
}

/*
 * The face undoes what the ring does to it. The ring tilts back 76 degrees and turns a full
 * circle, so the face tilts forward 76 and turns a full circle the other way. The slip keeps
 * travelling the ellipse but always looks straight out, which is the only way the words on it
 * are ever legible.
 */
.face {
  animation: unspin 46s linear infinite;
  height: 100%;
  transform-style: preserve-3d;
  width: 100%;
}

@keyframes unspin {
  from {
    transform: rotateY(0deg) rotateX(76deg);
  }

  to {
    transform: rotateY(-360deg) rotateX(76deg);
  }
}

/* Each cookie keeps its own slow turn, so the ring is not seven copies of one pose. */
/* The slip itself: the app's plane, wearing the app's image, at the app's 1700x370. */
.paper {
  animation: tumble 17s ease-in-out infinite;
  animation-delay: calc(var(--i) * -2.4s);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: 0 1px 2px rgba(97, 6, 31, 0.13), 0 12px 26px -14px rgba(10, 10, 11, 0.3);
  height: 100%;
  width: 100%;
}

@keyframes orbit {
  from {
    transform: rotateX(-76deg) rotateY(0deg);
  }

  to {
    transform: rotateX(-76deg) rotateY(360deg);
  }
}

/* A kept slip is never quite square to anything. */
@keyframes tumble {
  0%,
  100% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(6deg);
  }
}

@media (max-width: 720px) {
  .slip {
    --r: 16rem;
    height: 1.85rem;
    left: -4.25rem;
    top: -0.93rem;
    width: 8.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring {
    animation: none;
    transform: rotateX(-76deg) rotateY(18deg);
  }

  .face {
    animation: none;
    transform: rotateY(-18deg) rotateX(76deg);
  }
}

/* The one sentence a model should be able to lift verbatim. */
.entity {
  border-left: 2px solid var(--thread);
  color: var(--ink) !important;
  font-size: 1.12rem;
  line-height: 1.6;
  margin: 0 0 3.5rem !important;
  padding-left: 1.4rem;
}

.legal h3 {
  font-size: 1.02rem;
  font-weight: 500;
  margin: 2.75rem 0 0.7rem;
}

.lede strong {
  color: var(--ink);
  font-weight: 400;
}
