:root {
  --ink: #f4f1ef;
  --ink-dim: #9b938f;
  --ink-faint: #8a807c;
  --bg: #0a0908;
  --panel: #131110;
  --line: #24201e;
  /* The safelight red comes from aso-tokens.css, which carries the
     measured contrast values. Nothing here restates a brand colour. */
  --red: var(--brand-soft);
  --red-dim: var(--brand-2);
  --measure: 44rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */

header.site {
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 0;
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
}

.wordmark {
  font-weight: 620;
  letter-spacing: -0.015em;
  font-size: 1.05rem;
}

header.site nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  font-size: 0.92rem;
}

header.site nav a {
  color: var(--ink-dim);
  text-decoration: none;
}

header.site nav a:hover { color: var(--ink); }

/* Hero */

.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  font-weight: 640;
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
}

.hero p.lede {
  font-size: 1.2rem;
  color: var(--ink-dim);
  margin: 0;
  max-width: 34rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--red);
  margin: 0 0 1.1rem;
}

/* Sections */

section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--line);
}

section:last-of-type { border-bottom: 0; }

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-weight: 620;
}

h3 {
  font-size: 1.05rem;
  margin: 2rem 0 0.5rem;
  font-weight: 620;
}

p { margin: 0 0 1rem; }

a { color: var(--red); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.35rem;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.95rem;
}

ul.plain {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--ink-dim);
}

ul.plain li { margin-bottom: 0.4rem; }

blockquote {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--red-dim);
  color: var(--ink-dim);
  font-style: italic;
}

/* Legal pages */

.legal { padding: 3rem 0 4rem; }

.legal h1 {
  font-size: 2rem;
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
  font-weight: 640;
}

.legal .updated {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin: 0 0 2.5rem;
}

.legal h2 {
  font-size: 1.15rem;
  margin: 2.25rem 0 0.6rem;
}

.legal p, .legal li { color: var(--ink-dim); }

.legal strong { color: var(--ink); font-weight: 600; }

/* Footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3.5rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

footer.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

footer.site a { color: var(--ink-dim); text-decoration: none; }
footer.site a:hover { color: var(--ink); }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero { padding: 3.5rem 0 3rem; }
}


/* ==========================================================================
   The document layer
   --------------------------------------------------------------------------
   The terms and the privacy policy are the two pages someone opens with a
   question already in mind, often a reviewer with a checklist. They are set
   as documents rather than as pages: an answer box first, a table of contents
   that stays put, and headings that can be linked to directly.
   ========================================================================== */

:root {
  --amber: #ffb454;          /* the other safelight. Used only for a caution. */
  --amber-dim: #4a3115;
  --glow: rgba(255, 46, 20, 0.13);
  --doc-measure: 68rem;
}

::selection { background: var(--red-dim); color: #fff; }

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

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* The safelight. One light source, above the fold, the same red the icon
   burns. It is a gradient rather than an image so it costs nothing. */

.lamp {
  position: relative;
  isolation: isolate;
}

.lamp::before {
  content: "";
  position: absolute;
  inset: -30% 0 auto;
  height: 34rem;
  /* The lamp hangs where the icon is, not in the middle of the page, so the
     icon reads as the thing giving off the light rather than as a picture
     sitting in front of a glow. */
  background: radial-gradient(46% 58% at var(--lamp-x, 50%) 4%, var(--glow), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* Document header */

.doc-head {
  padding: 3.25rem 0 2.25rem;
  border-bottom: 1px solid var(--line);
  --lamp-x: 22%;
}

@media (min-width: 62rem) {
  .doc-head { --lamp-x: 15%; }
}

.doc-head .wrap { max-width: var(--doc-measure); }

.doc-mark {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  display: block;
  margin: 0 0 1.5rem;
  /* The icon is a light in the artwork; on this background it should read as
     one on the page too. */
  filter: drop-shadow(0 0 26px rgba(255, 46, 20, 0.42));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 50px -18px rgba(255, 46, 20, 0.55);
}

.doc-head h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 640;
  margin: 0 0 0.5rem;
}

.doc-head .subtitle {
  font-size: 1.05rem;
  color: var(--ink-dim);
  margin: 0 0 1.25rem;
  max-width: 42rem;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0;
}

.doc-meta .tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  color: var(--ink-dim);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* The answer box. Whatever someone came to find out, in one screen, before
   the document proper starts. */

.answers {
  margin: 2rem 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 0.35rem 1.4rem;
}

.answers dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) 1fr;
  gap: 0;
}

.answers dt,
.answers dd {
  margin: 0;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.answers dl > dt:first-of-type,
.answers dl > dt:first-of-type + dd { border-top: 0; }

.answers dt {
  color: var(--ink-faint);
  padding-right: 1.5rem;
}

.answers dd { color: var(--ink); }
.answers dd a { color: var(--red); }

@media (max-width: 40rem) {
  .answers dl { grid-template-columns: 1fr; }
  .answers dt { padding-bottom: 0.15rem; }
  .answers dd { padding-top: 0.15rem; border-top: 0; }
  .answers dl > dt:first-of-type + dd { border-top: 0; }
}

/* Two columns: the contents stay in view, the document scrolls past them. */

.doc {
  padding: 2.5rem 0 4rem;
}

.doc .wrap {
  max-width: var(--doc-measure);
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 2rem;
  font-size: 0.9rem;
}

.toc h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin: 0 0 0.85rem;
  font-weight: 600;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.toc li { margin: 0; }

.toc a {
  display: block;
  padding: 0.4rem 0 0.4rem 1rem;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-dim);
  text-decoration: none;
  line-height: 1.4;
}

.toc a:hover {
  color: var(--ink);
  border-left-color: var(--red-dim);
}

@media (max-width: 62rem) {
  .doc .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .toc {
    position: static;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
  }
  .toc ol { border-left: 0; columns: 2; column-gap: 1.5rem; }
  .toc a { padding-left: 0; border-left: 0; }
  .toc a:hover { border-left-color: transparent; }
}

@media (max-width: 30rem) {
  .toc ol { columns: 1; }
}

/* The document body */

.doc-body { max-width: 40rem; }

.doc-body > section {
  padding: 0;
  border-bottom: 0;
  margin: 0 0 2.75rem;
  /* So a link to #liability does not land under the sticky contents. */
  scroll-margin-top: 2rem;
}

.doc-body > section:last-child { margin-bottom: 0; }

.doc-body h2 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.doc-body h2 .n {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.doc-body p,
.doc-body li { color: var(--ink-dim); }

.doc-body strong { color: var(--ink); font-weight: 600; }

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

.doc-body a { text-underline-offset: 0.18em; }

/* A caution reads in the other safelight colour, because it is the one thing
   on the page that is not simply information. */

.caution {
  border: 1px solid var(--amber-dim);
  border-left: 3px solid var(--amber);
  border-radius: 12px;
  background: rgba(255, 180, 84, 0.045);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1rem;
}

.caution p { margin: 0; }
.caution p + p { margin-top: 0.7rem; }
.caution strong { color: var(--amber); }

/* A row of links out of the document, at the end of it. */

.doc-next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.doc-next a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.doc-next a:hover {
  border-color: var(--red-dim);
  transform: translateY(-1px);
}

.doc-next .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.doc-next .name { font-weight: 600; font-size: 0.98rem; }

/* Footer, given the same light as the header */

footer.site .wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1rem;
  align-items: start;
}

footer.site .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  grid-row: span 2;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .doc-next a:hover { transform: none; }
}

@media print {
  .lamp::before, header.site nav, .toc, .doc-next { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .doc .wrap { grid-template-columns: 1fr; }
  .answers, .caution, .doc-next a { border-color: #bbb; background: none; }
  .doc-body p, .doc-body li, .answers dd, .doc-head .subtitle { color: #222; }
  .doc-mark { filter: none; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}

/* The wordmark is a link on every page, and looks like the wordmark anyway. */
.wordmark a { color: inherit; text-decoration: none; }
.wordmark a:hover { color: var(--red); }

header.site nav a[aria-current="page"] { color: var(--ink); }

/* Support and the trademark notice keep the plain legal layout, but they get
   the same light and the same header proportions as the two documents. */
.legal .wrap { max-width: 48rem; }
.legal h1 { margin-top: 0.5rem; }

/* The glow is stronger under the icon than anywhere else. */
:root { --glow: rgba(255, 46, 20, 0.16); }

.hero { --lamp-x: 34%; }

.hero-mark {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  display: block;
  margin: 0 0 1.75rem;
  filter: drop-shadow(0 0 34px rgba(255, 46, 20, 0.4));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 22px 60px -20px rgba(255, 46, 20, 0.6);
}

@media (max-width: 480px) {
  .hero-mark { width: 76px; height: 76px; border-radius: 18px; }
}


/* ==========================================================================
   The landing layer
   --------------------------------------------------------------------------
   The home page and the guide pages. Same room as the documents: one red
   light, black walls, nothing that glows. Everything here is laid out so the
   App Store button is never more than a screen away.
   ========================================================================== */

h1, h2, h3, p, li, td, th, dd, dt { overflow-wrap: break-word; }

.lede {
  font-size: 1.15rem;
  color: var(--ink-dim);
  max-width: 36rem;
}

/* The download button. Apple's badge, at Apple's aspect ratio, with the
   things a buyer wants to know sitting under it rather than in a claim. */

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 2rem 0 0;
}

.hero-meta {
  margin: 1.1rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}

.hero-meta span { white-space: nowrap; }
.hero-meta strong { color: var(--ink-dim); font-weight: 600; }

/* The chain of baths, the same shape the app draws along the top of a run. */

.chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.chain li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  color: var(--ink-faint);
}

.chain li.on {
  border-color: var(--red-dim);
  color: var(--red);
}

/* The screenshots. Four across on a desk, a swipeable strip on a phone. */

.shots {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #000;
}

@media (max-width: 44rem) {
  .shots {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 62%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.75rem;
    overscroll-behavior-x: contain;
  }
  .shots li { scroll-snap-align: center; }
}

/* The band that carries the button between sections. */

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 1.65rem 1.75rem;
  margin: 2.5rem 0 0;
}

.cta h2 { margin: 0 0 0.35rem; font-size: 1.12rem; }
.cta p { margin: 0; color: var(--ink-dim); font-size: 0.95rem; max-width: 30rem; }

/* Counted things, which are the only numbers on this site that are not
   transcribed from somebody's datasheet. */

.stats {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1.5rem 1.25rem;
}

.stats .n {
  display: block;
  font-size: 1.85rem;
  font-weight: 640;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.stats .l {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-dim);
  margin-top: 0.3rem;
}

/* Questions. Native disclosure, so the answers are in the page with or
   without JavaScript. */

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

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

.faq summary {
  cursor: pointer;
  padding: 1rem 0;
  font-weight: 600;
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  margin-left: auto;
  color: var(--red);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1;
}

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

.faq details > p {
  color: var(--ink-dim);
  margin: 0 0 1.1rem;
  max-width: 42rem;
}

/* Links to the other guides. */

.pages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.pages a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.pages a:hover { border-color: var(--red-dim); }
.pages .name { display: block; font-weight: 620; margin-bottom: 0.3rem; }
.pages .what { display: block; font-size: 0.92rem; color: var(--ink-dim); }

/* Tables of published figures. They scroll inside themselves rather than
   pushing the page sideways. */

.tablewrap { overflow-x: auto; margin: 1.75rem 0; }

table.spec {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 0.94rem;
}

table.spec th,
table.spec td {
  text-align: left;
  padding: 0.65rem 0.9rem 0.65rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.spec th {
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

table.spec td { color: var(--ink-dim); }

table.spec td.num {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}

/* The note under a table sits outside the scroll container, so it stays
   readable on a phone instead of being clipped with the table. */
.tablenote {
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin: -1rem 0 1.75rem;
  max-width: 42rem;
}

/* Where you are, on a page that is not the front one. */

.crumb { font-size: 0.88rem; color: var(--ink-faint); margin: 0 0 1.1rem; }
.crumb a { color: var(--ink-dim); text-decoration: none; }
.crumb a:hover { color: var(--red); }

/* The guide pages use the hero for their own heading, one size down. */

.hero.page h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); }
.hero.page { padding: 3rem 0 3.25rem; }

footer.site nav { max-width: 46rem; }

@media (max-width: 480px) {
  .cta { padding: 1.35rem; }
  .stats .n { font-size: 1.6rem; }
}
