/* ═══════════════════════════════════════════════════════
   CATEGORY PAGE — Dark Cyber Design System v2
   ═══════════════════════════════════════════════════════ */

/* ── BASE OVERRIDES ── */
body {
  background: #02040a !important;
  background-image: none !important;
  color: #d8dde8 !important;
  font-family: 'Space Grotesk', sans-serif !important;
  overflow-x: hidden;
}

main {
  background: transparent !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  position: relative;
  z-index: 1;
}

.card, .tool-card, .tool-list-item {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ── ANIMATED BACKGROUND ── */
.cat-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cat-bg-grid {
  position: absolute;
  inset: -40px;
  background-image:
    linear-gradient(rgba(0,200,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: gridDrift 28s linear infinite;
}

.cat-bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(2,4,10,0) 0%, #02040a 75%);
}

@keyframes gridDrift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(44px, 44px); }
}

/* ── HERO SECTION ── */
.cat-hero {
  position: relative;
  background: linear-gradient(165deg, #07101f 0%, #030710 60%, #02040a 100%);
  padding: 5.5rem 2rem 4.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  min-height: 300px;
}

.cat-hero-glow {
  position: absolute;
  width: 700px;
  height: 500px;
  border-radius: 50%;
  background: var(--t-clr, #00c8ff);
  opacity: 0.07;
  filter: blur(110px);
  top: -150px;
  left: -150px;
  pointer-events: none;
  animation: heroGlowPulse 5s ease-in-out infinite;
  transition: left 0.9s ease, top 0.9s ease;
  will-change: transform, opacity;
}

@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.06; transform: scale(1); }
  50%       { opacity: 0.1;  transform: scale(1.08); }
}

/* Hero canvas for particles */
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cat-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Badge */
.cat-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--t-clr, #00c8ff);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 0 22px var(--t-clr, #00c8ff);
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeInLeft 0.7s cubic-bezier(0.16,1,0.3,1) 0.1s both;
}

.cat-badge::before { content: '//'; color: #ff2d78; }

.cat-badge-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--t-clr, #00c8ff);
  animation: cursorBlink 0.9s step-end infinite;
}

.cat-badge-text.done { border-right-color: transparent; animation: none; }

@keyframes cursorBlink {
  0%, 100% { border-right-color: var(--t-clr, #00c8ff); }
  50%       { border-right-color: transparent; }
}

/* Title */
.cat-title {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  color: #e8eaf0;
  margin-bottom: 0.75rem;
  line-height: 1.15;
  opacity: 0;
  animation: heroReveal 0.9s cubic-bezier(0.16,1,0.3,1) 0.3s both;
}

.cat-title span.emoji {
  display: inline-block;
  animation: emojiFloat 3s ease-in-out 1.2s infinite;
}

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

/* Lead */
.cat-lead {
  font-size: 0.95rem;
  color: rgba(216,221,232,0.5);
  max-width: 560px;
  line-height: 1.7;
  opacity: 0;
  animation: heroReveal 0.9s cubic-bezier(0.16,1,0.3,1) 0.5s both;
}

/* Tool count badge */
.cat-stat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 1.75rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  opacity: 0;
  animation: heroReveal 0.9s ease 0.7s both;
}

.cat-stat-num {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--t-clr, #00c8ff);
  text-shadow: 0 0 24px var(--t-clr, #00c8ff);
  line-height: 1;
  min-width: 2ch;
  text-align: right;
}

.cat-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(216,221,232,0.4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* Key animations */
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(28px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── CONTENT AREA ── */
.cat-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  position: relative;
  z-index: 1;
}

/* ── SECTION HEADS ── */
.tools-section {
  margin-bottom: 3.5rem;
}

.section-head {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.16,1,0.3,1);
}

.section-head.revealed {
  opacity: 1;
  transform: translateX(0);
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.61rem;
  color: var(--t-clr, #00c8ff);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
  flex-shrink: 0;
}

.section-title {
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  font-size: 1.05rem;
  color: #e8eaf0;
  letter-spacing: 0.05em;
}

/* ── TOOL GRID ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

/* ── TOOL TILES ── */
.t-tile {
  position: relative;
  background: rgba(8,14,28,0.82);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 1.5rem;
  text-decoration: none;
  color: #d0d4e0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  will-change: transform, border-color;
  /* Scroll-reveal initial state */
  opacity: 0;
  transform: translateY(32px) scale(0.98);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.16,1,0.3,1),
              border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.t-tile.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Glow overlay */
.t-tile-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 25%, var(--t-clr, #00c8ff), transparent 65%);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  z-index: 0;
}

/* Scan-line element */
.t-tile-scan {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--t-clr, #00c8ff) 50%, transparent 100%);
  top: -4px;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  filter: blur(1px);
}

/* Corner accent */
.t-tile-corner {
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  border-top: 1px solid var(--t-clr, #00c8ff);
  border-right: 1px solid var(--t-clr, #00c8ff);
  opacity: 0.45;
  transition: opacity 0.3s ease, width 0.35s ease, height 0.35s ease;
  z-index: 2;
}

/* Bottom charge bar */
.t-tile-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 1px;
  width: 0;
  background: var(--t-clr, #00c8ff);
  box-shadow: 0 0 10px var(--t-clr, #00c8ff);
  transition: width 0.45s cubic-bezier(0.16,1,0.3,1);
  z-index: 2;
}

/* Hover state */
.t-tile:hover {
  border-color: var(--t-clr, #00c8ff);
  background: rgba(8,14,28,0.97);
  color: #e8eaf0;
}

.t-tile:hover .t-tile-glow   { opacity: 0.07; }
.t-tile:hover .t-tile-corner { opacity: 1; width: 22px; height: 22px; }
.t-tile:hover .t-tile-bar    { width: 100%; }
.t-tile:hover .t-tile-scan   { animation: scanDown 0.65s ease forwards; }

@keyframes scanDown {
  0%   { top: -4px;   opacity: 1; }
  85%  { top: 100%;   opacity: 0.4; }
  100% { top: 100%;   opacity: 0; }
}

/* Tile content */
.t-ident {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  color: var(--t-clr, #00c8ff);
  letter-spacing: 0.15em;
  opacity: 0.6;
  text-shadow: 0 0 8px var(--t-clr, #00c8ff);
  position: relative;
  z-index: 1;
}

.t-name {
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: #e8eaf0;
  line-height: 1.35;
  position: relative;
  z-index: 1;
}

.t-desc {
  font-size: 0.79rem;
  color: rgba(216,221,232,0.45);
  line-height: 1.6;
  flex: 1;
  position: relative;
  z-index: 1;
}

.t-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.3rem;
  position: relative;
  z-index: 1;
}

.t-stars {
  color: var(--t-clr, #00c8ff);
  font-size: 0.7rem;
  opacity: 0.8;
  letter-spacing: 0.05em;
}

.t-cta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.61rem;
  color: var(--t-clr, #00c8ff);
  letter-spacing: 0.08em;
  opacity: 0.65;
  transition: opacity 0.2s ease, letter-spacing 0.25s ease, transform 0.25s ease;
  display: inline-flex;
  align-items: center;
}

.t-tile:hover .t-cta {
  opacity: 1;
  letter-spacing: 0.14em;
  transform: translateX(3px);
}

/* ── DIVIDERS ── */
.cat-divider {
  position: relative;
  height: 1px;
  margin: 0 0 3.5rem;
  overflow: visible;
}

.cat-divider::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.09) 50%, transparent 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.16,1,0.3,1);
}

.cat-divider.revealed::before {
  transform: scaleX(1);
}

.cat-divider::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -2px;
  width: 4px;
  height: 4px;
  background: var(--t-clr, #00c8ff);
  border-radius: 50%;
  transform: translateX(-50%) scale(0);
  box-shadow: 0 0 10px var(--t-clr, #00c8ff);
  transition: transform 0.3s ease 0.9s;
}

.cat-divider.revealed::after {
  transform: translateX(-50%) scale(1);
}

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar        { width: 5px; }
::-webkit-scrollbar-track  { background: #02040a; }
::-webkit-scrollbar-thumb  { background: rgba(0,200,255,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,200,255,0.55); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .cat-hero   { padding: 3.5rem 1.5rem 3rem; min-height: auto; }
  .cat-content { padding: 2.5rem 1.5rem 4rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-title  { font-size: clamp(1.6rem, 5vw, 2.4rem); }
}

@media (max-width: 480px) {
  .cat-hero   { padding: 2.5rem 1.1rem 2rem; }
  .cat-content { padding: 2rem 1.1rem 3rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .cat-title  { font-size: 1.55rem; }
}

/* ── NETFLIX TILE HOVER ─────────────────── */
.tools-grid { overflow: visible; }

.t-tile.nx-hovered {
  overflow: visible !important;
  clip-path: none !important;
  z-index: 50 !important;
  border-color: var(--t-clr, #00c8ff) !important;
  background: rgba(5,9,18,0.99) !important;
  box-shadow:
    0 24px 70px rgba(0,0,0,0.88),
    0 0 0 1px var(--t-clr, #00c8ff),
    0 0 40px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06) !important;
}

.tools-grid.nx-active .t-tile:not(.nx-hovered) {
  transform: scale(0.93) !important;
  opacity: 0.38 !important;
  filter: brightness(0.48) saturate(0.55) !important;
}

.t-expand {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.44s cubic-bezier(0.16,1,0.3,1) 0.06s,
    opacity 0.28s ease 0.12s,
    border-top-color 0.3s,
    margin-top 0.3s,
    padding-top 0.3s;
  border-top: 1px solid transparent;
  margin-top: 0;
  padding-top: 0;
}

.t-tile.nx-hovered .t-expand {
  max-height: 72px;
  opacity: 1;
  border-top-color: rgba(255,255,255,0.06);
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}

.t-expand-cta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--t-clr, #00c8ff);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--t-clr, #00c8ff);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.28s ease, letter-spacing 0.28s ease;
}
.t-tile.nx-hovered .t-expand-cta { gap: 16px; letter-spacing: 0.24em; }

@media (hover: none), (max-width: 768px) {
  .t-tile.nx-hovered {
    transform: none !important;
    box-shadow: none !important;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)) !important;
    overflow: hidden !important;
  }
  .tools-grid.nx-active .t-tile:not(.nx-hovered) {
    transform: none !important; opacity: 1 !important; filter: none !important;
  }
  .t-tile.nx-hovered .t-expand { max-height: 0 !important; opacity: 0 !important; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.3s !important;
  }
  .cat-badge, .cat-title, .cat-lead, .cat-stat,
  .t-tile, .section-head {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .cat-divider::before { transform: scaleX(1); }
}
