/* site.css — Readaria's own pages, on top of house.css: the faces served
   from here (nothing is fetched from anyone else), the bar, the pictures,
   the parts, the questions and the last call to download. */

@font-face { font-family: Literata; src: url(/assets/fonts/literata.woff2) format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: Literata; src: url(/assets/fonts/literata-italic.woff2) format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }

/* the stage of the release, set on <html>: only the words and buttons for that stage are shown */
[data-stage="preview"] .when-live { display: none !important; }
[data-stage="live"] .when-preview, html:not([data-stage]) .when-preview { display: none !important; }

/* the foot stands at the bottom of the window on a short page */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > * { width: 100%; }
body > .foot { margin-top: auto; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
:target { scroll-margin-top: var(--s3); }
.btn { border-radius: 6px; }
.btn svg { flex: none; }
.btn.small { padding: 10px 16px; font-size: 15px; }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.dark:hover { background: var(--ink); opacity: .86; }
.plain { color: var(--ink); text-underline-offset: 3px; padding: 12px 0; }
.plain:hover { color: var(--link); }

/* the bar: the name with its icon, and the few places to go. Top and bottom
   padding only: the sides are the wrap's gutter, on a phone as anywhere */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s2); padding-top: 18px; padding-bottom: 18px; }
.bar .name { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 22px; }
.bar .name img { width: 36px; height: 36px; }
/* the icon is a white sheet: on a white page it needs its edge drawn */
.bar .name img, .get img { filter: drop-shadow(0 1px 2px rgba(20, 22, 30, .28)); }
.bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) 28px; font-size: 15px; }
.bar nav a:not(.btn) { text-decoration: none; padding: 12px 0; }
.bar nav a:not(.btn):hover { color: var(--link); }
@media (max-width: 600px) { .bar nav .wide { display: none; } }

/* the head of the home page */
.hero { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; padding-top: 56px; }
.hero h1 { font-size: clamp(46px, 7vw, 92px); line-height: 1.04; }
.hero .lede { max-width: 720px; font-size: clamp(20px, 2.4vw, 24px); line-height: 1.4; color: var(--ink); }
.acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s1) var(--s3); }
.hero .acts { margin-top: var(--s1); }
/* the line under the buttons has one wording for each stage: the second is not a paragraph after the first */
.label + .label { margin-top: 0; }
/* what sets the app apart, said plainly under the download: in the reading face, and on one line
   wherever one will fit (the size gives a little as the window narrows) */
.hero .pledge { font-family: var(--serif); font-style: italic; font-size: clamp(15px, 2.35vw, 19px); line-height: 1.45; color: var(--ink); }

/* no line ends on a stranded word: headings and short lines break evenly, paragraphs avoid a lone last word */
h1, h2, .lede, .pledge, .label, .asks dt { text-wrap: balance; }
p, dd { text-wrap: pretty; }

/* a Mac cannot be downloaded to from a phone or a tablet: there the button sends the link on */
.for-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .for-mac { display: none; }
  .for-touch { display: inline-flex; }
}

/* a picture of the app */
.shot { border-radius: 10px; overflow: hidden; outline: 1px solid var(--line); box-shadow: 0 18px 50px rgba(20, 22, 30, .14); background: var(--panel); }
.shot img { width: 100%; }
.hero .shot { width: 100%; margin-top: var(--s3); }

/* the parts: words beside a picture, the sides taking turns */
.parts { display: flex; flex-direction: column; gap: 112px; padding-top: 112px; }
.part { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 56px; align-items: center; }
.part.turn { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.part.turn .words { order: 2; }
.part h2, .tint h2, .asks h2 { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -.01em; }
.part h2 { margin-bottom: var(--s2); }
.part .words p { font-size: 18px; line-height: 1.6; }
.part .words p + p { font-size: 16px; color: var(--dim); }
.part .shot { border-radius: 8px; box-shadow: 0 12px 36px rgba(20, 22, 30, .10); }

/* a band on the grey of the app's desk */
.tint { background: var(--panel); margin-top: 112px; }
.tint .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 56px; row-gap: var(--s2); align-items: center; padding-top: 72px; padding-bottom: 72px; }
.tint p { font-size: 18px; line-height: 1.6; }

/* the questions asked before a download */
.asks { padding-top: 112px; }
.asks h2 { margin-bottom: var(--s4); }
.asks dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s4) 56px; }
.asks dt { font-size: 18px; font-weight: 600; margin-bottom: var(--s1); }
.asks dd { color: var(--dim); }

/* the last call */
.get { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; padding-top: 72px; padding-bottom: 96px; }
.get img { width: 104px; height: 104px; }
.get h2 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.1; letter-spacing: -.012em; }
.get .small { max-width: 640px; font-size: 15px; }

/* a narrow window or a tablet held upright: one column, the words above their picture */
@media (max-width: 760px) {
  .hero { padding-top: var(--s4); }
  .parts { gap: var(--s5); padding-top: var(--s5); }
  .part, .part.turn, .tint .wrap { grid-template-columns: minmax(0, 1fr); row-gap: var(--s3); }
  .part.turn .words { order: 0; }
  .tint { margin-top: var(--s5); }
  .tint .wrap { padding-top: 48px; padding-bottom: 48px; }
  .asks { padding-top: var(--s5); }
  .get { padding-top: 48px; padding-bottom: 72px; }
}
/* a phone: the buttons run the width, and the pictures are shown larger */
@media (max-width: 560px) {
  .hero { align-items: stretch; }
  .hero .btn { justify-content: center; }
  /* a whole Mac window is too small to read at this width: each picture is shown larger, from its near corner */
  .shot { aspect-ratio: 3 / 2; }
  .shot img { width: 170%; max-width: none; }
  /* a picture whose point is at its far side is shown from that side */
  .shot.far img { margin-left: -70%; }
  /* and one whose point is in its middle, the quote card, is shown whole from there */
  .shot.mid img { width: 122%; margin-left: -11%; margin-top: -6.5%; }
  .hero .shot { aspect-ratio: 1 / 1; }
  /* the large picture is shown from where the article's sheet begins, wide enough for its title to be whole */
  .hero .shot img { width: 185%; margin-left: -48%; margin-top: -7%; }
}

/* a page of words: the guide, privacy, a page that is not there */
.page { max-width: 760px; padding-top: var(--s5); padding-bottom: var(--s6); }
.page h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: var(--s2); }
.page > .label { margin-bottom: var(--s4); }
.page h2 { margin: var(--s5) 0 var(--s2); }
.page h2:first-of-type { margin-top: var(--s4); }
.page p a, .page li a { color: var(--link); }
.page ol { list-style: none; counter-reset: n; display: grid; gap: var(--s3); }
.page ol li { counter-increment: n; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); }
.page ol li::before { content: counter(n); color: var(--faint); font-variant-numeric: tabular-nums; }
.page ol li strong { display: block; font-weight: 600; }
.page ol li span { color: var(--dim); }

/* the page a shared article lands on: the article as a sheet on the desk, and the app beside it */
body.desk { background: var(--panel); }
.sent { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; align-items: start; padding-top: var(--s4); padding-bottom: 72px; }
.sheet { background: var(--bg); border-radius: 8px; padding: 48px; box-shadow: 0 12px 36px rgba(20, 22, 30, .10); display: flex; flex-direction: column; gap: 20px; }
.sheet h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; overflow-wrap: anywhere; }
.sheet .from { font-family: var(--serif); font-style: italic; color: var(--dim); }
.sheet .acts { justify-content: flex-start; margin-top: 12px; }
.about { display: flex; flex-direction: column; gap: 20px; }
.about h2 { font-size: 28px; margin-top: var(--s1); }
.about .acts { justify-content: flex-start; }
.about .shot { border-radius: 8px; box-shadow: 0 12px 36px rgba(20, 22, 30, .10); aspect-ratio: auto; }
.about .shot img { width: 100%; margin: 0; }
.foot.slim { padding: 28px 0; }
.foot.slim .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; }
.foot.slim .mark { font-size: 28px; line-height: 1; }
.foot.slim .links { margin-top: 0; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .sent { grid-template-columns: minmax(0, 1fr); gap: var(--s4); padding-top: var(--s2); }
  .sheet { padding: 28px 24px; }
}
