/* KNOXLAB — "Red Team Console". Black + red, self-hosted fonts, no external assets. */

:root {
  --bg:        #070406;
  --bg2:       #0c0608;
  --panel:     #100a0c;
  --ink:       #f4eced;
  --muted:     #9c7e83;
  --dim:       #6e565b;
  --red:       #ff2040;
  --red-2:     #ff5266;
  --red-deep:  #a3001a;
  --glow:      rgba(255,32,64,0.40);
  --line:      rgba(255,32,64,0.14);
  --line-2:    rgba(255,32,64,0.30);

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display: "Chakra Petch", var(--mono);
  --maxw: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

a { color: var(--red); text-decoration: none; }
a:hover, a:focus-visible { color: var(--red-2); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

::selection { background: var(--red); color: #0a0002; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.hot { color: var(--red); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--red); color: #0a0002; padding: 8px 14px; font-weight: 700;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ============ atmosphere layers ============ */
.grid-floor {
  position: fixed; left: -10%; right: -10%; bottom: 0; height: 52vh; z-index: -3;
  perspective: 320px; perspective-origin: 50% 0%; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 78%);
          mask-image: linear-gradient(to top, #000 5%, transparent 78%);
}
.grid-floor::before {
  content: ""; position: absolute; left: -60%; right: -60%; top: 0; bottom: -60%;
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 52px 52px;
  transform: rotateX(76deg); transform-origin: 50% 0%;
  animation: gridscroll 5.5s linear infinite;
}
@keyframes gridscroll { to { background-position: 0 52px, 0 52px; } }

.glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 18%, rgba(255,32,64,0.16), transparent 60%),
    radial-gradient(40% 30% at 85% 0%, rgba(163,0,26,0.18), transparent 70%);
}
.scanlines {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.5;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.beam {
  position: fixed; left: 0; right: 0; top: 0; height: 32vh; z-index: 55; pointer-events: none;
  background: linear-gradient(rgba(255,32,64,0) 0%, rgba(255,32,64,0.06) 50%, rgba(255,32,64,0) 100%);
  animation: beam 7s linear infinite;
}
@keyframes beam { 0% { transform: translateY(-40vh); } 100% { transform: translateY(140vh); } }

/* targeting-reticle cursor (enabled by JS on fine pointers only) */
.reticle { display: none; }
body.cursor-on .reticle {
  display: block; position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  transform: translate(var(--mx, -100px), var(--my, -100px));
  transition: width .15s ease, height .15s ease, margin .15s ease;
  mix-blend-mode: screen;
}
body.cursor-on.cursor-hot .reticle { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.reticle b {
  position: absolute; inset: 0; border: 1px solid var(--red); border-radius: 50%;
  box-shadow: 0 0 12px var(--glow); animation: reticlespin 4s linear infinite;
}
.reticle i { position: absolute; background: var(--red); }
.reticle i:nth-child(1) { left: 50%; top: -8px; width: 1px; height: 12px; margin-left: -0.5px; }
.reticle i:nth-child(2) { top: 50%; left: -8px; height: 1px; width: 12px; margin-top: -0.5px; }
@keyframes reticlespin { to { transform: rotate(360deg); } }
body.cursor-on, body.cursor-on a, body.cursor-on .card { cursor: none; }

/* ============ layout ============ */
.site-header, main, .site-footer {
  width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: 28px; padding-right: 28px;
}
.site-header { padding-top: 26px; }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: 3px;
  color: var(--ink); position: relative;
}
.brand-red { color: var(--red); }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0;
  font-size: 0.86rem; letter-spacing: 1px; text-transform: lowercase; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--red); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink) !important;
  border: 1px solid var(--line-2); padding: 5px 12px; border-radius: 100px; }
.status:hover { border-color: var(--red); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 var(--glow); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--glow); } 70% { box-shadow: 0 0 0 7px rgba(255,32,64,0); } 100% { box-shadow: 0 0 0 0 rgba(255,32,64,0); } }

/* ============ hero ============ */
.hero { padding: clamp(56px, 12vh, 130px) 0 70px; }
.kicker {
  font-size: 0.82rem; letter-spacing: 4px; text-transform: uppercase; color: var(--muted);
  margin: 0 0 18px;
}
.kicker .kred { color: var(--red); }

.glitch {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(5rem, 24vw, 17rem); line-height: 0.82; letter-spacing: -2px;
  margin: 0 0 26px; position: relative; display: inline-block; color: var(--ink);
  text-shadow: 0 0 38px rgba(255,32,64,0.30);
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
  clip-path: inset(0 0 0 0);
}
.glitch::before { color: var(--red); left: 3px; text-shadow: -2px 0 var(--red); animation: glitch-a 3.4s infinite steps(2, jump-none); }
.glitch::after  { color: var(--red-deep); left: -3px; text-shadow: 2px 0 var(--red-deep); animation: glitch-b 2.7s infinite steps(2, jump-none); }
@keyframes glitch-a {
  0%,72%,100% { clip-path: inset(0 0 100% 0); transform: translate(0,0); }
  74% { clip-path: inset(8% 0 70% 0); transform: translate(-4px,-2px); }
  78% { clip-path: inset(40% 0 33% 0); transform: translate(5px,2px); }
  82% { clip-path: inset(70% 0 12% 0); transform: translate(-3px,1px); }
  86% { clip-path: inset(20% 0 60% 0); transform: translate(3px,-1px); }
}
@keyframes glitch-b {
  0%,80%,100% { clip-path: inset(100% 0 0 0); transform: translate(0,0); }
  83% { clip-path: inset(62% 0 8% 0); transform: translate(4px,2px); }
  88% { clip-path: inset(18% 0 55% 0); transform: translate(-5px,-1px); }
  93% { clip-path: inset(45% 0 35% 0); transform: translate(3px,2px); }
}

.lede { font-size: clamp(1.05rem, 2.4vw, 1.5rem); line-height: 1.55; max-width: 30ch;
  color: var(--ink); margin: 0 0 30px; }

.tagrow { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0 0 34px; padding: 0; }
.tagrow li {
  font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); padding: 7px 13px; border-radius: 4px; background: rgba(255,32,64,0.03);
}
.tagrow li::before { content: "▹ "; color: var(--red); }

.cmd-bar, .foot-cmd { font-size: 0.92rem; color: var(--ink); margin: 0; }
.cprompt { color: var(--red); } .csep { color: var(--muted); } .cpath { color: var(--red-2); }
.cdollar { color: var(--muted); margin: 0 8px 0 2px; }
.ctype { color: var(--ink); }
.ccursor { display: inline-block; width: 9px; height: 1.05em; vertical-align: text-bottom;
  background: var(--red); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ sections ============ */
.section { padding: 56px 0; }
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.sec-no { font-family: var(--display); font-size: 0.85rem; color: var(--red); letter-spacing: 2px; }
.sec-head h2 {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.4rem);
  text-transform: uppercase; letter-spacing: 2px; margin: 0; color: var(--ink);
}
.sec-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }

.prose { max-width: 62ch; }
.prose p { margin: 0 0 18px; font-size: 1.05rem; }
.prose strong { color: var(--red); font-weight: 700; }

/* ============ arsenal cards ============ */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); }
.card {
  position: relative; background: linear-gradient(160deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 10px; padding: 22px 20px 20px;
  overflow: hidden; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--red); transform: scaleY(0); transform-origin: top; transition: transform .25s ease;
}
.card:hover { border-color: var(--line-2); transform: translateY(-4px);
  box-shadow: 0 22px 50px -28px var(--glow); }
.card:hover::before { transform: scaleY(1); }
.card-no { position: absolute; top: 16px; right: 18px; font-family: var(--display);
  font-size: 1.6rem; color: rgba(255,32,64,0.14); font-weight: 700; }
.card:hover .card-no { color: rgba(255,32,64,0.32); }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: .5px;
  margin: 0 0 9px; color: var(--ink); }
.card p { margin: 0; font-size: 0.9rem; line-height: 1.6; color: var(--muted); max-width: 34ch; }

/* ============ footer ============ */
.site-footer { padding: 60px 28px 70px; margin-top: 30px;
  border-top: 1px solid var(--line); }
.foot-cmd { margin-bottom: 12px; }
.foot-meta { margin: 0; font-size: 0.88rem; color: var(--muted); }
.foot-meta a { color: var(--red); }

/* ============ reveal-on-load / scroll ============ */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
/* stagger via data-d */
.reveal[data-d="1"].in { transition-delay: .05s; }
.reveal[data-d="2"].in { transition-delay: .15s; }
.reveal[data-d="3"].in { transition-delay: .25s; }
.reveal[data-d="4"].in { transition-delay: .35s; }
.reveal[data-d="5"].in { transition-delay: .45s; }
.reveal[data-d="6"].in { transition-delay: .55s; }
/* no-JS: never leave reveal content hidden */
@media (scripting: none) { .reveal { opacity: 1; transform: none; } }

/* ============ responsive ============ */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .site-header, main, .site-footer { padding-left: 20px; padding-right: 20px; }
  .nav-links { gap: 14px; }
  .nav-links li:has(.status) { order: 3; }
  .cmd-bar { word-break: break-word; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grid-floor::before, .beam, .glitch::before, .glitch::after, .status-dot, .reticle b, .ccursor { animation: none; }
  .glitch::before, .glitch::after { display: none; }
  .reveal { opacity: 1; transform: none; }
}
