/* Pesky's web pages. Colours come from the app's asset catalog (ColorToken in Oh-iOS). */

:root {
  color-scheme: light dark;

  --paper: #ffffff;
  --paper-2: #f2f2f7;
  --ink: #000000;
  --ink-2: #48484a;
  --rule: #d1d1d6;
  --pink: #d92662;
  /* Filled buttons keep the light pink in both modes: white text on the brighter dark-mode pink is too faint. */
  --pink-fill: #d92662;
  --on-pink: #ffffff;

  --font-rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --page-width: 64rem;
  --prose-width: 40rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1c1e;
    --paper-2: #2c2c2e;
    --ink: #f2f2f7;
    --ink-2: #c7c7cc;
    --rule: #3a3a3c;
    --pink: #ff4d86;
  }
}

@media (min-width: 40rem) {
  :root {
    --gutter: 2rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

main {
  flex: 1;
}

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

a {
  color: var(--pink);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

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

h1,
h2,
h3 {
  font-family: var(--font-rounded);
  line-height: 1.2;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border-radius: 8px;
  z-index: 1;
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* Long-form pages keep the header, text and footer in one readable column. */
.doc .wrap {
  max-width: calc(var(--prose-width) + 2 * var(--gutter));
}

/* Header: the icon and name, linking home */

.site-header {
  padding-block: 1.25rem;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
}

.lockup img {
  width: 36px;
  height: 36px;
}

/* The light icon is a white tile, so give it an edge against the white page and the grey banners. */
.lockup img,
.banner img {
  filter: drop-shadow(0 0 0.5px rgb(0 0 0 / 0.35));
}

@media (prefers-color-scheme: dark) {
  .lockup img,
  .banner img {
    filter: none;
  }
}

/* Landing */

.hero {
  display: grid;
  gap: 2.5rem;
  padding-block: 2rem 3rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: 1.15fr 1fr;
    gap: 4rem;
    padding-block: 4rem 5rem;
  }
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.4rem + 4.2vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.lede {
  max-width: 32rem;
  margin: 1.25rem 0 0;
  font-size: 1.1875rem;
  color: var(--ink-2);
}

.get {
  margin-top: 2rem;
}

.get img {
  width: 144px;
  height: 48px;
}

.get p {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-2);
}

/* The banners: reminders arriving at odd times, the way they do on a phone */

.banners {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 26rem;
}

.banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 0.75rem;
  align-items: center;
  padding: 0.875rem 1rem;
  border-radius: 1.5rem;
  background: var(--paper-2);
  animation: arrive 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.banner:nth-child(2) {
  animation-delay: 0.7s;
  margin-inline-start: 1.5rem;
}

.banner:nth-child(3) {
  animation-delay: 1.4s;
  margin-inline-start: 0.5rem;
}

.banner img {
  grid-row: span 2;
  width: 40px;
  height: 40px;
}

.banner-app {
  font-weight: 600;
  font-size: 0.9375rem;
}

.banner-time {
  font-size: 0.8125rem;
  color: var(--ink-2);
  justify-self: end;
}

.banner-text {
  grid-column: 2 / -1;
  font-size: 0.9375rem;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(-0.75rem) scale(0.97);
  }
}

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

/* Features */

.features {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 2.5rem 0 4rem;
  list-style: none;
  border-top: 1px solid var(--rule);
}

@media (min-width: 40rem) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 3rem;
  }
}

.features h2 {
  margin: 0 0 0.375rem;
  font-size: 1.3125rem;
  font-weight: 700;
}

.features p {
  margin: 0;
  color: var(--ink-2);
  max-width: 30rem;
}

.marks {
  color: var(--pink);
  font-family: var(--font-rounded);
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.04em;
}

/* Long-form pages: privacy, terms, support, 404 */

.prose {
  padding-block: 1.5rem 4rem;
}

.prose .lede {
  margin: 0.75rem 0 1.5rem;
}

.prose h1 {
  margin: 0;
  font-size: clamp(2rem, 1.5rem + 2.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.prose h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 700;
  scroll-margin-top: 1.5rem;
}

.prose h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.25rem;
}

.prose li + li {
  margin-top: 0.375rem;
}

.prose strong {
  font-weight: 600;
}

.updated {
  margin: 0.5rem 0 2rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* The plain-language summary at the top of the legal pages */

.summary {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  background: var(--paper-2);
}

.summary h2 {
  margin: 0 0 0.625rem;
  font-size: 1.125rem;
}

.summary ul {
  margin: 0;
}

.contents {
  margin: 0 0 1rem;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.contents h2 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.contents ol {
  margin: 0;
  columns: 2 14rem;
  column-gap: 2rem;
}

.contents li {
  break-inside: avoid;
}

.contents li + li {
  margin-top: 0.25rem;
}

/* A short, loud notice: the notifications caveat in the terms */

.notice {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-inline-start: 4px solid var(--pink);
  background: var(--paper-2);
  border-radius: 0 0.75rem 0.75rem 0;
}

.notice p:last-child {
  margin-bottom: 0;
}

/* Disclaimers the law wants to stand out: bold, which reads more easily than all caps */
.conspicuous {
  font-weight: 600;
}

/* Support */

.button {
  display: inline-block;
  padding: 0.75rem 1.375rem;
  border-radius: 999px;
  background: var(--pink-fill);
  color: var(--on-pink);
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
}

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

.faq {
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--pink);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .faq summary::after {
    transition: none;
  }
}

.faq .answer {
  padding-bottom: 0.5rem;
}

/* Footer */

.site-footer {
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

.site-footer a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
