/* Optional book identities. Only decorative surfaces are owned here. No reader
   prose, font, page background, accessibility state or access policy overrides. */
:is(.zy-profile-verdant,[data-zy-profile="verdant"]) {
  --zy-book-accent: #bbcf9b; --zy-book-rgb: 151,185,121;
  --zy-book-ink: #40602c; --zy-book-motif: url('../img/story-profiles/verdant.svg');
  --zy-book-frame: 6px;
}
:is(.zy-profile-maritime,[data-zy-profile="maritime"]) {
  --zy-book-accent: #9bd5e6; --zy-book-rgb: 105,188,216;
  --zy-book-ink: #235a74; --zy-book-motif: url('../img/story-profiles/maritime.svg');
  --zy-book-frame: 13px;
}
:is(.zy-profile-field,[data-zy-profile="field"]) {
  --zy-book-accent: #b6c4d2; --zy-book-rgb: 151,171,192;
  --zy-book-ink: #40596c; --zy-book-motif: url('../img/story-profiles/field.svg');
  --zy-book-frame: 3px;
}
:is(.zy-profile-iron,[data-zy-profile="iron"]) {
  --zy-book-accent: #e0bfa5; --zy-book-rgb: 204,155,122;
  --zy-book-ink: #784b35; --zy-book-motif: url('../img/story-profiles/iron.svg');
  --zy-book-frame: 4px;
}
:is(.zy-profile-astral,[data-zy-profile="astral"]) {
  --zy-book-accent: #c8b7ef; --zy-book-rgb: 173,149,222;
  --zy-book-ink: #604184; --zy-book-motif: url('../img/story-profiles/astral.svg');
  --zy-book-frame: 17px;
}
@media screen and (forced-colors: none) {
  /* The home page is a deliberately dark surface regardless of reader mode. */
  #dwFrontpage .dw-spotlight-card[data-zy-profile] {
    border-color: rgba(var(--zy-book-rgb), .54);
    background: radial-gradient(ellipse at 86% 0%, rgba(var(--zy-book-rgb), .15), transparent 70%), #131820;
  }
  #dwFrontpage .dw-spotlight-card[data-zy-profile] .dw-spotlight-title {
    color: var(--zy-book-accent);
  }
  #dwFrontpage .dw-spotlight-card[data-zy-profile] .dw-spotlight-title::after,
  #dwModal[data-zy-profile] .dw-modal-descWrap::before {
    content: ''; display: block; width: min(9rem,100%); height: 1.8rem;
    margin: .3rem auto .1rem; background: var(--zy-book-accent);
    mask: var(--zy-book-motif) center / contain no-repeat;
    opacity: .8; pointer-events: none;
  }
  #dwFrontpage .dw-card[data-zy-profile] .dw-card-body {
    border-block-start: 2px solid rgba(var(--zy-book-rgb),.85);
  }
  #dwModal[data-zy-profile] .dw-modal-box {
    border-color: rgba(var(--zy-book-rgb), .52);
  }
  #dwModal[data-zy-profile] .dw-modal-title {
    color: var(--zy-book-accent); background: none; -webkit-text-fill-color: currentColor;
  }
  #dwModal[data-zy-profile] .dw-modal-descWrap::before { margin: 0 auto .65rem; }

  /* Inner pages: light-mode ink is separate, and chapter titles retain the
     user's palette. All profile motifs remain strictly ornamental. */
  body.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) {
    --zy-book-ornament: var(--zy-book-accent);
    --zy-book-line: rgba(var(--zy-book-rgb), .68);
  }
  :root[data-mode="light"] body.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) {
    --zy-book-ornament: var(--zy-book-ink);
    --zy-book-line: var(--zy-book-ink);
  }
  body.single-fcn_story.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .story__header {
    border-bottom-color: var(--zy-book-line);
  }
  body.single-fcn_story.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .story__identity-title {
    background: none !important;
    color: var(--zy-book-ornament) !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none;
  }
  :root[data-mode="light"] body.single-fcn_story.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .story__identity-title {
    background: none !important;
    color: var(--zy-book-ornament) !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none;
  }
  body.single-fcn_story.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .zy-story-gateway {
    --zy-story-gateway-border: rgba(var(--zy-book-rgb), .48);
    --zy-story-gateway-border-hot: var(--zy-book-line);
    background: radial-gradient(ellipse at 0% 0%, rgba(var(--zy-book-rgb), .16), transparent 75%), var(--zy-story-gateway-bg);
  }
  body.single-fcn_story.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .zy-story-gateway__eyebrow::after,
  body.single-fcn_chapter.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) header.chapter__headline.layout-links > .chapter__title::after {
    content: ''; display: block; width: min(9rem, 100%); height: 1.65rem;
    margin: .28rem auto 0; background: var(--zy-book-ornament);
    mask: var(--zy-book-motif) center / contain no-repeat;
    opacity: .82; pointer-events: none;
  }
  body.single-fcn_story.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .zy-story-gateway__eyebrow::after { margin-inline: 0 auto; }
  body.single-fcn_story.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .zy-story-gateway__button--primary:not(.is-locked) {
    background: linear-gradient(120deg, rgba(var(--zy-book-rgb), .18), rgba(var(--zy-book-rgb),.045));
    border-color: var(--zy-book-line);
  }
  body.single-fcn_chapter.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .zy-chapter-cinematic {
    border-color: var(--zy-book-line); border-radius: var(--zy-book-frame);
  }
  /* Tint the existing decorative backdrop only, within the original Cosmos
     visibility and opacity policy; no additional layer, animation or image. */
  @media (min-width: 768px) {
    :root:not([data-mode="light"]) body.single-fcn_chapter.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .zy-shell-starfield--canvas .zy-shell-starfield__backdrop {
      background-image: linear-gradient(90deg, rgba(var(--zy-book-rgb), .12), transparent 40%, transparent 60%, rgba(var(--zy-book-rgb), .12)), url('../images/chapter-cosmos-base.webp');
    }
  }
  body.single-fcn_chapter.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .zy-chapter-constellation__segment:is(.is-traversed,.is-next) {
    stroke: var(--zy-book-line);
  }
  body.single-fcn_chapter.zy-cohesion-view:is(.zy-profile-verdant,.zy-profile-maritime,.zy-profile-field,.zy-profile-iron,.zy-profile-astral) .zy-chapter-constellation__node.is-current:not(.is-locked) .zy-chapter-constellation__link::after {
    border-color: var(--zy-book-line);
  }
}

/* 1.69.7 — A shared house motif for unthemed books, and opt-in
 * scene separators that echo the chosen book without changing prose. */
@supports (mask: url('../img/story-profiles/house.svg') center/contain no-repeat) {
  @media screen and (forced-colors:none) {
    body.single-fcn_chapter.zy-cohesion-view #chapter-content hr.zy-scene-break:not([hidden]) {
      inline-size: min(8em,60%); block-size: .95em;
      margin-block: 1.325em; border: 0; background: currentColor;
      mask: var(--zy-book-motif,url('../img/story-profiles/house.svg')) center/contain no-repeat;
      opacity: .7;
    }
  }
}
