/* ==========================================================================
   BASE: colors, fonts, paper textures, reset, page chrome.
   Change the palette here and it changes everywhere.
   ========================================================================== */

:root {
  --black: #000;
  --kraft: #bb8650;
  --kraft-d: #8c5d31;
  --kraft-l: #dcb07c;
  --cream: #f1e7cc;
  --cream-d: #e0d2ae;
  --ink: #1b1713;
  --ink-2: #4b4136;
  --char: #2a2622;
  --taupe: #8a7358;
  --brown: #5a4330;
  --red: #c8362b;
  --red-d: #9e231b;
  --mustard: #f0b323;
  --mint: #a8d2bc;
  --blue: #bcd3e6;
  --pink: #efb8c1;

  --f-display: 'Playfair Display', 'Didot', 'Bodoni 72', Georgia, serif;
  --f-sc: 'Cormorant SC', 'Playfair Display', Georgia, serif;
  --f-body: 'Libre Caslon Text', 'Baskerville', Georgia, serif;
  --f-type: 'Special Elite', 'Courier New', monospace;
  --f-hand: 'Reenie Beanie', 'Bradley Hand', 'Segoe Print', cursive;
  --f-script: 'Mrs Saint Delafield', 'Snell Roundhand', cursive;
  --f-gothic: 'Pirata One', 'Old English Text MT', Georgia, serif;
  --f-deco: 'Cinzel Decorative', 'Cinzel', 'Playfair Display', Georgia, serif;
  --f-fell: 'IM Fell English', 'Libre Caslon Text', Georgia, serif;
  --f-cond: 'Bebas Neue', 'Oswald', 'Arial Narrow', sans-serif;

  /* Paper grain and kraft fibers, drawn once as tiny SVGs so there are no image files. */
  --grain: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .07 0 0 0 0 .04 0 0 0 .2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibers: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.01 .22' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .14 0 0 0 0 .05 0 0 0 .3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  background: var(--black);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--black);
  color: var(--cream);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }
.book :focus-visible { outline: 3px solid #0a58ca; outline-offset: 2px; border-radius: 2px; }

kbd {
  font-family: var(--f-type);
  font-size: .92em;
  border: 1.5px solid currentColor;
  border-radius: .25em;
  padding: 0 .35em;
  margin: 0 .1em;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.hand { font-family: var(--f-hand); font-weight: 400; line-height: 1; }

.noscript { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; padding: 2rem; background: #000; color: var(--cream); text-align: center; font-size: 1.1rem; }

/* --- Small links that live outside the book (Fast Lane, Motion) --- */
.chrome {
  position: fixed;
  z-index: 20;
  display: flex;
  gap: .5rem;
  font-family: var(--f-type);
  font-size: .86rem;
}
.chrome-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0 .85rem;
  border: 1px solid rgba(241, 232, 210, .38);
  border-radius: 99px;
  background: rgba(0, 0, 0, .6);
  color: var(--cream);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chrome-link:hover { background: var(--cream); color: var(--ink); border-color: var(--cream); }

/* Reduced motion: either the system asks for it or the visitor switched Motion off. */
html.still *, html.still *::before, html.still *::after {
  animation-duration: .001s !important;
  animation-delay: 0s !important;
  transition-duration: .001s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
    transition-delay: 0s !important;
  }
}

/* --- Recruiter toast: sits next to the Fast Lane link and points at it --- */
.chrome-link.is-close {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}
.chrome-link.is-close:hover {
  background: #e6e6e6;
  border-color: #e6e6e6;
  color: #000000;
}
.chrome-link.is-fast { background: var(--red); border-color: var(--red); color: #fff7e6; }
.chrome-link.is-fast:hover { background: #fff7e6; color: var(--red-d); border-color: #fff7e6; }

.toast {
  position: fixed; z-index: 30;
  width: min(21rem, calc(100vw - 1.6rem));
  padding: .95rem 1rem .85rem;
  background: #f3ead0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--char);
  border-left: .45rem solid var(--red);
  box-shadow: .3rem .35rem 0 rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(.6rem) rotate(.6deg);
  transition: opacity .35s, transform .35s;
  font-family: var(--f-body);
}
.toast.show { opacity: 1; transform: translateY(0) rotate(-.5deg); }
.toast[hidden] { display: none; }
html[data-mode='spread'] .toast { right: 1.3rem; bottom: 3.7rem; }
html[data-mode='single'] .toast { right: .7rem; top: 3rem; }
.toast::after {
  content: ''; position: absolute; right: var(--tail-right, 9.8rem); width: .9rem; height: .9rem;
  background: #f3ead0; transform: rotate(45deg);
}
html[data-mode='spread'] .toast::after { bottom: -.45rem; box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35); }
html[data-mode='single'] .toast::after { top: -.45rem; box-shadow: -1px -1px 0 rgba(0, 0, 0, 0.35); }
.toast-t { margin: 0 0 .15rem; font-family: var(--f-gothic); font-size: 1.75rem; line-height: 1; color: var(--red-d); }
.toast-b { margin: 0 0 .7rem; font-size: .9rem; line-height: 1.45; }
.toast-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.toast-go {
  display: inline-flex; align-items: center; min-height: 2.2rem; padding: 0 .9rem;
  background: var(--red); color: #fff7e6; text-decoration: none;
  font-family: var(--f-sc); font-weight: 600; letter-spacing: .1em; font-size: .95rem;
}
.toast-go:hover { background: var(--red-d); }
.toast-no { min-height: 2.2rem; border: 0; background: none; padding: 0 .1rem; color: var(--brown); font: inherit; font-size: .84rem; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.toast-no:hover { color: var(--char); }
@media (max-width: 580px) {
  .chrome { font-size: 0.78rem; gap: 0.35rem; }
  .chrome-link { min-height: 1.8rem; padding: 0 0.65rem; }
  html[data-mode='single'] .chrome { top: 0.4rem; right: 0.5rem; }
  html[data-mode='single'] .toast { right: .5rem; top: 2.6rem; }
  .toast { padding: .75rem .85rem .7rem; }
  .toast-t { font-size: 1.45rem; }
  .toast-b { font-size: .82rem; margin-bottom: .5rem; }
  .toast-go { min-height: 1.9rem; padding: 0 .75rem; font-size: .85rem; }
  .toast-no { font-size: .8rem; }
}
@media (max-height: 480px) { html[data-mode='single'] .toast { top: 2.6rem; } }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
html.still .toast { transition: none; }
