:root {
  --theme-color: #8a2b1f;
  --gold: #c9a66b;
  --gold-bright: #f6e6c4;
  --gold-deep: #9a6b39;
  --parchment: #f4ece0;
  --ink: #1a0f0c;
  --display-font: "Cinzel Decorative", Georgia, serif;
  --heading-font: "Cinzel", Georgia, serif;
  --serif-font: "Cormorant Garamond", Georgia, serif;
  --base-font-family: Georgia, "Times New Roman", serif;
}

/* ---------- In-book content ---------- */

.markdown-section {
  max-width: 820px;
}

.markdown-section:has(.book-grid) {
  max-width: 960px;
}

.markdown-section img:not(.book-card img) {
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.sidebar-nav li.active > a {
  font-weight: 700;
}

.app-name-link {
  font-family: var(--heading-font);
  letter-spacing: 0.04em;
}

.app-name-link img {
  max-width: 100%;
}

/* ---------- Book grid ---------- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2.25rem 1.5rem;
  margin: 2.25rem auto 0;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--theme-color);
  font-family: var(--heading-font);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-decoration: none;
  transition: transform 0.18s ease;
}

.book-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
}

.book-card img {
  width: 100%;
  max-width: 220px;
  border-radius: 2px 6px 6px 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin: 0 0 0.8rem;
  transition: box-shadow 0.18s ease;
}

.book-card:hover img {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.book-card .book-title {
  max-width: 220px;
}

/* ---------- Cover / front page ---------- */

body section.cover,
body section.cover.show {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #090b12 !important;
}

section.cover .mask {
  background: none;
  opacity: 1;
}

section.cover .cover-main {
  margin: 0 auto;
  color: #d9cdba;
  /* static so the pinned h4 banner anchors to the full cover, not this box */
  position: static;
}

section.cover .cover-main > h1 {
  margin: 0 0 1.3rem;
  font-family: var(--display-font);
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1.04;
  letter-spacing: 0.03em;
  background: linear-gradient(
    180deg,
    var(--gold-bright) 0%,
    var(--gold) 52%,
    var(--gold-deep) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}

section.cover .cover-main > h1 a {
  color: transparent;
  text-decoration: none;
}

/* Universe name — pinned banner at the very top of the cover */
section.cover .cover-main h4 {
  position: absolute;
  top: clamp(1.4rem, 4vh, 2.6rem);
  left: 0;
  right: 0;
  margin: 0;
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: clamp(0.95rem, 2.2vw, 1.35rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-bright);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.6);
}

section.cover blockquote {
  border: 0;
  margin: 0 auto 1.5rem;
  max-width: 42ch;
}

section.cover blockquote p {
  font-family: var(--serif-font);
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.55rem);
  line-height: 1.5;
  color: #ece0cc;
}

section.cover blockquote strong {
  font-style: normal;
  font-weight: 600;
  color: var(--gold);
}

section.cover .cover-main ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 48ch;
  font-family: var(--base-font-family);
  font-size: 1rem;
  line-height: 1.65;
  color: #b8aa96;
}

section.cover .cover-main ul li {
  margin: 0.2rem 0;
}

section.cover hr {
  width: 84px;
  height: 1px;
  border: 0;
  margin: 1.7rem auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

section.cover .cover-main > hr + p {
  margin-top: 0.4rem;
}

section.cover .cover-main > hr + p a {
  display: inline-block;
  margin: 0.4rem 0.45rem;
  padding: 0.72rem 1.7rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: transparent;
  color: var(--gold);
  font-family: var(--heading-font);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease,
    box-shadow 0.18s ease;
}

section.cover .cover-main > hr + p a:hover {
  background: var(--gold);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(201, 166, 107, 0.35);
}

section.cover .cover-main > hr + p a:first-child {
  border-color: var(--theme-color);
  background: var(--theme-color);
  color: var(--parchment);
}

section.cover .cover-main > hr + p a:first-child:hover {
  border-color: #a8362a;
  background: #a8362a;
  color: #fff;
  box-shadow: 0 8px 26px rgba(138, 43, 31, 0.5);
}

/* Byline — beneath the action buttons */
section.cover .cover-main p.cover-byline {
  margin: 1.5rem 0 0;
  font-family: var(--heading-font);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* E-pošta signup — above social links */
section.cover .cover-main form.cover-subscribe {
  margin: 1.6rem auto 0;
  max-width: min(92vw, 420px);
  text-align: center;
}

section.cover .cover-main form.cover-subscribe .cover-subscribe-label {
  display: block;
  margin: 0 0 0.75rem;
  font-family: var(--heading-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(217, 205, 186, 0.85);
}

section.cover .cover-main form.cover-subscribe .cover-subscribe-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

section.cover .cover-main form.cover-subscribe input[type="email"] {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(201, 166, 107, 0.45);
  border-radius: 2px;
  background: rgba(8, 5, 4, 0.55);
  color: var(--parchment);
  font-family: var(--serif-font);
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

section.cover .cover-main form.cover-subscribe input[type="email"]::placeholder {
  color: rgba(217, 205, 186, 0.45);
}

section.cover .cover-main form.cover-subscribe input[type="email"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 166, 107, 0.2);
}

section.cover .cover-main form.cover-subscribe button[type="submit"] {
  flex: none;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--theme-color);
  border-radius: 2px;
  background: var(--theme-color);
  color: var(--parchment);
  font-family: var(--heading-font);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

section.cover .cover-main form.cover-subscribe button[type="submit"]:hover:not(:disabled) {
  background: #a8362a;
  border-color: #a8362a;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(138, 43, 31, 0.45);
}

section.cover .cover-main form.cover-subscribe button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: wait;
}

section.cover .cover-main form.cover-subscribe .cover-subscribe-msg {
  min-height: 1.2em;
  margin: 0.65rem 0 0;
  font-family: var(--serif-font);
  font-size: 0.95rem;
  color: rgba(217, 205, 186, 0.55);
}

section.cover .cover-main form.cover-subscribe .cover-subscribe-msg.cover-subscribe-ok {
  color: var(--gold);
}

section.cover .cover-main form.cover-subscribe .cover-subscribe-msg.cover-subscribe-err {
  color: #e08a7a;
}

@media (max-width: 480px) {
  section.cover .cover-main form.cover-subscribe .cover-subscribe-row {
    flex-direction: column;
  }

  section.cover .cover-main form.cover-subscribe button[type="submit"] {
    width: 100%;
    padding: 0.72rem 1.1rem;
  }
}

/* Social links — email, substack, x, instagram, amazon (icons via CSS masks so the
   coverpage markdown stays plain and nothing gets stripped by the parser) */
section.cover .cover-main p.cover-social {
  margin: 1.1rem 0 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

section.cover .cover-main p.cover-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(201, 166, 107, 0.4);
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--heading-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease, box-shadow 0.18s ease;
}

section.cover .cover-main p.cover-social a::before {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

section.cover .cover-main p.cover-social a.soc-mail {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1.5 5.25A2.25 2.25 0 0 1 3.75 3h16.5a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 20.25 21H3.75a2.25 2.25 0 0 1-2.25-2.25V5.25Zm2.06-.25 8.44 6.41L20.44 5H3.56ZM21 6.49l-8.56 6.5a.75.75 0 0 1-.88 0L3 6.49V18.75c0 .41.34.75.75.75h16.5c.41 0 .75-.34.75-.75V6.49Z'/%3E%3C/svg%3E");
}

section.cover .cover-main p.cover-social a.soc-substack {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22.539 8.242H1.46V5.406h21.08v2.836zM1.46 10.812V24L12 18.11 22.54 24V10.812H1.46zM22.54 0H1.46v2.836h21.08V0z'/%3E%3C/svg%3E");
}

section.cover .cover-main p.cover-social a.soc-x {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z'/%3E%3C/svg%3E");
}

section.cover .cover-main p.cover-social a.soc-instagram {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z'/%3E%3C/svg%3E");
}

section.cover .cover-main p.cover-social a.soc-amazon {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M.045 18.02c.072-.116.187-.124.348-.022 3.636 2.11 7.594 3.166 11.87 3.166 2.852 0 5.668-.533 8.447-1.595l.315-.14c.138-.06.234-.1.293-.13.226-.088.39-.046.525.13.12.174.09.336-.12.48-.256.19-.6.41-1.006.654-1.244.743-2.64 1.316-4.185 1.726a17.617 17.617 0 01-10.951-.577 17.88 17.88 0 01-5.43-3.35c-.1-.074-.151-.15-.151-.22 0-.047.021-.09.051-.13zm6.565-6.218c0-1.005.247-1.863.743-2.577.495-.71 1.17-1.25 2.04-1.615.796-.335 1.756-.575 2.912-.72.39-.046 1.033-.103 1.92-.174v-.37c0-.93-.105-1.558-.3-1.875-.302-.43-.78-.65-1.44-.65h-.182c-.48.046-.896.196-1.246.46-.35.27-.575.63-.675 1.096-.06.3-.206.465-.435.51l-2.52-.315c-.248-.06-.372-.18-.372-.39 0-.046.007-.09.022-.15.247-1.29.855-2.25 1.82-2.88.976-.616 2.1-.975 3.39-1.05h.54c1.65 0 2.957.434 3.888 1.29.135.15.27.3.405.48.12.165.224.314.283.45.075.134.15.33.195.57.06.254.105.42.135.51.03.104.062.3.076.615.01.313.02.493.02.553v5.28c0 .376.06.72.165 1.036.105.313.21.54.315.674l.51.674c.09.136.136.256.136.36 0 .12-.06.226-.18.314-1.2 1.05-1.86 1.62-1.963 1.71-.165.135-.375.15-.63.045a6.062 6.062 0 01-.526-.496l-.31-.347a9.391 9.391 0 01-.317-.42l-.3-.435c-.81.886-1.603 1.44-2.4 1.665-.494.15-1.093.227-1.83.227-1.11 0-2.04-.343-2.76-1.034-.72-.69-1.08-1.665-1.08-2.94l-.05-.076zm3.753-.438c0 .566.14 1.02.425 1.364.285.34.675.512 1.155.512.045 0 .106-.007.195-.02.09-.016.134-.023.166-.023.614-.16 1.08-.553 1.424-1.178.165-.28.285-.58.36-.91.09-.32.12-.59.135-.8.015-.195.015-.54.015-1.005v-.54c-.84 0-1.484.06-1.92.18-1.275.36-1.92 1.17-1.92 2.43l-.035-.02zm9.162 7.027c.03-.06.075-.11.132-.17.362-.243.714-.41 1.05-.5a8.094 8.094 0 011.612-.24c.14-.012.28 0 .41.03.65.06 1.05.168 1.172.33.063.09.099.228.099.39v.15c0 .51-.149 1.11-.424 1.8-.278.69-.664 1.248-1.156 1.68-.073.06-.14.09-.197.09-.03 0-.06 0-.09-.012-.09-.044-.107-.12-.064-.24.54-1.26.806-2.143.806-2.64 0-.15-.03-.27-.087-.344-.145-.166-.55-.257-1.224-.257-.243 0-.533.016-.87.046-.363.045-.7.09-1 .135-.09 0-.148-.014-.18-.044-.03-.03-.036-.047-.02-.077 0-.017.006-.03.02-.063v-.06z'/%3E%3C/svg%3E");
}

/* Amazon is not live yet — show the button in a muted, non-interactive state */
section.cover .cover-main p.cover-social a.soc-soon {
  opacity: 0.55;
  cursor: default;
}

section.cover .cover-main p.cover-social a.soc-soon:hover {
  background: transparent;
  color: var(--gold);
  border-color: rgba(201, 166, 107, 0.4);
  transform: none;
  box-shadow: none;
}

section.cover .cover-main p.cover-social a:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(201, 166, 107, 0.35);
}

/* Scroll-down hint — bouncing chevron at the bottom of the cover */
section.cover::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: clamp(1.6rem, 5vh, 3rem);
  width: 1.05rem;
  height: 1.05rem;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  pointer-events: none;
  animation: cover-scroll-hint 2.2s ease-in-out infinite;
}

@keyframes cover-scroll-hint {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(45deg);
    opacity: 0.35;
  }
  50% {
    transform: translateX(-50%) translateY(10px) rotate(45deg);
    opacity: 0.95;
  }
}

/* Preview navigation has no sidebar or table of contents. */
.sidebar, .sidebar-toggle { display: none !important; }
.content { left: 0 !important; }

/* Web preview follows the manuscript styles documented in PUBLISHING.md. */
.book-preview .markdown-section {
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-size: 12pt;
  line-height: 1.15;
  color: #111;
  max-width: 720px;
}
.book-preview .markdown-section p {
  margin: 0;
  text-align: justify;
  text-indent: 0.3in;
  line-height: 1.15;
}
.book-preview .markdown-section h1,
.book-preview .markdown-section h2,
.book-preview .markdown-section h3 {
  font-family: inherit;
  font-weight: 700;
  color: #0f4761;
  text-align: center;
  line-height: 1.15;
}
.book-preview .markdown-section h1 { font-size: 24pt; margin: 1.5em 0 0.75em; }
.book-preview .markdown-section h2 { font-size: 18pt; margin: 2em 0 1em; }
.book-preview .markdown-section h3 {
  font-size: 16pt;
  font-variant: small-caps;
  margin: 1.5em 0 0.75em;
}
.book-preview .markdown-section .anchor,
.book-preview .markdown-section strong { color: inherit; }
.book-preview .markdown-section .anchor:hover { text-decoration: none; }
.book-preview .markdown-section h1 + p,
.book-preview .markdown-section h2 + p,
.book-preview .markdown-section h3 + p,
.book-preview .markdown-section .preview-scene-break + p {
  text-indent: 0;
}
.book-preview .markdown-section blockquote {
  margin: 1em 0.33in;
  padding: 0;
  border: 0;
  color: inherit;
}
.book-preview .markdown-section blockquote p {
  text-indent: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
}
.book-preview .markdown-section blockquote p + p { margin-top: 0.65em; }
.book-preview .markdown-section p.preview-scene-break {
  margin: 12pt 0;
  text-align: center;
  text-indent: 0;
  white-space: pre;
}
@media print {
  .book-preview .markdown-section h1,
  .book-preview .markdown-section h2 { break-before: page; }
}

/* Sadržaj for the unlocked preview only. */
#preview-contents {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  box-sizing: border-box;
  padding: 30px 22px;
  overflow-y: auto;
  background: #faf8f4;
  border-right: 1px solid #ded8cc;
  font-family: 'EB Garamond', Georgia, serif;
  color: #0f4761;
}
#preview-contents h2 { font-size: 20px; margin: 0 0 18px; }
#preview-contents ul { list-style: none; margin: 0; padding: 0; }
#preview-contents li { margin: 0 0 10px; line-height: 1.3; }
#preview-contents a { color: inherit; text-decoration: none; display: block; }
#preview-contents a:hover { text-decoration: underline; }
#preview-contents a:focus-visible { outline: 2px solid #0f4761; outline-offset: 3px; }
#preview-contents .contents-h1 { font-weight: 700; font-size: 18px; }
#preview-contents .contents-h2 { font-weight: 700; margin-top: 18px; }
#preview-contents .contents-h3 { padding-left: 14px; font-size: 17px; }
.book-preview:has(#preview-contents) .content { left: 260px !important; }
.raar-locked #preview-contents { display: none; }
.book-preview .markdown-section :is(h1, h2, h3) { scroll-margin-top: 24px; }
@media (max-width: 800px) {
  #preview-contents {
    position: relative;
    width: auto;
    margin: 20px 15px;
    border: 1px solid #ded8cc;
    border-radius: 6px;
    max-height: 250px;
  }
  .book-preview:has(#preview-contents) .content { position: relative; left: 0 !important; }
  .book-preview #preview-contents { order: -1; }
  .book-preview { display: flex; flex-direction: column; }
}
@media print {
  #preview-contents { display: none; }
  .book-preview:has(#preview-contents) .content { left: 0 !important; }
}

#preview-contents a.preview-back {
  box-sizing: border-box;
  margin-bottom: 24px;
  padding: 11px 13px;
  border-radius: 6px;
  background: #e7c873;
  color: #1a1206;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  text-decoration: none;
}
#preview-contents a.preview-back:hover { background: #f0d993; }

/* The reading invitation shares the sky with the cover above it. */
.content:has(.landing-preview) { padding-top: 0; background: transparent; }
.markdown-section:has(.landing-preview) { max-width: none; padding: 0; }
.landing-preview {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 900px;
  padding: 105px 24px 255px;
  text-align: center;
  color: #e9ddc6;
  background: transparent;
}
.preview-sigil {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 32px;
  border: 1px solid #c9a66b80;
  transform: rotate(45deg);
  box-shadow: 0 0 42px #bc67252b, inset 0 0 22px #bc672518;
}
.preview-sigil span { transform: rotate(-45deg); color: #e6c386; font-size: 34px; }
.markdown-section .landing-preview p.preview-eyebrow {
  margin: 0 0 22px;
  color: #c9a66b;
  font: 12px/1.5 var(--heading-font);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.markdown-section .landing-preview h2 {
  margin: 0;
  color: #f6e6c4;
  font: 500 clamp(36px, 5.5vw, 66px)/1.15 var(--display-font);
  text-shadow: 0 3px 30px #000;
}
.preview-ornament { display: flex; align-items: center; gap: 18px; max-width: 280px; margin: 28px auto; color: #c9a66b; font-size: 10px; }
.preview-ornament::before,
.preview-ornament::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, #c9a66b90); }
.preview-ornament::after { transform: rotate(180deg); }
.markdown-section .landing-preview p.preview-book-name {
  margin: 0 0 18px;
  font: 600 clamp(17px, 3vw, 23px)/1.4 var(--heading-font);
  color: #dfc594;
}
.markdown-section .landing-preview p.preview-invitation {
  margin: 0 auto 30px;
  max-width: 520px;
  color: #d1c4af;
  font: 22px/1.5 var(--serif-font);
}
.markdown-section .landing-preview a.preview-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 54px;
  padding: 0 30px;
  border: 1px solid #eed19a;
  border-radius: 3px;
  background: linear-gradient(135deg, #efdaaa, #bc8b49);
  box-shadow: 0 4px 28px #bc672530;
  color: #211509;
  font: 600 13px/1.5 var(--heading-font);
  letter-spacing: 0.07em;
  text-decoration: none;
  transition: box-shadow 180ms ease, background 180ms ease;
}
.markdown-section .landing-preview a.preview-enter:hover { background: #f3deb1; box-shadow: 0 4px 36px #c99a5b60; }
.markdown-section .landing-preview a.preview-enter:focus-visible { outline: 2px solid #f6e6c4; outline-offset: 6px; }
.markdown-section .landing-preview p.preview-access-note { margin: 18px 0 38px; color: #b9aa92; font: 16px/1.5 var(--serif-font); }
.preview-closing { color: #a47d4b; font-size: 11px; letter-spacing: 0.25em; }
@media (max-width: 600px) {
  .landing-preview { min-height: 820px; padding: 85px 26px 210px; }
  .markdown-section .landing-preview p.preview-invitation { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .markdown-section .landing-preview a.preview-enter { transition: none; }
}


/* One sky behind the entire landing page: no seam at the section boundary. */
body.landing-cosmos {
  isolation: isolate;
  background: #050914;
}
body.landing-cosmos section.cover,
body.landing-cosmos section.cover.show { background: transparent !important; }
#cosmic-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 5% 24%, #183d5940, transparent 48%),
    radial-gradient(ellipse at 95% 68%, #39305e38, transparent 50%),
    linear-gradient(180deg, #050914, #080f1e 65%, #0a1220);
}
#cosmic-sky[hidden] { display: none; }
#cosmic-sky::before {
  content: '';
  position: absolute;
  inset: -15%;
  opacity: 0.6;
  background:
    radial-gradient(ellipse at 25% 32%, #40718920, transparent 40%),
    radial-gradient(ellipse at 72% 70%, #64568524, transparent 40%);
  animation: cosmic-haze 32s ease-in-out infinite alternate;
}
#cosmic-sky canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
#cosmic-sky::after {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse at 18% 35%, #3c82a426, transparent 36%),
    radial-gradient(ellipse at 83% 60%, #7862a520, transparent 35%),
    radial-gradient(ellipse at 45% 85%, #c9a66b0a, transparent 30%);
  animation: nebula-tide 38s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes nebula-tide {
  from { opacity: 0.4; transform: translate3d(-3%, 2%, 0) rotate(-4deg) scale(1); }
  to { opacity: 0.95; transform: translate3d(4%, -3%, 0) rotate(4deg) scale(1.08); }
}
@keyframes cosmic-haze {
  from { transform: translate3d(-2%, 0, 0); }
  to { transform: translate3d(3%, 2%, 0); }
}
/* Only the upper arc of the planet enters the frame. */
.world-horizon {
  position: absolute;
  inset: auto 0 0;
  height: 260px;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.world-surface {
  --world-height: clamp(480px, 62vw, 1000px);
  --world-rise: clamp(115px, 13vw, 175px);
  position: absolute;
  left: -30%;
  width: 160%;
  height: var(--world-height);
  bottom: calc(var(--world-rise) - var(--world-height));
  border-radius: 50%;
  border-top: 1px solid #d4f2ffcf;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 37% 1%, #4e7c7540, transparent 17%),
    radial-gradient(ellipse at 62% 5%, #39596550, transparent 21%),
    radial-gradient(ellipse at 50% -3%, #477a9a, #162f46 12%, #091625 27%, #030811 48%);
  box-shadow:
    0 -2px 5px #b0e4ff8c,
    0 -7px 22px #5fbbff52,
    0 -22px 65px #3b88db2e,
    0 -45px 115px #3872ab1c,
    inset 0 9px 17px #78c7f73d;
}
.world-surface::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 0%, #02060dc9 25%, #02060d 50%);
}
.world-terrain,
.world-clouds {
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 58%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transform-origin: 50% 0;
}
.world-terrain {
  background-image: url('planet-land.svg');
  opacity: 0.95;
  animation: world-turn 100s ease-in-out infinite alternate;
}
.world-clouds {
  left: -15%;
  width: 130%;
  height: 48%;
  opacity: 0.65;
  background-image: url('planet-clouds.svg');
  animation: cloud-drift 65s ease-in-out infinite alternate;
}
@media (max-width: 600px) {
  .world-horizon { height: 200px; }
  .world-surface { left: -65%; width: 230%; }
}
@media (prefers-reduced-motion: reduce) {
  #cosmic-sky::before,
  #cosmic-sky::after,
  section.cover::after { animation: none; }
}

/* Series and volume title, separated by a small gilded ornament. */
section.cover .cover-main > h1.book-title-lockup {
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--gold-bright);
}
.book-title-lockup .book-title-series,
.book-title-lockup .book-title-volume {
  display: block;
  background: linear-gradient(180deg, #f6e6c4, #c9a66b 65%, #a97c46);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.book-title-lockup .book-title-volume {
  font-size: 0.65em;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  line-height: 1.2;
}
.book-title-lockup .book-title-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: clamp(120px, 20vw, 210px);
  margin: 20px auto 18px;
  color: #d6b779;
  -webkit-text-fill-color: #d6b779;
  font-size: 16px;
  line-height: 1;
  text-shadow: 0 0 18px #d6b77944;
}
.book-title-divider::before,
.book-title-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c9a66baa);
}
.book-title-divider::after { transform: rotate(180deg); }
.preview-book-name.book-title-lockup .book-title-divider {
  width: 110px;
  font-size: 10px;
  gap: 10px;
  margin: 12px auto;
}
.preview-book-name.book-title-lockup .book-title-volume { font-size: 0.85em; }
@media (max-width: 600px) {
  .book-title-lockup .book-title-divider { margin: 16px auto; }
}

/* Slow, layered motion keeps the world alive without competing with the text. */
.world-surface { animation: atmosphere-breathe 16s ease-in-out infinite alternate; }
.landing-cosmos .preview-sigil { animation: sigil-breathe 7s ease-in-out infinite; }
.landing-cosmos .preview-sigil span { animation: sigil-light 7s ease-in-out infinite; }
.landing-cosmos section.cover .cover-main > h1 {
  animation: title-arrive 1.4s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.landing-cosmos section.cover .cover-main > blockquote {
  animation: title-arrive 1.4s 0.18s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.landing-cosmos .preview-enter { position: relative; overflow: hidden; }
.landing-cosmos .preview-enter::after {
  content: '';
  position: absolute;
  inset: -80% auto -80% -55%;
  width: 30%;
  background: linear-gradient(90deg, transparent, #fff7df66, transparent);
  transform: translateX(0) rotate(25deg);
  pointer-events: none;
  animation: gilded-shimmer 12s ease-in-out infinite;
}
.landing-cosmos .preview-enter span:last-child { transition: transform 250ms ease; }
.landing-cosmos .preview-enter:hover span:last-child,
.landing-cosmos .preview-enter:focus-visible span:last-child { transform: translateX(4px); }
@keyframes world-turn {
  from { transform: translateX(-2%); }
  to { transform: translateX(2%); }
}
@keyframes cloud-drift {
  from { transform: translateX(-3%) scaleY(1); }
  to { transform: translateX(4%) scaleY(1.06); }
}
@keyframes atmosphere-breathe {
  from { filter: brightness(1); }
  to { filter: brightness(1.16); }
}
@keyframes sigil-breathe {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(-6px) rotate(45deg); }
}
@keyframes sigil-light {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 8px #e6c38622; }
  50% { opacity: 1; text-shadow: 0 0 22px #e6c38677; }
}
@keyframes title-arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gilded-shimmer {
  0%, 76% { transform: translateX(0) rotate(25deg); opacity: 0; }
  80% { opacity: 1; }
  95%, 100% { transform: translateX(650%) rotate(25deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .world-surface,
  .world-terrain,
  .world-clouds,
  .landing-cosmos .preview-sigil,
  .landing-cosmos .preview-sigil span,
  .landing-cosmos section.cover .cover-main > h1,
  .landing-cosmos section.cover .cover-main > blockquote,
  .landing-cosmos .preview-enter::after { animation: none; }
  .landing-cosmos .preview-enter::after { display: none; }
  .landing-cosmos .preview-enter span:last-child { transition: none; }
}

/* Reader-controlled white or warm paper, scoped to the book preview. */
.book-preview {
  --reader-background: #fff;
  --reader-sidebar: #faf8f4;
  background: var(--reader-background);
}
.book-preview.paper-reading {
  --reader-background: #f7f4ec;
  --reader-sidebar: #efece3;
}
.book-preview .content,
.book-preview .markdown-section { background: var(--reader-background); }
.book-preview #preview-contents { background: var(--reader-sidebar); }
#preview-contents .reading-paper-control {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 24px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.4;
}
.reading-paper-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.paper-switch-track {
  flex: 0 0 40px;
  height: 23px;
  box-sizing: border-box;
  padding: 3px;
  border: 1px solid #b8ae9b;
  border-radius: 20px;
  background: #e0ddd7;
}
.paper-switch-track::before {
  content: '';
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0002;
}
.reading-paper-control input:checked + .paper-switch-track {
  border-color: #9b763b;
  background: #c9a66b;
}
.reading-paper-control input:checked + .paper-switch-track::before {
  transform: translateX(17px);
}
.reading-paper-control input:focus-visible + .paper-switch-track {
  outline: 2px solid #0f4761;
  outline-offset: 4px;
}
@media (prefers-reduced-motion: no-preference) {
  .paper-switch-track { transition: background-color 160ms ease; }
  .paper-switch-track::before { transition: transform 160ms ease; }
}
@media (forced-colors: active) {
  .paper-switch-track { border-color: ButtonText; background: Canvas; }
  .paper-switch-track::before { background: ButtonText; }
  .reading-paper-control input:checked + .paper-switch-track { background: Highlight; }
}
@media print {
  .book-preview,
  .book-preview.paper-reading { --reader-background: #fff; }
}

/* Copyright front matter precedes the manuscript. */
.book-preview .markdown-section .preview-preface {
  margin: 2em 0 3em;
  padding-bottom: 2em;
  border-bottom: 1px solid #b8ae9b66;
}
.book-preview .markdown-section .preview-preface p {
  margin: 0 0 1em;
  text-align: left;
  text-indent: 0;
  line-height: 1.4;
}
.book-preview .markdown-section .preview-preface p:last-child { margin-bottom: 0; }

/* Keep emphasis in the manuscript's black ink. */
.book-preview .markdown-section em,
.book-preview .markdown-section i { color: #111; }
.book-preview .markdown-section #the-hole-in-the-lay + p { margin-bottom: 1em; }

.book-preview .markdown-section p.sample-edition {
  margin: 0 0 0.65em;
  text-align: center;
  text-indent: 0;
  font-size: 0.9em;
  font-variant: small-caps;
  letter-spacing: 0.08em;
}
.book-preview .markdown-section .sample-edition + h1 { margin-top: 0; }

/* Sadržaj stay accessible without occupying the phone's reading viewport. */
/* Override Docsify's default action-link margins and final-button treatment. */
section.cover .cover-main > p.cover-social a,
section.cover .cover-main > p.cover-social a:last-child {
  margin: 0;
}
section.cover .cover-main > p.cover-social a.soc-soon:last-child {
  background: transparent;
  border-color: rgba(201, 166, 107, 0.4);
  color: var(--gold);
  pointer-events: none;
}

#preview-contents summary {
  padding: 10px 0;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
#preview-contents summary:focus-visible {
  outline: 2px solid #0f4761;
  outline-offset: 3px;
}
#preview-contents details[open] summary { margin-bottom: 12px; }

@media screen and (max-width: 800px) {
  /* Let the cover grow naturally on small phones and in landscape. */
  body section.cover,
  body section.cover.show {
    box-sizing: border-box;
    min-height: 100svh;
    height: auto;
    padding: 96px max(20px, env(safe-area-inset-left)) 80px;
  }
  section.cover .cover-main {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 640px;
    margin: 0 auto;
  }
  section.cover .cover-main h4 {
    top: 24px;
    left: 20px;
    right: 20px;
    white-space: normal;
    font-size: clamp(0.75rem, 2.5vw, 1rem);
    line-height: 1.6;
    letter-spacing: 0.18em;
    overflow-wrap: anywhere;
  }
  section.cover .cover-main > h1 {
    font-size: clamp(1.65rem, 6.8vw, 3rem);
    line-height: 1.2;
    letter-spacing: 0.01em;
  }
  section.cover blockquote { max-width: 36ch; }
  section.cover blockquote p { font-size: 1.25rem; }
  section.cover .cover-main p.cover-byline {
    font-size: 0.85rem;
    line-height: 1.6;
    letter-spacing: 0.15em;
  }
  section.cover .cover-main form.cover-subscribe {
    width: 100%;
    max-width: 420px;
  }
  section.cover .cover-main form.cover-subscribe .cover-subscribe-label {
    line-height: 1.7;
    letter-spacing: 0.1em;
  }
  section.cover .cover-main form.cover-subscribe input[type="email"],
  section.cover .cover-main form.cover-subscribe button[type="submit"] {
    min-height: 48px;
  }
  section.cover .cover-main p.cover-social a {
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 14px;
    letter-spacing: 0.08em;
  }
  section.cover::after { bottom: 28px; }

  .landing-preview { min-height: 0; padding: 64px 20px 210px; }
  .markdown-section .landing-preview h2 {
    font-size: clamp(1.7rem, 6.8vw, 2.8rem);
  }
  .markdown-section .landing-preview a.preview-enter {
    box-sizing: border-box;
    max-width: 100%;
    padding: 14px 20px;
    gap: 16px;
  }
  .preview-eyebrow { overflow-wrap: anywhere; }

  /* Docsify's mobile closed-sidebar transform also shifts fixed descendants. */
  body.close .content { transform: none; }
  .content { min-width: 0; padding-top: 16px; }
  .markdown-section {
    box-sizing: border-box;
    width: 100%;
    padding: 20px max(20px, env(safe-area-inset-left)) 40px;
    overflow-wrap: break-word;
  }
  .book-grid { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
  .markdown-section table { max-width: 100%; overflow-x: auto; }
  .book-preview .markdown-section {
    max-width: 720px;
    font-size: 18px;
    line-height: 1.55;
  }
  .book-preview .markdown-section p {
    line-height: 1.55;
    text-align: left;
    text-indent: 1.25em;
  }
  .book-preview .markdown-section h1 { font-size: 1.8em; line-height: 1.2; }
  .book-preview .markdown-section h2 { font-size: 1.5em; line-height: 1.25; }
  .book-preview .markdown-section h3 { font-size: 1.25em; line-height: 1.3; }
  .book-preview .markdown-section blockquote { margin: 1em 16px; }
  .book-preview .markdown-section .preview-preface { margin-top: 0; }
  .book-preview .markdown-section :is(h1, h2, h3) { scroll-margin-top: 16px; }
  /* A single return link scrolls with the page; the other controls stay hidden. */
  .book-preview:not(.raar-locked) #preview-contents {
    display: block;
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 16px auto 0;
    padding: 0 max(20px, env(safe-area-inset-left));
    border: 0;
    background: transparent;
    max-height: none;
    overflow: visible;
  }
  .book-preview #preview-contents > :not(.preview-back) { display: none; }
  #preview-contents a.preview-back { min-height: 44px; margin-bottom: 0; }
}

@media screen and (max-width: 360px) {
  section.cover .cover-main p.cover-social { gap: 8px; }
  section.cover .cover-main p.cover-social a { padding-inline: 11px; font-size: 0.65rem; }
}
