:root {
  --bg: #04050a;
  --bg-soft: rgba(13, 17, 28, 0.84);
  --bg-card: rgba(16, 20, 32, 0.84);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f6ff;
  --muted: #a0afca;
  --accent: #a855f7;
  --accent-2: #22d3ee;
  --accent-3: #ec4899;
  --ok: #8ef0b7;
  --warn: #ffd17a;
  --danger: #ff829b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  --radius: 28px;
  --radius-sm: 18px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(168, 85, 247, 0.22), transparent 32%),
    radial-gradient(circle at 88% 14%, rgba(236, 72, 153, 0.15), transparent 26%),
    radial-gradient(circle at 32% 100%, rgba(34, 211, 238, 0.11), transparent 28%),
    linear-gradient(180deg, #04050a 0%, #070914 46%, #04050a 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at top, #000 36%, transparent 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.shell {
  width: min(1260px, calc(100% - 28px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.22;
  pointer-events: none;
}

.orb-a {
  width: 28rem;
  height: 28rem;
  top: -11rem;
  left: -8rem;
  background: rgba(168, 85, 247, 0.55);
}

.orb-b {
  width: 26rem;
  height: 26rem;
  top: 10rem;
  right: -10rem;
  background: rgba(236, 72, 153, 0.3);
}

.orb-c {
  width: 24rem;
  height: 24rem;
  bottom: -10rem;
  left: 34%;
  background: rgba(34, 211, 238, 0.2);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand strong,
.brand-mark,
.nav-link,
.button,
h1,
h2,
h3,
.stat-card strong,
.profile-card strong {
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: #08111d;
  background: linear-gradient(135deg, #d8ff8d 0%, #a855f7 50%, #22d3ee 100%);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand span {
  display: grid;
}

.brand small {
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link,
.button {
  border: 1px solid transparent;
  border-radius: 14px;
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nav-link:hover,
.button:hover {
  transform: translateY(-1px);
}

.nav-link.active,
.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.button.primary {
  color: #06111d;
  background: linear-gradient(135deg, #d8ff8d 0%, #a855f7 48%, #22d3ee 100%);
}

.topbar-actions,
.hero-actions,
.inline-actions,
.stack-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard {
  padding-bottom: 44px;
}

body.auth-guest .dashboard {
  min-height: calc(100vh - 86px);
  display: grid;
  align-content: center;
}

.panel,
.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.panel {
  padding: 28px;
}

.hero {
  display: grid;
  gap: 18px;
}

body.auth-guest .hero {
  text-align: center;
  justify-items: center;
}

body.auth-guest .hero h1 {
  max-width: 16ch;
}

body.auth-guest .hero-actions {
  justify-content: center;
}

body.auth-guest .hero-stats {
  display: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  background: rgba(168, 85, 247, 0.12);
  color: #eddfff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 6vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.18rem;
}

.lead,
p,
.muted,
.signal-row span,
label span,
.stat-card span,
.mini-stats span,
.breadcrumb-row,
.file-item small,
.table-list small,
.git-output {
  color: var(--muted);
  line-height: 1.7;
}

.hero-stats,
.grid.two,
.auth-grid,
.table-list,
.file-list {
  display: grid;
  gap: 18px;
}

.hero-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}

.stat-card,
.card {
  padding: 22px;
}

.stat-card {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

body.auth-guest .auth-grid {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

body.auth-guest .auth-panel {
  width: min(100%, 560px);
  min-height: 100%;
}

body.auth-guest .auth-panel .stack-form {
  align-content: start;
}

.auth-panel {
  padding: 28px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(216, 255, 141, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #edf2ff;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.signal-list,
.table-list {
  display: grid;
  gap: 12px;
}

.signal-row,
.file-item,
.user-row,
.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.file-item {
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--text);
}

.file-item:hover,
.user-row:hover,
.invite-row:hover {
  border-color: rgba(168, 85, 247, 0.22);
}

.file-item strong,
.user-row strong,
.invite-row strong {
  display: block;
  margin-bottom: 4px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

.breadcrumb-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.breadcrumb-row button {
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.breadcrumb-row span {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(167, 255, 131, 0.18);
  background: rgba(167, 255, 131, 0.12);
  color: #d7ffd9;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.warn {
  color: #fff0c2;
  border-color: rgba(255, 209, 122, 0.2);
  background: rgba(255, 209, 122, 0.12);
}

.badge.danger {
  color: #ffd0db;
  border-color: rgba(255, 130, 155, 0.2);
  background: rgba(255, 130, 155, 0.12);
}

.message {
  margin-top: 18px;
}

.message.success {
  border-color: rgba(142, 240, 183, 0.28);
  background: rgba(142, 240, 183, 0.08);
}

.message.error {
  border-color: rgba(255, 130, 155, 0.3);
  background: rgba(255, 130, 155, 0.08);
}

.invite-code,
.git-output {
  margin-top: 12px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  word-break: break-all;
  white-space: pre-wrap;
}

.tab {
  display: none;
  margin-top: 20px;
}

.tab.active {
  display: block;
}

.section-head {
  margin-bottom: 18px;
}

.section-head p {
  margin-top: 10px;
}

.file-item .meta,
.user-row .meta,
.invite-row .meta {
  text-align: right;
}

.file-item .meta small,
.user-row .meta small,
.invite-row .meta small {
  display: block;
}

@media (max-width: 1024px) {
  .hero-stats,
  .auth-grid,
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 840px) {
  .topbar {
    flex-wrap: wrap;
    min-height: auto;
  }

  .nav {
    width: 100%;
  }

  .hero-stats,
  .auth-grid,
  .grid.two,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
  }

  .panel {
    padding: 22px;
  }

  body.auth-guest .dashboard {
    min-height: auto;
  }

  body.auth-guest .hero {
    text-align: left;
    justify-items: start;
  }

  body.auth-guest .hero-actions {
    justify-content: flex-start;
  }

  .file-item,
  .user-row,
  .invite-row,
  .signal-row,
  .card-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100%, calc(100% - 18px));
  }

  .button,
  .nav-link {
    width: 100%;
  }

  .topbar-actions,
  .hero-actions,
  .inline-actions,
  .stack-actions {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
