/**
 * XERB0XI0N Page Styles
 *
 * Thème : Terminal / Futuriste / Glitch
 * Design : Aligné sur le design system cyberpunk global
 *
 * @author J0bot
 * @version 3.1.0
 */

/* ========================================
   VARIABLES CSS
   ======================================== */
:root {
  --xr-bg:        #050505;
  --xr-surface:   rgba(10, 10, 15, 0.7);
  --xr-border:    #0ff;
  --xr-accent:    rgba(0, 243, 255, 0.9);
  --xr-accent2:   rgba(255, 0, 200, 0.85);
  --xr-text:      rgba(220, 220, 220, 0.9);
  --xr-muted:     rgba(220, 220, 220, 0.45);
  --xr-glow:      rgba(0, 243, 255, 0.35);
  --xr-glow2:     rgba(255, 0, 200, 0.25);
  --xr-font:      'Orbitron', sans-serif;
  --xr-font-mono: 'Share Tech Mono', monospace;
  --xr-font-ui:   'Orbitron', sans-serif;
}

/* ========================================
   PAGE WRAPPER
   ======================================== */
.xr-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  font-family: var(--xr-font-ui);
  color: var(--xr-text);
  line-height: 1.7;
}

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 70vh;
  padding: 4rem 1rem;
  overflow: hidden;
}

/* Scan lines overlay — teinte cyan subtile */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 243, 255, 0.015) 2px,
    rgba(0, 243, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* Glitch title */
.hero-glitch {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.5rem, 9vw, 7rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  animation: glitch 4s infinite, glow-pulse 3s ease-in-out infinite;
  z-index: 2;

  /* Gradient violet profond → noir */
  background: linear-gradient(160deg,
    #7c3aed 0%,
    #4c1d95 40%,
    #1a0533 75%,
    #000000 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  filter: drop-shadow(0 0 14px rgba(124, 58, 237, 0.7))
          drop-shadow(0 0 32px rgba(76, 29, 149, 0.4));
}
.hero-glitch::before,
.hero-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  -webkit-text-fill-color: initial;
  background: none;
}
.hero-glitch::before {
  color: #4c1d95;
  text-shadow: -3px 0 rgba(124, 58, 237, 0.6);
  animation: glitch-before 4s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}
.hero-glitch::after {
  color: #1a0533;
  text-shadow: 3px 0 rgba(76, 29, 149, 0.5);
  animation: glitch-after 4s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glow-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.6))
            drop-shadow(0 0 28px rgba(76, 29, 149, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.9))
            drop-shadow(0 0 50px rgba(124, 58, 237, 0.4))
            drop-shadow(0 0 80px rgba(76, 29, 149, 0.2));
  }
}

@keyframes glitch-before {
  0%, 90%, 100% { transform: translate(0); }
  91% { transform: translate(-3px, 1px); }
  93% { transform: translate(3px, -1px); }
  95% { transform: translate(-1px, 2px); }
}
@keyframes glitch-after {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(3px, 1px); }
  94% { transform: translate(-3px, -2px); }
  96% { transform: translate(2px, -1px); }
}
@keyframes glitch {
  0%, 89%, 100% { opacity: 1; }
  90% { opacity: 0.85; }
  92% { opacity: 1; }
  94% { opacity: 0.9; }
  96% { opacity: 1; }
}

.hero-tagline {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: var(--xr-muted);
  margin: 1.5rem 0 2rem;
  max-width: 600px;
  letter-spacing: 0.05em;
  z-index: 2;
}

.hero-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
  z-index: 2;
}

.badge {
  background: transparent;
  border: 1px solid rgba(0, 243, 255, 0.5);
  color: rgba(0, 243, 255, 0.9);
  padding: 0.3rem 0.85rem;
  border-radius: 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 6px rgba(0, 243, 255, 0.2);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 2;
}

.cta-btn {
  display: inline-block;
  background: #000;
  color: #0ff;
  border: 2px solid #0ff;
  padding: 0.8rem 2rem;
  border-radius: 0;
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
  cursor: pointer;
  z-index: 2;
  position: relative;
}
.cta-btn:hover {
  background: rgba(0, 243, 255, 0.15);
  color: #0ff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5), 0 0 40px rgba(0, 243, 255, 0.15);
  transform: translateY(-2px);
}

/* ========================================
   LIENS GRID
   ======================================== */
.xr-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 4rem;
  padding-bottom: 2rem;
}

/* Carte générique */
.xr-card {
  background: var(--xr-surface);
  border: 1px solid rgba(0, 243, 255, 0.4);
  border-radius: 0;
  padding: 2rem;
  text-decoration: none;
  color: var(--xr-text);
  backdrop-filter: blur(3px);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.1);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
a.xr-card:hover {
  border-color: var(--xr-accent);
  box-shadow: 0 0 20px var(--xr-glow);
  transform: translateY(-3px);
}

/* Pleine largeur */
.xr-card-wide {
  grid-column: 1 / -1;
}

/* Désactivé */
.xr-card-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(0, 243, 255, 0.15);
}

/* Icône */
.xr-card-icon {
  font-size: 2rem;
  line-height: 1;
}

/* Titre de carte */
.xr-card h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--xr-accent);
  text-shadow: 0 0 8px var(--xr-glow);
  margin: 0.25rem 0 0;
}

/* Description */
.xr-card p {
  font-family: 'Share Tech Mono', monospace;
  color: var(--xr-muted);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* CTA dans la carte */
.xr-card-cta {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--xr-accent);
  margin-top: auto;
  padding-top: 1.25rem;
}

/* Livre : CTA en muted */
.xr-card-book .xr-card-cta {
  color: var(--xr-muted);
}

/* GitHub : accent vert */
.xr-card-github {
  border-color: rgba(0, 255, 159, 0.3);
}
.xr-card-github h2 {
  color: rgba(0, 255, 159, 0.9);
  text-shadow: 0 0 8px rgba(0, 255, 159, 0.3);
}
.xr-card-github .xr-card-cta {
  color: rgba(0, 255, 159, 0.9);
}
.xr-card-github:hover {
  border-color: rgba(0, 255, 159, 0.8);
  box-shadow: 0 0 20px rgba(0, 255, 159, 0.25);
}

/* Vidéo placeholder */
.xr-card-video {
  min-height: 260px;
  justify-content: center;
  align-items: center;
  border: 1px dashed rgba(0, 243, 255, 0.25);
  cursor: default;
}
.xr-card-video:hover {
  transform: none;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.1);
  border-color: rgba(0, 243, 255, 0.25);
}
.xr-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.xr-video-icon {
  font-size: 3rem;
  color: rgba(0, 243, 255, 0.3);
  line-height: 1;
}
.xr-video-placeholder p {
  font-family: 'Share Tech Mono', monospace;
  color: var(--xr-muted);
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}

/* ========================================
   FADE-UP ANIMATION
   ======================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
}
.fade-up.visible {
  animation: fadeUp 0.6s ease forwards;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 600px) {
  .xr-links {
    grid-template-columns: 1fr;
  }
  .xr-card-wide {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  .xr-page {
    padding: 0 1rem 3rem;
  }
  .hero {
    min-height: 50vh;
    padding: 3rem 1rem;
  }
}

/* ========================================
   RECHERCHES CARD (hub)
   ======================================== */
.xr-card-research {
  border-color: rgba(255, 180, 0, 0.35);
}
.xr-card-research h2 {
  color: rgba(255, 180, 0, 0.95);
  text-shadow: 0 0 8px rgba(255, 180, 0, 0.3);
}
.xr-card-research .xr-card-cta {
  color: rgba(255, 180, 0, 0.95);
}
.xr-card-research:hover {
  border-color: rgba(255, 180, 0, 0.8);
  box-shadow: 0 0 20px rgba(255, 180, 0, 0.25);
}

/* ========================================
   BRAINDUMPS (MURION) CARD (hub)
   ======================================== */
.xr-card-braindumps {
  border-color: rgba(255, 0, 200, 0.35);
}
.xr-card-braindumps h2 {
  color: rgba(255, 0, 200, 0.95);
  text-shadow: 0 0 8px var(--xr-glow2);
}
.xr-card-braindumps .xr-card-cta {
  color: rgba(255, 0, 200, 0.95);
}
.xr-card-braindumps:hover {
  border-color: rgba(255, 0, 200, 0.85);
  box-shadow: 0 0 20px var(--xr-glow2);
}

/* ========================================
   WIKI (LEXIQUE IONIQUE) CARD (hub)
   ======================================== */
.xr-card-wiki {
  border-color: rgba(124, 58, 237, 0.35);
}
.xr-card-wiki h2 {
  color: rgba(168, 85, 247, 0.95);
  text-shadow: 0 0 8px rgba(124, 58, 237, 0.55);
}
.xr-card-wiki .xr-card-cta {
  color: rgba(168, 85, 247, 0.95);
}
.xr-card-wiki:hover {
  border-color: rgba(168, 85, 247, 0.85);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

/* ========================================
   RESEARCH PAGE
   ======================================== */
.research-empty {
  text-align: center;
  padding: 4rem 1rem;
}
.research-empty p {
  font-family: 'Share Tech Mono', monospace;
  color: var(--xr-muted);
  font-size: 1rem;
}

.research-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.research-file-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--xr-surface);
  border: 1px solid rgba(255, 180, 0, 0.25);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--xr-text);
  backdrop-filter: blur(3px);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.research-file-card:hover {
  border-color: rgba(255, 180, 0, 0.7);
  box-shadow: 0 0 16px rgba(255, 180, 0, 0.2);
  transform: translateY(-2px);
}

.research-file-icon {
  color: rgba(255, 180, 0, 0.7);
  flex-shrink: 0;
}
.research-file-card[data-type="html"] .research-file-icon {
  color: var(--xr-accent);
}

.research-file-info {
  flex: 1;
  min-width: 0;
}
.research-file-info h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--xr-text);
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.research-file-meta {
  display: flex;
  gap: 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--xr-muted);
}

.research-file-type {
  font-weight: 700;
  letter-spacing: 0.1em;
}
.research-file-type--pdf {
  color: rgba(255, 180, 0, 0.9);
}
.research-file-type--html {
  color: var(--xr-accent);
}

.research-file-action {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 180, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.research-file-card[data-type="html"] .research-file-action {
  color: var(--xr-accent);
}

@media (max-width: 600px) {
  .research-file-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }
  .research-file-action {
    align-self: flex-end;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: rgba(0, 243, 255, 0.25);
  color: #fff;
}

/* Focus for accessibility */
.cta-btn:focus {
  outline: 2px solid rgba(0, 243, 255, 0.9);
  outline-offset: 2px;
}

/* ========================================
   PAGE PAPER — WRAPPER
   ======================================== */
.xr-page--paper {
  max-width: 840px;
  padding-top: 0;
}

/* ========================================
   TOOLBAR STICKY
   ======================================== */
.paper-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 3, 8, 0.96);
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.paper-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.paper-toolbar-btn {
  background: transparent;
  border: 1px solid rgba(0, 243, 255, 0.35);
  color: rgba(0, 243, 255, 0.85);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
  border-radius: 0;
}
.paper-toolbar-btn:hover {
  border-color: rgba(0, 243, 255, 0.9);
  background: rgba(0, 243, 255, 0.08);
  color: #0ff;
}

.paper-toolbar-back {
  border-color: rgba(0, 243, 255, 0.2);
  color: var(--xr-muted);
}
.paper-toolbar-back:hover {
  border-color: rgba(0, 243, 255, 0.6);
  color: rgba(0, 243, 255, 0.85);
  background: transparent;
}

.paper-toolbar-btn--muted {
  opacity: 0.4;
  cursor: not-allowed;
}
.paper-toolbar-btn--muted:hover {
  background: transparent;
  border-color: rgba(0, 243, 255, 0.35);
  color: rgba(0, 243, 255, 0.85);
}

.paper-toolbar-resume {
  border-color: rgba(124, 58, 237, 0.6);
  color: rgba(160, 100, 255, 0.9);
  animation: resume-pulse 2s ease-in-out infinite;
}
.paper-toolbar-resume:hover {
  border-color: rgba(124, 58, 237, 0.9);
  background: rgba(124, 58, 237, 0.1);
  color: rgba(180, 130, 255, 1);
}

@keyframes resume-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(124, 58, 237, 0.4); }
}

/* ========================================
   BARRE DE PROGRESSION
   ======================================== */
.paper-progress-bar {
  height: 2px;
  background: rgba(0, 243, 255, 0.08);
  position: sticky;
  top: 41px;
  z-index: 99;
  margin-bottom: 2rem;
}
.paper-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(0, 243, 255, 0.9), rgba(124, 58, 237, 0.8));
  transition: width 0.15s linear;
}

/* ========================================
   PDF VIEWER
   ======================================== */
.paper-pdf-viewer {
  margin-bottom: 2rem;
  border: 1px solid rgba(0, 243, 255, 0.3);
  background: #000;
}
.paper-pdf-iframe {
  width: 100%;
  height: 80vh;
  border: none;
  display: block;
}

/* ========================================
   PAPER VIEWER (markdown)
   ======================================== */
.paper-viewer {
  background: var(--xr-surface);
  border: 1px solid rgba(0, 243, 255, 0.4);
  border-radius: 0;
  padding: 3rem 2.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(3px);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.08);
}

/* ========================================
   MARKDOWN RENDERED CONTENT
   ======================================== */
.paper-content {
  font-family: 'Share Tech Mono', monospace;
  color: var(--xr-text);
  line-height: 1.8;
}

.paper-content h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  color: var(--xr-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(0, 243, 255, 0.6);
  text-shadow: 0 0 10px var(--xr-glow);
}

.paper-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  color: var(--xr-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  text-shadow: 0 0 8px var(--xr-glow);
}

.paper-content h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  color: var(--xr-accent2);
  text-transform: uppercase;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 6px var(--xr-glow2);
}

.paper-content h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  color: var(--xr-text);
  text-transform: uppercase;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.paper-content p {
  margin-bottom: 1rem;
  color: var(--xr-text);
}

.paper-content a {
  color: var(--xr-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
.paper-content a:hover {
  color: var(--xr-accent2);
}

.paper-content strong {
  color: #fff;
  font-weight: 700;
}

.paper-content em {
  color: var(--xr-muted);
  font-style: italic;
}

.paper-content ul,
.paper-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.paper-content li {
  margin-bottom: 0.4rem;
  color: var(--xr-text);
}
.paper-content li::marker {
  color: var(--xr-accent);
}

.paper-content blockquote {
  border-left: 4px solid rgba(0, 243, 255, 0.7);
  background: rgba(0, 243, 255, 0.04);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0;
  color: var(--xr-muted);
  font-style: italic;
}

.paper-content pre {
  background: #000;
  border: 1px solid rgba(0, 243, 255, 0.5);
  border-left: 4px solid rgba(0, 243, 255, 0.9);
  border-radius: 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(0, 243, 255, 0.9);
}

.paper-content code {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.88em;
  background: rgba(0, 243, 255, 0.08);
  color: rgba(0, 243, 255, 0.9);
  padding: 0.15em 0.45em;
  border-radius: 0;
}

.paper-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.paper-content hr {
  border: none;
  border-top: 1px solid rgba(0, 243, 255, 0.2);
  margin: 2.5rem 0;
}

.paper-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
.paper-content thead th {
  background: rgba(0, 243, 255, 0.08);
  color: rgba(0, 243, 255, 0.9);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(0, 243, 255, 0.6);
}
.paper-content tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.1);
  color: var(--xr-text);
}
.paper-content tbody tr:hover {
  background: rgba(0, 243, 255, 0.03);
}

.paper-content img {
  max-width: 100%;
  border-radius: 0;
  border: 1px solid rgba(0, 243, 255, 0.2);
  margin: 1.5rem 0;
}

/* ========================================
   PAPER VIEWER RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .xr-page--paper {
    max-width: 100%;
    padding: 0 0.5rem 3rem;
  }
  .paper-viewer {
    padding: 1rem 0.75rem;
    border-left: none;
    border-right: none;
  }
  .paper-content h1 {
    font-size: 1.5rem;
  }
  .paper-content h2 {
    font-size: 1.15rem;
  }
  .paper-content pre {
    font-size: 0.8rem;
    padding: 0.75rem;
  }
  .paper-content table {
    font-size: 0.82rem;
  }
  .paper-content thead th,
  .paper-content tbody td {
    padding: 0.5rem 0.6rem;
  }
  .paper-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
  }
}

/* ========================================
   PRINT STYLES — SCIENTIFIC PAPER FORMAT
   ======================================== */
@media print {
  /* ---- Hide all UI chrome ---- */
  .paper-toolbar,
  .paper-progress-bar,
  .paper-pdf-viewer,
  .cyber-sidebar,
  .cyber-topbar,
  .cyber-footer,
  .cyberpunk-header,
  .cyberpunk-footer,
  .xr-nav,
  #resume-btn,
  #neural-network-bg,
  canvas {
    display: none !important;
  }

  /* ---- Page setup ---- */
  @page {
    size: A4;
    margin: 2.5cm 2cm 2.5cm 2cm;
  }

  @page :first {
    margin-top: 3cm;
  }

  /* ---- Reset everything ---- */
  *,
  *::before,
  *::after {
    background: white !important;
    color: black !important;
    text-shadow: none !important;
    box-shadow: none !important;
    -webkit-text-stroke: 0 !important;
  }

  html {
    font-size: 11pt !important;
  }

  body,
  .cyberpunk-body,
  .cyberpunk-container,
  .xr-page,
  .xr-page--paper,
  .paper-viewer,
  .paper-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    border: none !important;
    font-family: "Times New Roman", "Noto Serif", "Georgia", serif !important;
    line-height: 1.4 !important;
  }

  /* ---- Title (h1) — centered, large ---- */
  .paper-content h1 {
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 20pt !important;
    font-weight: bold !important;
    text-align: center !important;
    border: none !important;
    border-bottom: none !important;
    margin: 0 0 0.3cm 0 !important;
    padding: 0 !important;
    page-break-after: avoid;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
  }

  /* ---- Subtitle (first h2 after h1) — centered italic ---- */
  .paper-content h1 + h2 {
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 13pt !important;
    font-weight: normal !important;
    font-style: italic !important;
    text-align: center !important;
    border: none !important;
    border-bottom: none !important;
    margin: 0 0 0.8cm 0 !important;
    padding: 0 !important;
    page-break-before: avoid !important;
    page-break-after: avoid;
    text-transform: none !important;
    letter-spacing: normal !important;
  }

  /* ---- Section headings (h2) ---- */
  .paper-content h2 {
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 14pt !important;
    font-weight: bold !important;
    text-align: left !important;
    border: none !important;
    border-bottom: 0.5pt solid black !important;
    margin: 1cm 0 0.4cm 0 !important;
    padding: 0 0 0.15cm 0 !important;
    page-break-after: avoid;
    text-transform: none !important;
    letter-spacing: normal !important;
  }

  /* ---- Subsection headings (h3) ---- */
  .paper-content h3 {
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 12pt !important;
    font-weight: bold !important;
    font-style: italic !important;
    text-align: left !important;
    border: none !important;
    margin: 0.6cm 0 0.25cm 0 !important;
    padding: 0 !important;
    page-break-after: avoid;
    text-transform: none !important;
    letter-spacing: normal !important;
  }

  /* ---- Sub-subsection (h4) ---- */
  .paper-content h4 {
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 11pt !important;
    font-weight: bold !important;
    border: none !important;
    margin: 0.4cm 0 0.15cm 0 !important;
    padding: 0 !important;
    page-break-after: avoid;
    text-transform: none !important;
    letter-spacing: normal !important;
  }

  /* ---- Body text ---- */
  .paper-content p {
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 11pt !important;
    line-height: 1.45 !important;
    text-align: justify !important;
    margin: 0 0 0.3cm 0 !important;
    orphans: 3;
    widows: 3;
  }

  /* ---- Author block (strong in first paragraphs) ---- */
  .paper-content h1 + h2 + p,
  .paper-content h1 + h2 + p + p {
    text-align: center !important;
    font-size: 10pt !important;
    margin-bottom: 0.15cm !important;
  }

  /* ---- Lists ---- */
  .paper-content ul,
  .paper-content ol {
    margin: 0.2cm 0 0.3cm 1cm !important;
    padding-left: 0.5cm !important;
  }

  .paper-content li {
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 11pt !important;
    line-height: 1.45 !important;
    margin-bottom: 0.1cm !important;
  }

  /* ---- Links — show URL after link text ---- */
  .paper-content a {
    color: black !important;
    text-decoration: none !important;
  }

  .paper-content a[href^="http"]::after {
    content: " [" attr(href) "]";
    font-size: 8pt !important;
    color: #555 !important;
    word-break: break-all;
  }

  /* Don't expand internal anchor links */
  .paper-content a[href^="#"]::after {
    content: "" !important;
  }

  /* ---- Tables — academic style ---- */
  .paper-content table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 0.4cm 0 !important;
    font-size: 9.5pt !important;
    page-break-inside: avoid;
  }

  .paper-content thead th {
    border-top: 1.5pt solid black !important;
    border-bottom: 1pt solid black !important;
    background: white !important;
    font-weight: bold !important;
    padding: 0.15cm 0.3cm !important;
    text-align: left !important;
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 9.5pt !important;
  }

  .paper-content tbody td {
    border: none !important;
    border-bottom: 0.5pt solid #ccc !important;
    padding: 0.12cm 0.3cm !important;
    font-family: "Times New Roman", "Noto Serif", serif !important;
    font-size: 9.5pt !important;
    vertical-align: top !important;
  }

  .paper-content tbody tr:last-child td {
    border-bottom: 1.5pt solid black !important;
  }

  /* ---- Code blocks ---- */
  .paper-content pre {
    font-family: "Courier New", "Courier", monospace !important;
    font-size: 9pt !important;
    line-height: 1.3 !important;
    background: #f8f8f8 !important;
    border: 0.5pt solid #999 !important;
    border-radius: 0 !important;
    padding: 0.3cm !important;
    margin: 0.3cm 0 !important;
    page-break-inside: avoid;
    overflow: visible !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
  }

  .paper-content code {
    font-family: "Courier New", "Courier", monospace !important;
    font-size: 9.5pt !important;
    background: transparent !important;
  }

  .paper-content p > code,
  .paper-content li > code {
    background: #f0f0f0 !important;
    padding: 0.02cm 0.08cm !important;
  }

  /* ---- Blockquotes — indented italic ---- */
  .paper-content blockquote {
    border-left: 2pt solid #666 !important;
    background: transparent !important;
    margin: 0.3cm 0 0.3cm 0.5cm !important;
    padding: 0.1cm 0 0.1cm 0.4cm !important;
    font-style: italic !important;
    page-break-inside: avoid;
  }

  .paper-content blockquote p {
    font-style: italic !important;
    text-align: left !important;
    font-size: 10pt !important;
  }

  /* ---- Horizontal rules — thin separator ---- */
  .paper-content hr {
    border: none !important;
    border-top: 0.5pt solid #999 !important;
    margin: 0.6cm 2cm !important;
  }

  /* ---- Bold and italic ---- */
  .paper-content strong {
    font-weight: bold !important;
  }

  .paper-content em {
    font-style: italic !important;
  }

  /* ---- Images ---- */
  .paper-content img {
    max-width: 100% !important;
    border: none !important;
    page-break-inside: avoid;
  }

  /* ---- Page break control ---- */
  .paper-content h2 {
    page-break-before: auto;
  }

  /* Keep headings with their content */
  .paper-content h1,
  .paper-content h2,
  .paper-content h3,
  .paper-content h4 {
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Avoid breaking inside tables, figures, blockquotes */
  .paper-content table,
  .paper-content figure,
  .paper-content blockquote,
  .paper-content pre {
    page-break-inside: avoid !important;
  }
}
