/* The home page. The paper, the ink and the accents are those of the iOS app (web/src/ui/tokens.ts): indigo for the
   theme `ink`, cinnabar for `line`. `site.js` sets `data-theme` on <html>. */
:root {
  --paper: #eef0ee; --ink: #16181b; --accent: #27496d; --bezel: #1b1d20;
  --soft: color-mix(in srgb, var(--ink) 58%, transparent);
  --faint: color-mix(in srgb, var(--ink) 14%, transparent);
  color-scheme: light dark;
}
:root[data-theme="line"] { --accent: #b3372a; }
@media (prefers-color-scheme: dark) {
  :root { --paper: #15171a; --ink: #d3d6d2; --accent: #7fb0d6; --bezel: #33363b; }
  :root[data-theme="line"] { --accent: #de5a48; }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-size: clamp(40px, 5.4vw, 68px); line-height: 1.04; }
h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; }
:lang(zh-Hans) :is(h1, h2) { letter-spacing: 0; line-height: 1.2; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1128px; margin-inline: auto; padding-inline: 24px; }
section { margin-top: clamp(96px, 13vw, 176px); }

/* The top bar and the footer */
.top { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; text-decoration: none; }
.icon { border-radius: 22.5%; box-shadow: 0 0 0 1px var(--faint); }
.brand .icon { width: 30px; height: 30px; }
nav { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 15px; }
nav a { color: var(--soft); text-decoration: none; }
nav a:hover { color: var(--ink); }
footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 26px;
  margin-top: clamp(96px, 13vw, 176px); padding-top: 28px; padding-bottom: 44px;
  font-size: 15px; color: var(--soft); border-top: 1px solid var(--faint);
}

/* The hero: the words, and the drawing with no edge on the paper */
.hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: center; gap: 40px; margin-top: 24px; }
.lede { margin-top: 26px; max-width: 30em; font-size: clamp(18px, 1.7vw, 21px); color: var(--soft); }
.get { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 36px; }
.button {
  display: inline-flex; align-items: center; height: 52px; padding: 0 28px; border-radius: 26px;
  background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none;
}
.button:hover { opacity: 0.86; }
.button.plain { background: none; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--faint); }
.soon { display: inline-flex; align-items: center; gap: 9px; color: var(--soft); }
.soon small { font-size: 13px; padding: 2px 9px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--faint); }
.note { margin-top: 18px; font-size: 14px; color: var(--soft); }
.hero-hill picture, .pair picture {
  display: block;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  mask-composite: intersect;
}
.places { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin-top: 4px; }
.places button { padding: 6px 0; white-space: nowrap; color: var(--soft); border-bottom: 2px solid transparent; }
.places button:hover { color: var(--ink); }
.places [aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* A heading with its text */
.words p { margin-top: 18px; max-width: 26em; font-size: 19px; color: var(--soft); }
.words p + p { margin-top: 12px; }

/* The two themes */
.themes .words { text-align: center; }
.themes .words p { margin-left: auto; margin-right: auto; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 880px; margin: 28px auto 0; }
.pair button { display: grid; align-content: start; justify-items: center; text-align: center; }
.pair img { aspect-ratio: 4 / 3; object-fit: cover; }
.pair strong { margin-top: 2px; font-size: 21px; font-weight: 600; }
.pair [aria-pressed="true"] strong::after { content: " ✓"; color: var(--accent); }
.pair span { color: var(--soft); }

/* Words beside one or two iPhones */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 48px; }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip .words { order: 2; }
.devices { display: flex; justify-content: center; align-items: flex-start; gap: clamp(14px, 2.4vw, 32px); }
.phone {
  --w: clamp(150px, 21vw, 272px);
  width: var(--w); padding: calc(var(--w) * 0.03); border-radius: calc(var(--w) * 0.18); background: var(--bezel);
}
.phone img { border-radius: calc(var(--w) * 0.152); }
.devices .phone + .phone { margin-top: calc(var(--w) * 0.22); }

/* The iPad */
.wide .words { text-align: center; }
.wide .words p { margin-left: auto; margin-right: auto; }
.pad { max-width: 980px; margin: 44px auto 0; padding: 1.3%; border-radius: 3.4% / 4.9%; background: var(--bezel); }
.pad img { border-radius: 2.2% / 3.2%; }

/* Short statements in columns */
.facts { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px 48px; }
.facts dl { display: grid; gap: 26px; margin: 6px 0 0; }
.facts dt { font-weight: 600; font-size: 19px; }
.facts dd { margin: 4px 0 0; color: var(--soft); max-width: 30em; }
.facts > p { grid-column: 2; }
.facts a { color: var(--accent); }
.faq details { border-top: 1px solid var(--faint); }
.faq details:last-child { border-bottom: 1px solid var(--faint); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; color: var(--soft); }
.faq [open] summary::after { content: "−"; }
.faq details p { padding-bottom: 20px; color: var(--soft); max-width: 34em; }

/* The end */
.end { display: grid; justify-items: center; text-align: center; }
.end .icon { width: 84px; height: 84px; margin-bottom: 28px; }
.end .get { justify-content: center; }

@media (max-width: 820px) {
  .wrap { padding-inline: 20px; }
  .top { height: 60px; }
  nav { gap: 8px 18px; }
  .hero, .feature, .feature.flip, .facts { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 12px; margin-top: 20px; }
  .hero-hill { max-width: 520px; margin: 0 auto; }
  .feature { gap: 40px; }
  .feature.flip .words { order: 0; }
  .phone { --w: min(41vw, 250px); }
  .facts > p { grid-column: 1; }
  .pair { gap: 8px; }
  .places { gap: 4px 20px; font-size: 15px; }
}
