.card-front-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
}
.card-flip-front .avatar-container {
  margin-right: 1.5rem;
  min-width: 120px;
}
.avatar-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, rgba(189,0,255,0.12), rgba(0,242,255,0.08));
  padding: 1rem 0;
}
.card_index-img-full {
  width: 100%;
  max-width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 1.2rem;
  border: 4px solid var(--border);
  box-shadow: 0 0 24px rgba(189,0,255,0.18);
}

.card-flip {
  perspective: 1200px;
  cursor: pointer;
  min-height: 260px;
}
.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
}
.card-flip.flipped .card-flip-inner {
  transform: rotateY(180deg);
}
.card-flip-front, .card-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.card-flip-front {
  background: linear-gradient(140deg, rgba(22, 10, 38, 0.9), rgba(8, 1, 21, 0.95));
  z-index: 2;
}
.card-flip-back {
  background: linear-gradient(140deg, rgba(8, 1, 21, 0.95), rgba(22, 10, 38, 0.9));
  transform: rotateY(180deg);
  z-index: 3;
}
.modal-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.modal-fullscreen .modal-dialog {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.modal-fullscreen .modal-content {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
:root {
  --bg: #0b021d;
  --card-bg: #160a26;
  --border: #1a0b2e;
  --primary: #bd00ff;
  --secondary: #00f2ff;
  --accent: #ff00ea;
  --warning: #fff600;
  --success: #10b981;
}

body.theme-alt {
  --bg: #060113;
  --card-bg: #120823;
  --border: #24123d;
  --primary: #00f2ff;
  --secondary: #ff00ea;
  --accent: #bd00ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', 'Segoe UI', 'Trebuchet MS', Arial, sans-serif;
  background-color: var(--bg);
  color: #f3e8ff;
  overflow-x: hidden;
  line-height: 1.6;
}

.font-cartoon { font-family: 'Impact', 'Bangers', system-ui; letter-spacing: 0.05em; }
.font-mono { font-family: 'Consolas', 'JetBrains Mono', monospace; }

/* Chunky Borders and Shadows */
.chunky-border {
  border: 4px solid var(--border);
}
.chunky-shadow {
  box-shadow: 8px 8px 0px #000;
  transition: box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chunky-shadow-sm {
  box-shadow: 4px 4px 0px #000;
}

/* Glow Effects */
.text-glow-purple { text-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary); }
.text-glow-cyan { text-shadow: 0 0 15px var(--secondary), 0 0 30px var(--secondary); }
.text-glow-pink { text-shadow: 0 0 15px var(--accent), 0 0 30px var(--accent); }

.filter-glow-purple { filter: drop-shadow(0 0 10px var(--primary)); }
.filter-glow-cyan { filter: drop-shadow(0 0 10px var(--secondary)); }
.filter-glow-pink { filter: drop-shadow(0 0 10px var(--accent)); }

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Entrance Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  box-shadow: 0 0 10px var(--primary);
  z-index: 200;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Background Effects */
.bg-halftone {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(0,0,0,0.2) 15%, transparent 16%);
  background-size: 10px 10px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.bg-diag {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(189,0,255,0.05), rgba(189,0,255,0.05) 10px, transparent 10px, transparent 20px);
  animation: slide-diag 20s linear infinite;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.architecture-panel {
  margin: 2rem auto 1rem;
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: rgba(16, 9, 39, 0.85);
  border: 1px solid rgba(189, 0, 255, 0.5);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.architecture-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.architecture-panel h2 {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  color: var(--secondary);
}

.architecture-panel p {
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.85);
}

.architecture-layers,
.architecture-benefits {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.architecture-layers li,
.architecture-benefits li {
  background: rgba(189, 0, 255, 0.15);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  color: #ffe6ff;
}

.architecture-modal-body {
  max-height: 60vh;
  overflow-y: auto;
}

.architecture-modal-section {
  margin-bottom: 1.5rem;
}

.architecture-modal-section h3 {
  margin-bottom: 0.35rem;
  color: var(--secondary);
}

.architecture-modal-section ul {
  margin: 0;
  padding-left: 1rem;
}

.architecture-modal-section li {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Navigation */
nav {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 90%;
  max-width: 1200px;
}

.nav-container {
  background: rgba(22, 10, 38, 0.9);
  backdrop-filter: blur(10px);
  border: 4px solid var(--border);
  box-shadow: 4px 4px 0px #000;
  border-radius: 1rem;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  animation: logo-pulse 4s infinite ease-in-out;
}

.nav-logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--primary);
  border: 4px solid var(--border);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.nav-logo:hover .nav-logo-icon {
  animation: mana-flow 4s linear infinite;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-family: 'Bangers', system-ui;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(196, 181, 253, 0.5);
  cursor: pointer;
  transition: all 0.3s;
  background: none;
  border: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--secondary);
  text-shadow: 0 0 15px var(--secondary), 0 0 30px var(--secondary);
  transform: translateY(-2px);
}

.nav-cta {
  background: var(--accent);
  border: 4px solid var(--border);
  box-shadow: 4px 4px 0px #000;
  padding: 0.375rem 1.25rem;
  border-radius: 0.75rem;
  font-family: 'Bangers', system-ui;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
}

.nav-cta:hover {
  background: #ff40ee;
  text-shadow: 0 0 15px var(--accent), 0 0 30px var(--accent);
  transform: scale(1.05);
}

/* Hero Section */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-block;
  background: var(--primary);
  border: 4px solid var(--border);
  box-shadow: 4px 4px 0px #000;
  padding: 0.375rem 1.25rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  transform: rotate(-2deg);
  animation: float 6s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 8rem);
  font-family: 'Bangers', system-ui;
  color: white;
  line-height: 0.9;
  margin-bottom: 2rem;
  text-shadow: 8px 8px 0px #1a0b2e;
  animation: strobe 4s infinite step-end;
}

.hero-title-accent {
  color: var(--secondary);
  text-shadow: 0 0 15px var(--secondary), 0 0 30px var(--secondary), 8px 8px 0px #1a0b2e;
  font-style: italic;
}

.hero-description {
  max-width: 800px;
  margin: 0 auto 3rem;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(196, 181, 253, 0.5);
  line-height: 1.8;
}

.hero-description strong {
  color: white;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 4px;
  text-underline-offset: 8px;
  text-shadow: 0 0 15px var(--accent), 0 0 30px var(--accent);
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.btn {
  border: 4px solid var(--border);
  box-shadow: 8px 8px 0px #000;
  padding: 1.25rem 2.5rem;
  border-radius: 1rem;
  font-family: 'Bangers', system-ui;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: white;
  color: black;
  transform: scale(1.1);
}

.btn-secondary {
  background: black;
  color: white;
}

.btn-secondary:hover {
  background: var(--secondary);
  color: black;
  transform: scale(1.1);
}

/* Codex Section */
#codex {
  padding: 10rem 1.5rem;
  background: #080115;
  position: relative;
  overflow: hidden;
  border-top: 8px solid var(--border);
}

.codex-header {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 8rem;
}

@media (min-width: 768px) {
  .codex-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.codex-badge {
  background: var(--accent);
  border: 4px solid var(--border);
  padding: 0.25rem 1rem;
  border-radius: 0.5rem;
  display: inline-block;
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(255, 0, 234, 0.4);
}

.codex-title {
  font-size: clamp(3rem, 8vw, 9rem);
  font-family: 'Bangers', system-ui;
  color: white;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.codex-subtitle {
  color: rgba(196, 181, 253, 0.7);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  border-left: 4px solid #9333ea;
  padding-left: 1rem;
  max-width: 800px;
  line-height: 1.8;
}

.codex-controls {
  display: flex;
  gap: 1rem;
}

.control-btn {
  width: 4rem;
  height: 4rem;
  background: var(--card-bg);
  border: 4px solid var(--border);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4b5fd;
  cursor: pointer;
  transition: all 0.3s;
}

.control-btn:hover {
  color: white;
  background: var(--primary);
}

.control-btn.spinning {
  animation: spin 1s linear;
}

/* Grid Layout */
.codex-grid {
  display: grid;
  gap: 4rem;
  margin-bottom: 10rem;
}

@media (min-width: 1024px) {
  .codex-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.codex-column {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-title h4 {
  font-family: 'Bangers', system-ui;
  font-size: 2.25rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* Color Swatches */
.color-swatches {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.color-swatch {
  padding: 1rem;
  border-radius: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: 140px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.7s ease;
}

.color-swatch:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.6);
}

.color-swatch-front {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 100%;
  transition: all 0.7s ease;
}

.color-swatch:hover .color-swatch-front {
  transform: translateY(-120%);
}

.color-box {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  border: 4px solid var(--border);
  flex-shrink: 0;
  transition: all 1s;
}

.color-swatch:hover .color-box {
  transform: scale(0.9) rotate(360deg);
}

.color-info h5 {
  font-family: 'Bangers', system-ui;
  font-size: 1.5rem;
  color: white;
  letter-spacing: 0.05em;
}

.color-info p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: #a78bfa;
  font-weight: bold;
}

.color-swatch-back {
  position: absolute;
  inset: 0;
  padding: 1.25rem;
  background: linear-gradient(to bottom right, #1a0b2e, #000);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.color-swatch:hover .color-swatch-back {
  transform: translateY(0);
}

.swatch-back-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.swatch-back-logic {
  max-width: 70%;
}

.swatch-back-logic-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.25rem;
}

.swatch-back-logic-text {
  color: white;
  font-size: 0.625rem;
  line-height: 1.4;
  font-style: italic;
  opacity: 0;
  transition: opacity 0.3s 0.2s;
}

.color-swatch:hover .swatch-back-logic-text {
  opacity: 1;
}

.copy-btn {
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
  background: var(--success);
  color: black;
  transform: scale(1.1);
}

.swatch-back-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.swatch-meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.125rem;
}

.swatch-meta-value {
  color: white;
  font-weight: bold;
  font-size: 0.5625rem;
}

.swatch-meta-pair {
  color: var(--secondary);
  font-family: 'Bangers', system-ui;
  font-size: 0.625rem;
  letter-spacing: 0.15em;
}

/* Icon Runes */
.icon-runes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.icon-rune {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 4px solid var(--border);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.icon-rune::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(189, 0, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.icon-rune:hover {
  transform: scale(1.1) translateY(-0.5rem);
  background: rgba(0, 0, 0, 0.5);
}

.icon-rune:hover::before {
  opacity: 1;
}

.icon-rune svg {
  color: #c4b5fd;
  margin-bottom: 0.75rem;
  animation: rune-breathing 4s infinite ease-in-out;
  position: relative;
  z-index: 10;
  transition: all 0.3s;
}

.icon-rune:hover svg {
  color: white;
  animation: soft-pulse 3s infinite ease-in-out;
}

.icon-rune-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: #9333ea;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  position: relative;
  z-index: 10;
  transition: all 0.3s;
}

.icon-rune:hover .icon-rune-name {
  color: var(--secondary);
}

.icon-rune-meaning {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: white;
  font-size: 0.5rem;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s;
  box-shadow: 0 -5px 15px rgba(189, 0, 255, 0.4);
}

.icon-rune:hover .icon-rune-meaning {
  transform: translateY(0);
}

/* Typography Tester */
.typography-tester {
  background: rgba(0, 0, 0, 0.6);
  padding: 1.5rem;
  border-radius: 2rem;
  border: 4px solid var(--border);
}

.typography-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--secondary);
  outline: none;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  transition: all 0.3s;
}

.typography-input:focus {
  border-color: var(--secondary);
}

.typography-input::placeholder {
  color: #581c87;
}

.typography-samples {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.typography-sample {
  overflow: hidden;
  transition: all 0.3s;
}

.typography-sample:hover {
  transform: translateX(0.5rem);
}

.typography-sample h5 {
  font-size: 3rem;
  color: white;
  margin-bottom: 0.5rem;
  transition: all 0.3s;
}

.typography-sample:nth-child(1) h5 {
  font-family: 'Bangers', system-ui;
  letter-spacing: 0.05em;
}

.typography-sample:nth-child(1):hover h5 {
  text-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary);
  transform: scale(1.05);
  transform-origin: left;
}

.typography-sample:nth-child(2) h5 {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
}

.typography-sample:nth-child(2):hover h5 {
  text-shadow: 0 0 15px var(--accent), 0 0 30px var(--accent);
}

.typography-sample:nth-child(3) h5 {
  font-family: 'JetBrains Mono', monospace;
  color: var(--secondary);
}

.typography-sample:nth-child(3):hover h5 {
  transform: skewX(-6deg);
}

.typography-meta {
  color: #c4b5fd;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* Footer */
footer {
  padding: 5rem 2rem;
  background: black;
  position: relative;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  position: relative;
  z-index: 10;
}

@media (min-width: 1024px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  cursor: pointer;
}

.footer-logo-icon {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--primary);
  border: 4px solid var(--border);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--primary);
  transition: all 0.3s;
}

.footer-logo:hover .footer-logo-icon {
  animation: mana-flow 4s linear infinite;
}

.footer-logo-text h3 {
  font-family: 'Bangers', system-ui;
  font-size: 1.875rem;
  color: white;
  transition: all 0.3s;
}

.footer-logo:hover h3 {
  text-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary);
}

.footer-logo-text p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  font-weight: bold;
}

.footer-social {
  display: flex;
  gap: 1.25rem;
}

.social-link {
  padding: 0.75rem;
  background: var(--card-bg);
  border: 4px solid var(--border);
  box-shadow: 4px 4px 0px #000;
  border-radius: 0.75rem;
  color: #c4b5fd;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-link:hover {
  transform: scale(1.25) translateY(-0.5rem);
}

.social-link:nth-child(1):hover { color: var(--secondary); border-color: var(--secondary); box-shadow: 0 0 20px rgba(0, 242, 255, 0.4); }
.social-link:nth-child(2):hover { color: var(--primary); border-color: var(--primary); box-shadow: 0 0 20px rgba(189, 0, 255, 0.4); }
.social-link:nth-child(3):hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 20px rgba(255, 0, 234, 0.4); }
.social-link:nth-child(4):hover { color: var(--warning); border-color: var(--warning); box-shadow: 0 0 20px rgba(255, 246, 0, 0.4); }

.social-link svg {
  transition: transform 0.3s;
}

.social-link:hover svg {
  transform: rotate(6deg);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  list-style: none;
}

.footer-link {
  font-family: 'Bangers', system-ui;
  font-size: 1.25rem;
  color: #c4b5fd;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.footer-link:nth-child(1):hover { color: var(--accent); }
.footer-link:nth-child(2):hover { color: var(--secondary); }
.footer-link:nth-child(3):hover { color: var(--primary); }

.footer-copyright {
  text-align: center;
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.3;
}

.footer-copyright span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5625rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1.5em;
}

/* Keyframe Animations */
@keyframes strobe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; filter: brightness(1.2) contrast(1.1); }
  98% { opacity: 1; }
  99% { opacity: 0.6; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}

@keyframes soft-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 5px currentColor); }
  50% { transform: scale(1.15); filter: brightness(1.4) drop-shadow(0 0 15px currentColor); }
}

@keyframes rune-breathing {
  0%, 100% { transform: scale(1); opacity: 0.4; filter: blur(0px); }
  50% { transform: scale(1.05); opacity: 0.8; filter: blur(1px); }
}

@keyframes logo-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(189, 0, 255, 0.4)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 0 20px rgba(189, 0, 255, 0.7)); }
}

@keyframes mana-flow {
  0% { border-color: var(--primary); box-shadow: 0 0 10px var(--primary); }
  50% { border-color: var(--secondary); box-shadow: 0 0 20px var(--secondary); }
  100% { border-color: var(--primary); box-shadow: 0 0 10px var(--primary); }
}

@keyframes slide-diag {
  from { background-position: 0 0; }
  to { background-position: 100px 100px; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Utility Classes */
.relative { position: relative; }
.z-10 { z-index: 10; }

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .codex-controls {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Cybermagic Edutainment App Layout */
html, body {
  min-height: 100%;
}

.page-content {
  padding: 1rem 0 3rem;
}

.navtop-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(189, 0, 255, 0.4), rgba(0, 242, 255, 0.25));
  border: 4px solid var(--border);
  box-shadow: 8px 8px 0 #000;
  height: 72px;
  color: #e9d5ff;
  padding: 0.75rem 1.5rem;
  margin: 1.5rem auto 1.5rem;
  border-radius: 1.25rem;
  max-width: 1200px;
  position: sticky;
  top: 1rem;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.navtop-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.navtop-title-main {
  font-family: 'Impact', 'Bangers', system-ui;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 12px rgba(189, 0, 255, 0.6);
}

.navtop-title-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(233, 213, 255, 0.65);
}

.navtop-runes {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.rune-icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 #000;
  filter: drop-shadow(0 0 6px rgba(0, 242, 255, 0.45));
}

.navtop-container a {
  color: #fff;
  text-decoration: none;
  font-family: 'Impact', 'Bangers', system-ui;
  letter-spacing: 0.08em;
  font-size: 1.3rem;
  text-transform: uppercase;
}

.navtop-container .btn {
  border: 3px solid var(--border);
  border-radius: 0.9rem;
  background: #0b021d;
  color: #e9d5ff;
  box-shadow: 4px 4px 0 #000;
  font-family: 'Impact', 'Bangers', system-ui;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.navtop-container .btn:hover {
  color: var(--secondary);
  box-shadow: 6px 6px 0 #000;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card_index {
  background: linear-gradient(140deg, rgba(22, 10, 38, 0.9), rgba(8, 1, 21, 0.95));
  border: 4px solid var(--border);
  box-shadow: 10px 10px 0 #000, 0 0 30px rgba(189, 0, 255, 0.25);
  border-radius: 1.5rem;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card_index:hover {
  transform: translateY(-6px) rotate(0.5deg);
  box-shadow: 12px 12px 0 #000, 0 0 40px rgba(0, 242, 255, 0.3);
}

.card_index-img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-right: 4px solid var(--border);
}

.card_index-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  gap: 0.5rem;
}

.card_index-title {
  margin: 0.2rem 0 0;
  font-family: 'Impact', 'Bangers', system-ui;
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: 0.06em;
}

.card_index-text {
  font-size: 0.95rem;
  color: rgba(233, 213, 255, 0.7);
  max-height: 70px;
  overflow: auto;
}

.card_index-icons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.4rem 0 0.6rem;
  flex-wrap: wrap;
}

.card_index-tag {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: rgba(189, 0, 255, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #f3e8ff;
}

.card_index .btn-primary {
  margin-top: auto;
  border: 3px solid var(--border);
  border-radius: 1rem;
  background: var(--primary);
  color: white;
  font-family: 'Impact', 'Bangers', system-ui;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 4px 4px 0 #000;
}

.card_index .btn-primary:hover {
  background: var(--secondary);
  color: #050210;
}

.loader {
  display: flex;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.circle {
  display: inline-block;
  margin: 0 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--primary);
  animation: bounce 2s infinite;
  opacity: 0;
  box-shadow: 0 0 10px rgba(189, 0, 255, 0.8);
}

.hidden {
  display: none;
}

#loading {
  display: none;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0;
  }
  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Cybermagic Cartoon Chat UI */
.modal {
  backdrop-filter: blur(6px);
}

.modal-dialog {
  max-width: 720px;
  margin: 2rem auto;
}

.modal-content {
  background: linear-gradient(135deg, #12041f 0%, #080115 55%, #000 100%);
  border: 4px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: 12px 12px 0 #000, 0 0 40px rgba(189, 0, 255, 0.25);
  overflow: hidden;
}

.modal-header {
  background: rgba(22, 10, 38, 0.9);
  border-bottom: 4px solid var(--border);
  padding: 1.25rem 1.5rem;
}

.modal-header .dropdown-toggle {
  border: 4px solid var(--border);
  background: #0a0218;
  color: #c4b5fd;
  box-shadow: 4px 4px 0 #000;
}

.modal-header .dropdown-menu {
  background: #0b021d;
  border: 4px solid var(--border);
  box-shadow: 8px 8px 0 #000;
}

.modal-header .dropdown-item {
  color: #e9d5ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-header .dropdown-item:hover {
  background: #160a26;
  color: var(--secondary);
}

.chat-top-image {
  width: 56px;
  height: 56px;
  border-radius: 1rem;
  border: 4px solid var(--border);
  box-shadow: 4px 4px 0 #000, 0 0 20px rgba(189, 0, 255, 0.4);
  object-fit: cover;
  margin-right: 0.75rem;
}

.chat-top-name {
  font-family: 'Bangers', system-ui;
  font-size: 1.5rem;
  color: white;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px var(--primary);
}

.chat-top-expert {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.chat-top-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: rgba(233, 213, 255, 0.6);
  margin-top: 0.25rem;
}

.online-bullet {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 0.5rem;
  background: var(--success);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

.modal-body {
  background: radial-gradient(circle at top right, rgba(189, 0, 255, 0.1), transparent 45%),
              radial-gradient(circle at bottom left, rgba(0, 242, 255, 0.08), transparent 50%),
              #0b021d;
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.chat-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-bubble {
  max-width: 78%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 3px solid var(--border);
  box-shadow: 4px 4px 0 #000;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
}

.chat-bubble::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-bottom: 3px solid var(--border);
  border-right: 3px solid var(--border);
  background: inherit;
  bottom: -6px;
}

.chat-bubble.me::after {
  right: 10px;
  transform: rotate(45deg);
}

.chat-bubble.other::after {
  left: 10px;
  transform: rotate(45deg);
}

.chat-bubble.me {
  align-self: flex-end;
  background: linear-gradient(135deg, #00f2ff 0%, #5bf7ff 100%);
  color: #02010a;
}

.chat-bubble.other {
  align-self: flex-start;
  background: linear-gradient(135deg, #bd00ff 0%, #ff00ea 100%);
  color: white;
}

.chat-bubble.wait,
.chat-bubble.loading {
  background: #160a26;
  color: #c4b5fd;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.chat-bubble.error {
  background: #3b0a14;
  color: #fecaca;
  border-color: #7f1d1d;
}

.chat-bubble[data-time]::after {
  content: attr(data-time);
  display: block;
  margin-top: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  opacity: 0.7;
}

.modal-footer {
  background: #0a0218;
  border-top: 4px solid var(--border);
  padding: 1rem 1.5rem 1.25rem;
}

.chat-input-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  justify-content: flex-end;
}

.chat-input-toolbar .rune-icon {
  width: 26px;
  height: 26px;
}

.chat-input {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.chat-input textarea {
  background: #0b021d;
  border: 3px solid var(--border);
  border-radius: 1rem;
  color: #f3e8ff;
  padding: 0.75rem 1rem;
  min-height: 54px;
  resize: none;
  font-family: 'Outfit', sans-serif;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.chat-input textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.2), inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.btn-send-chat {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  border: 4px solid var(--border);
  box-shadow: 4px 4px 0 #000;
  padding: 0.6rem 1.25rem;
  border-radius: 1rem;
  font-family: 'Bangers', system-ui;
  font-size: 1.1rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-send-chat:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 #000;
}

.btn-send-chat .btn-icon {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 6px rgba(255, 0, 234, 0.6));
}

@media (max-width: 768px) {
  .modal-dialog {
    margin: 1rem;
  }

  .chat-input {
    grid-template-columns: 1fr;
  }
}
