:root {
  --bg: #fbfbfd;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: #d2d2d7;
  --field: #fff;
  --button-bg: #1d1d1f;
  --button-fg: #fff;
  --error: #d70015;
  --glow: 22%;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --fg: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #6e6e73;
    --line: #424245;
    --field: #1c1c1e;
    --button-bg: #f5f5f7;
    --button-fg: #1d1d1f;
    --error: #ff6961;
    --glow: 30%;
  }
}

/* Each app's color: the glow behind its icon. */
[data-app=scanshelf] { --tint: #1fb5a5; }
[data-app=pliable] { --tint: #f0246a; }
[data-app=calendear] { --tint: #5a9cf0; }

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

main { flex: 1; }

/* ---- app cards (home and app pages) ---- */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-content: center;
  gap: 56px 32px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 24px 40px;
}
.apps.single { grid-template-columns: 1fr; }

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* A soft wash of the app's color behind its icon. */
.app::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -40px;
  width: 320px;
  height: 280px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tint) var(--glow), transparent), transparent);
  filter: blur(8px);
  pointer-events: none;
}

.app-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.icon {
  display: block;
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 10px 18px rgb(0 0 0 / 0.14));
}
/* Full-bleed icons (iOS): round them, and inset them to the size a Mac
   icon's shape has inside its canvas. */
.icon.square { padding: 16px; }
.icon.square img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22.5%;
}
.single .icon { width: 200px; height: 200px; }
.single .icon.square { padding: 20px; }

h1, h2 {
  margin: 18px 0 6px;
  font: 600 32px/1.1 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
}
.single h1 { font-size: 40px; }

.tagline {
  /* Fills the card, so side-by-side download buttons line up. */
  flex-grow: 1;
  margin: 0 0 26px;
  max-width: 20em;
  color: var(--muted);
  font-size: 19px;
  text-wrap: balance;
}
.single .tagline { flex-grow: 0; }

.nowrap { white-space: nowrap; }

.download, button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-fg);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.download::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5v9M3.5 6.5 8 11l4.5-4.5M2 14.5h12' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5v9M3.5 6.5 8 11l4.5-4.5M2 14.5h12' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.download:hover, button:hover, .store:hover { opacity: 0.85; }
.download:active, button:active, .store:active { transform: scale(0.97); }

.downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* Apple's badge, as tall as the download buttons. */
.store { display: block; transition: transform 0.15s ease, opacity 0.15s ease; }
.store img { display: block; width: 126px; height: 42px; }
.single .store img { width: 150px; height: 50px; }

.meta {
  min-height: 1.45em;
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---- Pliable's wordmark ----
   Anybody, a variable font with a width axis (SIL OFL, fonts/), each
   letter wider than the last as if pulled from the right. Pointing at the
   card pulls it further; it springs back. */
@font-face {
  font-family: "Anybody";
  src: url("fonts/Anybody.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
.stretch {
  font-family: "Anybody", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 850;
  letter-spacing: 0;
}
.stretch span {
  display: inline-block;
  font-variation-settings: "wdth" var(--w);
  transition: font-variation-settings 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.stretch span:nth-child(1) { --w: 60.0; --pull: 60.0; }
.stretch span:nth-child(2) { --w: 63.3; --pull: 67.3; }
.stretch span:nth-child(3) { --w: 68.6; --pull: 79.3; }
.stretch span:nth-child(4) { --w: 75.2; --pull: 94.1; }
.stretch span:nth-child(5) { --w: 82.7; --pull: 111.0; }
.stretch span:nth-child(6) { --w: 91.0; --pull: 129.7; }
.stretch span:nth-child(7) { --w: 100.0; --pull: 150.0; }
.app:hover .stretch span { font-variation-settings: "wdth" var(--pull); }
@media (prefers-reduced-motion: reduce) {
  .stretch span { transition: none; }
}

/* ---- text pages (privacy, support) ---- */

.doc {
  width: 100%;
  max-width: 34em;
  margin: 0 auto;
  padding: 72px 24px 40px;
}
.doc h1 { margin: 0 0 20px; }
.doc p { margin: 0 0 14px; }
.doc .updated { margin-top: 28px; color: var(--faint); font-size: 13px; }

.support { display: grid; gap: 18px; }
.support label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.support input, .support select, .support textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--fg);
  font: inherit;
}
.support select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5l3-3' fill='none' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 12px no-repeat;
}
.support textarea { resize: vertical; min-height: 10em; }
.support input:focus, .support select:focus, .support textarea:focus {
  outline: 3px solid color-mix(in srgb, #0071e3 40%, transparent);
  border-color: #0071e3;
}
.support button { justify-self: start; }
.support .error { margin: 0; color: var(--error); }
/* Bots fill in what people can't see. */
.support .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 0 24px 32px;
  font-size: 13px;
}
footer a { color: var(--faint); text-decoration: none; }
footer a:hover { color: var(--muted); text-decoration: underline; }
