/*
  4P3X AI BootCamp Hub™ — Launch Polish Styles v2.0
  Powered by 4P3X Intelligent AI™ Created by Kyzel Kreates™
*/

/* KYZEL BRAND LOCK */
:root {
  color-scheme: dark;
  --bg: #07070b;
  --bg-2: #0d0d14;
  --panel: rgba(20, 20, 31, 0.92);
  --panel-strong: #151520;
  --panel-soft: rgba(255,255,255,0.055);
  --text: #faf7ef;
  --muted: #cfc9bd;
  --dim: #969083;
  --gold: #f4c95d;
  --gold-dark: #8d651e;
  --silver: #dce2ec;
  --green: #44f09a;
  --purple: #a66cff;
  --danger: #ff6f80;
  --line: rgba(244, 201, 93, 0.26);
  --line-soft: rgba(255,255,255,0.11);
  --shadow: 0 24px 80px rgba(0,0,0,0.48);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max: 1180px;
  --tap: 48px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(166,108,255,0.25), transparent 28rem),
    radial-gradient(circle at 95% 8%, rgba(68,240,154,0.18), transparent 26rem),
    radial-gradient(circle at 50% 120%, rgba(244,201,93,0.13), transparent 40rem),
    linear-gradient(180deg, var(--bg), #09090f 40%, #06060a);
  color: var(--text);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 5000;
  padding: 0.85rem 1rem;
  background: var(--gold);
  color: #101010;
  border-radius: 999px;
  font-weight: 900;
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* APP HEADER + HAMBURGER MENU */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 11, 0.92);
  backdrop-filter: blur(18px);
}
.brand-shell {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 72px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(244,201,93,0.15), rgba(166,108,255,0.12));
  box-shadow: 0 0 34px rgba(244,201,93,0.16);
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 0.25rem; }
.brand-copy { min-width: 0; }
.brand-copy strong {
  display: block;
  font-size: clamp(1rem, 4.2vw, 1.18rem);
  line-height: 1.12;
  white-space: normal;
}
.brand-copy small {
  display: none;
  color: var(--muted);
  font-size: 0.76rem;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav-toggle, .nav-close, .mini-install, .install-btn, .button {
  min-height: var(--tap);
  border: 1px solid var(--line-soft);
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 0.78rem 1rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.nav-toggle { display: inline-flex; align-items: center; gap: 0.45rem; }
.nav-toggle:hover, .nav-close:hover, .button:hover, .install-btn:hover, .mini-install:hover,
.primary-nav a:hover, .primary-nav a.active {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(244,201,93,0.13);
  box-shadow: 0 0 24px rgba(244,201,93,0.12);
}
.primary-nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(92vw, 390px);
  z-index: 1500;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background:
    radial-gradient(circle at top right, rgba(166,108,255,0.21), transparent 16rem),
    linear-gradient(180deg, rgba(11,11,18,0.98), rgba(7,7,11,0.98));
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 60px rgba(0,0,0,0.52);
  transform: translateX(104%);
  transition: transform 210ms ease;
  overflow-y: auto;
}
.primary-nav:not([hidden]) { transform: translateX(0); }
.nav-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
  color: var(--gold);
}
.primary-nav a, .primary-nav button.install-btn {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 0.88rem 1rem;
  background: rgba(255,255,255,0.05);
  text-decoration: none;
  text-align: left;
}
.mini-install { display: none; }

/* LAYOUT */
main {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1rem 5.5rem;
}
.section { margin: 1rem 0 1.35rem; }
.panel, .card, .page-head, .hero-panel, .hero-side {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(20,20,31,0.94), rgba(11,11,18,0.88));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel::before, .card::before, .page-head::before, .hero-panel::before, .hero-side::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(244,201,93,0.07), transparent 32%, rgba(166,108,255,0.055));
}
.panel > *, .card > *, .page-head > *, .hero-panel > *, .hero-side > * { position: relative; }
.panel, .card, .page-head, .hero-panel, .hero-side { padding: clamp(1rem, 4vw, 2rem); }

.hero-grid { display: grid; gap: 1rem; }
.hero-logo-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.hero-logo-row img { width: 72px; height: 72px; object-fit: contain; border-radius: 18px; background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); padding: 0.2rem; }
.hero-panel h1, .page-head h1 {
  margin: 0.45rem 0 0.75rem;
  font-size: clamp(2.15rem, 12vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}
.page-head h1 { font-size: clamp(2rem, 9vw, 4rem); }
.lead { font-size: clamp(1.03rem, 4.5vw, 1.28rem); color: var(--muted); max-width: 70ch; }
.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 950;
  font-size: 0.78rem;
}
.brand-line { color: var(--silver); font-weight: 800; }
.positive-mobile-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(68,240,154,0.32);
  border-radius: 999px;
  background: rgba(68,240,154,0.08);
  color: #dfffea;
  font-weight: 800;
  font-size: 0.9rem;
}
.hero-actions, .card-actions, .inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: min(100%, 8rem);
  text-align: center;
}
.button.primary { color: #111; background: linear-gradient(135deg, var(--gold), var(--silver)); border-color: transparent; }
.button.secondary { background: rgba(166,108,255,0.14); border-color: rgba(166,108,255,0.48); }
.button.green { background: rgba(68,240,154,0.12); border-color: rgba(68,240,154,0.42); }
.button.ghost { background: rgba(255,255,255,0.035); }
.button.danger { background: rgba(255,111,128,0.12); border-color: rgba(255,111,128,0.42); }
.button.full { width: 100%; }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }

.kpi-grid, .card-grid, .feature-grid, .admin-grid, .edition-grid, .character-grid {
  display: grid;
  gap: 0.85rem;
}
.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  background: rgba(255,255,255,0.045);
}
.kpi strong { display: block; font-size: clamp(1.2rem, 6vw, 1.7rem); color: var(--gold); line-height: 1; }
.kpi span { color: var(--muted); font-size: 0.9rem; }

.card { border-radius: var(--radius-lg); }
.card h2, .card h3 { margin: 0 0 0.55rem; line-height: 1.08; }
.card p { color: var(--muted); margin: 0 0 0.75rem; }
.card ul { color: var(--muted); margin: 0.75rem 0 0; padding-left: 1.1rem; }
.card li { margin-bottom: 0.35rem; }
.card.highlight { border-color: rgba(244,201,93,0.48); box-shadow: 0 24px 90px rgba(244,201,93,0.10); }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.75rem 0; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: rgba(255,255,255,0.05);
  color: var(--silver);
  font-size: 0.83rem;
  font-weight: 800;
}
.tag.gold { border-color: rgba(244,201,93,0.42); color: var(--gold); }
.tag.green { border-color: rgba(68,240,154,0.42); color: var(--green); }
.tag.purple { border-color: rgba(166,108,255,0.42); color: #cfb7ff; }
.count-pill { color: var(--muted); font-size: 0.86rem; margin-top: 0.6rem; }

.image-card {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at center, rgba(166,108,255,0.17), transparent 60%), rgba(255,255,255,0.035);
}
.image-card img { max-height: 360px; object-fit: contain; filter: drop-shadow(0 16px 28px rgba(0,0,0,0.35)); }
.logo-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.logo-tile { display: grid; place-items: center; min-height: 112px; border: 1px solid var(--line-soft); border-radius: 18px; background: rgba(255,255,255,0.04); padding: 0.8rem; }
.logo-tile img { max-height: 94px; width: 100%; object-fit: contain; }

/* FORMS + ADMIN */
.form-grid { display: grid; gap: 0.8rem; }
label.field { display: grid; gap: 0.35rem; color: var(--muted); font-weight: 800; }
input, textarea, select {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  background: rgba(0,0,0,0.28);
  color: var(--text);
}
textarea { min-height: 132px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(68,240,154,0.42);
  outline-offset: 3px;
}
.status-box {
  margin-top: 0.8rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  background: rgba(255,255,255,0.045);
  color: var(--muted);
  white-space: pre-wrap;
}
.status-box.good { border-color: rgba(68,240,154,0.46); color: #dfffea; }
.status-box.warn { border-color: rgba(244,201,93,0.48); color: #fff3c4; }
.status-box.bad { border-color: rgba(255,111,128,0.5); color: #ffd7dd; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.9rem 0; }
.admin-tabs button { min-height: 44px; border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(255,255,255,0.05); color: var(--text); padding: 0.55rem 0.75rem; }
.admin-tabs button.active { border-color: var(--gold); background: rgba(244,201,93,0.13); }
.secret-note { color: var(--muted); font-size: 0.92rem; }
.masked-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold); word-break: break-all; }

/* VEX GUIDE AGENT */
.guide-launch {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 1200;
  min-height: 58px;
  max-width: calc(100vw - 2rem);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(244,201,93,0.5);
  border-radius: 999px;
  padding: 0.55rem 0.85rem 0.55rem 0.55rem;
  color: var(--text);
  background: rgba(10,10,16,0.94);
  box-shadow: 0 18px 45px rgba(0,0,0,0.45), 0 0 28px rgba(166,108,255,0.22);
}
.guide-launch img { width: 42px; height: 42px; border-radius: 999px; object-fit: contain; }
.guide-launch span { font-weight: 900; font-size: 0.92rem; }
.guide-panel {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 1800;
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(244,201,93,0.48);
  border-radius: 24px;
  background: rgba(12,12,19,0.98);
  box-shadow: 0 28px 90px rgba(0,0,0,0.62);
  overflow: hidden;
}
.guide-panel[hidden] { display: none !important; }
.guide-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.04);
}
.guide-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 16px; }
.guide-head strong { display: block; }
.guide-head small { color: var(--muted); }
.guide-head button, .guide-quick-actions button, .guide-form button {
  min-height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  padding: 0.55rem 0.75rem;
  font-weight: 800;
}
.guide-body { padding: 0.85rem; overflow-y: auto; display: grid; gap: 0.65rem; }
.agent-message, .user-message {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 0.8rem;
  background: rgba(255,255,255,0.055);
  color: var(--muted);
}
.user-message { justify-self: end; max-width: 88%; color: var(--text); border-color: rgba(68,240,154,0.28); }
.guide-quick-actions, .guide-tools { display: flex; gap: 0.45rem; flex-wrap: wrap; padding: 0.75rem; border-top: 1px solid var(--line-soft); }
.guide-form { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--line-soft); }
.guide-tools { color: var(--muted); font-size: 0.9rem; }
.guide-tools label { display: flex; align-items: center; gap: 0.45rem; }
.guide-tools input[type="range"] { width: 112px; min-height: 32px; }

/* TABLES + LISTS */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 0.8rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--gold); font-size: 0.88rem; }
td { color: var(--muted); }

/* RESPONSIVE RHYTHM */
@media (min-width: 560px) {
  .brand-copy small { display: block; }
  .feature-grid, .card-grid, .edition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mini-install { display: inline-flex; align-items: center; }
}

@media (min-width: 900px) {
  .brand-shell { min-height: 82px; }
  .nav-toggle, .nav-close, .nav-topline { display: none; }
  .primary-nav {
    position: static;
    width: auto;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1rem 0.9rem;
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
    transform: none;
    overflow: visible;
    border-left: 0;
    box-shadow: none;
    background: transparent;
  }
  .primary-nav[hidden] { display: flex !important; }
  .primary-nav a, .primary-nav button.install-btn { min-height: 42px; border-radius: 999px; padding: 0.6rem 0.82rem; font-size: 0.92rem; }
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); align-items: stretch; }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .edition-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 0.75fr 1.25fr; align-items: start; }
  .character-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .guide-panel { left: auto; right: 1rem; width: min(460px, calc(100vw - 2rem)); }
  main { padding-top: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 390px) {
  .brand-mark { width: 48px; height: 48px; flex-basis: 48px; }
  .brand-copy strong { font-size: 0.98rem; }
  .button, .hero-actions .button, .card-actions .button { width: 100%; }
  .guide-launch span { display: none; }
}
