/* ================================================================
   INKREALM NEXUS — Companion stylesheet (load AFTER 618.css)
   New components + overrides for the 2026 restructure
   ================================================================ */

/* ----------------------------------------------------------------
   1. VARIABLES & WATERMARK OVERRIDE
   ---------------------------------------------------------------- */
:root {
  --primary: #ff0000;
  --red: #ff0000;           /* slightly hotter red than 618’s #ff0033 */
  --font-mono: 'Kode Mono', 'VT323', 'Courier New', monospace;
}

/* Watermark (overrides / complements 618 body::before) */
body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, 60vw);
  height: min(400px, 60vw);
  background: url("https://wordstar.nexus/svg/favicon.svg") no-repeat center;
  background-size: contain;
  opacity: 0.03;
  pointer-events: none;
  z-index: -1;
}

/* ----------------------------------------------------------------
   2. HEADER & NAVIGATION (grid layout + center nav)
   ---------------------------------------------------------------- */
.site-header {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 10px 20px !important;
}

.header-left {
  justify-self: start !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.header-right {
  justify-self: end !important;
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
}

.header-nav {
  display: flex !important;
  gap: 15px !important;
  font-family: var(--font-mono, 'VT323', monospace) !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  justify-self: center !important;
  align-items: center !important;
}

.header-nav a {
  color: #777 !important;
  text-decoration: none !important;
  transition: color 0.25s ease !important;
}

.header-nav a:hover {
  color: #fff !important;
}

.header-nav .music-link {
  color: var(--red, #ff0000) !important;
  border: 1px solid rgba(255, 0, 0, 0.4) !important;
  padding: 2px 6px !important;
  border-radius: 2px !important;
  font-weight: bold !important;
}

.header-nav .music-link:hover {
  color: #fff !important;
  background: var(--red, #ff0000) !important;
  border-color: var(--red, #ff0000) !important;
}

@media (max-width: 820px) {
  .header-nav { display: none !important; }
  .site-header { display: flex !important; justify-content: space-between !important; }
}

/* ----------------------------------------------------------------
   3. HERO PENCIL COMPONENT
   ---------------------------------------------------------------- */
.ink-hero-pencil-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(24px, 5vw, 40px) clamp(16px, 4vw, 40px);
  background: #080808;
  border-top: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  gap: 24px;
}

.hero-pencil {
  flex: 0 0 auto;
  width: min(36vw, 320px);
  filter: drop-shadow(0 0 25px rgba(255,0,0,0.3));
  animation: pencilFloat 4.2s ease-in-out infinite;
}

.hero-text-block {
  flex: 1;
  text-align: right;
  filter: url(#threshfxStrong);
}

.ink-glitch-line {
  font-size: clamp(26px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #333;
  display: block;
}

.ink-glitch-line.shard {
  animation: glitchSplit 3.5s infinite steps(2, end);
}

@keyframes glitchSplit {
  0%, 100% { clip-path: inset(0 0 0 0); }
  25% { clip-path: inset(18% 0 65% 0); }
  50% { clip-path: inset(50% 0 25% 0); }
  75% { clip-path: inset(8% 0 80% 0); }
}

@keyframes pencilFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* Electric pencil SVG internal styles live in the SVG itself */

/* ----------------------------------------------------------------
   4. MARQUEE & WORD WALL
   ---------------------------------------------------------------- */
.ink-marquee-block {
  width: 100%;
  overflow: hidden;
  background: #050505;
  border-top: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  padding: 12px 0;
  cursor: ew-resize;
}

.ink-marquee-track {
  display: flex;
  white-space: nowrap;
  font-size: clamp(16px, 4vw, 32px);
  text-transform: uppercase;
  color: #333;
  filter: url(#threshfxStrong);
  animation: inkMarqueeAnim 26s linear infinite;
  will-change: transform;
}

.ink-marquee-track span { padding: 0 20px; }

@keyframes inkMarqueeAnim {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ink-wordwall {
  padding: 40px 16px;
  background: #050505;
  border-bottom: 1px solid #1a1a1a;
}

.ink-wall-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 32px;
  max-width: 900px;
  margin: 0 auto;
}

.ink-wall-item {
  font-size: clamp(18px, 4.5vw, 48px);
  line-height: 1.15;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid #222;
  padding-bottom: 6px;
  cursor: default;
  transition: color 0.2s, border-color 0.2s;
}

.ink-wall-item:hover {
  color: #ff0000;
  border-color: #ff0000;
}

/* ----------------------------------------------------------------
   5. TERMINAL FREQUENCIES // UNIFORM MEDIA VAULT
   ---------------------------------------------------------------- */
#vaultSection {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.k-header {
  font-size: clamp(22px, 5vw, 40px);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.k-header .hl { color: var(--primary); }

.section-intro {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #777;
  line-height: 1.5;
  margin-bottom: 25px;
  text-transform: uppercase;
  border-left: 2px solid var(--primary);
  padding-left: 10px;
}

.vault-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.signal-card {
  background: #080808;
  border: 1px solid #222;
  padding: 8px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s;
}

.signal-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.signal-card .card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signal-card .card-media img,
.signal-card .card-media video {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  filter: contrast(1.15) grayscale(0.2);
  transition: transform 0.35s ease, filter 0.3s ease;
}

.signal-card:hover .card-media img,
.signal-card:hover .card-media video {
  filter: contrast(1.25) grayscale(0);
  transform: scale(1.04);
}

.signal-card .expand-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
}

.signal-card:hover .expand-badge { opacity: 1; }

.signal-card .card-info { margin-top: 10px; font-family: var(--font-mono); }
.signal-card .card-kicker { color: var(--primary); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; }
.signal-card .card-text { color: #888; font-size: 11px; line-height: 1.4; text-transform: uppercase; margin-top: 4px; }

/* ----------------------------------------------------------------
   6. CENTERED WORDSTAR NEWS ACCORDION
   ---------------------------------------------------------------- */
#faq {
  max-width: 800px !important;
  margin: 40px auto !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  background: transparent !important;
}

.faq-head {
  font-family: var(--font-mono);
  font-size: clamp(22px, 5vw, 36px);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.faq-head .hl { color: var(--primary); }

.faq-item {
  border: 1px solid #222;
  background: #080808;
  margin-bottom: 12px;
}

.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: 0;
  color: #ccc;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  padding: 16px 14px;
  cursor: pointer;
  text-align: left;
}

.faq-q span { color: var(--primary); font-size: 14px; font-weight: bold; }

.faq-q:hover,
.faq-item.open .faq-q {
  color: #fff;
  background: #111;
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq-item.open .faq-a { max-height: 500px; }

.faq-a .story-body {
  padding: 14px;
  border-top: 1px dashed #222;
  color: #888;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.faq-a .story-body .dialogue {
  color: #fff;
  border-left: 2px solid var(--primary);
  padding-left: 10px;
  margin: 10px 0;
}

.faq-a .story-body .mono-code {
  display: inline-block;
  background: #111;
  border: 1px solid #333;
  color: var(--primary);
  padding: 2px 6px;
  font-size: 10px;
  margin: 8px 0;
}

/* ----------------------------------------------------------------
   7. CENTERED FOOTER LOGO (WHITE .INFO)
   ---------------------------------------------------------------- */
.logo-section-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 25px auto 10px !important;
}

svg.inkrealm-logo {
  display: block;
  width: 100% !important;
  max-width: 580px !important;
  height: auto !important;
  overflow: visible !important;
  margin: 0 auto;
}

.logo-text-grey { fill: #777777 !important; transition: all 0.2s ease; }
.logo-text-pink,
.logo-text-white { fill: #ffffff !important; transition: all 0.2s ease; }
.visual-dot { fill: #b31419 !important; transition: all 0.1s ease; transform-origin: center; pointer-events: none; }
.ghost-trigger { opacity: 0; cursor: pointer; }
.ghost-trigger:hover ~ .visual-dot { animation: dot-overload 0.6s infinite linear; }
.ghost-trigger:hover ~ .logo-text-grey { animation: text-shock 0.15s infinite alternate; }
.ghost-trigger:hover ~ .logo-text-pink,
.ghost-trigger:hover ~ .logo-text-white { animation: text-shock 0.15s infinite alternate-reverse; }

@keyframes dot-overload {
  0%, 100% { fill: #FFD700 !important; transform: scale(1.0) rotate(0deg); }
  25% { fill: #00FFFF !important; transform: scale(1.4) rotate(90deg); }
  50% { fill: #FFFFFF !important; transform: scale(0.8) rotate(180deg); }
  75% { fill: #FFD700 !important; transform: scale(1.4) rotate(270deg); }
}

@keyframes text-shock {
  0%, 100% { transform: translate(0, 0); }
  25% { fill: #FFD700 !important; transform: translate(-2px, 1px); }
  50% { fill: #00FFFF !important; transform: translate(2px, -2px); }
  75% { fill: #FFFFFF !important; transform: translate(-1px, -2px); }
}

/* ----------------------------------------------------------------
   8. LIGHTBOX MODAL OVERLAY
   ---------------------------------------------------------------- */
#imageModal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#imageModal.open {
  opacity: 1;
  pointer-events: auto;
}

#imageModal .modal-container {
  position: relative;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  border: 1px solid var(--primary);
  box-shadow: 0 0 40px rgba(255,0,0,0.35);
  overflow: hidden;
}

#imageModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #222;
  background: #000;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
}

#imageModal .modal-close {
  background: transparent;
  border: 1px solid var(--primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
}

#imageModal .modal-close:hover {
  background: var(--primary);
  color: #000;
}

#imageModal .modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030303;
  padding: 16px;
  min-height: 280px;
  max-height: 60vh;
  overflow: hidden;
}

#imageModal .modal-body img,
#imageModal .modal-body video {
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
}

#imageModal .modal-footer {
  padding: 10px 14px;
  background: #000;
  border-top: 1px solid #222;
  font-family: var(--font-mono);
}

#imageModal .modal-title {
  font-size: 12px;
  color: #fff;
  text-transform: uppercase;
}

#imageModal .modal-desc {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  line-height: 1.4;
}

/* ----------------------------------------------------------------
   9. SCANLINES + FULL-PAGE INVERT
   ---------------------------------------------------------------- */
.scanlines {
  position: relative;
  overflow: hidden;
}

.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.55) 0 1px, transparent 1px 3px);
  background-size: 100% 3px;
  animation: scanMove 1.1s linear infinite;
  z-index: 4;
}

@keyframes scanMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 6px; }
}

/* Pure CSS Full Page Invert */
html:has(#invertToggleCheckbox:checked) {
  filter: invert(1) hue-rotate(180deg) contrast(1.05) brightness(0.95);
  -webkit-filter: invert(1) hue-rotate(180deg) contrast(1.05) brightness(0.95);
  background-color: #fff !important;
}

/* Protect images, videos, modals, docks & canvas from becoming negatives */
html:has(#invertToggleCheckbox:checked) img,
html:has(#invertToggleCheckbox:checked) video,
html:has(#invertToggleCheckbox:checked) iframe,
html:has(#invertToggleCheckbox:checked) canvas,
html:has(#invertToggleCheckbox:checked) #imageModal,
html:has(#invertToggleCheckbox:checked) .ink-floating-dock,
html:has(#invertToggleCheckbox:checked) .electric-pencil-svg {
  filter: invert(1) hue-rotate(180deg) !important;
  -webkit-filter: invert(1) hue-rotate(180deg) !important;
}

/* ----------------------------------------------------------------
   10. RAISED FLOATING DOCK (LIT + BACK-TO-TOP)
   ---------------------------------------------------------------- */
.ink-floating-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.dock-action-btn {
  background: #080808;
  color: var(--primary, #ff0000);
  border: 1px solid var(--primary, #ff0000);
  font-family: var(--font-mono, 'VT323', monospace);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.8), 0 0 4px rgba(255, 0, 0, 0.2);
  transition: all 0.2s ease-in-out;
  outline: none;
}

.dock-action-btn:hover {
  background: var(--primary, #ff0000);
  color: #000000;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
  transform: translateY(-2px);
}

.dock-action-btn:active {
  transform: translateY(0);
}

/* ----------------------------------------------------------------
   11. RESPONSIVE ADJUSTMENTS FOR NEW COMPONENTS
   ---------------------------------------------------------------- */
@media (max-width: 860px) {
  .vault-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .ink-wall-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 580px) {
  .vault-grid-6 { grid-template-columns: 1fr; }
  .ink-hero-pencil-wrap { flex-direction: column; text-align: center; }
  .hero-pencil { width: min(60vw, 200px); }
  .hero-text-block { text-align: center; }
}

/* ----------------------------------------------------------------
   12. HERMES / NOUS INTERFACE (Static Memory section)
   ---------------------------------------------------------------- */
#nous-interface {
  margin-top: 30px;
  max-width: 280px;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono, 'VT323', monospace);
}

#nous-toggle {
  background: transparent;
  border: 1px solid var(--primary, #ff0000);
  color: var(--primary, #ff0000);
  font-family: var(--font-mono, 'VT323', monospace);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
}

#nous-toggle:hover {
  background: var(--primary, #ff0000);
  color: #000;
}

#nous-panel {
  display: none;
  margin-top: 12px;
  background: #080808;
  border: 1px solid #222;
  padding: 14px;
  font-family: var(--font-mono, 'VT323', monospace);
}

#nous-panel[style*="block"],
#nous-panel.open {
  display: block;
}

.nous-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid #333;
  color: #888;
  font-family: var(--font-mono, 'VT323', monospace);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 12px;
  cursor: pointer;
  margin: 8px 0;
  transition: all 0.2s ease;
}

.nous-btn:hover {
  border-color: var(--primary, #ff0000);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.2);
}

.nous-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#loadCoreBtn {
  border-color: var(--primary, #ff0000);
  color: var(--primary, #ff0000);
}

#loadCoreBtn:hover {
  background: var(--primary, #ff0000);
  color: #000;
}

#nous-output {
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
  background: #000;
  border: 1px solid #222;
  color: #888;
  font-size: 11px;
  line-height: 1.5;
  padding: 10px;
  margin: 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.nous-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #050505;
  border: 1px solid #333;
  color: #fff;
  font-family: var(--font-mono, 'VT323', monospace);
  font-size: 12px;
  padding: 10px;
  margin: 8px 0;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s;
}

.nous-input:focus {
  border-color: var(--primary, #ff0000);
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.15);
}

.nous-input::placeholder {
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#dl-track {
  width: 100%;
  height: 2px;
  background: #222;
  margin: 10px 0;
}

#dl-bar {
  height: 100%;
  background: var(--primary, #ff0000);
  width: 0%;
  transition: width 0.2s ease;
}

#dl-text {
  text-align: right;
  font-size: 9px;
  color: #444;
  letter-spacing: 1px;
}

#nous-status {
  font-size: 9px;
  letter-spacing: 1px;
}
