/* Yearsplit site in the look of Yearsplit 2.0 (SPECIFICATION "The website for Yearsplit 2.0", W1):
   Apple's system font, the app's colours in light and dark, the Mac toolbar's glass as the header and
   the app's grouped cards. The colours with a meaning (green, red, teal, brass, blue, violet) appear
   only in the app's own pictures; the page itself uses the text colours and the accent. Nothing comes
   from another host. */

/* ---------- Tokens ---------- */

:root {
  /* The grouped background and its cards. */
  --page: #f2f2f7;
  --card: #ffffff;
  --text: #1d1d1f;
  /* Secondary text: 4.7:1 on the page, 5.2:1 on a card (the system's 60 % grey reaches only 3.3:1). */
  --sec: #6c6c70;
  --sep: rgba(60, 60, 67, 0.18);
  --fill: rgba(118, 118, 128, 0.12);
  /* The app's AccentColor and OnAccent (native Assets.xcassets). */
  --accent: #0a786e;
  --on-accent: #ffffff;
  /* The Mac toolbar's glass. */
  --glass: rgba(246, 246, 248, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  /* The same shadow for a picture of a card on a transparent background: it follows the card's shape. */
  --shot-shadow: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.06));
  /* The segmented control (the guide's platform switch). */
  --seg-track: #e3e3e8;
  --seg-thumb: #ffffff;
  /* The devices around the whole-screen pictures. */
  --bezel: #1d1d1f;
  --bezel-rim: #3a3a3c;
  --device-shadow: 0 30px 60px rgba(0, 0, 0, 0.28);
  --window-shadow: 0 30px 70px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.25);
  /* Where a jump to a section lands: under the header (and the phone's contents bar). */
  --stick: 76px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --sec: rgba(235, 235, 245, 0.6);
    --sep: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --accent: #34d6c8;
    --on-accent: #07221f;
    --glass: rgba(28, 28, 30, 0.72);
    --shadow: none;
    --shot-shadow: none;
    --seg-track: #1c1c1e;
    --seg-thumb: #636366;
    --device-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    --window-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.18);
  }
}

/* Increase Contrast: the app's high-contrast accent, darker secondary text and separators. */
@media (prefers-contrast: more) {
  :root {
    --sec: #3c3c43;
    --sep: rgba(60, 60, 67, 0.36);
    --accent: #0a655c;
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --sec: rgba(235, 235, 245, 0.8);
    --sep: rgba(84, 84, 88, 0.9);
    --accent: #7defe5;
  }
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--stick);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
}

strong {
  font-weight: 600;
}

main {
  flex: 1;
  /* A path or a long German word breaks rather than pushing the page sideways on a narrow phone. */
  overflow-wrap: break-word;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 max(32px, env(safe-area-inset-right)) 0 max(32px, env(safe-area-inset-left));
}

/* ---------- Header: the Mac toolbar's glass ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 52px;
  /* The bar spans the window; its contents line up with the page's column. */
  padding: 0 max(32px, env(safe-area-inset-right), calc((100% - 1016px) / 2)) 0 max(32px, env(safe-area-inset-left), calc((100% - 1016px) / 2));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep);
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  /* The icon's dark edge would vanish on the dark page. */
  box-shadow: 0 0 0 0.5px var(--sep);
}

.top > nav {
  display: flex;
  align-self: stretch;
  gap: 20px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.top > nav a {
  display: flex;
  flex: none;
  align-items: center;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.top > nav a:hover,
.top > nav a[aria-current="page"] {
  opacity: 1;
}

.top > nav a[aria-current="page"] {
  font-weight: 600;
}

.top-end {
  display: flex;
  flex: none;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.lang {
  display: inline-flex;
  align-items: center;
  /* A finger's room on phones, inside the bar's 52 px. */
  min-height: 44px;
  padding: 0 4px;
  color: var(--sec);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.lang:hover {
  color: var(--text);
}

.lang .short {
  display: none;
}

/* The App Store link: a plain button, not Apple's badge (the badge sits in the landing hero, unmodified). */
.get {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: #000000;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.get:hover {
  background: #1d1d1f;
}

.get svg {
  width: 15px;
  height: 15px;
}

/* ---------- Footer ---------- */

footer {
  margin-top: 96px;
  border-top: 1px solid var(--sep);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px max(32px, env(safe-area-inset-right)) 40px max(32px, env(safe-area-inset-left));
  color: var(--sec);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links a[aria-current="page"] {
  color: var(--text);
}

/* ---------- Phone tab bar: the iPhone app's ---------- */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: none;
  justify-content: space-around;
  /* 20 below the labels, or the home indicator's room where it is larger. */
  padding: 6px max(6px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--sep);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  /* 70 px, the iPhone's; less below 318 px, so four tabs still fit a 280 px screen. */
  min-width: min(70px, 22vw);
  color: var(--sec);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
}

.tabbar a[aria-current="page"] {
  color: var(--accent);
}

.tabbar svg {
  width: 26px;
  height: 26px;
}

/* ---------- Landing page ---------- */

.landing main > section {
  padding-top: 80px;
}

.landing h2 {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.landing main > .hero {
  padding-top: 64px;
  text-align: center;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--sec);
  font-size: 14px;
  line-height: 1.3;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero .sub {
  margin: 6px 0 20px;
  color: var(--sec);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.hero .lead {
  max-width: 760px;
  margin: 0 auto 24px;
  font-size: 21px;
  line-height: 1.42;
}

.store {
  display: inline-block;
  border-radius: 9px;
}

.store img {
  display: block;
  width: auto;
  height: 52px;
}

/* The devices: whole screens in a bezel drawn here (iPhone, iPad) or as a window (Mac). Their parts are
   multiples of --u, which each place sets: 1 % of the iPhone's and the Mac's width and of the iPad
   screen's height (the iPad's picture may be landscape or portrait). Not em: a minimum font size would
   blow the devices up. */
.device {
  margin: 0;
}

.device .screen {
  position: relative;
}

.device img {
  display: block;
  width: 100%;
  height: auto;
}

.iphone {
  width: calc(100 * var(--u));
}

.iphone .screen {
  padding: calc(3.2 * var(--u));
  border-radius: calc(16.8 * var(--u));
  background: var(--bezel);
  box-shadow: var(--device-shadow), inset 0 0 0 1.5px var(--bezel-rim);
}

.iphone img {
  border-radius: calc(13.6 * var(--u));
}

/* The Dynamic Island, over the empty middle of the screenshot's status bar. */
.iphone .screen::after {
  content: "";
  position: absolute;
  top: calc(5.8 * var(--u));
  left: 50%;
  width: calc(29 * var(--u));
  height: calc(8.6 * var(--u));
  border-radius: calc(4.3 * var(--u));
  background: #000000;
  transform: translateX(-50%);
}

.ipad .screen {
  padding: calc(2.6 * var(--u));
  border-radius: calc(6.8 * var(--u));
  background: var(--bezel);
  box-shadow: var(--device-shadow), inset 0 0 0 1.5px var(--bezel-rim);
}

.ipad img {
  width: auto;
  height: calc(100 * var(--u));
  border-radius: calc(4.2 * var(--u));
}

.mac {
  width: calc(100 * var(--u));
}

.mac img {
  border-radius: calc(1.8 * var(--u));
  box-shadow: var(--window-shadow);
}

/* The hero: the Mac, the iPad in front of it on the left and the iPhone on the right, in their own
   proportions (1cqw is 1 % of the trio's width). */
.trio {
  position: relative;
  max-width: 1000px;
  margin: 44px auto 0;
  container-type: inline-size;
}

.trio .device {
  position: absolute;
  bottom: 0;
}

.trio .mac {
  position: relative;
  margin: 0 0 7cqw 3cqw;
  --u: 0.88cqw;
}

/* iPad and iPhone in their real sizes to each other (the 13-inch iPad Pro about 282 mm wide in landscape,
   the iPhone 18 Pro about 72 mm wide); the Mac behind them as a window on a large display. */
.trio .ipad {
  left: 0;
  --u: 0.353cqw;
}

.trio .iphone {
  right: 0;
  --u: 0.128cqw;
}

/* A feature: its text beside a picture of the card that shows it. */
.row {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: 56px;
}

.row.flip {
  grid-template-columns: 1.15fr 1fr;
}

.row.flip > .txt {
  order: 2;
}

.row.wide {
  grid-template-columns: 1fr;
  gap: 26px;
}

.row.wide > .txt {
  max-width: 760px;
}

.txt h2 {
  margin-bottom: 12px;
}

.txt p + p,
.txt p + ol,
.txt ol + p {
  margin-top: 12px;
}

.txt .note {
  color: var(--sec);
}

.txt ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--sec);
}

.txt li + li {
  margin-top: 8px;
}

/* A picture of a card, on a transparent background: the card's own shape carries the shadow. */
.shot {
  justify-self: center;
  width: 100%;
  max-width: 520px;
  margin: 0;
}

.row.wide > .shot {
  max-width: none;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--shot-shadow);
}

/* A tall card shows only its top, 14 parts high for 13 wide at any width, and fades out towards the cut.
   The extra 16 px around it leave its shadow room inside the mask. */
.shot.crop {
  width: calc(100% + 32px);
  max-width: 552px;
  margin: -16px;
  padding: 16px;
  -webkit-mask-image: linear-gradient(#000000 75%, transparent calc(100% - 16px));
  mask-image: linear-gradient(#000000 75%, transparent calc(100% - 16px));
}

.shot.crop img {
  aspect-ratio: 13 / 14;
  object-fit: cover;
  object-position: top;
}

/* Gemeinsam planen: the three steps as a grouped list, numbered like the app's tiles. */
.steps {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  counter-reset: step;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.steps li {
  position: relative;
  min-height: 52px;
  padding: 13px 16px 13px 54px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.steps li + li::after {
  content: "";
  position: absolute;
  left: 54px;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--sep);
}

/* Eine App für iPhone, iPad und Mac. */
.devices {
  text-align: center;
}

.devices h2 {
  margin-bottom: 12px;
}

.devices .lead {
  max-width: 780px;
  margin: 0 auto;
  color: var(--sec);
  font-size: 21px;
  line-height: 1.42;
}

/* iPhone, iPad and Mac side by side on one line, standing on its bottom, in their real sizes to each other:
   --s is one millimetre, the iPhone 18 Pro about 72 mm wide, the 13-inch iPad Pro about 216 mm high in
   landscape and the Mac's window about 300 mm wide, together 662 mm. The row fits them (1cqw is 1 % of it). */
.devrow {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 30px;
  margin-top: 30px;
  container-type: inline-size;
}

.devrow > .device {
  --s: min(1.6px, calc((100cqw - 60px) / 662));
}

.devrow .iphone {
  --u: calc(0.72 * var(--s));
}

.devrow .ipad {
  --u: calc(2.05 * var(--s));
}

.devrow .mac {
  --u: calc(3 * var(--s));
}

.devrow figcaption {
  margin-top: 10px;
  color: var(--sec);
  font-size: 14px;
}

/* Häufige Fragen: each question its own card. */
.faq {
  max-width: 820px;
  margin: 0 auto;
}

.faq h2 {
  margin-bottom: 20px;
}

.faq details {
  margin-top: 10px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

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

/* The app's disclosure chevron: right when closed, down when open. */
.faq summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--sec);
  border-bottom: 2px solid var(--sec);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding: 0 18px 16px;
  color: var(--sec);
}

.faq .more {
  margin-top: 20px;
  color: var(--sec);
  text-align: center;
}

/* ---------- Sub-pages: guide, support, privacy, legal notice ---------- */

main.doc {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  column-gap: 48px;
  padding-top: 48px;
}

main.doc > * {
  grid-column: 2;
  min-width: 0;
}

main.doc > h1,
main.doc section h2 {
  -webkit-hyphens: auto;
  hyphens: auto;
}

main.doc > h1 {
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

main.doc > h1 + p {
  margin-top: 16px;
}

main.doc > .lead {
  color: var(--sec);
  font-size: 21px;
  line-height: 1.42;
}

main.doc > p + p {
  margin-top: 12px;
}

main.doc > .updated {
  color: var(--sec);
  font-size: 14px;
}

main.doc > section {
  margin-top: 20px;
  padding: 26px 30px 28px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

main.doc > .toc + section {
  margin-top: 32px;
}

main.doc section h2 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

main.doc section h3 {
  margin: 24px 0 2px;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

main.doc section p {
  margin-top: 10px;
}

main.doc section ul,
main.doc section ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

main.doc section li {
  margin-top: 6px;
}

.guide-shot {
  margin: 20px 0 8px;
}

.guide-shot img {
  display: block;
  /* A picture is drawn at most at its 1x width (--w), so it stays sharp, and fills the column when that
     is narrower; a tall one (a single card on its own) is capped in height, so it never towers over the
     text. It stands centred. site.js sets --w and --r (width / height), which give the box its size before
     the picture loads; without them the width stays auto, which is the width `sizes` names (written by
     tool/pictures.mjs from the same rule). */
  width: min(100%, var(--w), calc(min(34rem, 80vh) * var(--r)));
  max-width: 100%;
  height: auto;
  max-height: min(34rem, 80vh);
  margin-inline: auto;
  /* The app's own shapes (a card on a transparent background, a sheet, the Mac's window) carry the
     shadow, as on the landing page. */
  filter: var(--shot-shadow);
}

.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

main.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

main.doc th,
main.doc td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--sep);
  text-align: left;
}

main.doc th {
  color: var(--sec);
  font-size: 13px;
  font-weight: 600;
}

kbd {
  padding: 2px 7px;
  border: 1px solid var(--sep);
  border-radius: 6px;
  background: var(--fill);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
}

/* The guide's platform switch: two radios as the app's segmented control (:has() hides the other
   platform). The chosen segment's raised face is its ::before, under its text. */
.platform {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.platform legend {
  float: left;
  margin-right: 14px;
  padding: 0;
  color: var(--sec);
  font-size: 15px;
  line-height: 34px;
}

.platform input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.platform label {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 18px;
  background: var(--seg-track);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.platform label:first-of-type {
  border-radius: 9px 0 0 9px;
}

.platform label:last-of-type {
  border-radius: 0 9px 9px 0;
}

.platform input:checked + label {
  font-weight: 600;
}

.platform input:checked + label::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: 7px;
  background: var(--seg-thumb);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
}

.platform input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body:has(#p-mac:checked) .on-ios,
body:not(:has(#p-mac:checked)) .on-mac {
  display: none;
}

/* The contents: a sticky card in the left column, the current section marked like the Mac sidebar's
   selection. */
main.doc > .toc {
  grid-column: 1;
  /* From the first row to the last, so it stays in view the whole page down. */
  grid-row: 1 / span 60;
  position: sticky;
  top: var(--stick);
  padding: 14px 8px 8px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.toc-label {
  display: block;
  padding: 0 10px 8px;
  color: var(--sec);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.toc ol {
  max-height: calc(100vh - 200px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-width: thin;
}

.toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toc a:hover {
  background: var(--fill);
}

/* The section being read: the Mac sidebar's selection, the accent behind the on-accent text. */
.toc a[aria-current="location"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* The phone's contents bar (site.js opens the menu from it). */
.toc-bar {
  display: none;
  align-items: center;
  gap: 12px;
  height: 48px;
  margin-top: 20px;
  padding: 0 16px;
  border: 1px solid var(--sep);
  border-radius: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.toc-bar .toc-label {
  flex: none;
  padding: 0;
}

.toc-cur {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-bar svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--sec);
  transition: transform 0.2s ease;
}

.toc-bar[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* ---------- Below the app's nav breakpoint (880) ---------- */

@media (max-width: 879px) {
  :root {
    /* Header 52, a gap of 6, the contents bar 48, a gap of 6. */
    --stick: 112px;
  }

  main {
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }

  .top {
    gap: 16px;
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }

  .top > nav,
  .get {
    display: none;
  }

  .lang .long {
    display: none;
  }

  .lang .short {
    display: inline;
  }

  .tabbar {
    display: flex;
  }

  footer {
    margin-top: 64px;
  }

  .foot {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  /* One column: the text, then its picture. */
  .row,
  .row.flip {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .row.flip > .txt {
    order: 0;
  }

  /* The month card is the narrow one here, as wide as the other cards. */
  .row.wide > .shot {
    max-width: 520px;
  }

  .txt {
    max-width: 680px;
  }

  main.doc {
    display: block;
    padding-top: 20px;
  }

  main.doc > section {
    padding: 22px 18px 24px;
  }

  main.doc > .toc {
    display: none;
  }

  .toc-bar {
    position: sticky;
    top: 58px;
    z-index: 20;
    display: flex;
  }

  /* The open menu: a glass panel under the bar. site.js sets --menu-top and --menu-max from where the
     bar and the tab bar are, so the panel also sits right before the bar has stuck. */
  main.doc > .toc.open {
    position: fixed;
    top: var(--menu-top, 112px);
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    z-index: 25;
    display: block;
    max-height: var(--menu-max, 58vh);
    padding: 6px;
    overflow: auto;
    border: 1px solid var(--sep);
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    backdrop-filter: saturate(180%) blur(24px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  }

  .toc.open .toc-label {
    display: none;
  }

  .toc.open ol {
    max-height: none;
    overflow: visible;
  }

  .toc.open a {
    padding: 10px 12px;
    font-size: 15px;
  }

  /* If the script fails to run, the bar's link still shows the list in place. */
  main.doc > .toc:target:not(.open) {
    position: static;
    display: block;
    margin-top: 12px;
  }
}

/* ---------- Phone widths ---------- */

@media (max-width: 699px) {
  body {
    font-size: 16px;
  }

  .landing main > section {
    padding-top: 56px;
  }

  .landing h2 {
    font-size: 30px;
  }

  .landing main > .hero {
    padding-top: 40px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero .sub {
    font-size: 19px;
  }

  .hero .lead,
  .devices .lead,
  main.doc > .lead {
    font-size: 18px;
  }

  /* The hero shows the iPhone alone. */
  .trio {
    margin-top: 36px;
  }

  .trio .mac,
  .trio .ipad {
    display: none;
  }

  .trio .iphone {
    position: relative;
    margin: 0 auto;
    --u: 2.4px;
  }

  .shot,
  .row.wide > .shot {
    max-width: 480px;
  }

  .shot.crop {
    max-width: 512px;
  }

  /* Here the iPad and the Mac, as the hero showed the iPhone. */
  .devrow {
    flex-direction: column;
    align-items: center;
    gap: 26px;
  }

  .devrow .iphone {
    display: none;
  }

  .devrow .ipad,
  .devrow .mac {
    width: min(480px, 100%);
    --u: min(3.6px, 0.75vw);
  }

  .devrow .ipad img {
    width: 100%;
    height: auto;
  }

  main.doc > h1 {
    font-size: 34px;
  }
}

/* Without a script the guide's pictures only take their size when they load, so a smooth jump would
   land short; jump straight there instead. */
@media (scripting: none) {
  html {
    scroll-behavior: auto;
  }
}

/* Without a script the phone's contents is a plain list under the page head, and the bar links to it. */
@media (max-width: 879px) and (scripting: none) {
  main.doc > .toc {
    position: static;
    display: block;
    margin-top: 12px;
  }

  .toc ol {
    max-height: none;
  }
}
