/* =========================================================================
   TIBIA NOIR // VECTOR X100 CSS ENGINE
   MICA NOIR AESTHETICS (YInMn Blue #2B3BE5)
   ========================================================================= */

:root {
  --accent-tibia: #2B3BE5; /* YInMn Blue */
  --bg-cinematic: #000000;
}

body.tibia-noir-page {
  --accent-primary: var(--accent-tibia);
  --accent-secondary: #b4ff00;
  --accent-gradient: linear-gradient(135deg, var(--accent-tibia), #6a78ff);
  background-color: var(--bg-cinematic);
  overflow-x: hidden;
}

/* ── 1. CINEMATIC BACKGROUND ── */
.tibia-noir-page .cinematic-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  overflow: hidden;
}

.tibia-noir-page .cinematic-bg video {
  min-width: 100%;
  min-height: 100%;
  width: auto; height: auto;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: grayscale(80%) contrast(1.2) brightness(0.6);
  opacity: 0.4;
  will-change: transform;
}

.tibia-noir-page .cinematic-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.8) 100%),
              url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.8;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ── 2. NARRATIVE HERO ── */
.tibia-noir-page .tibia-hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}

.tibia-noir-page .tibia-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  color: #fff;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.tibia-noir-page .title-sub {
  font-size: 0.3em;
  color: var(--accent-tibia);
  letter-spacing: 0.5em;
  margin-top: 0.5rem;
  text-shadow: 0 0 10px rgba(43, 59, 229, 0.4);
}

.tibia-noir-page .tibia-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin-bottom: 2rem;
}

/* ── 3. AWWWARDS TILT CARDS & GLARE ── */
.tibia-noir-page .chapter-card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  background: rgba(10, 10, 12, 0.7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(43, 59, 229, 0.15); /* YInMn */
  padding: 3rem;
  margin-bottom: 4rem;
  border-radius: 4px;
  transition: transform 0.4s var(--spring-120hz, cubic-bezier(0.175, 0.885, 0.32, 1.275)),
              border-color 0.4s ease,
              box-shadow 0.4s ease;
}

.tibia-noir-page .card-glare {
  position: absolute;
  width: 200%; height: 200%;
  top: -50%; left: -50%;
  background: radial-gradient(circle at center, rgba(43, 59, 229, 0.25) 0%, transparent 50%); /* YInMn */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  z-index: 10;
  mix-blend-mode: color-dodge;
}

.tibia-noir-page .chapter-card:hover .card-glare {
  opacity: 1;
}

.tibia-noir-page .chapter-card:hover,
.tibia-noir-page .chapter-card.is-active {
  border-color: var(--accent-tibia);
  box-shadow: 0 0 40px rgba(43, 59, 229, 0.2), inset 0 0 20px rgba(43, 59, 229, 0.05);
  transform: translateY(-10px);
}

/* ── 4. CONTENT TYPOGRAPHY ── */
.tibia-noir-page .chapter-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--accent-tibia);
  margin-bottom: 1rem;
  display: block;
  letter-spacing: 0.2em;
  text-shadow: 0 0 10px rgba(43, 59, 229, 0.3);
}

.tibia-noir-page .chapter-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.tibia-noir-page .chapter-content {
  font-size: 1.2rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.8);
}

.tibia-noir-page .chapter-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  margin-bottom: 2rem;
  border-radius: 2px;
  filter: grayscale(100%) contrast(1.1) brightness(0.8);
  transition: filter 0.4s ease;
}

.tibia-noir-page .chapter-card:hover .chapter-img,
.tibia-noir-page .chapter-card.is-active .chapter-img {
  filter: grayscale(20%) contrast(1.1) drop-shadow(0 0 10px rgba(43, 59, 229, 0.1));
}

/* ── 5. KINETIC & ABERRATION ENGINES ── */
.tibia-noir-page .rgb-split {
  transition: text-shadow 0.1s ease-out;
  will-change: text-shadow;
}

.tibia-noir-page .word-stagger {
  display: inline-block;
  white-space: pre;
}

.tibia-noir-page .glitch-text-tibia {
  position: relative;
}
.tibia-noir-page .glitch-text-tibia::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 2px; width: 100%;
  clip: rect(0, 900px, 0, 0);
  color: #fff; background: transparent;
  animation: noise-anim 2s infinite linear alternate-reverse;
}

@keyframes noise-anim {
  0%   { clip: rect(3px, 9999px, 86px, 0); }
  25%  { clip: rect(65px, 9999px, 12px, 0); }
  50%  { clip: rect(43px, 9999px, 86px, 0); }
  75%  { clip: rect(89px, 9999px, 21px, 0); }
  100% { clip: rect(11px, 9999px, 49px, 0); }
}

.tibia-noir-page .article-back {
  color: var(--accent-tibia) !important;
  text-shadow: 0 0 5px rgba(43, 59, 229, 0.4);
}

.tibia-noir-page .hero-label,
.tibia-noir-page .hero-author,
.tibia-noir-page .hero-date,
.tibia-noir-page .hero-reading-time,
.tibia-noir-page .hero-subtitle {
  text-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
}

.tibia-noir-page .article-epigraph,
.tibia-noir-page .article-epilogue {
  border-color: rgba(43, 59, 229, 0.18);
  background: rgba(10, 10, 12, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.tibia-noir-page .article-toc {
  padding-left: 1.5rem;
}

.tibia-noir-page .toc-link.active {
  border-left-color: var(--accent-tibia);
  background: rgba(43, 59, 229, 0.14);
  color: #fff;
}

.tibia-noir-page .nexo-link {
  color: #93a1ff;
}

.tibia-noir-page .nexo-link:hover {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .tibia-noir-page .chapter-card,
  .tibia-noir-page .chapter-card:hover,
  .tibia-noir-page .chapter-card.is-active {
    transform: none;
  }
}
