/* An essay: a back link, the title, then date and player on a ruled line, then the text. */
:root { --up: rgba(0, 0, 0, .3); }
.reading-page { --col: 600px; }

.back { padding-top: 96px; }
.back a { color: var(--mute); }
.back a:hover { color: var(--fg); }

.essay { padding-top: 80px; padding-bottom: 160px; }
.text h1 { font: 500 18px/24px Inter, system-ui, sans-serif; letter-spacing: -.2px; }
.text .sub { font-size: 18px; line-height: 24px; letter-spacing: -.2px; color: var(--mute); }
.side { display: flex; justify-content: space-between; align-items: start; gap: 24px; margin-top: 24px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.side .date { color: var(--mute); font-variant-numeric: tabular-nums; }
.body { margin-top: 40px; font-size: 15px; line-height: 24px; letter-spacing: -.1px; }
.body p + p { margin-top: 24px; }

/* narration: what's still to come dims, the word being spoken firms up */
.w { transition: color .18s ease, text-shadow .12s ease; }
.reading .w.up { color: var(--up); }
.reading .sub .w.up { color: #d0d0d0; }
.reading .w.now { text-shadow: 0 0 .45px currentColor, 0 0 .45px currentColor; }

.player { display: grid; justify-items: end; row-gap: 8px; font-variant-numeric: tabular-nums; }
.p-row { display: flex; gap: 14px; }
.p-play { display: inline-flex; align-items: center; gap: 7px; }
.p-play svg { width: 7px; height: 9px; fill: currentColor; flex: none; }
.p-play[data-state="play"] .i-pause, .p-play[data-state="pause"] .i-play { display: none; }
.p-time { color: var(--mute); }
.p-rate { color: var(--mute); }
.p-rate:hover { color: var(--fg); }
.p-track { position: relative; width: 180px; height: 12px; cursor: pointer; touch-action: none; }
.p-track::before, .p-fill { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.p-fill { background: var(--fg); transform-origin: 0 50%; transform: scaleX(0); }
.p-track:focus-visible { outline-offset: 2px; }
.player:not(.on) .p-track, .player:not(.on) .p-rate { display: none; }

@media (max-width: 640px) {
  .back { padding-top: 56px; }
  .essay { padding-top: 56px; }
  /* once it's playing, the player waits at the bottom edge */
  .player.live {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    padding: 14px var(--pad) calc(16px + env(safe-area-inset-bottom));
    background: var(--bg); box-shadow: 0 -1px 0 var(--line);
    justify-items: stretch;
  }
  .player.live .p-track { width: auto; }
  .player.live .p-rate { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .w { transition: none; } }
