/* PocketMac site. Light, from the app's own colours; system fonts; no outside files, no script.
   The colours and their sources (the report of worker site-3, "Colours"):
     page     #ffffff  PocketSurface.card, light (Apps/SharedUI/DesignSystem/Tokens.swift)
     surface  #f2f2f7  PocketSurface.screen, light
     text     #0b1c45  the app icon's dark fill, top (Design/icon/candidates/r4d/AppIcon.icon/icon.json)
     accent   #007aff  the app's tint, light (focus ring, the touch on the phone)
     button   #2750c0  the icon's pocket (Assets/pocket-dark.svg, gradient end); links too
     tint     #dbecff  PocketTone.info wash: the tint at PocketOpacity.toneWash (0.14) on white
     graphite #1c1c1e  PocketSurface.card, dark: the rims of the phone, the Mac and the card screens
   Secondary text is the text colour at 72 percent, a line at 12 percent. Buttons: the app's prominent button
   without its glass, 10 px corners (PocketRadius.control); cards 16 px (PocketRadius.card). */
:root {
  color-scheme: light;
  --page: #ffffff;
  --surface: #f2f2f7;
  --text: #0b1c45;
  --accent: #007aff;
  --button: #2750c0;
  --tint: #dbecff;
  --graphite: #1c1c1e;
  --second: color-mix(in srgb, var(--text) 72%, transparent);
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --bar-h: 72px;
  --gutter: 56px;
  /* The side room, never less than the iPhone's safe area (the notch side when it lies on its side). */
  --left: max(var(--gutter), env(safe-area-inset-left));
  --right: max(var(--gutter), env(safe-area-inset-right));
  /* Content at most 1280 px wide, on a field that runs edge to edge. */
  --inset-left: max(var(--left), calc((100% - 1280px) / 2 + var(--gutter)));
  --inset-right: max(var(--right), calc((100% - 1280px) / 2 + var(--gutter)));
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color: var(--text);
}

/* Every page starts and ends on the tint: the top bar and the footer are tint bands, and Safari paints the room
   above the page (behind the status bar) and the room past its end with the root's colour, the tint too. The body's
   white is an image, not a colour, for this reason: Safari blends an opaque body colour over the root's and shows
   white there (the Safari check of the page, round 2). The image is one flat colour, not a decoration. */
:root {
  background: var(--tint);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(var(--page), var(--page));
}

main {
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2 {
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

.skip {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: var(--left);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--button);
  color: var(--page);
  transform: translateY(-300%);
}

.skip:focus {
  transform: none;
}

/* Buttons. The main one: a solid fill in the button colour. The second one (the app's bordered style): the tint
   with the label in the button colour. A release switch that is empty is a plain line of text, never a button. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--button);
  color: var(--page);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}

.button.small {
  min-height: 44px;
  padding: 0 14px;
  font-size: 16px;
}

.button.second,
.button.secondary {
  background: var(--tint);
  color: var(--button);
}

a.button:hover {
  filter: brightness(1.08);
}

.soon,
.button.soon {
  display: block;
  min-height: 0;
  padding: 0;
  background: none;
  color: var(--second);
  font-size: 16px;
  font-weight: 400;
  text-align: left;
}

/* Top bar: a tint band on every page; on the home page it runs on into the first view. */
.top {
  padding-top: env(safe-area-inset-top);
  background: var(--tint);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1280px;
  height: var(--bar-h);
  margin: 0 auto;
  padding: 0 var(--right) 0 var(--left);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mark {
  width: 30px;
  height: 30px;
  flex: none;
}

/* The first view: the words on the left, the Mac's screen and the phone that shows it on the right. The stage is
   laid out in units of --u: one pixel at 1280 px wide, less below. The Mac's screen runs off the right edge. */
.hero {
  --u: min(1px, calc(100vw / 1280));
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
  align-content: center;
  align-items: start;
  column-gap: 40px;
  min-height: min(calc(100svh - var(--bar-h) - env(safe-area-inset-top)), 860px);
  padding: 8px var(--inset-right) 64px var(--inset-left);
  background: var(--tint);
}

.first {
  display: contents;
}

.copy {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
}

h1 {
  font-size: clamp(48px, 5vw, 64px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.lede {
  margin-top: 20px;
  color: var(--second);
  font-size: 20px;
  line-height: 1.35;
}

.actions {
  margin-top: 28px;
}

.hero .actions .button + .button {
  margin-left: 8px;
}

.actions .soon {
  margin-top: 12px;
}

.phone-slot {
  z-index: 2;
  grid-row: 1;
  grid-column: 2;
  width: calc(220 * var(--u));
  margin: calc(150 * var(--u)) 0 0 calc(11 * var(--u));
}

/* The phone: a graphite body drawn here, no maker's art, around a real screen. The same outline holds the first
   view's phone and every card's phone. */
.phone {
  padding: 7px;
  border-radius: 40px;
  background: var(--graphite);
}

.screen {
  position: relative;
  overflow: hidden;
  border-radius: 33px;
  background: var(--graphite);
}

.hero .phone {
  width: 100%;
  border-radius: calc(38 * var(--u) + 2px);
}

.hero .screen {
  border-radius: calc(31 * var(--u) + 2px);
}

/* The Mac's screen: a graphite rim of its own keeps the wallpaper's navy corner and pale corner off the page. */
.display {
  z-index: 1;
  grid-row: 1;
  grid-column: 2;
  width: calc(660 * var(--u));
  margin-left: calc(100 * var(--u));
  padding: calc(8 * var(--u));
  border-radius: calc(18 * var(--u));
  background: var(--graphite);
}

.desk {
  position: relative;
  overflow: hidden;
  border-radius: calc(10 * var(--u));
}

.desk > img,
.screen > img {
  display: block;
  width: 100%;
  height: auto;
}

/* The Mac's pointer, on the Mac's screen and in the phone's picture of it, and the touch that moves it. At rest it
   is on the word "click" of the Notes line "tap to click". These places are in the demo's desktop (1320 x 856) and
   in the zoomed screen (the desktop 3.45 times from x 225, under the real top's 473 rows): they hold for new
   screenshots while the windows stay put. On the phone the pointer keeps the demo's phone size, 0.025 of the
   screen's width (Apps/PhoneApp/Demo/Remote/DemoRemoteView.swift, DemoPointer: drawn at phone size). */
.pointer {
  position: absolute;
  height: auto;
  transform: translate(-8%, -5%);
  fill: var(--text);
  stroke: var(--page);
  stroke-width: 1.2;
  stroke-linejoin: round;
  pointer-events: none;
}

.desk .pointer {
  top: 20.68%;
  left: 22.95%;
  width: 2.6%;
}

.screen .pointer {
  top: 37.76%;
  left: 20.36%;
  width: 2.5%;
}

.touch {
  position: absolute;
  top: 37.76%;
  left: 20.36%;
  width: 16%;
  aspect-ratio: 1;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Sections under the first view */
.how,
.cards,
.plans,
.faq {
  max-width: 1280px;
  margin: 0 auto;
  padding: 96px var(--right) 0 var(--left);
}

.how h2,
.plans h2,
.faq h2 {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.how-steps li {
  padding: 28px;
  border-radius: 16px;
  background: var(--surface);
}

.step-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--button);
  font-size: 17px;
  font-weight: 600;
}

.how-steps h3 {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 600;
}

.how-steps p {
  margin-top: 6px;
  color: var(--second);
  font-size: 17px;
  line-height: 1.4;
}

/* The feature cards: on the white page, no panel. Each is a whole iPhone screen of the demo in the phone outline,
   one size for all, with its title and one sentence under it; three to a row, two on a narrower window, one on a
   phone. */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 64px 40px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.card .phone {
  width: min(340px, 100%);
}

.card .screen > img {
  display: block;
  width: 100%;
  height: auto;
}

.words {
  max-width: 340px;
  margin-top: 24px;
}

.words h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.words p {
  margin-top: 8px;
  color: var(--second);
  font-size: 17px;
  line-height: 1.4;
}

/* The two plans */
.plan-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-radius: 16px;
  background: var(--surface);
}

/* Each plan ends with the first view's iPhone button, or its plain line while the app is not out. */
.plan-get {
  margin-top: auto;
  padding-top: 28px;
}

.plan.pro {
  background: var(--tint);
}

.plan h3 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.plan ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 18px;
  line-height: 1.35;
}

.plan li {
  position: relative;
  padding-left: 20px;
}

.plan li::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--button);
}

/* Questions: details and summary, no script. */
.faq {
  padding-bottom: 24px;
}

.faq h2 {
  margin-bottom: 16px;
}

.faq details {
  max-width: 50em;
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 12px 0;
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  margin-left: auto;
  padding-left: 16px;
  color: var(--button);
  font-size: 24px;
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  padding: 0 0 18px;
  color: var(--second);
  font-size: 18px;
  line-height: 1.45;
}

/* Footer: a tint band, edge to edge, to the very end of the page (with the home bar's room inside it), so the page
   ends on the colour it starts with and nothing of another colour shows under it. */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 72px 0 0;
  padding: 32px var(--inset-right) calc(40px + env(safe-area-inset-bottom)) var(--inset-left);
  background: var(--tint);
  color: var(--second);
  font-size: 16px;
}

.site-footer nav {
  display: flex;
  gap: 24px;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Inner pages: set up, support, privacy, not found. */
.page {
  max-width: 70ch;
  margin: 0 auto;
  padding: 40px var(--right) 0 var(--left);
  font-size: 18px;
  line-height: 1.65;
}

.page p,
.page li,
.page dd {
  color: var(--text);
}

.page p,
.page ul,
.page ol,
.page dl {
  margin: 14px 0;
}

.page a:not(.button) {
  color: var(--button);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.page .eyebrow {
  color: var(--second);
  font-size: 16px;
  font-weight: 600;
}

.page h1 {
  margin: 6px 0 16px;
  font-size: clamp(34px, 7vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.page h2 {
  margin: 36px 0 10px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.page .lead,
.page .small {
  color: var(--second);
}

.page .small {
  font-size: 16px;
}

.page .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 24px 0 8px;
}

.page .actions .soon {
  flex-basis: 100%;
  margin: 0;
}

.steps {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin: 0 0 16px;
  padding-left: 48px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0.1em;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--button);
  font-size: 16px;
  font-weight: 600;
}

dl.terms dt {
  margin-top: 16px;
  font-weight: 650;
}

dl.terms dd {
  margin: 0;
}

/* The cards two to a row on a narrower window, one to a row on a phone held upright. */
@media (max-width: 1099px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* iPhone upright, and any narrow window: the words, then the phone, inside the first view; no Mac's screen. The
   first view is the small viewport (svh), so it holds with Safari's bars shown, and the phone is as tall as the room
   left under the words (a size container). One button in the first view: the top bar's goes. */
@media (max-width: 899px) {
  :root {
    --bar-h: 60px;
    --gutter: 16px;
  }

  .bar .button {
    display: none;
  }

  .brand {
    gap: 8px;
    font-size: 18px;
  }

  .mark {
    width: 28px;
    height: 28px;
  }

  .hero {
    display: block;
    min-height: 0;
    padding: 0 var(--right) 40px var(--left);
  }

  .first {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - var(--bar-h) - env(safe-area-inset-top));
  }

  .copy {
    flex: none;
    align-self: stretch;
    padding-top: 12px;
  }

  h1 {
    font-size: 40px;
  }

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

  .actions {
    margin-top: 20px;
  }

  .actions .soon {
    margin-top: 10px;
  }

  .phone-slot {
    display: flex;
    flex: 1 1 0;
    align-items: flex-start;
    justify-content: center;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 20px 0 16px;
    container-type: size;
  }

  .hero .phone {
    width: min(calc((100cqh - 12px) / 2.1733 + 12px), 100cqw, 360px);
    padding: 6px;
    border-radius: calc(min(calc((100cqh - 12px) / 2.1733 + 12px), 100cqw, 360px) * 0.16);
  }

  .hero .screen {
    border-radius: calc(min(calc((100cqh - 12px) / 2.1733 + 12px), 100cqw, 360px) * 0.16 - 6px);
  }

  /* One phone in the first view and nothing twice: the Mac's screen shows only on a wide window. */
  .display {
    display: none;
  }

  .hero {
    padding-bottom: 8px;
  }

  .how,
  .cards,
  .plans,
  .faq {
    padding-top: 64px;
  }

  .how h2,
  .plans h2,
  .faq h2 {
    font-size: 30px;
  }

  .how-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 24px;
  }

  .how-steps li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 16px;
    padding: 20px;
  }

  .step-number {
    grid-row: span 2;
  }

  .how-steps h3 {
    margin-top: 4px;
    font-size: 20px;
  }

  .cards {
    gap: 56px 24px;
  }

  .plan-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 24px;
  }

  .plan {
    padding: 24px;
  }

  .plan h3 {
    font-size: 24px;
  }

  .plan ul {
    font-size: 17px;
  }

  .faq summary {
    font-size: 17px;
  }

  .faq details p {
    font-size: 17px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 48px;
  }

  .page {
    padding-top: 24px;
    font-size: 17px;
  }
}

/* iPhone on its side: a short view. The words on the left and the phone as tall as the view on the right; no
   Mac's screen. Comes after the upright rules and sets all that differs from them and from the wide layout. */
@media (orientation: landscape) and (max-height: 500px) {
  :root {
    --bar-h: 52px;
    --gutter: 20px;
  }

  .bar .button {
    display: none;
  }

  .brand {
    gap: 8px;
    font-size: 18px;
  }

  .mark {
    width: 28px;
    height: 28px;
  }

  .hero {
    display: block;
    min-height: 0;
    padding: 0 var(--inset-right) 40px var(--inset-left);
  }

  .first {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: 24px;
    /* At least the view under the bar; taller if Safari's page zoom makes the words need more. */
    min-height: calc(100svh - var(--bar-h) - env(safe-area-inset-top));
  }

  .copy {
    align-self: center;
    padding-top: 0;
  }

  h1 {
    font-size: 34px;
  }

  .lede {
    margin-top: 10px;
    font-size: 17px;
  }

  .actions {
    margin-top: 18px;
  }

  .actions .soon {
    margin-top: 8px;
  }

  .phone-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 100%;
    margin: 0;
    padding: 10px 0 14px;
    container-type: size;
  }

  .hero .phone {
    width: min(calc((100cqh - 12px) / 2.1733 + 12px), 100cqw);
    padding: 6px;
    border-radius: calc(min(calc((100cqh - 12px) / 2.1733 + 12px), 100cqw) * 0.16);
  }

  .hero .screen {
    border-radius: calc(min(calc((100cqh - 12px) / 2.1733 + 12px), 100cqw) * 0.16 - 6px);
  }

  .display {
    display: none;
  }

  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* A card's phone is never taller than the view: its width follows from the view's height (the screen is 2868 by
     1320, the rim 7 px a side), less 40 px of room. */
  .card .phone {
    width: min(340px, 100%, calc((100svh - 40px - 14px) / 2.1733 + 14px));
    border-radius: 28px;
  }

  .card .screen {
    border-radius: 22px;
  }

  .how-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .how-steps li {
    display: block;
  }

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

/* One sequence on load: the Mac's screen comes up, the phone rises in front of it and its screen lights up; then a
   touch on the phone, and the Mac's pointer moves to it on both screens. With motion off, everything is at rest. */
@media (prefers-reduced-motion: no-preference) {
  .display {
    animation: show 900ms ease-out both;
  }

  .hero .phone {
    animation: rise 1000ms cubic-bezier(0.16, 0.84, 0.3, 1) 450ms both;
  }

  .hero .screen > img {
    animation: light 600ms ease-out 1300ms both;
  }

  .touch {
    animation: touch 1800ms ease-out 2200ms both;
  }

  .desk .pointer {
    animation: glide-mac 1000ms cubic-bezier(0.45, 0, 0.2, 1) 2400ms both;
  }

  .screen .pointer {
    animation: glide-phone 1000ms cubic-bezier(0.45, 0, 0.2, 1) 2400ms both;
  }

  .faq summary::after {
    transition: transform 0.2s ease;
  }
}

@keyframes show {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14%);
  }
}

@keyframes light {
  from {
    opacity: 0;
  }
}

@keyframes touch {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }

  15%,
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* From where the demo draws the pointer (x 667, y 392 of the desktop) to the word "click" (x 303, y 177). */
@keyframes glide-mac {
  from {
    top: 45.85%;
    left: 50.57%;
  }
}

/* The same path in the phone's zoomed picture: it starts off the right edge. */
@keyframes glide-phone {
  from {
    top: 63.65%;
    left: 115.5%;
  }
}

@media (forced-colors: active) {
  .button,
  .plan,
  .phone,
  .how-steps li {
    border: 1px solid CanvasText;
  }
}
