/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg:          #0a0c10;
  --bg2:         #0f1218;
  --bg3:         #141820;
  --border:      #1e2430;
  --border2:     #262d3a;
  --text:        #e2e8f0;
  --text-muted:  #8892a4;
  --accent:      #4f9eff;
  --accent2:     #3b7dd8;
  --red:         #ef4444;
  --orange:      #f97316;
  --yellow:      #eab308;
  --green:       #22c55e;
  --blue:        #3b82f6;
  --grey:        #6b7280;
  --font:        'Inter', sans-serif;
  --mono:        'JetBrains Mono', monospace;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.2rem; border-radius: var(--radius); border: none; cursor: pointer;
  font-family: var(--font); font-size: .9rem; font-weight: 600; line-height: 1;
  transition: background .15s, transform .1s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent2); text-decoration: none; }
.btn--ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
.btn--ghost:hover { background: var(--border); text-decoration: none; }
.btn--lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn--full { width: 100%; }

/* ── Landing nav ───────────────────────────────────────────────────────────── */
.lp-nav { position: sticky; top: 0; z-index: 100; background: rgba(10,12,16,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.lp-nav__inner { max-width: 1200px; margin: 0 auto; padding: .9rem 2rem; display: flex; align-items: center; justify-content: space-between; }
.lp-nav__logo { font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; min-height: 600px; display: flex; align-items: center; padding: 6rem 2rem 4rem; max-width: 1200px; margin: 0 auto; gap: 4rem; }
.hero--split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.hero__glow { position: absolute; top: -200px; left: 0; width: 600px; height: 600px; background: radial-gradient(circle, rgba(79,158,255,.12) 0%, transparent 70%); pointer-events: none; }
.hero__content { position: relative; z-index: 1; }
.hero__title { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700; line-height: 1.15; margin-bottom: 1.25rem; }
.hero__accent { color: var(--accent); }
.hero__sub { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 520px; }
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__visual { position: relative; z-index: 1; }

/* ── Mock panel ────────────────────────────────────────────────────────────── */
.mock-panel { background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); min-width: 320px; }
.mock-panel__header { background: var(--bg2); padding: .75rem 1rem; display: flex; align-items: center; gap: .5rem; }
.mock-dot { width: 12px; height: 12px; border-radius: 50%; }
.mock-dot--red    { background: #ef4444; }
.mock-dot--yellow { background: #eab308; }
.mock-dot--green  { background: #22c55e; }
.mock-panel__title { font-size: .8rem; color: var(--text-muted); margin-left: .25rem; }
.mock-panel__body { padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.mock-pilot { display: flex; align-items: center; gap: .75rem; padding: .75rem; border-radius: var(--radius); border: 1px solid var(--border); }
.mock-pilot--red    { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.2); }
.mock-pilot--orange { background: rgba(249,115,22,.08); border-color: rgba(249,115,22,.2); }
.mock-pilot--green  { background: rgba(34,197,94,.08);  border-color: rgba(34,197,94,.2); }
.mock-portrait { width: 40px; height: 40px; border-radius: 6px; background: var(--border2); flex-shrink: 0; }
.mock-info { flex: 1; min-width: 0; }
.mock-name { font-weight: 600; font-size: .9rem; }
.mock-corp { font-size: .75rem; color: var(--text-muted); }
.mock-threat { font-family: var(--mono); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.mock-threat--red    { color: var(--red); }
.mock-threat--orange { color: var(--orange); }
.mock-threat--green  { color: var(--green); }
.mock-threat span { font-size: .85rem; }

/* ── Stats strip ───────────────────────────────────────────────────────────── */
.stats-strip { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0; background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1.5rem 2rem; }
.stat-item { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 0 2.5rem; }
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--accent); font-family: var(--mono); }
.stat-label { font-size: .8rem; color: var(--text-muted); }
.stat-sep { width: 1px; height: 40px; background: var(--border2); }

/* ── LP sections ───────────────────────────────────────────────────────────── */
.lp-section { padding: 5rem 2rem; }
.lp-section--alt { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-section__inner { max-width: 1100px; margin: 0 auto; }
.lp-section__header { text-align: center; margin-bottom: 3rem; }
.lp-section__header h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; margin-top: .75rem; }
.lp-badge { display: inline-block; padding: .3rem .9rem; background: rgba(79,158,255,.12); color: var(--accent); border: 1px solid rgba(79,158,255,.25); border-radius: 100px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ── Feature grid ──────────────────────────────────────────────────────────── */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.feat-card { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 1.75rem; transition: border-color .2s; }
.feat-card:hover { border-color: var(--accent); }
.feat-card__icon { font-size: 2rem; margin-bottom: 1rem; }
.feat-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.feat-card p { color: var(--text-muted); font-size: .9rem; line-height: 1.6; margin-bottom: 1rem; }
.feat-card__list { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.feat-card__list li { font-size: .85rem; color: var(--text-muted); padding-left: 1.2rem; position: relative; }
.feat-card__list li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

/* ── Steps ─────────────────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; position: relative; }
.step { display: flex; flex-direction: column; align-items: flex-start; position: relative; }
.step__num { font-family: var(--mono); font-size: 2.5rem; font-weight: 700; color: var(--accent); opacity: .3; line-height: 1; margin-bottom: .75rem; }
.step__connector { width: 60%; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); margin: .25rem 0 .75rem; opacity: .3; }
.step__content h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.step__content p { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }

/* ── Threat breakdown ──────────────────────────────────────────────────────── */
.threat-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.threat-item { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 1.25rem; }
.threat-item__badge { display: inline-block; padding: .25rem .75rem; border-radius: 100px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75rem; }
.threat-item--red    .threat-item__badge { background: rgba(239,68,68,.15);  color: var(--red);    border: 1px solid rgba(239,68,68,.3); }
.threat-item--orange .threat-item__badge { background: rgba(249,115,22,.15); color: var(--orange); border: 1px solid rgba(249,115,22,.3); }
.threat-item--yellow .threat-item__badge { background: rgba(234,179,8,.15);  color: var(--yellow); border: 1px solid rgba(234,179,8,.3); }
.threat-item--green  .threat-item__badge { background: rgba(34,197,94,.15);  color: var(--green);  border: 1px solid rgba(34,197,94,.3); }
.threat-item--blue   .threat-item__badge { background: rgba(59,130,246,.15); color: var(--blue);   border: 1px solid rgba(59,130,246,.3); }
.threat-item p { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }

/* ── Tech grid ─────────────────────────────────────────────────────────────── */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.tech-card { background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 1.5rem; }
.tech-card__name { font-weight: 700; color: var(--accent); font-family: var(--mono); font-size: 1.05rem; margin-bottom: .5rem; }
.tech-card__desc { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }

/* ── CTA section ───────────────────────────────────────────────────────────── */
.cta-section { position: relative; overflow: hidden; text-align: center; padding: 6rem 2rem; background: var(--bg2); border-top: 1px solid var(--border); }
.cta-section__glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 700px; height: 400px; background: radial-gradient(ellipse, rgba(79,158,255,.1) 0%, transparent 70%); pointer-events: none; }
.cta-section__content { position: relative; z-index: 1; }
.cta-section h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 700; margin-bottom: 1rem; }
.cta-section p  { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; }

/* ── Landing footer ────────────────────────────────────────────────────────── */
.landing-footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 2rem; text-align: center; }
.landing-footer__top { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto 1rem; flex-wrap: wrap; gap: 1rem; }
.landing-footer__brand { font-weight: 700; font-size: 1rem; }
.landing-footer__nav { display: flex; gap: 1.5rem; }
.landing-footer__nav a { color: var(--text-muted); font-size: .9rem; }
.landing-footer__nav a:hover { color: var(--text); }
.landing-footer__legal { font-size: .78rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; }

/* ── App shell ─────────────────────────────────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg2); border-right: 1px solid var(--border); padding: 1.25rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar__brand { padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.sidebar__logo { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.sidebar__logo:hover { text-decoration: none; color: var(--accent); }
.sidebar__section { display: flex; flex-direction: column; gap: .5rem; }
.sidebar__label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.sidebar__textarea { background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: var(--mono); font-size: .8rem; padding: .75rem; resize: vertical; min-height: 180px; outline: none; transition: border-color .15s; }
.sidebar__textarea:focus { border-color: var(--accent); }

/* ── Filter chips ──────────────────────────────────────────────────────────── */
.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { background: var(--bg3); border: 1px solid var(--border2); color: var(--text-muted); border-radius: 100px; padding: .25rem .75rem; font-size: .78rem; cursor: pointer; transition: all .15s; }
.chip--active { background: rgba(79,158,255,.15); color: var(--accent); border-color: var(--accent); }
.chip:hover { border-color: var(--accent); color: var(--text); }

/* ── Summary grid ──────────────────────────────────────────────────────────── */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.summary-item { background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius); padding: .5rem .6rem; }
.summary-item__label { font-size: .7rem; color: var(--text-muted); }
.summary-item__val { font-size: 1.1rem; font-weight: 700; font-family: var(--mono); }
.summary-item--red    .summary-item__val { color: var(--red); }
.summary-item--orange .summary-item__val { color: var(--orange); }
.summary-item--yellow .summary-item__val { color: var(--yellow); }
.summary-item--green  .summary-item__val { color: var(--green); }
.summary-item--blue   .summary-item__val { color: var(--blue); }

/* ── Main area ─────────────────────────────────────────────────────────────── */
.main-area { padding: 1.5rem; overflow-y: auto; }

/* ── Empty / loading state ─────────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 60vh; gap: 1rem; padding: 2rem; }
.empty-state__icon { font-size: 3.5rem; opacity: .5; }
.empty-state h2 { font-size: 1.4rem; font-weight: 600; }
.empty-state p { color: var(--text-muted); max-width: 420px; }

.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 1rem; color: var(--text-muted); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Results grid ──────────────────────────────────────────────────────────── */
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; align-content: start; }

/* ── Pilot card ────────────────────────────────────────────────────────────── */
.pilot-card { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .1s; }
.pilot-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pilot-card--red    { border-left: 3px solid var(--red); }
.pilot-card--orange { border-left: 3px solid var(--orange); }
.pilot-card--yellow { border-left: 3px solid var(--yellow); }
.pilot-card--green  { border-left: 3px solid var(--green); }
.pilot-card--blue   { border-left: 3px solid var(--blue); }
.pilot-card--grey   { border-left: 3px solid var(--grey); }

.pilot-card__header { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; }
.pilot-card__portrait { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--bg3); flex-shrink: 0; }
.pilot-card__portrait.placeholder { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.pilot-card__info { flex: 1; min-width: 0; }
.pilot-card__name { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pilot-card__corp { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pilot-card__threat { font-family: var(--mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .25rem .6rem; border-radius: 100px; white-space: nowrap; }
.threat-badge--red    { background: rgba(239,68,68,.15);  color: var(--red);    border: 1px solid rgba(239,68,68,.25); }
.threat-badge--orange { background: rgba(249,115,22,.15); color: var(--orange); border: 1px solid rgba(249,115,22,.25); }
.threat-badge--yellow { background: rgba(234,179,8,.15);  color: var(--yellow); border: 1px solid rgba(234,179,8,.25); }
.threat-badge--green  { background: rgba(34,197,94,.15);  color: var(--green);  border: 1px solid rgba(34,197,94,.25); }
.threat-badge--blue   { background: rgba(59,130,246,.15); color: var(--blue);   border: 1px solid rgba(59,130,246,.25); }
.threat-badge--grey   { background: rgba(107,114,128,.15); color: var(--grey);  border: 1px solid rgba(107,114,128,.25); }

.pilot-card__stats { display: flex; gap: 0; padding: .5rem 1rem .9rem; border-top: 1px solid var(--border); }
.pilot-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.pilot-stat__val { font-family: var(--mono); font-size: .85rem; font-weight: 600; }
.pilot-stat__key { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; }
.pilot-card--error .pilot-card__header { opacity: .6; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 2rem; max-width: 540px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal--sm { max-width: 360px; }
.modal__close { position: absolute; top: 1rem; right: 1rem; background: var(--bg3); border: 1px solid var(--border2); color: var(--text); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: .85rem; }

/* Modal body */
.modal-pilot__top { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.modal-pilot__portrait { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; }
.modal-pilot__name { font-size: 1.3rem; font-weight: 700; margin-bottom: .25rem; }
.modal-pilot__corp { color: var(--text-muted); font-size: .9rem; }
.modal-pilot__alliance { color: var(--text-muted); font-size: .85rem; font-style: italic; }
.modal-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.5rem; }
.modal-stat { background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius); padding: .75rem 1rem; }
.modal-stat__label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .2rem; }
.modal-stat__val { font-size: 1.1rem; font-weight: 600; font-family: var(--mono); }
.modal-actions { display: flex; gap: .75rem; }

/* ── Shortcuts table ───────────────────────────────────────────────────────── */
.shortcuts-table { width: 100%; border-collapse: collapse; }
.shortcuts-table tr td { padding: .5rem .25rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.shortcuts-table tr:last-child td { border-bottom: none; }
.shortcuts-table td:first-child { width: 50px; }
kbd { background: var(--bg3); border: 1px solid var(--border2); border-radius: 4px; padding: .1rem .4rem; font-family: var(--mono); font-size: .8rem; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero--split { grid-template-columns: 1fr; }
  .hero__visual { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
}
@media (max-width: 600px) {
  .stats-strip { gap: 1rem; }
  .stat-sep { display: none; }
  .stat-item { padding: 0 1rem; }
  .landing-footer__top { flex-direction: column; align-items: center; }
}
