/* ==========================================================================
   Living Avatars Dark Cinematic Theme
   Harmonized with 3dcharacter.pro Main Slate & Steel Sky Blue
   ========================================================================== */

:root,
html,
body,
body[data-page] {
  color-scheme: dark !important;
  --paper: #101417 !important;
  --bg: #101417 !important;
  --surface: #161e24 !important;
  --surface-card: #1c242b !important;
  --ink: #f3f0e8 !important;
  --text: #f3f0e8 !important;
  --muted: #b8c1c4 !important;
  --line: #2e373e !important;
  --line-gold: rgba(120, 194, 230, 0.38) !important;
  --accent: #78c2e6 !important;
  --accent-hover: #a3dcf7 !important;
  --gold: #78c2e6 !important;
  --wash: #161e24 !important;
  --dark: #0a0d10 !important;
  background-color: #101417 !important;
  color: #f3f0e8 !important;
}

body {
  background: #101417 !important;
  color: #f3f0e8 !important;
}

/* Typography & Headings */
h1, h2, h3, h4, blockquote {
  color: #f3f0e8 !important;
}
p {
  color: #cfd6d8;
}
.eyebrow {
  color: #78c2e6 !important;
}

/* Site Header */
.site-header {
  position: relative !important;
  z-index: 80 !important;
  border-bottom: 1px solid #2e373e !important;
  background-color: #101417 !important;
  background: #101417 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.site-header .brand {
  color: #f3f0e8 !important;
}
.site-header .brand-symbol {
  color: #78c2e6 !important;
}
.site-header nav a {
  color: #f3f0e8 !important;
  transition: color 0.2s ease;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: #78c2e6 !important;
}

/* Buttons */
.button {
  border-color: #4a545c !important;
  color: #f3f0e8 !important;
  background: transparent !important;
  transition: all 0.2s ease;
}
.button:hover {
  background: #1c242b !important;
  border-color: #78c2e6 !important;
  color: #78c2e6 !important;
}
.button.solid,
.header-cta {
  background: #78c2e6 !important;
  border-color: #78c2e6 !important;
  color: #101417 !important;
  font-weight: 700 !important;
}
.button.solid:hover,
.header-cta:hover {
  background: #a3dcf7 !important;
  border-color: #a3dcf7 !important;
  color: #101417 !important;
}

/* Character Cards (Catalog Grid) */
.character-card {
  background: #161e24 !important;
  border: 1px solid #2e373e !important;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.character-card:hover {
  border-color: #78c2e6 !important;
  transform: translateY(-2px);
}
.character-card .card-visual {
  background: #0f1418 !important;
}
.character-card .card-copy {
  padding: 16px 20px 20px !important;
  margin-top: 0 !important;
}
.character-card .card-copy h3 {
  color: #f3f0e8 !important;
  font-size: 28px !important;
}
.character-card .card-copy p {
  color: #aab4b8 !important;
  font-size: 14px !important;
}
.character-card .card-arrow {
  color: #78c2e6 !important;
}
.character-card .card-version {
  color: #cfd6d8 !important;
  padding: 0 20px 16px !important;
  margin-top: 0 !important;
}

/* Hero Section */
.home-hero h1 em {
  color: #78c2e6 !important;
}
.home-art {
  background: #161e24 !important;
  border: 1px solid #2e373e !important;
  border-radius: 4px;
}
.home-art > figcaption {
  color: #aab4b8 !important;
}
.home-art > figcaption span {
  color: #f3f0e8 !important;
}

/* Filter Chips */
.chip {
  border-color: #2e373e !important;
  color: #f3f0e8 !important;
  background: #161e24 !important;
  transition: all 0.2s ease;
}
.chip:hover {
  border-color: #78c2e6 !important;
  color: #78c2e6 !important;
}
.chip[aria-pressed="true"] {
  background: #78c2e6 !important;
  color: #101417 !important;
  border-color: #78c2e6 !important;
  font-weight: 700 !important;
}

/* Sections & Dividers */
.collection,
.collection-tail,
.quick-facts,
.technical-intro,
.technical-release,
.next-character {
  border-color: #2e373e !important;
}

/* Tail & Invitation Banner */
.collection-tail h3 {
  color: #f3f0e8 !important;
}
.collection-tail p {
  color: #aab4b8 !important;
}
.invitation {
  background: #161e24 !important;
  border-top: 1px solid #2e373e !important;
  border-bottom: 1px solid #2e373e !important;
}
.invitation h2 {
  color: #f3f0e8 !important;
}
.invitation p {
  color: #aab4b8 !important;
}

/* Character Profiles & Journals */
.quick-facts strong {
  color: #f3f0e8 !important;
}
.quick-facts span {
  color: #aab4b8 !important;
}
.profile-tabs [role="tablist"] {
  border-bottom: 1px solid #2e373e !important;
}
.profile-tabs [role="tab"] {
  color: #aab4b8 !important;
}
.profile-tabs [role="tab"]:hover {
  color: #78c2e6 !important;
}
.profile-tabs [role="tab"][aria-selected="true"] {
  color: #78c2e6 !important;
  border-bottom-color: #78c2e6 !important;
}
.expand-image {
  background: rgba(16, 20, 23, 0.88) !important;
  border: 1px solid rgba(120, 194, 230, 0.38) !important;
  color: #f3f0e8 !important;
}
.expand-image:hover {
  background: #78c2e6 !important;
  color: #101417 !important;
  border-color: #78c2e6 !important;
}
.text-link {
  color: #78c2e6 !important;
  border-bottom-color: rgba(120, 194, 230, 0.45) !important;
}
.text-link:hover {
  color: #a3dcf7 !important;
  border-bottom-color: #a3dcf7 !important;
}

/* Story and Scene Panes */
.story-entry {
  background: #161e24 !important;
  border: 1px solid #2e373e !important;
  border-radius: 4px;
}
.scene-copy blockquote,
.journal-role-scene blockquote {
  color: #78c2e6 !important;
  font-style: italic;
  border-left: 2px solid #78c2e6;
  padding-left: 14px;
}
.role-controls button {
  border-color: #2e373e !important;
  background: #161e24 !important;
  color: #f3f0e8 !important;
}
.role-controls button:hover {
  border-color: #78c2e6 !important;
  color: #78c2e6 !important;
}
.role-controls button[aria-pressed="true"] {
  background: #1c242b !important;
  border-color: #78c2e6 !important;
  color: #78c2e6 !important;
  font-weight: 700;
}
.role-controls button span {
  color: #78c2e6 !important;
}
.journal-role-scene {
  background: #161e24 !important;
  border: 1px solid #2e373e !important;
  border-radius: 4px;
  padding: 24px !important;
}

/* Specs & Details */
.spec-list > div {
  border-top: 1px solid #2e373e !important;
}
.spec-list dt {
  color: #cfd6d8 !important;
}
.spec-list dd {
  color: #f3f0e8 !important;
}
.source-details summary {
  color: #78c2e6 !important;
}

/* Dialog Viewer */
.image-viewer {
  background: #101417 !important;
  color: #f3f0e8 !important;
  border: 1px solid #2e373e !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8) !important;
}
.viewer-head {
  border-bottom: 1px solid #2e373e !important;
  color: #f3f0e8 !important;
}
.viewer-head button {
  color: #78c2e6 !important;
}

/* Footer */
.site-footer {
  border-top: 1px solid #2e373e !important;
  color: #aab4b8 !important;
}
.site-footer .brand {
  color: #f3f0e8 !important;
}
.footer-links a {
  color: #aab4b8 !important;
}
.footer-links a:hover {
  color: #78c2e6 !important;
}

/* Stage 1 Unified Avatar Polish */
.expression-block { background: #0d1216 !important; color: #f3f0e8 !important; }
.expression-visual, .expression-visual .art-window, .expression-visual figcaption { background: #161e24 !important; color: #b8c1c4 !important; }
.expression-buttons .chip[aria-pressed="true"] { background: #78c2e6 !important; color: #101417 !important; border-color: #78c2e6 !important; }
.proof-grid .art-window { background: #141a1f !important; border: 1px solid #2e373e; }
.mobile-navigation > nav { background: #161e24 !important; border-color: #2e373e !important; color: #f3f0e8 !important; }
.site-header .mobile-navigation nav a.mobile-cta{margin-top:8px;padding:10px 14px;background:#78c2e6;color:#101417 !important;font-weight:700;text-align:center;border-radius:2px}
.site-header .mobile-navigation nav a.mobile-cta:hover{background:#a3dcf7;color:#101417 !important}
@media (max-width: 440px) { .site-header .header-cta { display: none !important; } }


/* Stage 4 Chronicles 6-Link Nav Responsive Guard */
@media (max-width: 1180px) {
  .site-header { gap: 20px !important; }
  .desktop-nav { gap: 18px !important; font-size: 14.5px !important; }
}
@media (max-width: 920px) {
  .desktop-nav { display: none !important; }
  .mobile-navigation { display: block !important; position: static !important; }
  .mobile-navigation > summary {
    list-style: none;
    min-height: 44px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #f3f0e8;
    border: 1px solid transparent;
    border-radius: 2px;
  }
  .mobile-navigation[open] > summary {
    color: #78c2e6 !important;
    background: #161e24 !important;
    border-color: #3a4349 !important;
  }
  .mobile-navigation > summary::-webkit-details-marker { display: none; }
  .mobile-navigation:not([open]) > nav { display: none !important; }
  .mobile-navigation[open] > nav {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 1px) !important;
    width: auto !important;
    padding: 20px 24px 24px !important;
    z-index: 90 !important;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    border: 1px solid #3a4349 !important;
    border-radius: 2px;
    background-color: #172128 !important;
    background: #172128 !important;
    opacity: 1 !important;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.88) !important;
  }
  .mobile-navigation nav a {
    display: block;
    padding-block: 11px;
    font-size: 17px;
    line-height: 1.4;
    border-bottom: 1px solid rgba(46, 55, 62, 0.45);
  }
  .mobile-navigation nav a:nth-last-child(-n+2) {
    border-bottom: 0;
  }
  .site-header .mobile-navigation nav a.mobile-cta {
    margin-top: 10px;
    padding: 13px 16px;
    font-size: 16px;
    border-bottom: 0;
  }
  .site-header .header-cta { margin-left: auto; }
}
@media (max-width: 440px) {
  .site-header .header-cta { display: none !important; }
  .site-header .mobile-navigation { margin-left: auto !important; }
}
