:root {
  color-scheme: dark;
  --bg: #050711;
  --bg-2: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --glass: rgba(8, 13, 28, 0.78);
  --text: #f7f9ff;
  --muted: #aeb8d4;
  --subtle: #6f7b9d;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.26);
  --accent: #6ee7ff;
  --accent-2: #8b5cf6;
  --gold: #f6c76f;
  --good: #63e6a7;
  --warn: #f6c76f;
  --bad: #ff7285;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 12% 12%, rgba(111, 231, 255, 0.18), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(139, 92, 246, 0.22), transparent 32%),
    linear-gradient(135deg, var(--bg), var(--bg-2) 48%, #070914);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  margin: 0;
  min-height: 100%;
}

body::before {
  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: 58px 58px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  pointer-events: none;
  position: fixed;
}

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

main {
  margin: 0 auto;
  max-width: 1440px;
  padding: 24px;
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(42px, 7vw, 96px);
  letter-spacing: -0.075em;
  line-height: 0.9;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 14px;
}

h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.16em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.topbar {
  align-items: center;
  background: rgba(5, 7, 17, 0.72);
  backdrop-filter: blur(22px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 14px;
  position: sticky;
  top: 16px;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  padding-left: 6px;
}

.brand-mark {
  align-items: center;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(110, 231, 255, 0.25);
  color: #04101d;
  display: inline-flex;
  font-weight: 950;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.brand span:last-child {
  display: grid;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a,
.pill {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  font-weight: 750;
  min-height: 42px;
  padding: 10px 15px;
  transition: 160ms ease;
}

.nav a.active,
.nav a:hover,
.pill.hot {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(110, 231, 255, 0.48);
  color: var(--text);
}

.studio-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    radial-gradient(circle at 80% 18%, rgba(110, 231, 255, 0.22), transparent 34%),
    radial-gradient(circle at 86% 84%, rgba(139, 92, 246, 0.2), transparent 32%);
  border: 1px solid var(--line);
  border-radius: 40px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
  margin-bottom: 22px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  position: relative;
}

.studio-hero::after {
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  content: "";
  height: 160%;
  position: absolute;
  right: 22%;
  top: -30%;
  transform: rotate(18deg);
  width: 1px;
}

.hero-copy,
.hero-panel,
.card,
.glass-card,
.soft-section {
  position: relative;
  z-index: 1;
}

.page-kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.lead {
  color: #d4dcf3;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.55;
  max-width: 820px;
}

.hero-actions,
.row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-panel {
  align-self: stretch;
  background: rgba(5, 8, 18, 0.58);
  border: 1px solid var(--line);
  border-radius: 32px;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.orbital-preview {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(110, 231, 255, 0.4), transparent 16%),
    conic-gradient(from 180deg, rgba(110, 231, 255, 0.95), rgba(139, 92, 246, 0.85), rgba(246, 199, 111, 0.85), rgba(110, 231, 255, 0.95));
  border-radius: 32px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.34), 0 24px 70px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  position: relative;
}

.orbital-preview::before,
.orbital-preview::after {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  content: "";
  inset: 16%;
  position: absolute;
  transform: rotate(-20deg);
}

.orbital-preview::after {
  inset: 30%;
  transform: rotate(28deg);
}

.status-board {
  display: grid;
  gap: 12px;
}

.status {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  font-weight: 750;
  gap: 9px;
}

.dot {
  background: var(--warn);
  border-radius: 50%;
  box-shadow: 0 0 18px currentColor;
  height: 10px;
  width: 10px;
}

.dot.good {
  background: var(--good);
  color: var(--good);
}

.dot.bad {
  background: var(--bad);
  color: var(--bad);
}

.workflow-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 22px;
}

.stage-card,
.card,
.glass-card,
.soft-section {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  padding: 24px;
}

.stage-card {
  min-height: 190px;
}

.stage-number {
  align-items: center;
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--accent);
  display: inline-flex;
  font-weight: 950;
  height: 44px;
  justify-content: center;
  margin-bottom: 18px;
  width: 44px;
}

.stage-card.active {
  background:
    linear-gradient(135deg, rgba(110, 231, 255, 0.16), rgba(139, 92, 246, 0.12)),
    var(--glass);
  border-color: rgba(110, 231, 255, 0.46);
}

.workspace {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(330px, 0.82fr) minmax(0, 1.18fr);
}

.workspace.wide {
  grid-template-columns: minmax(0, 1fr);
}

.split,
.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.command-panel {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 24px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.mini-stat {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.mini-stat strong {
  color: var(--text);
  display: block;
  font-size: 32px;
  letter-spacing: -0.045em;
  margin-bottom: 4px;
}

label {
  color: #d4dcf3;
  display: block;
  font-size: 14px;
  font-weight: 850;
  margin-bottom: 8px;
}

input,
textarea,
select {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  font: inherit;
  margin-bottom: 14px;
  min-height: 54px;
  outline: none;
  padding: 14px 16px;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(110, 231, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(110, 231, 255, 0.12);
}

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

button,
.button {
  align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  border-radius: 18px;
  color: #04101d;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 54px;
  padding: 14px 20px;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

button:hover,
.button:hover {
  box-shadow: 0 18px 45px rgba(110, 231, 255, 0.18);
  transform: translateY(-1px);
}

button.secondary,
.button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
}

button.danger {
  background: rgba(255, 114, 133, 0.16);
  border: 1px solid rgba(255, 114, 133, 0.38);
  color: #ffd8de;
}

.helper {
  color: var(--subtle);
  font-size: 13px;
  margin: -6px 0 12px;
}

.field-group {
  margin-bottom: 4px;
}

.notice,
.success-box {
  border-radius: 20px;
  line-height: 1.55;
  padding: 16px;
}

.notice {
  background: rgba(246, 199, 111, 0.12);
  border: 1px solid rgba(246, 199, 111, 0.34);
  color: #ffe6af;
}

.success-box {
  background: rgba(99, 230, 167, 0.12);
  border: 1px solid rgba(99, 230, 167, 0.34);
  color: #cdfbe1;
}

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

.good {
  color: var(--good);
}

.warn {
  color: var(--warn);
}

.list {
  display: grid;
  gap: 12px;
}

.list button,
.list-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  padding: 16px;
  text-align: left;
}

.preview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin-top: 18px;
}

.preview-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.preview-card img {
  aspect-ratio: 1;
  background: #02040a;
  display: block;
  object-fit: cover;
  width: 100%;
}

.preview-card div {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 10px;
}

.studio-footer,
.page-footer {
  color: var(--subtle);
  font-size: 14px;
  margin-top: 28px;
  text-align: center;
}

pre {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: #c9d4f2;
  max-height: 340px;
  min-height: 150px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}

.friendly-output {
  font-size: 13px;
}

.toast {
  background: rgba(5, 8, 18, 0.9);
  border: 1px solid rgba(110, 231, 255, 0.45);
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 900;
  left: 50%;
  max-width: min(620px, calc(100% - 32px));
  padding: 15px 18px;
  position: fixed;
  top: 20px;
  transform: translateX(-50%);
  z-index: 100;
}

.toast.good {
  border-color: rgba(99, 230, 167, 0.48);
}

.toast.bad {
  border-color: rgba(255, 114, 133, 0.56);
  color: #ffd8de;
}

.auth-portal-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
}

.auth-portal-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  display: grid;
  gap: 14px;
  padding: 28px;
  transition: border-color 160ms ease, transform 160ms ease;
}

.auth-portal-card:hover {
  border-color: rgba(110, 231, 255, 0.46);
  transform: translateY(-2px);
}

.auth-portal-card .button {
  justify-self: start;
  margin-top: 4px;
}

.auth-form-layout {
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
}

.auth-form-card {
  align-self: start;
}

.auth-switch {
  color: var(--muted);
  font-size: 15px;
  margin-top: 8px;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1080px) {
  main {
    padding: 16px;
  }

  .studio-hero,
  .workspace,
  .workflow-strip,
  .auth-portal-grid,
  .auth-form-layout,
  .split,
  .metric-grid,
  .metric-grid.three,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

.compact-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
}

.admin-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: 220px minmax(0, 1fr);
}

.admin-sidebar {
  align-self: start;
  position: sticky;
  top: 16px;
}

.admin-tab {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 0.65rem 1rem;
  text-align: left;
}

.admin-tab.active,
.admin-tab:hover {
  background: rgba(110, 231, 255, 0.12);
  border-color: rgba(110, 231, 255, 0.35);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  border-collapse: collapse;
  font-size: 0.92rem;
  width: 100%;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
