/* ══════════════════════════════════════════════════════════
   Midnight Bioluminescence v3 — with Firefly GIF Hero
   Soft firelight in darkness. Warm golds, cool blues.
   ══════════════════════════════════════════════════════════ */

   @import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

   /* ——— Override Relearn CSS variables ——— */
   :root {
     /* Backgrounds */
     --INTERNAL-MAIN-BG-color: #060b12;
     --INTERNAL-MAIN-TEXT-color: #d0cfc7;
     --INTERNAL-MAIN-LINK-color: #e2c67e;
     --INTERNAL-MAIN-LINK-HOVER-color: #f0d898;
   
     /* Headings — warm gold */
     --INTERNAL-MAIN-TITLES-TEXT-color: #e2c67e;
     --INTERNAL-MAIN-TITLES-H1-TEXT-color: #e8dcc0;
     --INTERNAL-MAIN-TITLES-H2-TEXT-color: #e2c67e;
     --INTERNAL-MAIN-TITLES-H3-TEXT-color: #9ab8a8;
     --INTERNAL-MAIN-TITLES-H4-TEXT-color: #9ab8a8;
     --INTERNAL-MAIN-TITLES-H5-TEXT-color: #7a9a9e;
     --INTERNAL-MAIN-TITLES-H6-TEXT-color: #7a9a9e;
   
     /* Heading fonts */
     --INTERNAL-MAIN-TITLES-H1-font: 'Cormorant Garamond', Georgia, serif;
     --INTERNAL-MAIN-TITLES-H2-font: 'Cormorant Garamond', Georgia, serif;
     --INTERNAL-MAIN-TITLES-H3-font: 'Cormorant Garamond', Georgia, serif;
     --INTERNAL-MAIN-TITLES-H1-font-weight: 300;
     --INTERNAL-MAIN-TITLES-H2-font-weight: 300;
     --INTERNAL-MAIN-TITLES-H3-font-weight: 300;
     --INTERNAL-MAIN-TITLES-H1-letter-spacing: 0.06em;
   
     /* Sidebar / Menu */
     --INTERNAL-MENU-SECTIONS-BG-color: #080e16;
     --INTERNAL-MENU-SECTIONS-ACTIVE-BG-color: #12202e;
     --INTERNAL-MENU-SECTIONS-LINK-color: #a8a59e;
     --INTERNAL-MENU-SECTIONS-LINK-HOVER-color: #e2c67e;
     --INTERNAL-MENU-SECTION-ACTIVE-CATEGORY-color: #e2c67e;
     --INTERNAL-MENU-SECTION-HR-color: #1a2435;
   
     /* Topbar */
     --INTERNAL-TOPBAR-TEXT-color: #a8a59e;
   
     /* Code */
     --INTERNAL-CODE-INLINE-BG-color: #0c1420;
     --INTERNAL-CODE-INLINE-BORDER-color: #1a2435;
     --INTERNAL-CODE-INLINE-color: #9ab8a8;
     --INTERNAL-CODE-BLOCK-BG-color: #0c1420;
     --INTERNAL-CODE-BLOCK-BORDER-color: #1a2435;
     --INTERNAL-CODE-BLOCK-color: #d0cfc7;
   }
   
   /* ——— Body ——— */
   body {
     font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
     font-weight: 300;
     background: #060b12;
   }
   
   #R-body-inner {
     background: #060b12;
   }
   
   #R-main-overlay {
     background: rgba(6, 11, 18, 0.85);
   }
   
   /* ══════════════════════════════════════════════════════════
      HERO: Firefly GIF as full-viewport cover on homepage
      ══════════════════════════════════════════════════════════ */
   
   /* The hero container — sits before all content on the homepage */
   article.home {
     position: relative;
   }
   
   article.home::before {
     content: '';
     display: block;
     width: 100%;
     height: 80vh;
     background-image: url('/2026a-iman-karibzhanova/images/130561-Fireflies.gif');
     background-size: cover;
     background-position: center;
     background-repeat: no-repeat;
     margin-bottom: 3rem;
     position: relative;
   }
   
   /* Dark gradient overlay on the hero GIF */
   article.home::after {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 80vh;
     background: linear-gradient(
       180deg,
       rgba(6, 11, 18, 0.3) 0%,
       rgba(6, 11, 18, 0.1) 40%,
       rgba(6, 11, 18, 0.5) 80%,
       rgba(6, 11, 18, 1) 100%
     );
     pointer-events: none;
   }
   
   /* Push the h1 title over the hero image */
   article.home h1 {
     position: absolute;
     top: 55vh;
     left: 0;
     right: 0;
     text-align: center;
     z-index: 2;
     font-size: clamp(1.8rem, 5vw, 3.5rem);
     text-shadow: 
       0 0 30px rgba(226, 198, 126, 0.35),
       0 0 60px rgba(226, 198, 126, 0.15),
       0 2px 20px rgba(0, 0, 0, 0.8);
     padding: 0 2rem;
   }
   
   /* ══════════════════════════════════════════════════════════
      HEADINGS & TEXT
      ══════════════════════════════════════════════════════════ */
   
   /* H1 glow */
   article h1 {
     text-shadow: 0 0 30px rgba(226, 198, 126, 0.2), 0 0 60px rgba(226, 198, 126, 0.08);
   }
   
   /* H2: warm gold, gentle */
   article h2 {
     text-shadow: 0 0 14px rgba(226, 198, 126, 0.15);
   }
   
   /* H3: muted sage, barely glowing */
   article h3 {
     text-shadow: 0 0 10px rgba(154, 184, 168, 0.12);
   }
   
   /* ——— Links ——— */
   article a {
     text-shadow: 0 0 6px rgba(226, 198, 126, 0.1);
     transition: color 0.4s ease, text-shadow 0.4s ease;
     text-decoration: none;
     border-bottom: 1px solid rgba(226, 198, 126, 0.2);
   }
   
   article a:hover {
     text-shadow: 0 0 16px rgba(226, 198, 126, 0.3);
     border-bottom-color: rgba(226, 198, 126, 0.5);
   }
   
   /* ——— Sidebar ——— */
   #R-sidebar {
     background: #080e16;
     border-right: 1px solid rgba(26, 36, 53, 0.6);
   }
   
   /* ——— Topbar ——— */
   #R-topbar {
     background: #060b12;
     border-bottom: 1px solid rgba(26, 36, 53, 0.4);
   }
   
   /* ——— Content ——— */
   article.home,
   article.default {
     color: #d0cfc7;
     line-height: 1.75;
   }
   
   /* ——— Children list ——— */
   ul.children li {
     border-bottom: 1px solid rgba(26, 36, 53, 0.5);
   }
   
   ul.children li a {
     color: #e2c67e;
     transition: all 0.4s ease;
   }
   
   ul.children li a:hover {
     color: #f0d898;
     text-shadow: 0 0 14px rgba(226, 198, 126, 0.25);
   }
   
   /* ——— Icons in headings: soften ——— */
   article h2 .badge,
   article h2 i,
   article h3 .badge,
   article h3 i {
     opacity: 0.6;
   }
   
   /* ——— Scrollbar ——— */
   ::-webkit-scrollbar {
     width: 6px;
     background: #060b12;
   }
   
   ::-webkit-scrollbar-thumb {
     background: #1a2435;
     border-radius: 3px;
   }
   
   ::-webkit-scrollbar-thumb:hover {
     background: #253348;
   }
   
   /* ——— Selection ——— */
   ::selection {
     background: rgba(226, 198, 126, 0.2);
     color: #ffffff;
   }
   
   /* ——— Subtle fade-in ——— */
   @keyframes fadeIn {
     from { opacity: 0; transform: translateY(6px); }
     to { opacity: 1; transform: translateY(0); }
   }
   
   .flex-block-wrapper {
     animation: fadeIn 0.8s ease-out;
   }
   
   /* ——— Footer ——— */
   #R-footer {
     color: rgba(168, 165, 158, 0.25);
     font-size: 0.8rem;
   }
  
   /* ——— Fix: Style children cards to match dark theme ——— */

/* ——— Dark cards ——— */
article.card {
  background: #0c1420 !important;
  border: 1px solid rgba(26, 36, 53, 0.6) !important;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

article.card:hover {
  border-color: rgba(226, 198, 126, 0.3) !important;
  box-shadow: 0 0 20px rgba(226, 198, 126, 0.08);
}

.card-content {
  background: #0c1420 !important;
}

.card-title a {
  color: #e2c67e !important;
}

.card-content-text {
  color: #8a8880 !important;
  background: #0c1420 !important;
}

.card-image {
  border-bottom: 1px solid rgba(26, 36, 53, 0.4);
}

/* ═══════ LIGHT CONTENT AREA (below hero) ═══════ */

#R-body-inner {
  background: #f5f3ee !important;
}

article.home,
article.default {
  color: #2a2a2a;
}

article h2 {
  border-image: linear-gradient(90deg, transparent, rgba(180, 160, 100, 0.3), transparent) 1;
}

article a {
  border-bottom-color: rgba(180, 140, 60, 0.25);
}

article a:hover {
  border-bottom-color: rgba(180, 140, 60, 0.5);
}

/* ═══════ DARK TEXT FOR LIGHT BACKGROUND ═══════ */

/* Headings — dark versions */
:root {
  --INTERNAL-MAIN-TITLES-H1-TEXT-color: #2a2218;
  --INTERNAL-MAIN-TITLES-H2-TEXT-color: #8a6d2f;
  --INTERNAL-MAIN-TITLES-H3-TEXT-color: #3d6b5a;
  --INTERNAL-MAIN-TITLES-H4-TEXT-color: #3d6b5a;
  --INTERNAL-MAIN-TEXT-color: #2a2a2a;
  --INTERNAL-MAIN-LINK-color: #8a6d2f;
  --INTERNAL-MAIN-LINK-HOVER-color: #6b5420;
}

/* Remove glow on headings — doesn't work on light */
article h1 {
  text-shadow: none;
}

article h2 {
  text-shadow: none;
}

article h3 {
  text-shadow: none;
}

/* Links — darker gold */
article a {
  color: #8a6d2f;
  text-shadow: none;
}

article a:hover {
  color: #6b5420;
  text-shadow: none;
}

/* Children list links */
ul.children li a {
  color: #8a6d2f;
}

ul.children li a:hover {
  color: #6b5420;
  text-shadow: none;
}

/* Bullet points */
article ul li::marker {
  color: #8a6d2f;
}

/* ═══════ FIX TABLES FOR LIGHT ═══════ */

article table th {
  background: #e8e5dc !important;
  color: #2a2218 !important;
  border-bottom: 2px solid #8a6d2f !important;
}

article table td {
  background: #f5f3ee !important;
  color: #2a2a2a !important;
  border-bottom: 1px solid #ddd8cc !important;
}

article table tr:hover td {
  background: #ece9e0 !important;
}

/* ═══════ FIX CODE BLOCKS FOR LIGHT ═══════ */

article pre {
  background: #2a2a2a !important;
  border: 1px solid #ddd8cc !important;
  border-radius: 6px;
}

article code {
  color: #e8e5dc;
}

/* Inline code */
:root {
  --INTERNAL-CODE-INLINE-BG-color: #ece9e0;
  --INTERNAL-CODE-INLINE-BORDER-color: #ddd8cc;
  --INTERNAL-CODE-INLINE-color: #6b5420;
}

/* ═══════ FIX CARDS FOR LIGHT ═══════ */

article.card {
  background: #ffffff !important;
  border: 1px solid #ddd8cc !important;
}

article.card:hover {
  border-color: #8a6d2f !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-content {
  background: #ffffff !important;
}

.card-title a {
  color: #8a6d2f !important;
}

.card-content-text {
  color: #555 !important;
  background: #ffffff !important;
}

/* ═══════ KEEP HERO TITLE LIGHT ═══════ */

article.home h1 {
  color: #ffffff !important;
  text-shadow:
    0 0 40px rgba(255, 255, 255, 0.4),
    0 0 80px rgba(226, 198, 126, 0.3),
    0 4px 30px rgba(0, 0, 0, 1) !important;
}