/* ============================================================
   KaliPilot — premium monochrome theme. Black only. No color.
   ============================================================ */
:root {
  --black: #000000;
  --ink-1: #050505;
  --ink-2: #0a0a0a;
  --ink-3: #111111;
  --ink-4: #1a1a1a;
  --line: #232323;
  --line-soft: #141414;
  --text: #f5f5f5;
  --dim: #a3a3a3;
  --faint: #5f5f5f;
  --accent: #ff2d40;
  --accent-deep: #a30014;
  --accent-glow: rgba(255, 45, 64, 0.35);
  --accent-faint: rgba(255, 45, 64, 0.12);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Nunito', 'Readex Pro', system-ui, sans-serif;
}

* { box-sizing: border-box; }

::selection { background: var(--accent); color: #fff; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[lang="ar"] { font-family: 'Readex Pro', 'Nunito', sans-serif; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #2b2b2b; border-radius: 6px; border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.app { position: relative; min-height: 100vh; display: flex; flex-direction: column; background: var(--black); }
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

/* ---------- Boot preloader ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}
#boot.done { opacity: 0; visibility: hidden; }
.boot-box { font-family: var(--mono); font-size: 13px; color: var(--dim); line-height: 2; }
.boot-box .ok { color: #fff; }
.boot-caret { display: inline-block; width: 9px; height: 16px; background: #fff; vertical-align: -3px; animation: blink 0.8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Glass ---------- */
.glass {
  background: rgba(6, 6, 6, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 12px 44px 0 rgba(0, 0, 0, 0.9);
  border-radius: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 12px;
  font-family: var(--sans);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid transparent;
}
.btn-solid { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%); color: #fff; border-color: rgba(255, 45, 64, 0.6); box-shadow: 0 8px 30px -6px var(--accent-glow); }
.btn-solid:hover { box-shadow: 0 0 40px 4px var(--accent-glow); transform: translateY(-2px); filter: brightness(1.1); }
.btn-ghost {
  background: rgba(8, 8, 8, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  border-color: #3d3d3d;
}
.btn-ghost:hover { border-color: var(--accent); box-shadow: 0 0 26px 2px var(--accent-faint), inset 0 0 18px rgba(255,45,64,0.06); transform: translateY(-2px); }
.btn-mini { padding: 8px 14px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 14px;
  z-index: 50;
  margin: 14px auto 0;
  width: min(1180px, calc(100% - 40px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-radius: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-text { font-size: 21px; font-weight: 900; letter-spacing: 0.5px; }
.brand-text b { color: #fff; }
.brand-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 2px;
}
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a.nl { color: var(--dim); text-decoration: none; font-weight: 700; font-size: 14px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 1px; }
.nav-links a.nl.active, .nav-links a.nl:hover { color: #fff; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 14px;
  background: #070707;
  text-decoration: none;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 1.8s infinite; }
.status-pill:hover { color: #fff; border-color: #555; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: grayscale(1) brightness(0.32); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.35) 45%, #000 100%); }
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; z-index: 2; padding: 110px 0 70px; width: 100%; }
.hero-kicker { font-family: var(--mono); font-size: 13px; color: var(--dim); letter-spacing: 1px; margin: 0 0 22px; }
.hero-kicker .prompt { color: var(--accent); font-weight: 700; }
.hero h1 {
  margin: 0;
  font-size: clamp(46px, 8.5vw, 110px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -1px;
  text-transform: uppercase;
}
.hero h1 .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  text-shadow: 0 0 60px var(--accent-faint);
}
.hero-sub { color: #c4c4c4; max-width: 640px; line-height: 1.75; font-size: 16px; margin: 24px 0 0; }
.typed-box {
  margin-top: 30px;
  max-width: 640px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.typed-box .u { color: #fff; }
#typed { color: #d8d8d8; }
#typed::after { content: "▊"; color: var(--accent); animation: blink 0.9s steps(1) infinite; margin-left: 2px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin-top: 64px;
  border-top: 1px solid var(--line);
}
.hstat { padding: 20px 22px 4px 0; }
.hstat + .hstat { border-left: 1px solid var(--line-soft); padding-left: 22px; }
.hstat span { font-size: 30px; font-weight: 900; }
.hstat label { display: block; color: var(--dim); font-size: 12px; margin-top: 4px; font-family: var(--mono); letter-spacing: 1px; }
.scroll-cue { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: 3px; z-index: 2; animation: cue 2s ease-in-out infinite; }
@keyframes cue { 50% { transform: translateX(-50%) translateY(6px); } }

/* ---------- Ticker ---------- */
.ticker { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); overflow: hidden; background: #030303; }
.ticker-track { display: flex; gap: 0; width: max-content; animation: tick 30s linear infinite; padding: 16px 0; }
.ticker span { font-family: var(--mono); font-size: 13px; letter-spacing: 3px; color: var(--dim); padding: 0 28px; white-space: nowrap; }
.ticker span i { font-style: normal; color: var(--accent); padding-right: 28px; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 50px; flex-wrap: wrap; }
.sec-index { font-family: var(--mono); font-size: 12px; letter-spacing: 3px; color: var(--dim); margin: 0 0 12px; }
.sec-title { margin: 0; font-size: clamp(30px, 4.5vw, 54px); font-weight: 900; letter-spacing: -0.5px; line-height: 1.05; text-transform: uppercase; }
.sec-title .outline { color: transparent; -webkit-text-stroke: 1.2px var(--accent); }
.sec-desc { color: var(--dim); max-width: 380px; line-height: 1.7; font-size: 14.5px; margin: 0; }

.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.cap {
  position: relative;
  padding: 34px 30px 30px;
  background: linear-gradient(180deg, #0b0b0b, #040404);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.cap:hover { border-color: rgba(255, 45, 64, 0.55); transform: translateY(-6px); box-shadow: 0 24px 60px rgba(0,0,0,0.9), 0 0 44px 2px var(--accent-faint); }
.cap-num {
  position: absolute;
  top: 6px;
  right: 18px;
  font-size: 92px;
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px #2c2c2c;
  user-select: none;
}
.cap-icon {
  width: 52px;
  height: 52px;
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080808;
  margin-bottom: 22px;
}
.cap h3 { margin: 0 0 10px; font-size: 21px; font-weight: 900; }
.cap p { margin: 0 0 20px; color: #b2b2b2; font-size: 14px; line-height: 1.7; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--mono); font-size: 11px; letter-spacing: 0.5px; color: #d5d5d5; background: #0e0e0e; border: 1px solid #2b2b2b; border-radius: 7px; padding: 6px 11px; }

/* ---------- Workflow ---------- */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.step { position: relative; padding: 28px; border: 1px solid var(--line-soft); border-radius: 16px; background: #040404; }
.step .snum { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--faint); }
.step h4 { margin: 12px 0 8px; font-size: 18px; font-weight: 900; }
.step p { margin: 0; color: var(--dim); font-size: 13.5px; line-height: 1.7; }

/* ---------- CTA banner ---------- */
.cta-banner {
  position: relative;
  overflow: hidden;
  border: 1px solid #3a3a3a;
  border-radius: 22px;
  padding: 70px 40px;
  text-align: center;
  background: radial-gradient(600px 260px at 50% 0%, rgba(255,255,255,0.09), transparent 70%), #050505;
}
.cta-banner h2 { margin: 0; font-size: clamp(30px, 5vw, 60px); font-weight: 900; letter-spacing: -0.5px; text-transform: uppercase; }
.cta-banner h2 .outline { color: transparent; -webkit-text-stroke: 1.2px var(--accent); }
.cta-banner p { color: var(--dim); margin: 16px 0 32px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Terminal console ---------- */
.console { padding: 46px 0 30px; }
.shell { overflow: hidden; }
.shell-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: #080808;
  border-radius: 16px 16px 0 0;
}
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #2c2c2c; }
.dots i:nth-child(1) { background: #4d4d4d; }
.shell-title { font-family: var(--mono); font-size: 12.5px; color: var(--dim); letter-spacing: 0.5px; }
.enc {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-radius: 20px;
  padding: 6px 13px;
  font-weight: 700;
  box-shadow: 0 0 18px -2px var(--accent-glow);
}
.enc i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.6s infinite; }
.shell-body { display: grid; grid-template-columns: 264px 1fr; min-height: 600px; }
.sidebar { padding: 18px 14px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line-soft); background: rgba(0,0,0,0.6); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.side-title { font-family: var(--mono); font-size: 11px; letter-spacing: 2.5px; color: var(--dim); }
.side-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.side-item { display: flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 10px; padding: 3px; background: transparent; transition: all 0.3s; }
.side-item:hover { background: #0b0b0b; }
.side-item.active { border-color: #3d3d3d; background: #0d0d0d; }
.side-item.active .side-select { border-left-color: var(--accent); }
.side-select {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 9px 10px;
  text-align: left;
  border-radius: 0 8px 8px 0;
}
.side-del { background: none; border: none; color: var(--faint); font-size: 18px; cursor: pointer; padding: 4px 9px; border-radius: 7px; }
.side-del:hover { color: #fff; background: #1a1a1a; }
.side-empty { color: var(--faint); font-size: 13px; font-family: var(--mono); padding: 0 6px; }
.side-foot { color: var(--dim); font-size: 11.5px; border-top: 1px solid var(--line-soft); padding: 12px 6px 0; font-family: var(--mono); line-height: 1.9; }
.side-foot .dim { color: var(--faint); }

.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; max-height: 56vh; min-height: 380px; }
.chat-hint { color: var(--dim); font-size: 14px; line-height: 1.8; border: 1px dashed #3d3d3d; border-radius: 12px; padding: 20px 22px; background: #030303; }
.chat-hint b { color: #fff; font-family: var(--mono); }
.msg { display: flex; gap: 12px; animation: msgin 0.35s ease; }
@keyframes msgin { from { opacity: 0; transform: translateY(8px); } }
.avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #3a3a3a;
  background: #0d0d0d;
  color: #fff;
}
.msg.user .avatar { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; border-color: transparent; box-shadow: 0 0 16px -2px var(--accent-glow); }
.msg-body {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  border-radius: 4px 14px 14px 14px;
  background: #080808;
  border: 1px solid var(--line-soft);
  line-height: 1.75;
  font-size: 14px;
  overflow-x: auto;
}
.msg.user .msg-body { background: #101010; border-color: #2e2e2e; white-space: pre-wrap; }
.msg.err .msg-body { border-color: #555; }
.msg-body pre { position: relative; background: #000; border: 1px solid #2b2b2b; border-radius: 10px; padding: 16px; overflow-x: auto; direction: ltr; margin: 10px 0; }
.msg-body code { font-family: var(--mono); font-size: 12.5px; background: rgba(255,255,255,0.08); padding: 2px 7px; border-radius: 6px; }
.msg-body pre code { background: none; padding: 0; display: block; }
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  background: #161616;
  color: #cfcfcf;
  border: 1px solid #333;
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.25s;
}
.copy-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.msg-body ul, .msg-body ol { padding-left: 20px; margin: 8px 0; }
.msg-body li { margin: 4px 0; }
.msg-body h1, .msg-body h2, .msg-body h3 { margin: 14px 0 8px; line-height: 1.3; }
.msg-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.msg-body th, .msg-body td { border: 1px solid #2b2b2b; padding: 8px 12px; text-align: left; }
.msg-body th { background: #101010; font-family: var(--mono); font-size: 11.5px; letter-spacing: 1px; }
.msg-body p { margin: 8px 0; }
.pulse { animation: blink 1s infinite; color: #fff; font-family: var(--mono); }
.chat-input-row { display: flex; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--line-soft); background: rgba(0,0,0,0.55); }
.chat-input {
  flex: 1;
  resize: vertical;
  min-height: 52px;
  padding: 14px 16px;
  color: var(--text);
  background: #060606;
  font-family: var(--mono);
  font-size: 13.5px;
  outline: none;
  border-radius: 12px;
  border: 1px solid var(--line);
  transition: all 0.3s;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(255,45,64,0.35), 0 0 24px 2px var(--accent-faint); }
.chat-input::placeholder { color: var(--faint); }
.shell-status {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 20px;
  border-top: 1px solid var(--line-soft);
  background: #060606;
  border-radius: 0 0 16px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--faint);
}
.shell-status .on { color: #fff; display: inline-flex; align-items: center; gap: 7px; }
.shell-status .on i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: blink 1.8s infinite; }
.shell-status .right { margin-left: auto; }

/* ---------- Footer ---------- */
.footer { position: relative; width: min(1180px, calc(100% - 40px)); margin: 30px auto 26px; overflow: hidden; min-height: 560px; display: flex; }
.footer-bg { position: absolute; inset: -60px 0; background-size: cover; background-position: center 38%; opacity: 0.5; filter: grayscale(1); pointer-events: none; }
.footer-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.38), rgba(0,0,0,0.88)); pointer-events: none; }
.footer-content { position: relative; margin: auto; width: 100%; padding: 110px 24px 54px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; }
.footer-word {
  font-size: clamp(80px, 15vw, 200px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  margin: 0;
  color: transparent;
  -webkit-text-stroke: 1px #3d3d3d;
  user-select: none;
}
.footer-note { margin: 0; font-size: 14px; color: var(--dim); letter-spacing: 0.5px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c9c9c9;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 18px;
  background: rgba(0,0,0,0.6);
  transition: all 0.3s;
}
.footer-link:hover { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border-color: transparent; box-shadow: 0 0 24px -4px var(--accent-glow); }

@media (max-width: 900px) {
  .shell-body { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line-soft); min-height: 0; }
  .hero-inner { padding: 90px 0 60px; }
  .section { padding: 70px 0; }
  .nav-links a.nl { display: none; }
}
