/* S21 ORBIT — Premium Design System & Stylesheet
   Fonts: Plus Jakarta Sans & JetBrains Mono
   Theme: Deep Obsidian Dark with Emerald & Indigo Accents */

:root {
  /* Color Palette */
  --bg: #090b10;
  --surface: #11151e;
  --surface-hover: #171c28;
  --surface2: #1b202e;
  --surface2-hover: #22293b;
  --line: rgba(255, 255, 255, 0.08);
  --line-hover: rgba(255, 255, 255, 0.16);

  /* Typography Colors */
  --txt: #f1f5f9;
  --dim: #94a3b8;
  --dim2: #64748b;

  /* Accent Colors */
  --acc: #10b981;
  --acc-glow: rgba(16, 185, 129, 0.25);
  --acc-bg: rgba(16, 185, 129, 0.1);
  --acc2: #6366f1;
  --vio: #818cf8;
  --vio-bg: rgba(99, 102, 241, 0.12);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.1);
  --bad: #ef4444;
  --bad-bg: rgba(239, 68, 68, 0.1);
  --ok: #10b981;

  /* Radii & Typography */
  --r: 16px;
  --r-sm: 10px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Shadow & Transitions */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Ambient Lighting */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(55vw 45vh at 10% -5%, rgba(99, 102, 241, 0.14), transparent 60%),
    radial-gradient(45vw 40vh at 90% -5%, rgba(16, 185, 129, 0.12), transparent 55%),
    radial-gradient(70vw 60vh at 50% 100%, rgba(15, 23, 42, 0.8), transparent 70%);
}

#root {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Form Controls */
input, select, textarea {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  width: 100%;
  outline: none;
  font-size: 14px;
  color: var(--txt);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

input::placeholder, textarea::placeholder {
  color: var(--dim2);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-glow);
  background: var(--surface2-hover);
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field {
  margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  border-color: var(--line-hover);
  background: var(--surface2-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #022c22;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn.violet {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn.violet:hover {
  filter: brightness(1.1);
}

.btn.danger {
  color: var(--bad);
  border-color: rgba(239, 68, 68, 0.25);
  background: var(--bad-bg);
}

.btn.danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--bad);
}

.btn.sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn.on {
  border-color: var(--acc);
  color: var(--acc);
  background: var(--acc-bg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Header & Navigation ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 11, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

.hwrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 18px;
  color: var(--txt);
}

.logo .dot {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  flex: none;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  display: grid;
  place-items: center;
  color: #022c22;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

nav {
  display: flex;
  gap: 6px;
  margin-left: 12px;
  flex-wrap: wrap;
}

nav a {
  padding: 8px 15px;
  border-radius: 10px;
  color: var(--dim);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s var(--ease);
}

nav a:hover {
  color: var(--txt);
  background: var(--surface2);
}

nav a.act {
  color: var(--acc);
  background: var(--acc-bg);
  font-weight: 700;
}

.hright {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Page Layout ---------- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 100px;
}

.ptitle {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 6px;
  color: var(--txt);
}

.psub {
  color: var(--dim);
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.5;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.grid {
  display: grid;
  gap: 16px;
}

.g3 {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.g2 {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sechead {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim2);
  font-weight: 700;
  margin: 28px 0 14px;
}

/* ---------- Avatars ---------- */
.av {
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #03140e;
  width: 46px;
  height: 46px;
  font-size: 16px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.av.lg {
  width: 80px;
  height: 80px;
  font-size: 28px;
  border-radius: 24px;
}

.av.sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

/* ---------- Chips & Badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--dim);
  transition: all 0.15s ease;
}

.chip.acc {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--acc);
  background: var(--acc-bg);
}

.chip.vio {
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--vio);
  background: var(--vio-bg);
}

.chip.warn {
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--warn);
  background: var(--warn-bg);
}

.chip.bad {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--bad);
  background: var(--bad-bg);
}

.ver {
  color: var(--acc);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}

/* ---------- User & Project Cards ---------- */
.ucard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: block;
  position: relative;
  overflow: hidden;
}

.ucard:hover {
  border-color: var(--line-hover);
  transform: translateY(-2px);
  background: var(--surface-hover);
  box-shadow: var(--shadow-md);
}

.uname {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--txt);
}

.unick {
  color: var(--dim2);
  font-size: 13px;
  font-family: var(--font-sans);
}

.bio {
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- Skills & Endorsement ---------- */
.skill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 13px;
  transition: border-color 0.15s ease;
}

.skill:hover {
  border-color: var(--line-hover);
}

.lvl {
  display: flex;
  gap: 4px;
}

.lvl i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}

.lvl i.f {
  background: var(--acc);
  box-shadow: 0 0 6px var(--acc-glow);
}

.endorse {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--dim);
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}

.endorse:hover {
  border-color: var(--acc);
  color: var(--acc);
  background: var(--acc-bg);
}

.endorse.on {
  background: var(--acc-bg);
  border-color: var(--acc);
  color: var(--acc);
}

/* ---------- Team Radar (Jamoa Radari) ---------- */
.radar {
  background: linear-gradient(165deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.mrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}

.mrow:last-child {
  border-bottom: none;
}

.mrow:hover .uname {
  color: var(--acc);
}

.bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}

.score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--acc);
  min-width: 52px;
  text-align: right;
  letter-spacing: -0.02em;
}

/* ---------- Stat Cards ---------- */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: var(--line-hover);
}

.stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--txt);
}

.stat span {
  color: var(--dim2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* ---------- Tables ---------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tbl th {
  text-align: left;
  color: var(--dim2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.tbl td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.tbl tr:last-child td {
  border-bottom: none;
}

.tbl tr:hover td {
  background: var(--surface2);
}

.scrollx {
  overflow-x: auto;
}

/* ---------- Modal & Toast ---------- */
.ov {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 11, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line-hover);
  border-radius: 20px;
  padding: 26px;
  width: min(580px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.25s var(--ease);
}

.mtitle {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  color: var(--txt);
}

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.tst {
  background: var(--surface2);
  border: 1px solid var(--line-hover);
  border-left: 4px solid var(--acc);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--txt);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s var(--ease);
  pointer-events: auto;
}

.tst.err {
  border-left-color: var(--bad);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Auth Screens ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.authbox {
  width: min(440px, 100%);
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}

.tabs button {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--dim);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.tabs button.act {
  background: var(--surface);
  color: var(--txt);
  box-shadow: var(--shadow-sm);
}

.demo {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--dim2);
  line-height: 1.6;
}

.demo code {
  font-family: var(--font-mono);
  color: var(--dim);
}

/* ---------- Utility Classes ---------- */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--dim2);
  font-size: 14.5px;
}

.mut {
  color: var(--dim);
  font-size: 14px;
}

.tiny {
  font-size: 12.5px;
  color: var(--dim2);
}

/* ---------- Media Queries & Responsiveness ---------- */
@media (max-width: 640px) {
  .hwrap {
    gap: 14px;
    padding: 12px 16px;
  }
  nav {
    order: 3;
    width: 100%;
    margin: 0;
    justify-content: flex-start;
  }
  main {
    padding: 20px 16px 80px;
  }
  .ptitle {
    font-size: 24px;
  }
  .grid.g2, .grid.g3 {
    grid-template-columns: 1fr;
  }
}
