/* Little Things online reader. Warm paper, navy ink, gold accents, deep green for part openers. Light only, like the print book. */
:root {
  --paper: #faf6ee;
  --paper-2: #f2ebdd;
  --ink: #1f2638;
  --ink-2: #4a4f60;
  --gold: #9a7a3c;
  --gold-soft: #d9c79c;
  --green: #1d362f;
  --cream: #e9dfc4;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
  /* type unit: 1px at the default text size, scales with the reader's text size settings */
  --u: calc(1rem / 16);
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* iPhone/iPad: follow the system Text Size (Dynamic Type) setting. Default body size there is 17px. */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
  :root { --u: calc(1rem / 17); }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: calc(21 * var(--u)); line-height: 1.62; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(ellipse 70% 40% at 100% 0%, rgba(240, 211, 140, .28), transparent 70%); background-repeat: no-repeat; min-height: 100vh; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(250, 246, 238, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid rgba(154, 122, 60, .18);
  padding-top: env(safe-area-inset-top, 0px); }
.bar-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px max(18px, env(safe-area-inset-right, 0px)) 12px max(18px, env(safe-area-inset-left, 0px)); }
.home { font-family: var(--display); font-weight: 600; font-size: calc(21 * var(--u)); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.where { flex: 1; text-align: center; font-family: var(--sans); font-size: calc(12 * var(--u)); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tocbtn { font: 500 calc(13 * var(--u)) var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: transparent; border: 1px solid rgba(31, 38, 56, .25); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.tocbtn:hover { background: var(--paper-2); }
.progress { height: 2px; background: transparent; position: absolute; left: 0; right: 0; bottom: -1px; }
.progress i { display: block; height: 100%; background: var(--gold-soft); }

/* contents drawer */
.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(31, 38, 56, .35); display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-in { width: min(420px, 100%); height: 100%; overflow-y: auto; background: var(--paper); padding: calc(18px + env(safe-area-inset-top, 0px)) 26px 40px; box-shadow: -20px 0 40px -20px rgba(0, 0, 0, .3); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; font: 500 calc(13 * var(--u)) var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.close { background: none; border: 0; font-size: calc(22 * var(--u)); cursor: pointer; color: var(--ink); padding: 6px; }
.pdf { display: inline-block; margin-top: 22px; font: 400 calc(15 * var(--u)) var(--sans); color: var(--gold); }

.toc { list-style: none; padding: 0; margin: 0; font-size: calc(19 * var(--u)); line-height: 1.4; }
.toc li { margin: 0; }
.toc a { display: flex; gap: 12px; padding: 7px 0; text-decoration: none; border-bottom: 1px solid rgba(154, 122, 60, .14); }
.toc a:hover { color: var(--gold); }
.toc a[aria-current="page"] { color: var(--gold); font-style: italic; }
.toc .toc-part > a { font-family: var(--display); font-weight: 600; font-size: calc(22 * var(--u)); margin-top: 12px; flex-direction: column; gap: 0; border: 0; padding-bottom: 2px; }
.toc .toc-part > a span { font: 400 calc(11 * var(--u)) var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.toc ol { list-style: none; padding: 0 0 0 4px; margin: 0; }
.toc .d { font: 400 calc(13 * var(--u)) var(--sans); color: var(--gold); width: 20px; flex: none; padding-top: 4px; font-variant-numeric: tabular-nums; }

/* reading column */
.sheet { max-width: 640px; margin: 0 auto; padding: 48px max(22px, env(safe-area-inset-right, 0px)) 24px max(22px, env(safe-area-inset-left, 0px)); }
.kicker { font: 400 calc(12.5 * var(--u)) var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--gold); text-align: center; }
h1 { font-family: var(--display); font-weight: 500; font-size: clamp(calc(42 * var(--u)), 9vw, calc(58 * var(--u))); line-height: 1.05; text-align: center; margin: 12px 0 0; text-wrap: balance; overflow-wrap: break-word; }
h1.big { letter-spacing: .1em; text-transform: uppercase; font-size: clamp(calc(44 * var(--u)), 11vw, calc(72 * var(--u))); }
.pair { text-align: center; font-style: italic; color: var(--gold); margin-top: 4px; }
.verse { margin: 30px auto 34px; padding: 26px 0 0; text-align: center; border-top: 1.5px solid var(--gold-soft); max-width: 520px; position: relative; }
.verse::before { content: ""; position: absolute; top: -1.5px; left: 50%; width: 60px; margin-left: -30px; height: 1.5px; background: var(--gold); }
.verse p { font-style: italic; font-size: calc(24 * var(--u)); line-height: 1.5; margin: 0; }
.verse cite { display: block; margin-top: 12px; font: 300 calc(12.5 * var(--u)) var(--sans); font-style: normal; letter-spacing: .24em; text-transform: uppercase; color: #8a7d62; }
.sheet > p { margin: 0 0 18px; }
.lead::first-line { font-variant: small-caps; letter-spacing: .04em; }
.band { display: block; width: 100%; height: auto; margin: 18px 0 26px; }
.box { border-top: 1.5px solid var(--gold-soft); padding-top: 16px; margin-top: 26px; }
.box h2 { font: 400 calc(12.5 * var(--u)) var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.box p { margin: 0; }
.sheet > .prayer, .sheet > .closeline { font-style: italic; text-align: center; color: #3a4155; margin: 38px auto 0; max-width: 460px; }
.moves { list-style: none; padding: 0; margin: 6px 0 20px; }
.moves li { margin-bottom: 6px; }
.moves b { font-family: var(--display); font-weight: 600; font-size: calc(25 * var(--u)); color: var(--gold); }

/* part openers: a slightly deeper linen than the reading pages, like the cover, with a warm glow from the top */
body.part { background: #efe6d4; color: var(--ink);
  background-image: radial-gradient(ellipse 70% 45% at 50% 0%, rgba(241, 215, 154, .45), transparent 70%); }
body.part .bar { background: rgba(239, 230, 212, .92); }
body.part .verse { border-color: var(--gold-soft); }
body.part .sheet { padding-top: 70px; }
.partintro { text-align: center; color: var(--ink-2); font-size: calc(21 * var(--u)); max-width: 520px; margin: 0 auto 30px; }
.days { list-style: none; padding: 0; margin: 0 auto; max-width: 420px; }
.days a { display: flex; gap: 16px; align-items: baseline; padding: 12px 4px; border-bottom: 1px solid rgba(154, 122, 60, .25); text-decoration: none; font-family: var(--display); font-size: calc(25 * var(--u)); }
.days a:hover { color: var(--gold); }
.days .d { font: 400 calc(12 * var(--u)) var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); width: 56px; flex: none; }

/* pager */
.pager { max-width: 640px; margin: 10px auto 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding: 0 max(22px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(22px, env(safe-area-inset-left, 0px)); }
.pg { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid rgba(154, 122, 60, .3); border-radius: 12px; text-decoration: none; min-width: 0; }
.pg:hover { border-color: var(--gold); }
.pg small { font: 400 calc(11.5 * var(--u)) var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.pg span { font-family: var(--display); font-size: calc(22 * var(--u)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg.next { text-align: right; }

/* landing: cover on the left, Start reading at the top right; on phones a small cover sits beside the title so the button shows right away */
.landing .bar-in { max-width: 1040px; }
.landing .where { visibility: hidden; }
.cover-wrap { max-width: 1040px; margin: 0 auto; padding: 40px max(22px, env(safe-area-inset-right, 0px)) 70px max(22px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 56px; row-gap: 30px; align-items: start; }
.cover { grid-column: 1; grid-row: 1 / span 2; width: 100%; aspect-ratio: 5 / 7; height: auto; box-shadow: 0 2px 4px rgba(31, 38, 56, .15), 0 30px 60px -24px rgba(31, 38, 56, .45); border-radius: 2px 5px 5px 2px; position: sticky; top: 90px; }
.hero { grid-column: 2; grid-row: 1; min-width: 0; }
.more { grid-column: 2; grid-row: 2; min-width: 0; }
.more > p { margin: 0 0 30px; }
.hero .kicker { text-align: left; }
.hero h1 { text-align: left; letter-spacing: .1em; text-transform: uppercase; font-size: clamp(calc(30 * var(--u)), 7vw, calc(60 * var(--u))); margin-top: 8px; }
.tag span { white-space: nowrap; }
.tag { text-wrap: balance; font-style: italic; color: var(--gold); font-size: calc(22 * var(--u)); margin: 6px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 10px; }
.btn { display: inline-flex; flex-direction: column; align-items: center; font: 500 calc(16 * var(--u)) var(--sans); letter-spacing: .06em; text-decoration: none; padding: 14px 28px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.btn small { font: 400 calc(12.5 * var(--u)) var(--sans); letter-spacing: .04em; opacity: .8; margin-top: 2px; }
.btn:hover { background: #2d3650; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid rgba(31, 38, 56, .3); }
.btn.ghost:hover { background: var(--paper-2); }
.btn[hidden] { display: none; }
.pdflink { font: 400 calc(14 * var(--u)) var(--sans); color: var(--gold); }
.toc-h { font: 400 calc(12.5 * var(--u)) var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin: 0 0 4px; }
@media (max-width: 760px) {
  /* phones: stack the top of the home page, centered */
  .cover-wrap { grid-template-columns: minmax(0, 1fr); row-gap: 34px; padding-top: 28px; }
  .cover { grid-column: 1; grid-row: 1; justify-self: center; width: min(150px, 40vw); position: static; box-shadow: 0 1px 2px rgba(31, 38, 56, .15), 0 14px 28px -12px rgba(31, 38, 56, .45); }
  .hero { grid-column: 1; grid-row: 2; text-align: center; margin-top: -8px; }
  .hero .kicker { text-align: center; font-size: calc(11.5 * var(--u)); letter-spacing: .24em; }
  .hero h1 { text-align: center; white-space: nowrap; letter-spacing: .08em; font-size: min(calc(40 * var(--u)), 10.5vw); margin-top: 10px; }
  .tag { font-size: calc(18 * var(--u)); margin-top: 8px; }
  .actions { flex-direction: column; align-items: stretch; gap: 12px; margin: 24px auto 16px; max-width: 360px; }
  .btn { padding: 14px 22px; font-size: calc(16 * var(--u)); }
  .pdflink { display: inline-block; padding: 6px 4px; }
  .more { grid-column: 1; grid-row: 3; }
  body { font-size: calc(20 * var(--u)); }
  .where { display: none; }
  .home { flex: 1; }
}
@media (prefers-reduced-motion: no-preference) { .drawer-in { animation: slide .22s ease-out; } @keyframes slide { from { transform: translateX(30px); opacity: .6; } } }

/* PDF viewer */
.pdfview { background: #e9e2d4; }
.back { font: 500 calc(14 * var(--u)) var(--sans); letter-spacing: .06em; text-decoration: none; white-space: nowrap; }
.savebtn { text-decoration: none; }
.pages { max-width: 720px; margin: 0 auto; padding: 18px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; }
.pages img { width: 100%; height: auto; aspect-ratio: 5 / 7; background: var(--paper); box-shadow: 0 1px 2px rgba(31, 38, 56, .12), 0 12px 26px -14px rgba(31, 38, 56, .4); }
.pdfnote { text-align: center; font: 400 calc(14 * var(--u)) var(--sans); color: var(--ink-2); padding: 10px 20px 50px; margin: 0; }
@media (max-width: 760px) { .pdfview .where { display: block; } }

/* floating page control: thumb-sized pill above the home bar, hides only after a real scroll down */
.float { position: fixed; z-index: 15; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 0);
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px;
  background: rgba(31, 38, 56, .9); color: var(--paper); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px -8px rgba(31, 38, 56, .5); transition: transform .25s ease, opacity .25s ease;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.float a { color: inherit; text-decoration: none; font: 500 calc(17 * var(--u)) var(--sans); letter-spacing: .04em; border-radius: 999px; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; min-width: 56px; min-height: min(max(52px, calc(52 * var(--u))), 64px); padding: 0 1.3em; touch-action: manipulation; }
.float a:first-child { font-size: calc(22 * var(--u)); padding: 0 .8em; }
.float a:active { background: rgba(255, 255, 255, .18); }
@media (hover: hover) { .float a:hover { background: rgba(255, 255, 255, .1); } }
.float span { font: 400 calc(12 * var(--u)) var(--sans); letter-spacing: .18em; text-transform: uppercase; opacity: .7; padding: 0 4px; white-space: nowrap; pointer-events: none; }
.float { max-width: calc(100vw - 24px); }
.float.away { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .float { transition: none; } }
.pager { margin-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }

/* larger text sizes: keep the top bar on one line and the floating control compact */
.bar-in > * { min-width: 0; }
.home { font-size: min(calc(21 * var(--u)), 5.4vw); overflow: hidden; text-overflow: ellipsis; }
.tocbtn, .back { flex-shrink: 0; }
.float a { font-size: min(calc(17 * var(--u)), 21px); }
.float a:first-child { font-size: min(calc(22 * var(--u)), 27px); }
.float span { font-size: min(calc(12 * var(--u)), 14px); }
@media (max-width: 380px) { .home { letter-spacing: .08em; font-size: min(calc(19 * var(--u)), 5vw); } .tocbtn { padding: 7px 11px; } }

/* main reading button: warm gold, dark lettering, inviting */
.btn:not(.ghost) { background: linear-gradient(180deg, #e3c37c, #d3aa58); color: #1f2638; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 10px 22px -12px rgba(154, 122, 60, .75); }
.btn:not(.ghost):hover { background: linear-gradient(180deg, #e8ca88, #d8b062); }
.btn:not(.ghost):active { background: #cfa553; transform: translateY(1px); }
.btn:not(.ghost) small { color: #3a3524; opacity: 1; font-weight: 500; }
.btn .arr { display: inline-block; margin-left: .45em; transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* floating page control: frosted paper, quiet text, out of the way */
.float { background: rgba(250, 246, 238, .72); color: var(--ink-2); border: 1px solid rgba(31, 38, 56, .1);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 6px 18px -10px rgba(31, 38, 56, .35); }
.float a:active { background: rgba(31, 38, 56, .08); }
@media (hover: hover) { .float a:hover { background: rgba(31, 38, 56, .05); } }
.float span { color: var(--gold); opacity: .85; }
