/*
 * Zabarvan CyberPunk - Shared Page Language & Primitives
 * Aesthetic: Cyber-Deck Spine, Holographic Accents, Chamfered HUD Tiles
 * Scoped to [data-theme="cyberpunk"] .cp-page. All rules unlayered.
 */

/* ---------- 1. Page Root & Layout Frame ---------- */
[data-theme="cyberpunk"] .cp-page {
  overflow-x: clip;
  background-color: #030508;
  color: #EDF2F7;
  padding-left: 0 !important;
}

[data-theme="cyberpunk"] .cp-page > footer {
  position: relative;
  z-index: 2;
  margin-left: 0 !important;
}

/* ---------- 3. Cyber Highlight Tile (High-Voltage Chamfer) ---------- */
[data-theme="cyberpunk"] .cp-tile {
  background: var(--cp-yellow) !important;
  color: #030508 !important;
  border-radius: 0px !important;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  box-shadow: 0 10px 30px rgba(var(--cp-yellow-rgb), 0.45), inset 0 0 12px rgba(255, 255, 255, 0.3);
}

[data-theme="cyberpunk"] .cp-tile * {
  color: #030508 !important;
}

/* ---------- 4. Dark Cyber Card with Cyan Wireframe ---------- */
[data-theme="cyberpunk"] .cp-card {
  background: #080D18 !important;
  border: 1px solid rgba(0, 240, 255, 0.25) !important;
  border-radius: 0px !important;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  position: relative;
}

/* ---------- 5. Tactical Badges & Chips (Zero Pills!) ---------- */
[data-theme="cyberpunk"] .cp-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--cp-cyan) !important;
  border-radius: 0px !important;
  background: rgba(0, 240, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cp-cyan) !important;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

[data-theme="cyberpunk"] .cp-pill--solid {
  background: var(--cp-yellow) !important;
  border-color: var(--cp-yellow) !important;
  color: #030508 !important;
  box-shadow: 0 0 12px rgba(var(--cp-yellow-rgb), 0.4);
}

/* ---------- 6. Arrow Action Buttons ---------- */
[data-theme="cyberpunk"] .cp-arrow {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 0px !important;
  background: var(--cp-yellow) !important;
  color: #030508 !important;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  box-shadow: 0 0 14px rgba(var(--cp-yellow-rgb), 0.4);
  transition: all 0.2s ease;
}

[data-theme="cyberpunk"] a:hover > .cp-arrow,
[data-theme="cyberpunk"] .cp-arrow:hover {
  background: var(--cp-cyan) !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
}

/* ---------- 7. Tactical Spine Timeline ---------- */
[data-theme="cyberpunk"] .cp-timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 36px;
  display: grid;
  gap: 28px;
}

[data-theme="cyberpunk"] .cp-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--cp-cyan), var(--cp-yellow), rgba(0, 240, 255, 0.2));
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

[data-theme="cyberpunk"] .cp-timeline > * {
  position: relative;
}

[data-theme="cyberpunk"] .cp-timeline > *::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 0px !important;
  background: var(--cp-yellow);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 14px rgba(var(--cp-yellow-rgb), 0.8);
}

/* ---------- 8. Big Numerals, Stats & Accents ---------- */
[data-theme="cyberpunk"] .cp-stat {
  font-family: var(--font-orbitron), sans-serif !important;
  font-weight: 900 !important;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--cp-yellow) !important;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(var(--cp-yellow-rgb), 0.45);
}

[data-theme="cyberpunk"] .cp-accent {
  color: var(--cp-cyan) !important;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* Hazard Tech Bar Beside Text */
[data-theme="cyberpunk"] .cp-bar {
  border-left: 3px solid var(--cp-yellow) !important;
  padding-left: 18px;
  box-shadow: -4px 0 10px rgba(var(--cp-yellow-rgb), 0.3);
}

/* Laser Divider */
[data-theme="cyberpunk"] .cp-rule {
  border-bottom: 1px solid rgba(0, 240, 255, 0.2) !important;
  position: relative;
}

/* ---------- 9. Tech Data Tables ---------- */
[data-theme="cyberpunk"] .cp-page table {
  border-collapse: collapse;
  width: 100%;
}

[data-theme="cyberpunk"] .cp-page th {
  padding: 14px 16px;
  border-bottom: 2px solid var(--cp-cyan);
  color: var(--cp-yellow);
  font-family: var(--font-orbitron);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
}

[data-theme="cyberpunk"] .cp-page td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
  font-family: var(--font-mono);
  color: #EDF2F7;
}

[data-theme="cyberpunk"] .cp-page tr:hover td {
  background: rgba(0, 240, 255, 0.05);
}

/* ---------- 10. Page Hero Primitives (cp-hx) ---------- */
/* Shared pieces for the page heroes. Each page sets its own layout in its own sheet. */
[data-theme="cyberpunk"] .cp-hx {
  background: #030508;
  overflow: hidden;
  isolation: isolate;
}

[data-theme="cyberpunk"] .cp-hx-bg {
  z-index: 0;
}

[data-theme="cyberpunk"] .cp-hx-bg img {
  filter: contrast(1.08) saturate(1.05);
}

[data-theme="cyberpunk"] .cp-hx-shade {
  background:
    linear-gradient(90deg, rgba(3, 5, 8, 0.9) 0%, rgba(3, 5, 8, 0.5) 55%, rgba(3, 5, 8, 0.15) 100%),
    linear-gradient(0deg, #030508 0%, rgba(3, 5, 8, 0) 40%);
}

[data-theme="cyberpunk"] .cp-hx-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cp-yellow);
}

[data-theme="cyberpunk"] .cp-hx-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #FF003C;
  box-shadow: 0 0 10px #FF003C;
  animation: cp-hx-pulse 1.4s ease-in-out infinite;
}

[data-theme="cyberpunk"] .cp-hx-title {
  margin: 0;
  font-family: var(--font-orbitron), sans-serif;
  font-size: clamp(2.75rem, 7.5vw, 7rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #FFFFFF;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.3);
}

[data-theme="cyberpunk"] .cp-hx-accent {
  background: linear-gradient(90deg, var(--cp-cyan), var(--cp-yellow));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

[data-theme="cyberpunk"] .cp-hx-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--cp-yellow);
  text-shadow: 0 0 22px rgba(252, 238, 10, 0.35);
}

[data-theme="cyberpunk"] .cp-hx-lede {
  max-width: 36rem;
  margin-top: 24px;
  padding-left: 18px;
  border-left: 3px solid var(--cp-yellow);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.6;
  color: #CBD5E0;
}

/* Entrance: the copy rises in, one beat apart */
@keyframes cp-hx-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes cp-hx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

[data-theme="cyberpunk"] .cp-hx-rise {
  animation: cp-hx-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

[data-theme="cyberpunk"] .cp-hx-rise.d1 { animation-delay: 0.12s; }
[data-theme="cyberpunk"] .cp-hx-rise.d2 { animation-delay: 0.25s; }
[data-theme="cyberpunk"] .cp-hx-rise.d3 { animation-delay: 0.38s; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="cyberpunk"] .cp-hx,
  [data-theme="cyberpunk"] .cp-hx * {
    animation: none !important;
  }

  /* Typed lines would stay at zero width without their animation, so show them in full */
  [data-theme="cyberpunk"] .cp-hx-type {
    width: 100% !important;
  }
}
