/* The website's pages. Tokens come from ink.css; the sizes follow the app (docs/design.md). One column
   lines everything up: the name in the bar, the titles, the section labels, the cards and the first
   screen all start at the same edge, and text inside a card sits 14px in, as in the app's lists
   (Depth.pageMargin and Depth.rowPadding). */

:root {
  --column: 720px;
  --gutter: 16px;
  --inset: 14px;
}

a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
:where(a):focus-visible { border-radius: 6px; }

/* The column: the page margin, the safe area or the centred column, whichever is widest. The screens
   row uses the same edges, so it lines up in landscape on an iPhone too. */
:root {
  --edge-left: max(var(--gutter), env(safe-area-inset-left), calc((100% - var(--column)) / 2));
  --edge-right: max(var(--gutter), env(safe-area-inset-right), calc((100% - var(--column)) / 2));
}
.wrap { width: 100%; padding-left: var(--edge-left); padding-right: var(--edge-right); }

.skip { position: absolute; left: var(--gutter); top: -60px; padding: 10px 14px; background: var(--sheet); border-radius: var(--control-radius); box-shadow: var(--toplight), var(--shadow); z-index: 2; }
.skip:focus { top: 10px; }

/* The bar */

.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 20px; letter-spacing: 0; text-decoration: none; }
.bar nav { display: flex; gap: 20px; font-size: 15px; letter-spacing: -.24px; }
.bar nav a { color: var(--secondary); text-decoration: none; padding: 10px 0; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--text); }
.bar nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--hairline); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* Type, from Typeface */

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 10.5vw, 68px);
  line-height: 1.04;
  letter-spacing: -.02em;
  text-shadow: 0 1px 0 var(--letterpress);
}
.lead { font-size: clamp(19px, 4.6vw, 21px); line-height: 1.4; letter-spacing: -.3px; color: var(--secondary); max-width: 30em; }
.sh { font-weight: 400; font-size: 13px; letter-spacing: -.08px; color: var(--secondary); padding-bottom: 6px; }
.small { font-size: 13px; letter-spacing: -.08px; color: var(--secondary); line-height: 1.38; }

/* The share strip, the app's one recurring mark, grooved like the one under the big number */

.strip { display: flex; gap: 3px; height: 4px; }
.strip i { flex: 1; display: block; box-shadow: inset 0 1px .5px rgba(0, 0, 0, .35), 0 1px 0 var(--letterpress); }
.p0 { background: var(--p0); } .p2 { background: var(--p2); } .p4 { background: var(--p4); }
.p6 { background: var(--p6); } .p8 { background: var(--p8); }

/* PrimaryButtonStyle: a slab of ink that sinks when pressed, and lies flat while there's nothing to press */

.primary {
  display: inline-grid; place-items: center; min-height: 52px; padding: 0 28px; border-radius: var(--control-radius);
  background: var(--text); color: var(--paper); font-size: 17px; font-weight: 500; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 3px 4px rgba(42, 33, 24, .2);
}
.primary:hover { text-decoration: none; }
.primary:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 1px rgba(42, 33, 24, .2); }
.soon { font-size: 15px; letter-spacing: -.24px; line-height: 1.4; color: var(--secondary); }
.soon strong { font-weight: 500; color: var(--text); }

/* Cards and rows, from RaisedRows */

.card { background: var(--sheet); border-radius: var(--card-radius); box-shadow: var(--toplight), var(--shadow); overflow: hidden; }
.card ul { list-style: none; }
.card li { position: relative; display: flex; align-items: center; padding: 11px var(--inset); min-height: 50px; line-height: 1.35; }
.card li + li::before { content: ""; position: absolute; top: 0; left: var(--inset); right: 0; border-top: .5px solid var(--hairline); }

/* Home */

.home { padding-bottom: 8px; }
.hero { padding-top: 36px; padding-bottom: 8px; }
.hero .strip { max-width: 360px; margin-bottom: 26px; }
.hero .lead { margin-top: 20px; }
.hero .get { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 30px; }

/* Screens: a row that scrolls sideways across the page, its first screen in line with the column */

.screens {
  display: flex; gap: 18px; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  /* the row spans the page, so percentages here are of the page, scroll bar left out */
  margin-top: 44px;
  padding: 6px var(--edge-right) 26px var(--edge-left);
  scroll-padding-left: var(--edge-left);
  scroll-padding-right: var(--edge-right);
  scrollbar-width: none;
}
.screens::-webkit-scrollbar { display: none; }
.screens:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; border-radius: var(--card-radius); }
/* with a mouse, show a thin scroll bar so it's clear the row goes on */
@media (hover: hover) and (pointer: fine) {
  .screens { scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; }
  .screens::-webkit-scrollbar { display: block; height: 6px; }
  .screens::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }
}
.screens li { flex: none; scroll-snap-align: start; width: clamp(200px, 56vw, 250px); }
.screens figure { display: flex; flex-direction: column-reverse; gap: 14px; }
.screens figcaption { font-family: var(--serif); font-size: 19px; line-height: 1.2; letter-spacing: -.1px; text-align: center; padding: 0 6px; }
.screens img {
  display: block; width: 100%; height: auto; aspect-ratio: 660 / 1435;
  /* The device corner, as on the App Store screenshots: 9.5% of the width round every corner */
  border-radius: 9.6% / 4.42%;
  background: var(--sheet);
  box-shadow: 0 0 0 .5px rgba(42, 33, 24, .08), 0 2px 4px rgba(42, 33, 24, .06), 0 14px 28px -10px rgba(42, 33, 24, .22);
}

/* The reel. With motion allowed, the row drifts left on its own, screen 1 to 7 and round again, the
   second seven (.echo) carrying it on without a jump. It stops while a pointer or a finger is on it
   or it has focus, and the button under it pauses it for good. With Reduce Motion on, none of this
   applies and the row above is swiped by hand. */
.echo, .reel-toggle, .reel-bar { display: none; }
.hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .reel { position: relative; overflow: hidden; margin-top: 44px; }
  .screens {
    /* the row is exactly two sets wide, so moving it by half lands the echo where the first set began */
    width: max-content; gap: 0; margin: 0 0 0 var(--edge-left); padding: 6px 0 26px;
    overflow: visible; scroll-snap-type: none;
    animation: reel 56s linear infinite;
  }
  .screens li { margin-right: 18px; }
  .screens .echo { display: block; }
  .screens:hover, .screens:focus, .screens:active, .reel-toggle:checked ~ .screens { animation-play-state: paused; }
  .screens:focus-visible { outline: none; }

  .reel-toggle { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; }
  .reel-bar { display: flex; justify-content: flex-end; margin-top: -6px; }
  .reel-pause {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    background: var(--sheet); box-shadow: var(--toplight), var(--shadow);
  }
  /* two bars while it moves, a play triangle once paused */
  .reel-pause::before { content: ""; width: 4px; height: 12px; border-left: 3.5px solid var(--text); border-right: 3.5px solid var(--text); }
  .reel-toggle:checked ~ .reel-bar .reel-pause::before {
    width: 0; height: 0; margin-left: 3px;
    border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--text);
  }
  .reel-pause:active { background: var(--paper); }
  .reel-toggle:focus-visible ~ .reel-bar .reel-pause { outline: 2px solid var(--text); outline-offset: 3px; }
}

@keyframes reel { to { transform: translateX(-50%); } }

.section { margin-top: 44px; }
.section h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.2; letter-spacing: .2px; margin-bottom: 10px; }
.section > p { max-width: 36em; }
.section > p + p { margin-top: 10px; }
/* one column, like the app's lists */
.groups { display: grid; gap: 22px; margin-top: 24px; }

.closing { font-family: var(--serif); font-size: 22px; line-height: 1.3; max-width: 30em; }

/* Prose: privacy, support and the like */

.prose { padding-top: 28px; padding-bottom: 8px; }
.prose > * { max-width: 40em; }
.prose h1 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.15; letter-spacing: .1px; margin-bottom: 14px; }
.prose .updated { color: var(--secondary); font-size: 15px; letter-spacing: -.24px; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.25; letter-spacing: .1px; margin: 36px 0 10px; }
.prose h3 { font-size: 17px; font-weight: 600; letter-spacing: -.4px; margin: 26px 0 6px; }
.prose p, .prose li { line-height: 1.5; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 12px; }
.prose ul { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--tertiary); }
.prose strong { font-weight: 600; }
.prose code { font: 15px ui-monospace, Menlo, monospace; }

/* A page that isn't there */

.missing { padding-top: 14vh; padding-bottom: 10vh; text-align: center; }
.missing .mark { justify-content: center; margin-bottom: 22px; }
.missing .mark i { width: 22px; height: 22px; }
.missing .mark i:last-child { margin-left: -7px; }
.missing h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin-bottom: 8px; }
.missing p { color: var(--secondary); }
.missing .primary { margin-top: 24px; }

/* The footer */

.footer { margin-top: 56px; padding-bottom: max(32px, env(safe-area-inset-bottom)); font-size: 13px; letter-spacing: -.08px; line-height: 1.38; color: var(--secondary); }
.footer .rule { border-top: .5px solid var(--hairline); padding-top: 22px; }
.footer p + p { margin-top: 8px; }
.footer .links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer a { color: var(--secondary); text-decoration: none; padding: 4px 0; }
.footer a:hover { color: var(--text); text-decoration: underline; }

/* Windows High Contrast drops shadows, so cards and controls get a plain outline there */
@media (forced-colors: active) {
  .card, .primary, .skip, .reel-pause { border: 1px solid CanvasText; }
  .strip i { background: CanvasText; }
}

