/* Quire: one desk through one day, and one notebook on it. Every word is on the page; the site only holds the desk. */
@font-face { font-family: Excalifont; src: url(/quire/assets/fonts/Excalifont.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Caveat Brush"; src: url(/quire/assets/fonts/CaveatBrush.woff2) format("woff2"); font-display: block; }
@font-face { font-family: Caveat; src: url(/quire/assets/fonts/Caveat.woff2) format("woff2"); font-display: block; }
:root {
  --ink: #1f2630;            /* the tutor's blue-black */
  --pencil: #3b3936;         /* the learner's graphite */
  --red: #c2412d; --blue: #2f5fb3; --green: #2f8a57; --orange: #d4622a; --gold: #b8892c;
  --hl: rgba(246, 212, 72, 0.62);
  --paper: #f7f2e8;
  --tutor: Excalifont, "Comic Sans MS", sans-serif;
  --hand: "Nothing You Could Do", cursive;
  --head: "Caveat Brush", Caveat, cursive;
  --book: "IM Fell English", Georgia, serif;
  --caps: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --sans: Inter, -apple-system, "Helvetica Neue", sans-serif;
  --night: #120d09;
}
* { box-sizing: border-box; }
html { background: #3a2a1d; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: #211a14; background: #3a2a1d; font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, video { display: block; }

.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 20px clamp(20px, 3vw, 40px); color: #2a2018; transition: color 1.2s; pointer-events: none; }
.nav a { pointer-events: auto; text-decoration: none; }
.nav .mark { font: 400 26px/1 var(--book); }
.nav nav a { margin-left: 24px; font-size: 14px; opacity: 0.7; }
.nav nav a:hover { opacity: 1; }
body.dark .nav { color: #efe4d2; }

/* the desk, laid out by site.js so the tablet fills most of the screen */
.day { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #3a2a1d; transition: background 1.6s; }
.plate { position: absolute; left: 0; top: 0; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.8s ease; }
.scene.on { opacity: 1; }
.screen { position: absolute; z-index: 3; overflow: hidden; background: var(--paper); }
.cue { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center; font: italic 400 15px/1 var(--book); color: rgba(40, 30, 20, 0.7);
  transition: opacity 0.6s; }

/* ---- the notebook: a 900 x 1107 page, scaled onto the screen */
.book { position: absolute; left: 0; top: 0; width: 900px; height: 1107px; transform-origin: 0 0; overflow: hidden; background: var(--paper);
  font: 400 29px/1.42 var(--tutor); color: var(--ink); }
.book::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(60, 50, 40, 0.26) 1.3px, transparent 1.7px);
  background-size: 37px 37px; background-position: 18px 22px; }
.light { position: absolute; inset: 0; z-index: 20; mix-blend-mode: multiply; pointer-events: none; opacity: 0; transition: opacity 1.8s; background-size: 100% 100%; }
.light.on { opacity: 0.82; }
.flash { position: absolute; inset: 0; z-index: 21; background: #1b1814; opacity: 0; pointer-events: none; }
.flash.go { animation: eink 0.34s ease-out; }
@keyframes eink { 0% { opacity: 0; } 25% { opacity: 0.22; } 45% { opacity: 0.05; } 100% { opacity: 0; } }

.page { position: absolute; inset: 0; z-index: 1; display: none; }
.page.on { display: block; }
.page header { position: absolute; left: 62px; right: 56px; top: 40px; height: 70px; }
.page header .title { position: absolute; left: 0; top: 4px; font: 400 32px/1 Caveat, var(--head); color: #6f6a63; }
.dots { position: absolute; right: 0; top: 6px; display: flex; align-items: center; }
.dots i { position: relative; width: 17px; height: 17px; border-radius: 50%; border: 2px solid #9a948c; margin-left: 74px; }
.dots i:first-child { margin-left: 0; }
.dots i + i::before { content: ""; position: absolute; right: 15px; top: 6px; width: 72px; height: 2px; background: #b9b2a8; }
.dots i.done { border-color: var(--red); background: var(--red); }
.dots i.now { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 4px rgba(212, 98, 42, 0.22); }
.dots i.done + i::before, .dots i.now::before { background: var(--red); }
.page header .chap { position: absolute; right: 0; top: 34px; font: 400 27px/1 Caveat, var(--head); color: var(--orange); white-space: nowrap; }
.page .folio { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; font: 400 24px/1 Caveat, var(--head); color: #8a837a; }
.flow { position: absolute; left: 74px; right: 70px; top: 128px; }

/* blocks of the page */
.b { position: relative; margin: 0 0 24px; }
.b.me { font: 400 32px/1.48 var(--hand); color: var(--pencil); padding-left: 8px; transform: rotate(-0.5deg); transform-origin: 0 50%; }
.b.me::before { content: ""; position: absolute; left: -26px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: rgba(59, 57, 54, 0.18); }
.b.h { font: 400 46px/1.1 var(--head); color: var(--ink); margin-bottom: 18px; }
.b.ask { color: var(--red); }
.b.ask::before { content: "✎"; position: absolute; left: -40px; top: 0; font-size: 28px; color: var(--red); }
.b.aside { margin-left: 330px; font: 400 26px/1.35 var(--tutor); color: #6d6862; }
.b.aside::before { content: "↳ "; color: var(--orange); }
.b.center { text-align: center; }
.b.small { font-size: 26px; }
.c { opacity: 0; }
.go .c { animation: ink 0.42s ease-out forwards; animation-delay: var(--d); }
.done .c { opacity: 1; animation: none; }
@keyframes ink { 0% { opacity: 0; filter: blur(2.2px); } 60% { opacity: 0.9; } 100% { opacity: 1; filter: none; } }
.hl { background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 62% / 0% 58%; border-radius: 6px; padding: 0 2px; margin: 0 -2px; }
.go .hl { transition: background-size 0.7s ease-out; transition-delay: var(--hd); background-size: 100% 58%; }
.done .hl { background-size: 100% 58%; transition: none; }
.r { color: var(--red); } .bl { color: var(--blue); } .g { color: var(--green); } .o { color: var(--orange); } .gr { color: #7a746c; }
.strike { position: relative; }
.strike::after { content: ""; position: absolute; left: -4px; right: -4px; top: 52%; height: 3px; background: var(--pencil); transform: scaleX(0); transform-origin: 0 50%;
  border-radius: 2px; }
.go .strike::after { transition: transform 0.35s; transition-delay: var(--hd); transform: scaleX(1) rotate(-2deg); }
.done .strike::after { transform: scaleX(1) rotate(-2deg); }

.fig { position: relative; display: block; margin: 6px auto 22px; overflow: visible; }
.fig text { font-family: var(--tutor); fill: var(--ink); }
.fig .lbl { opacity: 0; transition: opacity 0.5s; }
.fig .lbl.on { opacity: 1; }
.fig .wash { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.8); transition: opacity 1.6s ease-out, transform 1.8s ease-out; mix-blend-mode: multiply; }
.fig .wash.on { opacity: 0.55; transform: none; }
canvas.fig { display: block; }
.tex { text-align: center; font-size: 44px; color: var(--ink); margin: 10px 0 26px; }
.tex .katex { font-size: 1em; }
.tex.small { font-size: 34px; }
.tex.wipe { -webkit-mask-image: linear-gradient(90deg, #000 var(--w, 0%), transparent calc(var(--w, 0%) + 10%)); mask-image: linear-gradient(90deg, #000 var(--w, 0%), transparent calc(var(--w, 0%) + 10%)); }
.note-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: visible; }

/* the title page, set like a printed book */
.titlepage { position: absolute; inset: 0; text-align: center; }
.titlepage .run { position: absolute; top: 64px; left: 0; right: 0; font: 400 22px/1 var(--caps); letter-spacing: 0.2em; color: #8b847a; }
.initial { position: absolute; left: 112px; top: 150px; width: 150px; height: 150px; }
.titlepage h1 { position: absolute; left: 290px; right: 70px; top: 150px; margin: 0; text-align: left; font: 400 84px/0.98 var(--book); color: #1d1a17; }
.titlepage .sub { position: absolute; left: 292px; top: 330px; margin: 0; text-align: left; font: italic 400 32px/1.2 var(--book); color: #5b544c; }
.titlepage .rule { position: absolute; left: 292px; top: 390px; width: 300px; height: 2px; background: #b9b0a3; }
.titlepage .rule::after { content: ""; position: absolute; left: 140px; top: -6px; width: 13px; height: 13px; background: var(--orange); transform: rotate(45deg); }
.titlepage .vignette { position: absolute; left: 80px; right: 80px; top: 430px; height: 250px; }
.titlepage .contents { position: absolute; left: 130px; right: 130px; top: 700px; text-align: left; font: 400 26px/1.5 var(--book); color: #2b2621; }
.titlepage .contents b { display: block; font: 400 22px/1 var(--caps); letter-spacing: 0.2em; color: #8b847a; margin-bottom: 14px; font-weight: 400; }
.titlepage .contents span { display: flex; gap: 14px; }
.titlepage .contents span em { font-style: normal; width: 44px; color: var(--orange); }
.titlepage .contents span i { flex: 1; border-bottom: 2px dotted #c3baae; transform: translateY(-9px); }
.titlepage .owner { position: absolute; left: 130px; right: 100px; bottom: 58px; text-align: left; font: italic 400 24px/1.3 var(--book); color: #7d766d; }
.titlepage .owner .me { font: 400 30px/1 var(--hand); color: var(--pencil); font-style: normal; margin-left: 10px; }

.seal { position: relative; display: flex; gap: 30px; align-items: center; margin: 18px 0 0 6px; }
.seal svg { flex: none; }
.seal .words { font: 400 30px/1.3 var(--book); color: #2b2621; }
.seal .words small { display: block; font: 400 20px/1.2 var(--caps); letter-spacing: 0.18em; color: var(--gold); }
.gild { animation: gild 3.6s ease-in-out infinite; }
@keyframes gild { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18) saturate(1.1); } }
.book a.inklink { color: var(--red); text-decoration: none; border-bottom: 2px solid rgba(194, 65, 45, 0.4); pointer-events: auto; }

/* after the day: the film, in the dark */
.film { background: var(--night); padding: clamp(70px, 12vh, 140px) 24px clamp(60px, 10vh, 110px); color: #e9dfcf; }
.film video { width: 100%; max-width: 1240px; margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 6px; background: #1d1610; }
.film .caption { margin: 18px 0 0; text-align: center; font: italic 400 16px/1.4 var(--book); color: rgba(233, 223, 207, 0.62); }
.colophon { background: var(--night); margin: 0; padding: 40px 24px 90px; text-align: center; font-size: 15px; color: rgba(233, 223, 207, 0.72); }
.colophon p { max-width: 720px; margin: 0 auto 10px; text-wrap: pretty; }
.colophon .fine { font-size: 13px; color: rgba(233, 223, 207, 0.5); }

@media (max-width: 759px) {
  .nav { padding: 14px 16px; }
  .nav .mark { font-size: 22px; }
  .nav nav a { margin-left: 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .scene, .light { transition: none; } .gild { animation: none; } }
