/* handy-tools.app. The same look as the apps' own sites (Yap, Wake): the Mac's typeface, two tones of ink, and no
   third-party requests at all. The one addition is Alan Sans for the name, served from this site. */
@font-face {
  font-family: "Alan Sans";
  src: url("/fonts/alan-sans.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --bg: #fff;
  --bg-alt: #f5f5f7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --card: #fff;
  --ink: #1d1d1f;
  --ink-fg: #fff;
  --panel: #000;
  --panel-fg: #f5f5f7;
  --panel-muted: #a1a1a6;
  --panel-line: rgba(255, 255, 255, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.12), 0 32px 80px rgba(0, 0, 0, 0.1);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --display: "Alan Sans", var(--sans);
  /* The second tone of a headline: Apple's headline grey, which reads on white and black alike. */
  --ink-2: #86868b;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: clamp(16px, 5vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --bg-alt: #101012;
    --fg: #f5f5f7;
    --muted: #a1a1a6;
    --line: rgba(255, 255, 255, 0.14);
    --card: #161618;
    --ink: #f5f5f7;
    --ink-fg: #000;
    --panel: #101012;
    --panel-line: rgba(255, 255, 255, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45), 0 32px 80px rgba(0, 0, 0, 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 18px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 700; letter-spacing: -0.035em; word-spacing: 0.06em; line-height: 1.02; text-wrap: balance; }
/* A headline's second half is the same type in a second tone, not a different typeface. */
h1 em, h2 em { font-style: normal; color: var(--ink-2); }
h2 { font-size: clamp(32px, 4.6vw, 52px); }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
section { padding: clamp(64px, 9vw, 120px) var(--gutter); }
:focus-visible { outline: 3px solid #0a84ff; outline-offset: 3px; border-radius: 6px; }
.wordmark { font-family: var(--display); font-weight: 700; letter-spacing: -0.04em; word-spacing: 0; }
.lede { max-width: 34em; margin: 22px auto 0; font-size: clamp(18px, 1.8vw, 20px); color: var(--muted); text-wrap: pretty; }
.requires { font-size: 14px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-fg);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
a.button:hover { transform: translateY(-1px); opacity: 0.88; }
a.button:active { transform: translateY(0) scale(0.98); }
.button.quiet { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.button.off { background: var(--bg-alt); color: var(--muted); }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.brand { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.03em; text-decoration: none; }
.nav nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--muted); transition: color 0.2s; }
.nav nav a:hover { color: var(--fg); }

/* The front page's stage. Without the script (or with it switched off) this is a plain page: the name, then the
   icons in a row with their cards on hover. stage.js adds .spiral to <html>, pins the stage and moves the icons. */
.stage { text-align: center; scroll-margin-top: 60px; }
.masthead .wordmark { font-size: clamp(48px, 13vw, 176px); line-height: 0.95; white-space: nowrap; }
.orbit { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin: 56px 0 0; padding: 0; list-style: none; }
.orb { position: relative; --size: 88px; }
/* The icon whose card is showing sits above its neighbours, and the cards above the line under the row. */
.orb:hover, .orb:focus-within, .orb.open { z-index: 3; }
.orb .icon { display: block; width: var(--size); height: var(--size); border-radius: 22%; transition: scale 0.25s var(--ease); }
.orb .icon img { width: 100%; height: 100%; }
.orb .icon:hover, .orb .icon:focus-visible { scale: 1.08; }
.row-head { margin-top: 44px; padding: 0 var(--gutter); }
.row-head h2 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.03em; }
.row-head p { margin-top: 10px; font-size: 16px; color: var(--muted); }

/* The card under an icon. Its top padding bridges the gap, so the pointer can travel from the icon into the card. */
.info {
  position: absolute;
  z-index: 5;
  top: 100%;
  left: 50%;
  width: min(300px, 100vw - 32px);
  padding-top: 14px;
  translate: calc(-50% + var(--card-x, 0px)) 0;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}
.sheet { padding: 18px 20px 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sheet .name { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.sheet .name span { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.sheet .name b { color: var(--fg); }
.sheet .job { font-size: 15px; color: var(--muted); }
.sheet .card { margin-top: 10px; font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.sheet .more { display: inline-block; margin-top: 12px; font-size: 15px; font-weight: 600; text-underline-offset: 3px; }
.orb:hover .info, .orb:focus-within .info, .orb.open .info { opacity: 1; visibility: visible; pointer-events: auto; }

.spiral .stage { height: 300vh; padding: 0; }
.spiral .stage.still { height: auto; }
/* The stage sits under the navigation bar (60px), so its centre is the centre of what you can see. */
.spiral .pin { position: sticky; top: 60px; height: calc(100vh - 60px); height: calc(100svh - 60px); overflow: clip; }
.spiral .masthead { position: absolute; left: 0; right: 0; top: 50%; translate: 0 -50%; will-change: transform; }
.spiral .orbit { position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: 0; display: block; z-index: 2; }
.spiral .orb { position: absolute; left: 0; top: 0; will-change: transform; }
.spiral .orb .icon { margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2); }
.spiral .info { top: calc(var(--size) / 2); left: 0; }
.spiral .row-head { position: absolute; left: 0; right: 0; margin: 0; opacity: var(--head, 0); }
/* The cards wait until the icons have lined up. */
.spiral .stage:not(.settled) .info { opacity: 0; visibility: hidden; pointer-events: none; }

/* The promise, and each app's own points */
.promise { background: var(--panel); color: var(--panel-fg); scroll-margin-top: 60px; }
.intro { max-width: 1040px; margin: 0 auto clamp(40px, 6vw, 64px); }
.intro p { margin-top: 20px; max-width: 34em; font-size: 19px; color: var(--panel-muted); }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: clamp(24px, 3vw, 40px); max-width: 1040px; margin: 0 auto; padding: 0; list-style: none; }
.points li { padding-top: 22px; border-top: 1px solid var(--panel-line); }
.points svg { width: 28px; height: 28px; margin-bottom: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.points h3 { margin-bottom: 6px; }
.points p { font-size: 16px; color: var(--panel-muted); }

/* An app's page, laid out like a store listing: what it is and how to get it, then the detail. */
.product { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 28px; max-width: calc(1040px + 2 * var(--gutter)); margin: 0 auto; padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(32px, 4vw, 48px); }
.product .icon { flex: none; }
.product .what { flex: 999 1 280px; min-width: 0; }
.product .wordmark { font-size: clamp(44px, 6vw, 68px); line-height: 1; }
.product .job { margin-top: 6px; font-size: 20px; color: var(--muted); }
.product .cost { margin-top: 10px; font-size: 17px; color: var(--muted); }
.product .cost b { font-size: 28px; letter-spacing: -0.03em; color: var(--fg); }
.product .get { flex: 1 1 260px; display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start; }
.product .get .requires { flex-basis: 100%; max-width: 30em; }
.pitch { text-align: center; padding-top: clamp(32px, 5vw, 64px); padding-bottom: clamp(40px, 6vw, 72px); }
.pitch h2 { max-width: 18ch; margin: 0 auto; font-size: clamp(36px, 5.6vw, 64px); }
.shot { padding-top: 0; padding-bottom: clamp(56px, 8vw, 96px); }
.shot img { max-width: min(1040px, 100%); margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }

.faq { max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; }
.faq h2, .information h2 { margin-bottom: clamp(24px, 3vw, 36px); font-size: clamp(28px, 3.6vw, 40px); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 26px; font-weight: 400; line-height: 1; color: var(--muted); transition: rotate 0.2s var(--ease); }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { padding-bottom: 22px; max-width: 40em; color: var(--muted); }

.information { max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; padding-top: 0; }
.information dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px 32px; margin: 0; }
.information dt { font-size: 14px; color: var(--muted); }
.information dd { margin: 2px 0 0; font-size: 17px; }

.closing { text-align: center; background: var(--bg-alt); }
.closing .button { margin-top: 28px; }

/* Terms and privacy */
.legal { max-width: calc(720px + 2 * var(--gutter)); margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(64px, 9vw, 120px); font-size: 17px; }
.legal h1 { font-size: clamp(36px, 5vw, 56px); }
.legal .updated { margin-top: 14px; font-size: 14px; color: var(--muted); }
.legal .lede { margin: 18px 0 0; }
.legal h2 { margin: 44px 0 12px; font-size: 24px; letter-spacing: -0.02em; line-height: 1.2; }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0; padding-left: 1.2em; }
.legal li + li { margin-top: 6px; }

footer { display: flex; flex-wrap: wrap; gap: 32px 64px; padding: 44px var(--gutter) 56px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
footer .about { flex: 999 1 280px; display: flex; flex-direction: column; gap: 8px; max-width: 30em; }
footer .about .brand { color: var(--fg); }
footer nav { display: flex; flex-direction: column; gap: 8px; min-width: 110px; }
footer nav p { font-weight: 600; color: var(--fg); }
footer a { text-decoration: none; }
footer a:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  .button, .orb .icon, .info { transition: none; }
}
