/* R.J. Cole free Chapter One reader. Shared by every read*.html page.
   Same midnight canvas, nav, buttons and footer as the world pages.
   Each page sets body[data-world] for its accent. Reading comes first:
   no pinning, no scroll effects, nothing the text waits on. */
:root {
  color-scheme: dark;
  --sc-canvas: #08080a; --sc-surface: #121317;
  --sc-ink: #e2e3e9; --sc-ink-soft: #9194a1;
  --sc-font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sc-font-text: "Inter", system-ui, sans-serif;
  --read-font: "Newsreader", "Iowan Old Style", Georgia, serif;
  --head: #ffffff;
  --card: #0d0e11; --card-2: #121317;
  --line: #1c1d22; --line-2: #2e3038;
  --mute: #9194a1; --dim: #5e616e; --silver: #c7c9d1;
  --gild: linear-gradient(103deg, rgb(174 147 87 / 0), rgb(174 147 87) 18%, rgb(255 240 204) 45%, rgb(174 147 87) 72%, rgb(189 157 79 / 0));
  --ease: cubic-bezier(.22, 1, .36, 1);
  --maxw: 1216px;
  --pad: clamp(20px, 5vw, 56px);
  --col: 567px;
  /* world defaults: Thornhaven */
  --accent: #E3AE62; --accent-2: #F0C27E; --glow: 240 170 90; --read-ink: #e9e2d4;
  --kick-font: var(--sc-font-text); --kick-track: .02em; --kick-case: none; --kick-size: 13px;
}
body[data-world="dragons"] {
  --accent: #8CC5BE; --accent-2: #F0C46A; --glow: 140 197 190; --read-ink: #e4e7e3;
  --kick-font: "Cinzel", Georgia, serif; --kick-track: .24em; --kick-case: uppercase; --kick-size: 12px;
}
body[data-world="oracle"] {
  --accent: #ff6b5e; --accent-2: #ff6b5e; --glow: 229 38 27; --read-ink: #e2e3e9;
  --kick-font: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; --kick-track: .08em; --kick-case: uppercase; --kick-size: 12px;
}
:root, body { --sc-accent: var(--accent); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sc-font-text); font-weight: 400; font-size: 17px; line-height: 1.55; color: var(--sc-ink);
       background: var(--sc-canvas); letter-spacing: -0.006em; overflow-x: clip; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--sc-font-display); font-weight: 400; color: var(--head); margin: 0; letter-spacing: 0.005em; text-wrap: balance; }
p { margin: 0; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons (homepage) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px;
       border-radius: 9999px; font: 500 14px/1 var(--sc-font-text); white-space: nowrap; cursor: pointer; border: 0;
       transition: transform 140ms var(--ease), background 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease); }
.btn:active { transform: scale(.97); }
.btn--white { background: #fff; color: #08080a; }
.btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
@media (hover: hover) and (pointer: fine) {
  .btn--white:hover { background: #e9e6df; }
  .btn--ghost:hover { box-shadow: inset 0 0 0 1px #777a88; }
}
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.arrow { display: inline-block; transition: transform 200ms var(--ease); }
a:hover .arrow { transform: translateX(3px); }
.tlink { color: var(--accent); font-size: 15px; font-weight: 500; }

/* chrome (homepage, verbatim) */
.announce { position: relative; z-index: 61; min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 10px;
            font-size: 13px; color: var(--silver); background: #050506; border-bottom: 1px solid var(--line); padding: 0 16px; }
.announce b { font-weight: 500; color: #fff; }
.announce a { color: #cc9166; white-space: nowrap; }
.announce .shine { background: var(--gild); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 500;
                   animation: shine 6s linear infinite; }
@keyframes shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .announce .shine { animation: none; color: #cc9166; background: none; } }
@media (max-width: 520px) { .announce { font-size: 12px; gap: 8px; } .announce .shine, .announce .ann-long { display: none; } }
.nav { position: sticky; top: 0; z-index: 60; transition: background 300ms var(--ease), box-shadow 300ms var(--ease), backdrop-filter 300ms; }
.nav.solid { background: rgb(8 8 10 / .72); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 1px 0 var(--line); }
.nav__in { height: 64px; display: flex; align-items: center; gap: 28px; }
.mark { font-family: var(--sc-font-display); font-size: 26px; color: #fff; letter-spacing: .005em; white-space: nowrap; }
.mark i { color: #cc9166; }
.nav__links { display: flex; gap: 26px; margin: 0 auto; font-size: 14px; color: var(--mute); }
.nav__links a { transition: color 160ms; padding: 6px 0; }
.nav__links a:hover, .nav__links a:focus-visible { color: #fff; }
.nav__links a[aria-current="page"] { color: #fff; box-shadow: inset 0 -1px 0 var(--accent); }
.nav__cta { display: flex; gap: 10px; }
.nav__cta .btn { height: 38px; padding: 0 18px; }
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 9999px; border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: #fff; cursor: pointer; }
.sheet { display: none; }
@media (max-width: 980px) {
  .nav__links, .nav__cta { display: none; }
  .menu-btn { display: inline-grid; place-items: center; }
  .sheet { position: fixed; inset: 100px 12px auto 12px; z-index: 59; display: grid; gap: 4px; padding: 14px; border-radius: 14px; background: rgb(14 15 18 / .96);
           -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 0 0 1px var(--line-2), 0 30px 60px -20px #000;
           opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
  .sheet.open { opacity: 1; transform: none; pointer-events: auto; }
  .sheet a { padding: 12px 10px; border-radius: 8px; font-size: 16px; color: var(--silver); }
  .sheet a[aria-current="page"] { color: #fff; background: var(--card-2); box-shadow: inset 2px 0 0 var(--accent); }
  .sheet a:hover { background: var(--card-2); color: #fff; }
  .sheet .btn { margin-top: 8px; color: #08080a; }
}

/* reading progress: a hairline of the world accent along the very top */
#progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 80; background: var(--accent);
            transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* ============================================================ CHAPTER HEAD */
.col { width: 100%; max-width: calc(var(--col) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }
.chead { position: relative; padding: clamp(48px, 8vw, 104px) 0 0; isolation: isolate; overflow-x: clip; }
.chead::before { content: ""; position: absolute; z-index: -1; left: 50%; top: -60px; width: min(1100px, 140vw); height: 520px; transform: translateX(-50%); pointer-events: none;
                 background: radial-gradient(50% 50% at 50% 30%, rgb(var(--glow) / .13), rgb(var(--glow) / .04) 55%, transparent 75%); }
.kick { font-family: var(--kick-font); font-size: var(--kick-size); letter-spacing: var(--kick-track); text-transform: var(--kick-case); font-weight: 500; color: var(--accent); }
.chead h1 { margin-top: 18px; font-size: clamp(44px, 1.6rem + 4.4vw, 84px); line-height: 1.0; letter-spacing: -0.005em; }
.chead .bookline { margin-top: 18px; max-width: 34em; font-size: clamp(17px, 1rem + .25vw, 20px); line-height: 1.5; color: var(--silver); font-weight: 300; text-wrap: pretty; }
.tools { margin-top: 32px; padding: 14px 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.tools .lab { margin-right: auto; }
.sizer button { width: 44px; height: 40px; border-radius: 9999px; border: 0; cursor: pointer; background: transparent; color: #fff;
                box-shadow: inset 0 0 0 1px var(--line-2); font-family: var(--read-font); line-height: 1;
                transition: box-shadow 160ms var(--ease), background 160ms var(--ease), transform 140ms var(--ease); }
.sizer button[data-size="-1"] { font-size: 15px; }
.sizer button[data-size="1"] { font-size: 20px; }
.sizer button:active { transform: scale(.95); }
.sizer button:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (pointer: fine) { .sizer button:not(:disabled):hover { box-shadow: inset 0 0 0 1px var(--accent); background: rgb(var(--glow) / .08); } }
.sizer { display: flex; gap: 8px; align-items: center; }
.sizer .now { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; color: var(--dim); }

/* ============================================================ THE TEXT */
.page { padding: clamp(40px, 6vw, 64px) 0 clamp(64px, 8vw, 104px); }
.reader { max-width: 27em; margin: 0 auto; font-family: var(--read-font); font-optical-sizing: auto; font-size: 21px; line-height: 1.7;
          color: var(--read-ink); font-weight: 400; letter-spacing: 0; hyphens: manual; overflow-wrap: break-word;
          font-kerning: normal; font-variant-ligatures: common-ligatures; }
.reader p { margin: 0 0 .5em; text-indent: 1.4em; text-wrap: pretty; }
.reader p:first-of-type, .reader p.sb + p { text-indent: 0; }
.reader p:first-of-type::first-letter { font-family: var(--sc-font-display); float: left; font-size: 3.9em; line-height: .84; padding: .06em .12em 0 0; color: var(--accent-2); }
.reader p.sb { text-indent: 0; text-align: center; letter-spacing: .5em; color: var(--accent); margin: 1.6em 0; }
.reader em, .reader i { font-style: italic; }
@media (max-width: 600px) { .reader { font-size: 19px; line-height: 1.66; } .reader p { text-indent: 1.2em; } }

/* ============================================================ KEEP READING */
.keep { position: relative; padding: 0 0 clamp(72px, 10vw, 128px); isolation: isolate; }
.keep__in { position: relative; max-width: 860px; margin: 0 auto; padding-top: clamp(48px, 6vw, 72px); display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center; }
.keep__in::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, rgb(var(--glow) / 0), rgb(var(--glow) / .55) 30%, rgb(var(--glow) / .55) 70%, rgb(var(--glow) / 0)); }
.keep__cover { width: 150px; border-radius: 4px; aspect-ratio: 5 / 8; object-fit: cover; height: auto;
               box-shadow: 0 30px 60px -18px #000, 0 10px 24px -10px rgb(0 0 0 / .8), 0 0 90px -10px rgb(var(--glow) / .28); }
.keep h2 { font-size: clamp(40px, 1.4rem + 2.6vw, 60px); line-height: 1; }
.keep p { margin-top: 14px; color: var(--silver); font-size: 17px; line-height: 1.55; max-width: 32em; text-wrap: pretty; }
.keep .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.keep .more { display: inline-block; margin-top: 22px; }
@media (max-width: 640px) {
  .keep__in { grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 20px; }
  .keep__cover { width: 96px; }
  .keep .actions { grid-column: 1 / -1; }
  .keep .actions .btn { flex: 1 1 100%; }
}

/* ============================================================ PLAIN PAGES (privacy, 404) */
.doc { padding: clamp(48px, 8vw, 104px) 0 clamp(72px, 10vw, 128px); }
.doc h1 { font-size: clamp(44px, 1.6rem + 4vw, 80px); line-height: 1; margin-top: 18px; }
.doc .muted { margin-top: 14px; color: var(--mute); font-size: 15px; }
.doc h2 { margin: 2.2em 0 .5em; font-size: clamp(26px, 1.2rem + 1vw, 32px); line-height: 1.15; color: #fff; }
.doc p { font-size: 17px; line-height: 1.7; color: #d4d6dd; max-width: 40em; }
.doc p + p { margin-top: 1em; }
.doc main a, .doc .prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc .back { display: inline-block; color: var(--mute); font-size: 14px; text-decoration: none !important; }
.doc .back:hover { color: #fff; }
.lost { text-align: left; }
.lost .worlds { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); }
.lost .worlds a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); text-decoration: none !important; color: #fff; }
.lost .worlds b { font-family: var(--sc-font-display); font-weight: 400; font-size: clamp(26px, 1.2rem + 1.4vw, 36px); line-height: 1.1; }
.lost .worlds span { color: var(--mute); font-size: 14px; text-align: right; }
.lost .worlds li:nth-child(1) a:hover b { color: #F0C27E; }
.lost .worlds li:nth-child(2) a:hover b { color: #8CC5BE; }
.lost .worlds li:nth-child(3) a:hover b { color: #ff6b5e; }
@media (max-width: 520px) { .lost .worlds a { flex-direction: column; gap: 4px; } .lost .worlds span { text-align: left; } }

/* footer (homepage) */
.foot { border-top: 1px solid var(--line); padding: 64px 0 40px; font-size: 14px; }
.foot__grid { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: 32px; }
.foot h4 { margin: 0 0 14px; font-family: var(--sc-font-text); font-size: 13px; font-weight: 500; color: #fff; letter-spacing: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot a { color: var(--mute); transition: color 160ms; }
.foot a:hover { color: #fff; }
.foot__base { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; color: var(--dim); font-size: 13px; }
.foot__base a { color: var(--mute); }
.foot .mark { font-size: 30px; }
.foot__blurb { margin-top: 12px; color: var(--mute); max-width: 22em; }
@media (max-width: 860px) {
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__grid > :first-child { grid-column: 1 / -1; }
}
.doc p.kick { color: var(--accent); font-size: var(--kick-size); line-height: 1.3; }
