/* Old German Letters page, built from Marco's pick A, "the letter and its English" (old-letters#2, arc-eng/hq#1650).
   Cream, near-black ink and burgundy, the white English card and the letter's own colours. Newsreader throughout,
   as Whole Tree Charts. Phone first; A's two halves from 900 px. Sizes at 1440 are A's own, measured in CSS px from
   the 1440-wide pick; the small print is larger than the pick, for older readers (designer's note). */
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --cream: #f9f1e4;
  --ink: #1c1611;
  --wine: #911722;
  --white: #ffffff;
  --rule: rgb(28 22 17 / 0.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.4;
}
p, h1, h2, ul, ol, figure { margin: 0; }
button, input { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
br.wide { display: none; }

/* ---------- phone: one column. Name, headline, paragraph, the button, then the letter and its card. ---------- */
main { padding: 0 20px; }
.brand { padding-top: 16px; font-size: 17px; line-height: 1.3; }
h1 { margin-top: 22px; font-weight: 400; font-size: 34px; line-height: 1.12; letter-spacing: -0.01em; }
.lede { margin-top: 14px; font-size: 19px; line-height: 1.38; }

.buy, .send {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  background: var(--wine);
  color: var(--cream);
  font-size: 21px;
  line-height: 1.2;
  padding: 0.45em 1em;
  cursor: pointer;
}
.buy:focus-visible, .send:focus-visible, .close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.send[disabled] { opacity: 0.6; cursor: default; }
.pitch .buy { margin-top: 20px; }

/* Marco's pick A: the letter in front, whole, upright with a soft shadow; the white English card behind it, slightly
   tilted, peeking out to its right and below it. The English starts just right of the letter's edge: a few lines, cut
   off, then white card. --lw is the letter's width, --cl and --cw the card's left and width, all as shares of .sheets. */
.sample { margin-top: 32px; max-width: 520px; }
.sheets { --lw: 54%; --cl: 32%; --cw: 64%; position: relative; width: 100%; aspect-ratio: 350 / 310; }
.letter {
  position: absolute; left: 0; top: 0; z-index: 1;
  width: var(--lw); height: auto;
  box-shadow: 0 2px 4px rgb(28 22 17 / 0.18), 0 10px 24px rgb(28 22 17 / 0.16);
}
.english {
  position: absolute; left: var(--cl); top: 12%;
  width: var(--cw); height: 86%;
  overflow: hidden;
  background: var(--white);
  /* padding in % is a share of .sheets' width, so the text starts 3% right of the letter's edge */
  padding: 16px 12px 0 calc(var(--lw) - var(--cl) + 3%);
  transform: rotate(4deg);
  box-shadow: 0 2px 4px rgb(28 22 17 / 0.14), 0 10px 24px rgb(28 22 17 / 0.14);
  font-size: 18px;
  line-height: 1.3;
}
.english-head { font-size: 22px; margin-bottom: 8px; }
.english-text { max-height: calc(1.3em * 7); overflow: hidden; }
.sample figcaption { margin-top: 18px; font-style: italic; font-size: 17px; line-height: 1.35; }

/* below the first screen: what you get, how it works, the second button, a thin rule and the footer */
.get ul { list-style: none; padding: 0; margin-top: 44px; counter-reset: point; }
.get li { counter-increment: point; position: relative; padding-left: 44px; min-height: 30px; }
.get li + li { margin-top: 16px; }
.get li::before {
  content: counter(point);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border: 1px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; font-size: 16px; line-height: 1;
}

.how { margin-top: 48px; }
.how h2 { font-weight: 600; font-size: 24px; line-height: 1.2; }
.how ol { list-style: none; padding: 0; margin-top: 12px; }
.how li { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.how .buy { margin-top: 28px; }

footer { margin-top: 40px; padding: 24px 0 36px; border-top: 1px solid var(--ink); text-align: center; font-size: 16px; line-height: 1.5; }
footer p + p { margin-top: 10px; }

/* ---------- after the tap: the box over the dimmed page ---------- */
.box {
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 8px;
  padding: 18px 22px 26px;
  background: var(--cream);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 20px 60px rgb(28 22 17 / 0.35);
}
.box::backdrop { background: rgb(28 22 17 / 0.66); }
.close-row { display: flex; justify-content: flex-end; }
.close { border: 0; background: none; padding: 4px 0; font-size: 20px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; cursor: pointer; }
.box h2 { margin-top: 6px; font-weight: 400; font-size: 34px; line-height: 1.12; letter-spacing: -0.005em; }
.box-line { margin-top: 12px; font-size: 20px; line-height: 1.4; }
.waitlist { margin-top: 22px; }
.waitlist input {
  display: block;
  width: 100%;
  height: 54px;
  padding: 0 0.7em;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--white);
  font-size: 20px;
}
.waitlist input::placeholder { color: rgb(28 22 17 / 0.5); }
.waitlist input:focus { outline: none; border: 2px solid rgb(28 22 17 / 0.55); padding: 0 calc(0.7em - 1px); }
.problem { margin-top: 10px; font-style: italic; font-size: 18px; }
.send { margin-top: 14px; font-size: 21px; }
.listed { margin-top: 22px; font-size: 21px; line-height: 1.4; }
.listed:focus { outline: none; }
.ask { margin-top: 16px; font-size: 17px; line-height: 1.4; }

/* ---------- desktop: A's two halves. --u is 1 px of A at 1440, at most 1 px. ---------- */
@media (min-width: 900px) {
  :root { --u: min(100vw / 1440, 1px); }
  br.wide { display: inline; }

  main { max-width: calc(1440 * var(--u)); margin: 0 auto; padding: 0 calc(77 * var(--u)); }
  .top { display: grid; grid-template-columns: calc(600 * var(--u)) 1fr; column-gap: calc(43 * var(--u)); grid-template-rows: auto 1fr; }
  .brand { grid-column: 1 / -1; padding-top: calc(19 * var(--u)); font-size: max(calc(21 * var(--u)), 16px); }
  .pitch { grid-column: 1; }
  h1 { margin-top: calc(44 * var(--u)); font-size: max(calc(58 * var(--u)), 32px); line-height: 1.16; }
  .lede { margin-top: calc(44 * var(--u)); font-size: max(calc(33 * var(--u)), 18px); line-height: 1.38; }
  .pitch .buy { width: auto; margin-top: calc(38 * var(--u)); min-height: max(calc(60 * var(--u)), 48px); padding: 0 calc(32 * var(--u)); font-size: max(calc(26 * var(--u)), 20px); border-radius: calc(6 * var(--u)); }

  .sample { grid-column: 2; margin-top: calc(32 * var(--u)); max-width: none; }
  .sheets { --lw: 56.25%; --cl: 30.8%; --cw: 62%; width: calc(640 * var(--u)); aspect-ratio: 640 / 600; }
  .english { top: 11.3%; height: 86%; padding-top: calc(40 * var(--u)); padding-right: calc(18 * var(--u)); font-size: max(calc(18 * var(--u)), 16px); }
  .english-head { font-size: max(calc(26 * var(--u)), 18px); margin-bottom: calc(14 * var(--u)); }
  .english-text { max-height: calc(1.3em * 8); }
  .sample figcaption { margin-top: calc(14 * var(--u)); max-width: calc(520 * var(--u)); font-size: max(calc(21 * var(--u)), 16px); line-height: 1.4; }

  .get { max-width: 880px; margin: 0 auto; }
  .get ul { margin-top: 88px; font-size: 24px; }
  .get li { padding-left: 60px; min-height: 40px; }
  .get li + li { margin-top: 28px; }
  .get li::before { width: 40px; height: 40px; font-size: 22px; top: -2px; }

  .how { margin-top: 76px; text-align: center; }
  .how h2 { text-align: left; font-size: 26px; }
  .how ol { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 28px; font-size: 24px; }
  .how li { border: 0; padding: 0 14px; line-height: 1.35; }
  .how li + li { border-left: 1px solid var(--ink); }
  .how .buy { width: auto; margin: 52px auto 0; min-height: 60px; padding: 0 32px; font-size: 26px; }

  footer { margin-top: 64px; padding: 32px 0 48px; font-size: 17px; }

  .box { padding: 22px 38px 34px; }
  .box h2 { margin-top: 8px; font-size: 52px; line-height: 1.1; }
  .box-line { font-size: 23px; }
}
