/* The family stylesheet. Every page uses it and none of them override it.
   The neutrals are the platform's. An app's own hue is carried on its tile in
   --c-500/600/700/400, set on the element, from the claim in design.md. */

:root {
  color-scheme: light dark;

  /* System semantic colors, the same values the apps get from the platform. */
  --bg: #ffffff;
  --bg-grouped: #f2f2f7;
  --card: #ffffff;
  --label: #000000;
  /* Apple's secondaryLabel is rgba(60,60,67,.6), which lands at 3.3:1 here.
     In an app that is the platform's own value. A web page has no platform, so
     secondary text is carried to .74, which holds 4.7:1 on every surface used
     below. Dark already holds 5.9:1 at Apple's own alpha and is unchanged. */
  --label-2: rgba(60, 60, 67, .74);
  --label-3: rgba(60, 60, 67, .38);
  --separator: rgba(60, 60, 67, .29);
  --fill: rgba(120, 120, 128, .12);

  --link: #1c1c1e;

  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-grouped: #000000;
    --card: #1c1c1e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --separator: rgba(84, 84, 88, .6);
    --fill: rgba(120, 120, 128, .24);
    --link: #f2f2f7;
  }
}

/* Each app claims one hue for life, at steps 500, 600 and 700 for light and
   400 for dark, from the claim in design.md. One class per app, because a
   style= attribute on the element is blocked by the policy in _headers. */
.app-tile.sundae {
  --c-500: #f83e53; --c-600: #d92340; --c-700: #a6182f; --c-400: #f98385;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 20px 96px;
  background: var(--bg-grouped);
  color: var(--label);
  font: 17px/1.5 var(--sys);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { max-width: 640px; margin: 0 auto; }

/* The type ramp, the same steps the apps use. */
h1 {
  font: 800 34px/1.1 var(--rounded);
  letter-spacing: -.03em;
  margin: 0 0 8px;
}
/* A heading reached by its anchor lands with air above it, not flush to the top. */
h2[id] { scroll-margin-top: 32px; }
h2 { font: 700 22px/1.25 var(--sys); letter-spacing: -.01em; margin: 40px 0 10px; }
h3 { font: 600 17px/1.35 var(--sys); margin: 0 0 4px; }
p  { margin: 0 0 14px; }

.lead { font-size: 17px; color: var(--label-2); margin-bottom: 8px; }

/* The sentence a legal page opens with, before its sections. */
.summary { font-size: 19px; line-height: 1.5; margin: 26px 0 0; max-width: 60ch; }

a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 30%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--link); }

/* The masthead of every page. */
header { padding: 72px 0 8px; }

header .eyebrow {
  display: inline-block;
  font: 600 13px/1 var(--sys);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--label-2);
  margin-bottom: 28px;
  text-decoration: none;
}
header .eyebrow:hover { color: var(--label); }

footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: .5px solid var(--separator);
  font-size: 13px;
  color: var(--label-2);
}
footer a { color: var(--label-2); }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }

@media (max-width: 480px) {
  header { padding-top: 48px; }
  h1 { font-size: 30px; }
}

/* ---- The home page ---- */

/* The hero says the family's name in the family's voice, and nothing else. */
.hero { padding: 96px 0 8px; }
.hero h1 { font-size: clamp(44px, 8vw, 68px); line-height: 1.02; margin: 0 0 14px; }
/* Wide enough for one line where there is room, balanced into even lines
   where there is not, so the last word is never left on its own. */
.hero p { font-size: clamp(17px, 2.2vw, 20px); color: var(--label-2); max-width: 46ch; margin: 0; text-wrap: balance; }

/* An app's tile. The hue is the app's, carried in on --c-* by the element. */
.app-tile {
  border-radius: 28px;
  padding: 34px 34px 30px;
  background: color-mix(in srgb, var(--c-500) 10%, var(--card));
  border: .5px solid color-mix(in srgb, var(--c-600) 18%, transparent);
}
.app-tile .icon { width: 108px; height: 108px; border-radius: 24.5%; display: block; box-shadow: 0 4px 16px color-mix(in srgb, var(--c-700) 22%, transparent); }
.app-tile .name { font: 800 40px/1.05 var(--rounded); letter-spacing: -.03em; margin: 22px 0 6px; color: var(--c-700); }
.app-tile .line { font-size: 19px; color: var(--label); margin: 0; max-width: 34ch; }

/* Two apps and up, the home screen the family's own document describes. */
.apps { display: grid; gap: 16px; margin-top: 30px; }
@media (min-width: 720px) { .apps.many { grid-template-columns: 1fr 1fr; } }

@media (prefers-color-scheme: dark) {
  .app-tile { background: color-mix(in srgb, var(--c-400) 12%, var(--card)); border-color: color-mix(in srgb, var(--c-400) 22%, transparent); }
  .app-tile .name { color: var(--c-400); }
}

@media (max-width: 480px) {
  .hero { padding-top: 64px; }
  .app-tile { padding: 26px 24px 24px; border-radius: 24px; }
  .app-tile .icon { width: 88px; height: 88px; }
  .app-tile .name { font-size: 32px; }
}
