/* Reader, portrait. Top 30%: a YouTube tile and a TikTok tile. Bottom 70%: a Kindle page.
   The black page is the Kindle's bezel. 1rem is 1/48 of the screen width (16px on a 768 wide iPad). */
@font-face { font-family: "DM Sans"; src: url(fonts/DMSans.woff2) format("woff2"); font-weight: 100 1000; font-display: block; }

:root {
  --ui: "DM Sans", -apple-system, "Helvetica Neue", sans-serif;
  --book: Charter, "Iowan Old Style", Georgia, serif;
  --eink: #efede6; --eink-ink: #17171a; --eink-dim: #67655f;
  --text: #f4f1ea; --dim: rgba(244,241,234,.6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 2.0833vw; }
html, body { height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--ui); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

.screen { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }

/* ---------- shorts ---------- */
.feeds { position: absolute; left: 0; right: 0; top: 0; height: 30%; display: -webkit-flex; display: flex;
  padding: 1rem 1rem 0.75rem; padding-top: max(1rem, env(safe-area-inset-top)); }
.tile { -webkit-flex: 1 1 0; flex: 1 1 0; min-width: 0; display: -webkit-flex; display: flex; }
.tile + .tile { margin-left: 1rem; }
.frame { position: relative; overflow: hidden; border-radius: 0.75rem; background: #111; }
.frame.tall { height: 100%; aspect-ratio: 9 / 16; -webkit-flex: none; flex: none; }
.slot, .slot iframe, iframe#yt-slot { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; }

.info { -webkit-flex: 1 1 auto; flex: 1 1 auto; min-width: 0; padding-left: 0.75rem; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; }
.brand { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; height: 1.25rem; margin-bottom: 0.75rem; }
.brand b { font: 700 1rem/1 var(--ui); letter-spacing: -0.02em; }
.yt-mark { width: 1.75rem; height: 1.25rem; margin-right: 0.375rem; }
.tt-mark { width: 1.25rem; height: 1.25rem; margin-right: 0.375rem; overflow: visible; }
.handle { font: 700 0.9375rem/1.3 var(--ui); }
.cap { margin-top: 0.25rem; font: 500 0.875rem/1.4 var(--ui); color: rgba(244,241,234,.86);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.nav { margin-top: auto; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.step { width: 2.75rem; height: 2.75rem; margin-right: 0.5rem; border: 0; border-radius: 1.375rem; background: rgba(244,241,234,.12); color: var(--text);
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; cursor: pointer; }
.step:active { background: rgba(244,241,234,.24); }
.step svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.count { margin-left: 0.25rem; font: 500 0.8125rem/1 var(--ui); color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---------- Kindle ---------- */
.kindle { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; top: 30%; background: var(--eink); color: var(--eink-ink);
  border-radius: 0.375rem; overflow: hidden; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), inset 0 0.25rem 0.75rem rgba(0,0,0,.08); }
.k-head, .k-foot { -webkit-flex: none; flex: none; font: 500 0.8125rem/1 -apple-system, "Helvetica Neue", sans-serif; color: var(--eink-dim); }
.k-head { padding: 1rem 3rem 0; text-align: center; font-weight: 600; }
.k-foot { padding: 0 3rem 1rem; display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; font-variant-numeric: tabular-nums; }
.k-page { position: relative; -webkit-flex: 1 1 auto; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; margin: 1rem 0 0.75rem; padding: 1rem 3rem 2rem; }
.k-page::-webkit-scrollbar { display: none; }
.k-page { -webkit-mask-image: linear-gradient(transparent, #000 1rem, #000 calc(100% - 1.5rem), transparent); mask-image: linear-gradient(transparent, #000 1rem, #000 calc(100% - 1.5rem), transparent); }
.k-page p { font: 400 1.3125rem/1.45 var(--book); text-align: justify; -webkit-hyphens: auto; hyphens: auto; text-indent: 1.5em; }
.k-page p.first, .k-page p.cont { text-indent: 0; }
.k-page h1 { margin: 3rem 0 2.5rem;  text-align: center; font: 400 2.75rem/0.95 var(--book); letter-spacing: -0.01em; }
.k-page h1 small { display: block; margin-bottom: 1rem; font: 400 0.9375rem/1 var(--book); letter-spacing: 0.12em; text-transform: uppercase; color: var(--eink-dim); }
.k-page p.first:first-letter { float: left; font-size: 3.6em; line-height: 0.8; padding: 0.06em 0.08em 0 0; }

.ink { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: #000; opacity: 0; pointer-events: none; }
.ink.dark { opacity: 1; }
.ink.light { opacity: 1; background: var(--eink); }
