@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@400;500;600;700&family=Exo+2:wght@300;400;700;900&display=swap');

/* ─── Variables ───────────────────────────────────────────── */
:root {
  --void:         #020608;
  --terminal:     #040A0F;
  --panel:        #060D14;
  --panel-edge:   #0D1E2A;
  --cyan:         #00EEFF;
  --cyan-mid:     #00BBCC;
  --cyan-dim:     rgba(0,238,255,.12);
  --cyan-pale:    rgba(0,238,255,.05);
  --red-alert:    #FF0033;
  --red-dim:      rgba(255,0,51,.14);
  --amber:        #FFB000;
  --amber-dim:    rgba(255,176,0,.13);
  --matrix:       #00FF41;
  --matrix-dim:   rgba(0,255,65,.10);
  --white-code:   #C0F0FF;
  --text:         #50A8BF;
  --text-hi:      #A8E8FF;
  --text-dim:     #1E4A5A;
  --font-mono:    'Share Tech Mono', monospace;
  --font-hud:     'Exo 2', sans-serif;
  --font-body:    'Rajdhani', sans-serif;
  --r:            6px;
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Body ────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--void);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Scanlines CRT */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0,0,0,.20) 2px, rgba(0,0,0,.20) 4px
  );
  pointer-events: none;
  z-index: 200;
}

/* Halo cyan */
body::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,238,255,.05) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(0,238,255,.04) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Canvas pluie ────────────────────────────────────────── */
#matrix-canvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .18;
}

/* ─── Container ───────────────────────────────────────────── */
.container {
  width: min(1200px, calc(100% - 40px));
  margin: 28px auto 60px;
  position: relative;
  z-index: 1;
}

/* ─── Hero ────────────────────────────────────────────────── */
.hero {
  background: var(--terminal);
  border: 1px solid rgba(0,238,255,.14);
  border-top: 2px solid var(--cyan-mid);
  border-radius: var(--r);
  padding: 28px 32px 26px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,238,255,.06), 0 16px 48px rgba(0,0,0,.6);
  animation: bootIn .6s steps(12) both;
}
@keyframes bootIn {
  from { opacity:0; transform:scaleY(.88) translateY(-12px); filter:blur(5px); }
  to   { opacity:1; transform:scaleY(1)   translateY(0);     filter:blur(0); }
}

/* Barre terminal */
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.term-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.term-dot.r { background:var(--red-alert); box-shadow:0 0 5px var(--red-alert); }
.term-dot.y { background:var(--amber); box-shadow:0 0 5px var(--amber); }
.term-dot.g { background:var(--matrix); box-shadow:0 0 5px var(--matrix); }
.term-path {
  font-family: var(--font-mono);
  font-size: .62rem;
  color: var(--text-dim);
  margin-left: 6px;
  letter-spacing: 1px;
}

/* Curseur clignotant */
.hero::after {
  content: '█';
  position: absolute;
  bottom: 18px; right: 22px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--cyan);
  animation: blink .8s step-end infinite;
  opacity: .5;
}
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font-family: var(--font-hud);
  font-weight: 900;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  color: var(--cyan);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(0,238,255,.5), 0 0 60px rgba(0,238,255,.18);
  margin-bottom: 10px;
  animation: glitchCyan 7s infinite;
}
@keyframes glitchCyan {
  0%,93%,100% { text-shadow:0 0 20px rgba(0,238,255,.5),0 0 60px rgba(0,238,255,.18); transform:none; }
  94% { text-shadow: -3px 0 var(--red-alert), 3px 0 var(--matrix); transform:translateX(2px); }
  95% { text-shadow: 3px 0 var(--red-alert), -3px 0 var(--matrix); transform:translateX(-2px); }
  96% { text-shadow: 0 0 20px rgba(0,238,255,.5); transform:none; }
}

.hero p {
  font-family: var(--font-mono);
  font-size: .86rem;
  color: var(--text);
  line-height: 1.8;
  max-width: 72ch;
  margin-bottom: 8px;
}
.hero p:last-of-type { margin-bottom: 0; }
.hero p strong { color: var(--cyan); }

/* Badges */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  border-radius: 3px;
  margin-right: 8px;
  margin-bottom: 12px;
  border: 1px solid;
}
.b-red   { background: var(--red-dim);   color: var(--red-alert); border-color: rgba(255,0,51,.3); }
.b-blue  { background: var(--cyan-dim);  color: var(--cyan);      border-color: rgba(0,238,255,.3); }
.b-green { background: var(--matrix-dim);color: var(--matrix);    border-color: rgba(0,255,65,.3); }

/* Topnote */
.topnote {
  font-family: var(--font-mono);
  font-size: .75rem;
  padding: 12px 16px;
  border-left: 3px solid var(--red-alert);
  background: var(--red-dim);
  border-radius: var(--r);
  color: rgba(255,180,180,.85);
  margin-top: 14px;
  line-height: 1.7;
}

/* Mini-grid */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.mini {
  background: rgba(0,238,255,.04);
  border: 1px solid rgba(0,238,255,.12);
  border-radius: var(--r);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text);
  line-height: 1.6;
}
.mini strong {
  display: block;
  color: var(--cyan);
  margin-bottom: 5px;
  font-size: .68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ─── Threat chip (JS-injected) ──────────────────────────── */
.threat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 3px;
  margin-bottom: 10px;
  border: 1px solid;
}
.threat-chip.cyan   { background: var(--cyan-dim);   color: var(--cyan);      border-color: rgba(0,238,255,.28); }
.threat-chip.red    { background: var(--red-dim);     color: var(--red-alert); border-color: rgba(255,0,51,.3); }
.threat-chip.amber  { background: var(--amber-dim);   color: var(--amber);     border-color: rgba(255,176,0,.3); }
.threat-chip.green  { background: var(--matrix-dim);  color: var(--matrix);    border-color: rgba(0,255,65,.28); }

/* ─── Grid & cards ────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--r);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: cardIn .5s cubic-bezier(.22,1,.36,1) forwards;
  backdrop-filter: blur(4px);
  transition: border-color .25s, box-shadow .25s, transform .2s;
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
}
.card::before {
  content: '';
  position: absolute; top:0; left:0; right:0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-mid), transparent);
  opacity: 0;
  transition: opacity .25s;
}
.card:hover {
  border-color: rgba(0,238,255,.25);
  box-shadow: 0 0 0 1px rgba(0,238,255,.08), 0 8px 32px rgba(0,0,0,.5), inset 0 0 30px var(--cyan-pale);
  transform: translateY(-3px);
}
.card:hover::before { opacity: 1; }

/* Stagger */
.card:nth-child(1){animation-delay:.04s} .card:nth-child(2){animation-delay:.09s}
.card:nth-child(3){animation-delay:.14s} .card:nth-child(4){animation-delay:.19s}
.card:nth-child(5){animation-delay:.24s} .card:nth-child(6){animation-delay:.29s}
.card:nth-child(7){animation-delay:.34s} .card:nth-child(8){animation-delay:.39s}
.card:nth-child(9){animation-delay:.44s} .card:nth-child(10){animation-delay:.49s}
.card:nth-child(11){animation-delay:.54s}

@keyframes cardIn {
  from { opacity:0; transform:translateY(14px) scale(.98); }
  to   { opacity:1; transform:translateY(0)    scale(1); }
}

/* ─── Headings ────────────────────────────────────────────── */
h1 { /* handled above */ }
h2 {
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: 1rem;
  color: var(--cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0 0 12px;
  text-shadow: 0 0 10px rgba(0,238,255,.2);
}
h3 {
  font-family: var(--font-hud);
  font-weight: 600;
  font-size: .85rem;
  color: var(--amber);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 14px 0 8px;
  text-shadow: 0 0 8px rgba(255,176,0,.2);
}

p  { font-size: .97rem; font-weight: 400; margin-bottom: 10px; color: var(--text); line-height: 1.7; }
p:last-child { margin-bottom: 0; }
p strong { color: var(--cyan); font-weight: 600; }

/* ─── Lists ───────────────────────────────────────────────── */
ul, ol { list-style: none; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; padding-left: 0; }
li {
  padding-left: 18px;
  position: relative;
  font-size: .93rem;
  font-weight: 400;
  color: var(--text);
}
ul li::before {
  content: '>';
  position: absolute; left: 0;
  color: var(--cyan-mid);
  font-family: var(--font-mono);
  font-size: .8rem;
  top: 2px;
}
ol { counter-reset: ol-cnt; }
ol li { counter-increment: ol-cnt; }
ol li::before {
  content: counter(ol-cnt, decimal-leading-zero) '.';
  position: absolute; left: 0;
  color: var(--cyan-mid);
  font-family: var(--font-mono);
  font-size: .65rem;
  top: 3px;
}
li strong { color: var(--cyan); }

/* ─── Code ────────────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  background: rgba(0,238,255,.08);
  border: 1px solid rgba(0,238,255,.18);
  padding: 1px 7px;
  border-radius: 3px;
  color: var(--cyan);
  font-size: .83em;
}
pre {
  background: #020A0F;
  border: 1px solid var(--panel-edge);
  border-left: 2px solid var(--cyan-mid);
  border-radius: var(--r);
  padding: 16px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.8;
  color: #A0E8F8;
  box-shadow: inset 0 0 30px rgba(0,0,0,.4);
  margin: 10px 0;
}
pre code { background: transparent; border: none; padding: 0; color: inherit; font-size: inherit; }

/* ─── Exploit bar (JS-driven) ────────────────────────────── */
.exploit-wrap {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.exploit-label {
  font-family: var(--font-mono);
  font-size: .56rem;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.exploit-track {
  flex: 1;
  height: 3px;
  background: rgba(0,238,255,.06);
  border-radius: 2px;
  overflow: hidden;
}
.exploit-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 1.1s steps(22);
}
.exploit-fill.cyan  { background: var(--cyan);      box-shadow: 0 0 6px var(--cyan); }
.exploit-fill.red   { background: var(--red-alert); box-shadow: 0 0 6px var(--red-alert); }
.exploit-fill.amber { background: var(--amber);     box-shadow: 0 0 6px var(--amber); }
.exploit-fill.green { background: var(--matrix);    box-shadow: 0 0 6px var(--matrix); }
.exploit-val {
  font-family: var(--font-mono);
  font-size: .56rem;
  color: var(--cyan);
  min-width: 36px;
  text-align: right;
}

/* ─── Status bar (JS-injected) ───────────────────────────── */
#status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--terminal);
  border: 1px solid var(--panel-edge);
  border-radius: var(--r);
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: .62rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  flex-wrap: wrap;
}
.status-warn { color: var(--amber); animation: blink .7s step-end infinite; }
.status-cyan { color: var(--cyan); }
.status-ok   { color: var(--matrix); }

/* ─── Footer ──────────────────────────────────────────────── */
footer {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 1px;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Scroll-to-top ───────────────────────────────────────── */
#back-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  background: var(--panel);
  border: 1px solid rgba(0,238,255,.3);
  border-radius: 4px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: .85rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 16px rgba(0,238,255,.10);
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .2s, box-shadow .2s;
  z-index: 100;
}
#back-top.visible { opacity: 1; pointer-events: auto; }
#back-top:hover   { transform: translateY(-2px); box-shadow: 0 0 24px rgba(0,238,255,.22), 0 0 0 1px rgba(0,238,255,.25); }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 20px 18px 22px; }
  .grid { grid-template-columns: 1fr; }
  h2    { font-size: .88rem; }
}
