/* Moby-Dick — its own look. Scrimshaw: ink line work cut into old ivory; night scenes in pale lines on dark baleen;
   ledgers, logbooks and ship's articles in brown ink on ruled paper. Old Standard TT (a 19th-century book face with
   full Latin Extended and Cyrillic). Loaded on top of style.css; everything is scoped to html[data-book="moby"]. */
@import url('/fonts/book-moby.css');

html[data-book="moby"] {
  --old: 'Old Standard TT', 'EB Garamond', Georgia, serif;
  --iv: #ebe0c4; --ivink: #1b2228; --rust: #9a2e1f; --ledger: #f0e7cf; --rule: rgba(38, 64, 92, .22);
}
html[data-book="moby"] body[data-theme='harbor'] { --bg: #e6dbc0; --ink: #1b2228; --muted: #5a5648; --accent: #9a2e1f; --card: #f1e8d2; --line: rgba(27, 34, 40, .16); }
html[data-book="moby"] body[data-theme='inn']    { --bg: #e2d4b4; --ink: #1d1a14; --muted: #5e5442; --accent: #9a2e1f; --card: #f1e6cc; --line: rgba(29, 26, 20, .16); }
html[data-book="moby"] body[data-theme='sea']    { --bg: #12222c; --ink: #e9e1cc; --muted: #9fb0b6; --accent: #d9b25a; --card: rgba(18, 34, 44, .95); --line: rgba(233, 225, 204, .15); }
html[data-book="moby"] body[data-theme='try']    { --bg: #1d120c; --ink: #f0e2c8; --muted: #c4a888; --accent: #e8813a; --card: rgba(36, 22, 14, .95); --line: rgba(240, 226, 200, .15); }
html[data-book="moby"] body[data-theme='storm']  { --bg: #0b161d; --ink: #e3e6de; --muted: #93a5aa; --accent: #bfe3cf; --card: rgba(12, 24, 32, .95); --line: rgba(227, 230, 222, .15); }
html[data-book="moby"] body[data-theme='deep']   { --bg: #06121a; --ink: #e7e1cf; --muted: #8ea2aa; --accent: #ebe0c4; --card: rgba(9, 22, 30, .95); --line: rgba(231, 225, 207, .15); }

/* ---------- type ---------- */
html[data-book="moby"] .kicker, html[data-book="moby"] .note .k { font-family: var(--old); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; font-size: 12px; color: var(--accent); }
html[data-book="moby"] .cover h1 { font-family: var(--old); font-weight: 700; font-style: normal; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(48px, 8.6vw, 150px); line-height: .95; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
html[data-book="moby"] .cover .tag { font-family: var(--old); font-style: italic; font-size: clamp(18px, 1.05rem + .45vw, 25px); }
html[data-book="moby"] .cover .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4, 10, 14, .95) 0, rgba(4, 10, 14, .6) 34%, rgba(4, 10, 14, 0) 62%); pointer-events: none; }
html[data-book="moby"] .cover-txt { z-index: 3; }

html[data-book="moby"] .part-n { font-family: var(--old); font-weight: 700; }
html[data-book="moby"] .part h2 { font-family: var(--old); font-weight: 400; font-style: italic; font-size: clamp(42px, 6.6vw, 104px); overflow-wrap: anywhere; }
html[data-book="moby"] .part p { font-family: var(--old); font-style: italic; font-size: clamp(18px, 1rem + .35vw, 23px); max-width: 36ch; }
/* a rope laid along the top of every part header */
html[data-book="moby"] .part::before { content: ''; position: absolute; inset: 76px 0 auto 0; height: 10px; pointer-events: none; opacity: .55;
  background: repeating-linear-gradient(60deg, currentColor 0 3px, transparent 3px 8px); border-block: 1.5px solid currentColor; }

html[data-book="moby"] .h { font-family: var(--old); font-weight: 700; font-size: clamp(26px, 1.1rem + 1.1vw, 36px); text-transform: uppercase; letter-spacing: .08em; }
html[data-book="moby"] .p.drop::first-letter { font-family: var(--old); font-weight: 700; color: var(--accent); font-size: 4.3em; }

html[data-book="moby"] .q blockquote { font-family: var(--old); font-style: italic; font-weight: 400; font-size: clamp(22px, 1rem + 1.05vw, 32px); line-height: 1.4; }
html[data-book="moby"] .q.hero blockquote { font-style: normal; font-weight: 700; font-size: clamp(48px, 2rem + 4.6vw, 124px); letter-spacing: .01em; }
html[data-book="moby"] .q blockquote::before { color: var(--accent); }
html[data-book="moby"] .q figcaption i { font-family: var(--old); font-size: 16px; }
html[data-book="moby"] .q:not(.hero) blockquote { border-inline-start: 3px double var(--accent); padding-inline-start: .9em; border-inline-start-width: 6px; }

/* notes are scrimshaw plates: ivory, a scratched double rule */
html[data-book="moby"] .note { background: var(--iv); color: var(--ivink); border: 0; border-radius: 3px; position: relative;
  box-shadow: inset 0 0 0 6px var(--iv), inset 0 0 0 7.5px var(--ivink), inset 0 0 0 10px var(--iv), inset 0 0 0 11px var(--ivink), 0 26px 40px -22px rgba(0, 0, 0, .7);
  background-image: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .4), rgba(120, 90, 30, .12) 90%); padding: 2.1em 2.2em 1.9em; margin-block: 3.2em; }
html[data-book="moby"] .note .k { color: var(--rust); }
html[data-book="moby"] .note h3 { font-family: var(--old); font-weight: 700; font-size: 1.55em; color: var(--ivink); }
html[data-book="moby"] .note p { color: #2e3438; }

html[data-book="moby"] .card { border-radius: 2px; border-inline-start: 3px solid var(--accent); font-family: var(--old); font-size: 1.04em; }
html[data-book="moby"] .block-h h3 { font-family: var(--old); font-weight: 400; font-style: italic; }
html[data-book="moby"] .stat b { font-family: var(--old); font-weight: 700; font-size: clamp(32px, 1rem + 2.4vw, 56px); }
html[data-book="moby"] .theme h4, html[data-book="moby"] .more-i h4 { font-family: var(--old); font-weight: 700; font-size: 1.25em; }
html[data-book="moby"] .fin h2 { font-family: var(--old); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- x: who is on board, the ship's articles ---------- */
html[data-book="moby"] .x-cast { max-width: 50rem; margin: 3.4em auto; padding: 0 20px; }
html[data-book="moby"] .cl { background: var(--ledger); color: #22201a; padding: 1.8em clamp(16px, 3.6vw, 44px) 1.4em; border-radius: 2px;
  background-image: linear-gradient(90deg, transparent 54px, rgba(154, 46, 31, .35) 54px 55.5px, transparent 55.5px), repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px);
  box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .7); }
html[data-book="moby"] .cl-h { text-align: center; margin-bottom: 1.1em; }
html[data-book="moby"] .cl-h .kicker { color: var(--rust); }
html[data-book="moby"] .cl-h h3 { font-family: var(--old); font-style: italic; font-weight: 400; font-size: clamp(30px, 1.2rem + 1.6vw, 44px); margin: .15em 0 0; color: #1b2228; }
html[data-book="moby"] .cl-list { list-style: none; margin: 0; padding: 0; }
html[data-book="moby"] .cl-i { display: grid; grid-template-columns: 28px 40px 1fr; gap: 0 12px; padding: 12px 0 14px; border-top: 1px solid rgba(34, 32, 26, .22); align-items: start; }
html[data-book="moby"] .cl-n { font-family: var(--old); font-style: italic; color: var(--rust); font-size: 17px; text-align: end; padding-top: 3px; }
html[data-book="moby"] .cl-ic { width: 36px; height: 36px; color: #1b2228; margin-top: 1px; }
html[data-book="moby"] .cl-t h4 { font-family: var(--old); font-weight: 700; font-size: 1.22em; margin: 0; color: #1b2228; }
html[data-book="moby"] .cl-r { font-family: var(--old); font-style: italic; color: var(--rust); font-size: .98em; margin: 1px 0 4px; }
html[data-book="moby"] .cl-t p { margin: 0; color: #3d3a30; font-size: .96em; line-height: 1.5; }
html[data-book="moby"] .cl-i.moby { background: rgba(27, 34, 40, .06); }

/* ---------- x: the lay ---------- */
html[data-book="moby"] .x-lay { max-width: 44rem; margin: 3.4em auto; padding: 0 20px; }
html[data-book="moby"] .ly { background: var(--ledger); color: #22201a; padding: 1.4em clamp(16px, 3vw, 34px) 1.1em; border-radius: 2px; box-shadow: 0 24px 40px -22px rgba(0, 0, 0, .6);
  background-image: repeating-linear-gradient(transparent 0 35px, var(--rule) 35px 36px); }
html[data-book="moby"] .ly-i { display: grid; grid-template-columns: minmax(8em, 34%) 1fr auto; gap: 14px; align-items: center; padding: 9px 0; }
html[data-book="moby"] .ly-w { font-family: var(--old); font-style: italic; font-size: 1.02em; }
html[data-book="moby"] .ly-bar { height: 14px; border: 1.5px solid #1b2228; border-radius: 2px; position: relative; overflow: hidden; }
html[data-book="moby"] .ly-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: repeating-linear-gradient(60deg, #1b2228 0 2px, transparent 2px 5px); transition: width 1.4s cubic-bezier(.3, .7, .3, 1); }
html[data-book="moby"] .ly-i.me .ly-bar i { background: var(--rust); }
html[data-book="moby"] .x-lay.on .ly-bar i { width: var(--w); }
html[data-book="moby"] .x-lay.on .ly-i:nth-child(2) .ly-bar i { transition-delay: .2s; }
html[data-book="moby"] .x-lay.on .ly-i:nth-child(3) .ly-bar i { transition-delay: .4s; }
html[data-book="moby"] .x-lay.on .ly-i:nth-child(4) .ly-bar i { transition-delay: .6s; }
html[data-book="moby"] .ly-f { font-family: var(--old); font-weight: 700; font-size: 1.35em; min-width: 3.2em; text-align: end; white-space: nowrap; direction: ltr; }
html[data-book="moby"] .ly-f sup, html[data-book="moby"] .ly-f sub { font-size: .62em; }
html[data-book="moby"] .ly-i.me .ly-f { color: var(--rust); }
html[data-book="moby"] .ly-u { margin: .5em 0 0; text-align: end; font-family: var(--old); font-style: italic; color: #5a5648; font-size: .95em; }
html[data-book="moby"] .ly-t { max-width: 40rem; margin: 1.2em auto 0; }

/* ---------- x: nine ships ---------- */
html[data-book="moby"] .x-gams { max-width: 64rem; margin: 3.4em auto; padding: 0 20px; }
html[data-book="moby"] .gm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
html[data-book="moby"] .gm-i { position: relative; background: var(--card); border: 1px solid var(--line); padding: 14px 16px 16px; transition-delay: var(--d); }
html[data-book="moby"] .gm-s { width: 52px; height: 46px; color: var(--ink); float: inline-start; margin-inline-end: 10px; }
html[data-book="moby"] .gm-t h4 { font-family: var(--old); font-style: italic; font-weight: 700; font-size: 1.22em; margin: 2px 0 0; }
html[data-book="moby"] .gm-f { font: 600 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
html[data-book="moby"] .gm-i p { clear: both; margin: 10px 0 0; font-size: .95em; line-height: 1.5; color: var(--muted); }
html[data-book="moby"] .gm-i.met { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
html[data-book="moby"] .gm-i.met p { color: var(--ink); }
html[data-book="moby"] .gm-w { position: absolute; top: 10px; inset-inline-end: 10px; width: 30px; height: 30px; color: var(--iv); filter: drop-shadow(0 0 1px #000); }

/* ---------- x: the prophecy, then the same lines fulfilled ---------- */
html[data-book="moby"] :is(.x-prophecy, .x-fulfilled) { max-width: 42rem; margin: 3.4em auto; padding: 0 20px; }
html[data-book="moby"] .pr { list-style: none; margin: 0; padding: 0; counter-reset: pr; }
html[data-book="moby"] .pr-i { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px dashed var(--line); transition-delay: var(--d); }
html[data-book="moby"] .pr-i svg { width: 40px; height: 40px; color: var(--accent); }
html[data-book="moby"] .pr-i span { font-family: var(--old); font-size: 1.12em; line-height: 1.35; }
html[data-book="moby"] .pr-i em { font: 600 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1.5px solid currentColor; padding: 4px 8px; border-radius: 2px; white-space: nowrap; font-style: normal; }
html[data-book="moby"] .pr.done .pr-i em { color: #d8553f; transform: rotate(-8deg) scale(1.8); opacity: 0; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1), opacity .3s; }
html[data-book="moby"] .x-fulfilled.on .pr.done .pr-i em { transform: rotate(-8deg); opacity: 1; }
html[data-book="moby"] .x-fulfilled.on .pr-i:nth-child(2) em { transition-delay: .35s; }
html[data-book="moby"] .x-fulfilled.on .pr-i:nth-child(3) em { transition-delay: .7s; }
html[data-book="moby"] .x-fulfilled.on .pr-i:nth-child(4) em { transition-delay: 1.05s; }

/* ---------- the logbook ---------- */
html[data-book="moby"] :is(.x-log, .x-stamp) { display: block; height: 0; }
html[data-book="moby"] .ml {
  position: fixed; z-index: 40; inset-inline-end: 18px; bottom: 18px; width: 250px;
  background: var(--ledger); color: #22201a; padding: 10px 14px 10px;
  background-image: linear-gradient(90deg, transparent 10px, rgba(154, 46, 31, .3) 10px 11px, transparent 11px), repeating-linear-gradient(transparent 0 19px, var(--rule) 19px 20px);
  box-shadow: 0 18px 34px -12px rgba(0, 0, 0, .7); border-radius: 2px;
  opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; pointer-events: none;
}
html[data-book="moby"] .ml.on { opacity: 1; transform: none; }
html[data-book="moby"] .ml-t { font-family: var(--old); font-style: italic; font-size: 13px; color: var(--rust); }
html[data-book="moby"] .ml-p { display: block; font-family: var(--old); font-weight: 700; font-size: 15.5px; line-height: 1.25; margin-top: 2px; }
html[data-book="moby"] .ml-route { display: flex; align-items: center; gap: 0; margin: 8px 0 6px; }
html[data-book="moby"] .ml-route i { flex: 1; height: 1.5px; background: rgba(34, 32, 26, .25); position: relative; }
html[data-book="moby"] .ml-route i::after { content: ''; position: absolute; inset-inline-end: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--ledger); border: 1.5px solid rgba(34, 32, 26, .4); }
html[data-book="moby"] .ml-route i.past { background: #22201a; }
html[data-book="moby"] .ml-route i.past::after { background: #22201a; border-color: #22201a; }
html[data-book="moby"] .ml-route i.now { background: #22201a; }
html[data-book="moby"] .ml-route i.now::after { background: var(--rust); border-color: var(--rust); transform: scale(1.35); }
html[data-book="moby"] .ml-s { display: flex; flex-wrap: wrap; gap: 2px; min-height: 22px; }
html[data-book="moby"] .ml-s svg { width: 22px; height: 22px; color: #1b2228; opacity: .12; transition: opacity .4s, transform .4s; }
html[data-book="moby"] .ml-s svg.on { opacity: 1; }
html[data-book="moby"] .ml-s svg.lost.on { color: var(--rust); }
html[data-book="moby"] .ml-c { display: flex; gap: 14px; font: 600 10px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: #5a5648; margin-top: 3px; }
html[data-book="moby"] .ml-c b { color: #22201a; font-size: 12px; }
html[data-book="moby"] .ml.ping .ml-p { animation: mo-ping 1s; }
html[data-book="moby"] .ml.stamp .ml-s svg.on:last-of-type, html[data-book="moby"] .ml.stamp .ml-c { animation: mo-stamp .7s; }
@keyframes mo-ping { from { color: #9a2e1f; transform: translateY(-3px); } }
@keyframes mo-stamp { 0% { transform: scale(1.6); } 60% { transform: scale(.92); } }

@media (max-width: 640px) {
  html[data-book="moby"] .ml { inset-inline: 0; top: 56px; bottom: auto; width: auto; padding: 5px 12px 6px 18px; transform: translateY(-8px); border-radius: 0;
    display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center; background-image: linear-gradient(90deg, transparent 8px, rgba(154, 46, 31, .3) 8px 9px, transparent 9px); box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .6); }
  html[data-book="moby"] .ml-t, html[data-book="moby"] .ml-c { display: none; }
  html[data-book="moby"] .ml-p { font-size: 13.5px; margin: 0; grid-column: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html[data-book="moby"] .ml-route { grid-column: 1; margin: 4px 0 1px; }
  html[data-book="moby"] .ml-s { grid-column: 2; grid-row: 1 / 3; display: grid; grid-template-columns: repeat(5, 16px); gap: 0 1px; }
  html[data-book="moby"] .ml-s svg { width: 16px; height: 16px; }
  html[data-book="moby"] .gm { grid-template-columns: 1fr; }
  html[data-book="moby"] .cl-i { grid-template-columns: 22px 32px 1fr; gap: 0 9px; }
  html[data-book="moby"] .cl-ic { width: 30px; height: 30px; }
  html[data-book="moby"] .cl { background-image: repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px); }
  html[data-book="moby"] .ly-i { grid-template-columns: 1fr auto; row-gap: 4px; }
  html[data-book="moby"] .ly-bar { grid-column: 1 / 3; grid-row: 2; }
  html[data-book="moby"] .pr-i { grid-template-columns: 34px 1fr; }
  html[data-book="moby"] .pr-i svg { width: 32px; height: 32px; }
  html[data-book="moby"] .pr-i em { grid-column: 2; justify-self: start; }
  html[data-book="moby"] .q.hero blockquote { font-size: clamp(40px, 12vw, 64px); }
  html[data-book="moby"] .note { padding: 1.7em 1.4em 1.5em; }
}

/* ---------- scripts without these fonts ---------- */
html[data-book="moby"]:is([lang=zh], [lang=ja], [lang=ko], [lang=ar], [lang=hi]) { --old: var(--display); }
html[data-book="moby"]:is([lang=zh], [lang=ja], [lang=ko]) .cover h1 { font-size: clamp(30px, 7.5vw, 120px); line-height: 1.15; letter-spacing: .02em; }
html[data-book="moby"]:is([lang=ar], [lang=hi], [lang=zh], [lang=ja], [lang=ko]) :is(.kicker, .note .k, .cover h1, .h, .fin h2, .gm-f, .pr-i em, .ml-c) { letter-spacing: 0; }
html[data-book="moby"]:is([lang=ar], [lang=hi], [lang=zh], [lang=ja], [lang=ko]) :is(.part h2, .part p, .q blockquote, .block-h h3, .cover .tag, .cl-h h3, .cl-r, .cl-n, .ly-w, .ly-u, .gm-t h4, .ml-t, .q figcaption i) { font-style: normal; }
/* Serbian Cyrillic italics need Serbian letterforms (б, г, д, п, т): keep it upright */
html[data-book="moby"][lang=sr] :is(.part h2, .part p, .q blockquote, .block-h h3, .cover .tag, .cl-h h3, .cl-r, .ly-w, .ly-u, .gm-t h4, .ml-t) { font-style: normal; }
html[data-book="moby"] :is(.x-gams, .x-prophecy, .x-fulfilled, .x-lay) { overflow-x: clip; }
