/* ───────────────────────────────────────────────────────────────
   KORT-X shared visual-effects layer
   Loaded by main.html and every subpage. Pure progressive
   enhancement: pages render fine if this file fails to load.
   ─────────────────────────────────────────────────────────────── */

/* Neural particle field — sits between the body background and content */
#kx-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Soft vignette so content stays readable over the particle field */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 0%, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
}
body[data-theme="light"]::after {
  background: radial-gradient(ellipse at center,
    transparent 0%, transparent 60%, rgba(120, 140, 165, 0.12) 100%);
}

/* Scroll-reveal for cards */
.fx-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.165, .84, .44, 1);
}
.fx-reveal.fx-in {
  opacity: 1;
  transform: none;
}

/* Cursor-tracking glow on cards (uses --mx / --my set from JS) */
.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(52, 152, 219, 0.07), rgba(255, 255, 255, 0.015) 45%);
  border-top-color: rgba(52, 152, 219, 0.28);
}
body[data-theme="light"] .card {
  background: linear-gradient(165deg, rgba(52, 152, 219, 0.08), rgba(0, 0, 0, 0.03) 45%);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 152, 219, 0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), 0 0 30px rgba(52, 152, 219, 0.08);
}
body[data-theme="light"] .card:hover {
  box-shadow: 0 14px 40px rgba(100, 120, 145, 0.18), 0 0 30px rgba(52, 152, 219, 0.10);
}
.card-icon {
  color: var(--primary);
  text-shadow: 0 0 18px rgba(52, 152, 219, 0.6);
}
.card-title {
  position: relative;
  padding-bottom: 8px;
}
.card-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

/* Banner: stronger gradient + animated underline */
.page-banner {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.10) 0%, transparent 60%) !important;
}
.page-banner::after {
  content: '';
  position: absolute;
  left: 40px;
  bottom: 0;
  height: 2px;
  width: 190px;
  background: linear-gradient(90deg, var(--primary), transparent);
  animation: fxLineGrow 1.2s cubic-bezier(.165, .84, .44, 1) 0.3s backwards;
}
@keyframes fxLineGrow {
  from { width: 0; opacity: 0; }
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(52, 152, 219, 0.10), transparent 65%);
}
.card:hover::after { opacity: 1; }

/* Cards that open a dedicated module page (data-topic) */
.card-topic { cursor: pointer !important; }
.card-topic * { cursor: pointer !important; }
.card-topic::before {
  content: '→';
  position: absolute;
  top: 16px;
  right: 18px;
  color: var(--primary);
  font-size: 14px;
  opacity: 0.25;
  transform: translateX(-4px);
  transition: 0.25s ease;
  pointer-events: none;
}
.card-topic:hover::before { opacity: 0.95; transform: none; }
.card-topic:focus-visible {
  outline: 1px solid var(--primary);
  outline-offset: 2px;
}

/* Page-banner title entrance on subpages */
.page-title {
  animation: fxTitleIn 0.9s cubic-bezier(.165, .84, .44, 1) backwards;
}
.page-subtitle, .breadcrumb {
  animation: fxFadeIn 1s ease 0.25s backwards;
}
@keyframes fxTitleIn {
  from { opacity: 0; transform: translateY(16px); letter-spacing: 14px; filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes fxFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ───────────────────────────────────────────────────────────────
   Section building blocks for the developed subpages
   ─────────────────────────────────────────────────────────────── */

/* Stat strip under the banner */
.fx-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 8px; }
.fx-stat {
  flex: 1 1 150px;
  border: 1px solid var(--glass-border);
  border-left: 2px solid var(--primary);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--card-bg);
  transition: 0.25s ease;
}
.fx-stat:hover { border-color: rgba(52, 152, 219, 0.45); box-shadow: 0 0 22px rgba(52, 152, 219, 0.08); }
.fx-stat-num { font-size: 22px; font-weight: 850; letter-spacing: 1px; color: var(--primary); }
.fx-stat-label { font-size: 8px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.5; margin-top: 4px; }

/* Titled section with rule line */
.fx-section { margin-top: 46px; }
.fx-section-title {
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.fx-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(52, 152, 219, 0.4), transparent);
}

/* Vertical timeline */
.fx-timeline { position: relative; padding-left: 26px; }
.fx-timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 4px; bottom: 4px;
  width: 1px;
  background: linear-gradient(to bottom, var(--primary), transparent);
}
.fx-tl-item { position: relative; padding: 0 0 26px 18px; }
.fx-tl-item::before {
  content: '';
  position: absolute;
  left: -23px; top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--primary);
  background: var(--bg);
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}
.fx-tl-phase { font-size: 9px; letter-spacing: 3px; color: var(--primary); text-transform: uppercase; margin-bottom: 6px; }
.fx-tl-text { font-size: 0.72rem; line-height: 1.7; opacity: 0.65; max-width: 640px; }

/* Layer stack (technology layers) */
.fx-layers { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.fx-layer {
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 14px 18px;
  background: linear-gradient(90deg, rgba(52, 152, 219, 0.08), transparent 55%);
  display: flex;
  align-items: baseline;
  gap: 14px;
  transition: 0.25s ease;
}
.fx-layer:hover { border-color: rgba(52, 152, 219, 0.5); transform: translateX(6px); }
.fx-layer-no { font-family: 'Consolas', monospace; font-size: 9px; color: var(--primary); opacity: 0.8; }
.fx-layer-name { font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; }
.fx-layer-desc { font-size: 0.66rem; opacity: 0.5; margin-left: auto; text-align: right; max-width: 46%; }

/* Chip cloud (namespaces, tags) */
.fx-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.fx-chip {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  background: var(--card-bg);
  transition: 0.2s ease;
}
.fx-chip:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 16px rgba(52, 152, 219, 0.15); }
.fx-chip b { color: var(--primary); font-weight: 600; }

/* Role rows (careers) */
.fx-roles { display: flex; flex-direction: column; gap: 10px; }
.fx-role {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 16px 20px;
  background: var(--card-bg);
  transition: 0.25s ease;
}
.fx-role:hover { border-color: rgba(52, 152, 219, 0.45); transform: translateX(6px); }
.fx-role-status {
  font-size: 7px;
  letter-spacing: 2px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(52, 152, 219, 0.4);
  color: var(--primary);
  white-space: nowrap;
}
.fx-role-name { font-size: 0.74rem; letter-spacing: 2px; text-transform: uppercase; }
.fx-role-meta { margin-left: auto; font-size: 0.64rem; opacity: 0.45; text-align: right; }

/* Closing CTA panel + cross-page links */
.fx-cta {
  margin-top: 50px;
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: 14px;
  padding: 30px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(52, 152, 219, 0.08), transparent 70%);
}
.fx-cta-title { font-size: 0.9rem; letter-spacing: 5px; text-transform: uppercase; margin-bottom: 10px; }
.fx-cta-text { font-size: 0.7rem; opacity: 0.55; margin-bottom: 18px; }
.fx-next { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.fx-next a {
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 0.62rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: 0.2s ease;
}
.fx-next a:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 14px rgba(52, 152, 219, 0.12); }

/* Centered manifesto quote */
.fx-quote {
  margin: 44px auto 0;
  max-width: 720px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 200;
  letter-spacing: 2px;
  line-height: 1.9;
  opacity: 0.7;
  font-style: italic;
}
.fx-quote::before { content: '« '; color: var(--primary); }
.fx-quote::after { content: ' »'; color: var(--primary); }

/* Slim themed scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(52, 152, 219, 0.25);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(52, 152, 219, 0.5); }

/* Interactive elements get a real pointer (crosshair stays elsewhere) */
button, a, select, label, [role="button"],
#theme-toggle, #chat-close, #chat-send, .menu-btn {
  cursor: pointer !important;
}
input, textarea { cursor: text !important; }

/* Accessibility: respect reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  .fx-reveal { transition: none; opacity: 1; transform: none; }
  .page-title, .page-subtitle, .breadcrumb { animation: none; }
  .page-banner::after { animation: none; }
  .scan-glow { animation-duration: 30s; }
}
